-
Notifications
You must be signed in to change notification settings - Fork 4
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
Iterator refactor [3/N] #204
Conversation
fd3d245
to
89fce4c
Compare
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.
👍
* @return true Background is dispersive | ||
* @return false Background is not dispersive | ||
*/ | ||
bool is_dispersive(int K_tot, double near_zero_tolerance=1e-15); |
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.
So we can have a non-dispersive dispersive multilayer? (DispersiveMultiLayer::is_dispersive == false
)
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.
Apparently so - there's a corresponding call in iterator.cpp
. I don't have the same feel for everything in iterator.cpp
yet like Tom did, so I'm guessing its an oddity for us to be in this case rather than common.
There's also another is_dispersive
function for the background material (which doesn't have its own class) too.
Co-authored-by: Sam Cunliffe <samcunliffe@users.noreply.github.com>
…o wgraham-refactor_iterator_3
Attempting to do some small refactors to
iterator.cpp
that don't touch anything that will need to be touched by #70. Docstrings are added to all refactored functions, classes, etc.List of replacements:
checkPhasorConvergence
Replaced with the
Field
class methodmax_pointwise_difference_over_max_element
. The name of the old function is misleading, it is only computing an error metric and NOT checking convergence - this happens later in theiterator.cpp
main loop.Pulling this out into a class method to make things a bit cleaner. Also, both the inputs are
Field
s, and the function is asymmetric, so it makes sense to have this as a class method.setGridLabels
Changed to the
initialise_from
method of theGridLabels
class.is_dispersive_ml
Changed to
is_dispersive
method ofDispersiveMultilayer
class.is_conductive
Superceeded by the
all_elements_less_than
method of theXYZVector
class. The check for whether a material is conductive is just whether at least one entry of an XYZVector exceeds a particular threshold.