-
Notifications
You must be signed in to change notification settings - Fork 35
Add BDF Integrator, Field Extrapolator, and Tensor Utilities #1392
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
base: develop
Are you sure you want to change the base?
Conversation
- Improved styling of residual norm output. - Added a fixed-step Backward Differentiation Formula (BDF) integrator. - Introduced an extrapolator operator for approximating fields using previous values. - Added tensor utilities to compute rank and shape, and to copy tensors for vectors. - Extended BasePhysics with: - Functions to compute absolute and relative state changes in time. - A method to retrieve checkpointed time for a given cycle. - A method to access previous steps by cycle index.
| } | ||
|
|
||
| ::std::vector<::serac::FiniteElementState> | ||
| BasePhysics::getPreviousStates( |
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.
what is this for? we are really trying to get away from this type of thing with the new design.
| * | ||
| * @tparam r_order The desired extrapolation order (0 = zero, 1 = constant, 2 = linear). | ||
| */ | ||
| template <int r_order> |
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.
what is the point of templating this? Is there some performance optimization. If not, I'd suggest just having it be a constructor argument or and input to the () operator. In term, the details should be implemented in a .cpp file.
| */ | ||
| virtual double getCheckpointedTimestep(int cycle) const; | ||
|
|
||
| /** |
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.
As a general rule: The base_physics interface exists as a public API for external use. At the moment, that external use is in LiDO. Do these newly added functions need to be called by LiDO for your new physics to work? If so, I'd like to understand that. If LiDO does not need to call these functions directly, they should be implementation details of your particular physics so that we do not bloat the base_physics interface even more.
| * | ||
| * @return The absolute L2 norm of the difference: || u^k - u^{k-1} ||. | ||
| */ | ||
| double |
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.
Operations like this, that may be reused by other physics, should be provided in, e.g., numerics, as a free function. Once again, we don't want to expand the public base_physics interface when its not strictly required.
| template <typename T, int... n> | ||
| SERAC_HOST_DEVICE int constexpr | ||
| rank( | ||
| ::serac::tensor<T, n...> const & |
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.
stylistically, we don't really do the pre :: for ::serac or ::std in serac. I'd argue its best to keep the style consistent, even though its not enforced by our style guide.
| */ | ||
| SERAC_HOST_DEVICE constexpr auto inner(double A, double B) { return A * B; } | ||
|
|
||
| /** |
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.
These are confusing me (inner products with zeros). I thought they were already in the repo? I cannot figure out why its showing up here as a change.
22efa49 to
6482079
Compare
…DF integrator and field extrapolator
Adds infrastructure to support higher-order time integration and multiphysics coupling: