Skip to content
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

Add conductivity boundaries to Dirichlet BC list for wave ports #264

Merged
merged 3 commits into from
Jun 20, 2024

Conversation

sebastiangrimberg
Copy link
Contributor

@sebastiangrimberg sebastiangrimberg commented Jun 11, 2024

Wave port mode calculation right now inherits all PEC boundary conditions from the 3D problem. Conductivity boundaries should also be considered as PEC for mode calculation (otherwise it was expected the user adds them with "WavePortPEC").

Also updates the eigenvalue target for the shifted wave port eigemode problem to EigenvalueSolver::WhichType::SMALLEST_REAL, which appropriately deprioritizes evanescent modes with large imaginary part and small real part of k_n.

@sebastiangrimberg sebastiangrimberg added usage Related to usage driven Related to driven simulations in the frequency domain labels Jun 11, 2024
…alculation

Also removes old FEAST code from docs, simplifies ability to specify eigenmode solver to wave ports.
@sebastiangrimberg
Copy link
Contributor Author

Note: This resolves #251 and #267.

Copy link
Collaborator

@hughcars hughcars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the positive response in #251 and the lack of updates needed for the regression testing I am taking this as functional. Tiny questions but LGTM.

ARPACK,
FEAST
};
using Type = WavePortData::EigenSolverType;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems a little surprising to have the EigenSolverType a subtype within WavePortData rather than freestanding?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree I didn't love this but also wanted to be consistent that everywhere else enums are defined in the scope of a struct which uses them. The fact that it is defined here instead of in EigenSolverData as it was previously is just because of ordering in the file. Is there a better solution?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Practically it doesn't make that much of a difference ultimately given this type alias, so not a big deal. It does highlight the difficulty of that convention though, as it introduces this side coupling. I would prefer the enum outside, as at this point the notion of an EigenSolverType is "more common", but it's just a style thing so consistency is king here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I would support the refactor to having all enums be described outside the structs, and we could us using statements in the struct scope to avoid needing naming changes to access them. That is a good idea for a later PR to make it all consistent.

Comment on lines +605 to +606
mu_eps_min = 1.0 / (c_max * c_max) * 0.5; // Add a safety factor for minimum propagation
// constant possible
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the origin of this safety factor? Is it a floating point issue?

Copy link
Contributor Author

@sebastiangrimberg sebastiangrimberg Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, if the wave port is specified on a homogeneous waveguide supporting a TEM mode with no cutoff, then setting the safety factor of 1 will lead to the shift for the shift-and-invert transformation being directly on top of the actual lowest eigenvalue which is going to cause problems. Setting the shift to 0 works fine (and was what we did previously) but having some non-zero shift can speed up the eigenvalue solve convergence. It didn't make a significant difference in my testing but I figured it might as well be some positive value.

@@ -138,21 +138,9 @@ number of eigenmodes of the problem. The available options are:

- `"SLEPc"`
- `"ARPACK"`
- `"FEAST"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RIP Feast.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can come back when needed! Commit c435ace has the original code which just needs minor modifications after the linear algebra refactors of last year.

ARPACK,
FEAST
};
using Type = WavePortData::EigenSolverType;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Practically it doesn't make that much of a difference ultimately given this type alias, so not a big deal. It does highlight the difficulty of that convention though, as it introduces this side coupling. I would prefer the enum outside, as at this point the notion of an EigenSolverType is "more common", but it's just a style thing so consistency is king here.

@sebastiangrimberg sebastiangrimberg merged commit db48539 into main Jun 20, 2024
17 checks passed
@sebastiangrimberg sebastiangrimberg deleted the sjg/wave-port-bcs branch June 20, 2024 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
driven Related to driven simulations in the frequency domain usage Related to usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants