-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Floquet periodic boundary conditions #314
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking pretty good, I think there are a few larger changes to take care of first
- FP should be part of K, given it has no omega dependence in its construction unlike A2. This will simplify loads of things
- The muinv kx should be in the MaterialOperator, (doing this neatly will mean adding the ability to use transpose coefficients in the ceed context)
- The geodata.cpp can be shortened and simplified some, I have some initial work on doing this in
hughcars/periodic-bc
, but I'm sure once you get started you'll probably see even more things to do. The basic thing is a mixing assumptions on sdim and no assumptions on sdim.
attribute to the receiver attribute in mesh units. If neither `"Translation"` or | ||
`"AffineTransformation"` are specified, the transformation between donor and receiver boundaries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: neither "Translation"
nor "AffineTransformation"
eigenmode simulation type. Ignored if non-zero Floquet wave vector is specified in | ||
[`config["Boundaries"]["Periodic"]["FloquetWaveVector"]`](boundaries.md##boundaries%5B%%22Periodic%22%5D%22FloquetWaveVector%22%5D) | ||
or [`config["Boundaries"]["FloquetWaveVector"]`](boundaries.md##boundaries%5B%%22FloquetWaveVector%22%5D). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also necessary for London equations, so you'll need to reconcile this.
distance between them is given by the `"Translation"` vector in mesh units. In `floquet.json`, | ||
an additional `"FloquetWaveVector"` specifies the phase delay between the donor and receiver | ||
boundaries in the X/Y/Z directions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the relative simplicity of this example, it would be great if we can derive the expected modes analytically. I suspect it'll be possible to map them to an equivalent set of modes on a full length cylinder without phase shift, at which point analytic results can be compared against like for the waveguide case.
@@ -74,7 +74,7 @@ Periodic boundary conditions on an existing mesh can be specified using the | |||
["Periodic"](../config/boundaries.md#boundaries%5B%22Periodic%22%5D) boundary keyword. This | |||
boundary condition enforces that the solution on the specified boundaries be exactly equal, | |||
and requires that the surface meshes on the donor and receiver boundaries be identical up to | |||
translation. Periodicity in *Palace* is also supported through meshes generated | |||
translation or rotation. Periodicity in *Palace* is also supported through meshes generated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How have you tested the rotational case? Might make for a cool example, thinking plausibly the waveguide cylinder could be split into wedges maybe and analyzed.
|
||
CeedOperator GetTranspose(std::size_t i) const { return op_t[i]; } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not seeing any use of this so far, why did you need?
auto trslt = it->find("Translation"); | ||
if (trslt != it->end()) | ||
{ | ||
MFEM_VERIFY(trslt->is_array(), | ||
"\"Translation\" should specify an array in the configuration file!"); | ||
data.translation = trslt->get<std::array<double, 3>>(); | ||
} | ||
auto trsfr = it->find("AffineTransformation"); | ||
if (trsfr != it->end()) | ||
{ | ||
MFEM_VERIFY( | ||
trsfr->is_array(), | ||
"\"AffineTransformation\" should specify an array in the configuration file!"); | ||
data.affine_transform = trsfr->get<std::array<double, 16>>(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use full names for the variables.
// Vector defining the direction and distance for this periodic boundary condition. | ||
std::array<double, 3> translation = {0.0, 0.0, 0.0}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be encoded into the affine transformation? Given it's going to overlap with the final column in terms of data. I.e. if there's a translation, set the rotation piece to identity and fill the translation in.
if (translation.Norml2() > mesh_tol) | ||
{ | ||
// Use user-provided translation. | ||
for (int i = 0; i < 3; i++) | ||
{ | ||
transformation(i, i) = 1.0; | ||
transformation(i, 3) = translation[i]; | ||
} | ||
transformation(3, 3) = 1.0; | ||
} | ||
else if (affine_vec.Norml2() > mesh_tol) | ||
{ | ||
// Use user-provided affine transformation matrix. | ||
for (int i = 0; i < 4; i++) | ||
{ | ||
for (int j = 0; j < 4; j++) | ||
{ | ||
transformation(i, j) = affine_vec[i * 4 + j]; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the translation is written to the affine transformation variable in configfile.cpp, this can be shortened to
mfem::DenseMatrix transformation(4);
std::copy(data.affine_transform.begin(), data.affine_transform.end(), transformation.begin());
transformation.Transpose();
if (transformation.Norml2() == 0.0)
{
...
@@ -8,6 +8,7 @@ | |||
#include "fem/errorindicator.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing the correction on the adaptive branch.
template class FloquetCorrSolver<Vector>; | ||
template class FloquetCorrSolver<ComplexVector>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this ever going to be applied to a real valued case?
Add support for Floquet periodic boundary conditions and improve flexibility of periodic boundary conditions specifications.