-
Notifications
You must be signed in to change notification settings - Fork 191
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 IMEX protocols #5618
Add IMEX protocols #5618
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.
You can squash any changes directly
@@ -0,0 +1,28 @@ | |||
# Distributed under the MIT License. |
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.
Shouldn't there be a add_subdirectory
one level higher in this commit?
@@ -0,0 +1,26 @@ | |||
# Distributed under the MIT License. |
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.
Shouldn't there be a add_subdirectory
one level higher in this commit?
/// | ||
/// In addition to the usual requirements for an evolution system, an | ||
/// IMEX system must specify an `implicit_sectors` typelist of structs | ||
/// conforming to protocols::ImplicitSector, each of which described |
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.
described
-> describes
?
6fe4445
to
b156154
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.
Some minor fix requests on documentation as the first customer :)
Please squash everything
src/Evolution/Imex/GuessResult.hpp
Outdated
#include "Utilities/TMPL.hpp" | ||
|
||
namespace imex { | ||
/// Accuracy of a guess returned from an implicit sector's |
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.
[nitpick] Accuracy -> Type?
/// `std::vector<GuessResult>` indicating, for each point, whether | ||
/// the implicit equation has been solved analytically or whether | ||
/// the numerical solve should continue. An empty return is | ||
/// equivalent to `GuessResult::InitialGuess` for every point. When |
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.
imex::GuessResult::InitialGuess
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.
Q. Does this mean that an empty return is exactly same as using imex::GuessExplicitResult
?
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.
No. GuessExplicitResult
guesses the explicit result. You are free to guess something else. I added a bit to the documentation of the GuessExplicitResult
struct. Do you think something should be added here?
/// equivalent to `GuessResult::InitialGuess` for every point. When | ||
/// this is called, the sector variables will have the value from | ||
/// the explicit part of the time step. This mutator will not be | ||
/// called if the implicit weight is zero, as a system-independent |
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.
I think the comment after ".. weight is zero" is a little confusing, since implicit weight being zero means no implicit step is required, not that it's analytically invertible.
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.
Sort of. The step becomes explicit and no source evaluations are performed, but there is still a step. Admittedly, calling the result of solving y = constant
for y
an analytic solution is a bit grandiose, so I changed it to "This mutator will not be called if the implicit weight is zero, as the solution is trivial in that case.".
/// * `tags_from_evolution` for tags to be made available from the | ||
/// evolution DataBox. Volume quantities will be reduced to | ||
/// have one grid point, with the appropriate value for the | ||
/// point being solved for. |
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.
Please mention that this excludes the tags from tensors
(that needs to be solved).
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.
Done, and also added a check to the protocol verification below.
b156154
to
ba3abdc
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.
Also added a sanity check now assumed after some local changes to the solver.
/// `std::vector<GuessResult>` indicating, for each point, whether | ||
/// the implicit equation has been solved analytically or whether | ||
/// the numerical solve should continue. An empty return is | ||
/// equivalent to `GuessResult::InitialGuess` for every point. When |
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.
No. GuessExplicitResult
guesses the explicit result. You are free to guess something else. I added a bit to the documentation of the GuessExplicitResult
struct. Do you think something should be added here?
/// equivalent to `GuessResult::InitialGuess` for every point. When | ||
/// this is called, the sector variables will have the value from | ||
/// the explicit part of the time step. This mutator will not be | ||
/// called if the implicit weight is zero, as a system-independent |
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.
Sort of. The step becomes explicit and no source evaluations are performed, but there is still a step. Admittedly, calling the result of solving y = constant
for y
an analytic solution is a bit grandiose, so I changed it to "This mutator will not be called if the implicit weight is zero, as the solution is trivial in that case.".
/// * `tags_from_evolution` for tags to be made available from the | ||
/// evolution DataBox. Volume quantities will be reduced to | ||
/// have one grid point, with the appropriate value for the | ||
/// point being solved for. |
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.
Done, and also added a check to the protocol verification below.
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.
Looks good. Please squash
/// `std::vector<GuessResult>` indicating, for each point, whether | ||
/// the implicit equation has been solved analytically or whether | ||
/// the numerical solve should continue. An empty return is | ||
/// equivalent to `imex::GuessResult::InitialGuess` for every point. |
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.
Maybe a short extension like "empty return is equivalent to returning GuessResult::InitialGuess everywhere and the numerical solve will be done for every point"?
I'm also happy! Please go ahead and squash |
The examples will be added in a future commit
ba3abdc
to
329ee0d
Compare
The examples for the ImplicitSector protocol that will be added later with the actual solver are
Edit: decided to add two more examples:
Proposed changes
Upgrade instructions
Code review checklist
make doc
to generate the documentation locally intoBUILD_DIR/docs/html
.Then open
index.html
.code review guide.
bugfix
ornew feature
if appropriate.Further comments