Add BDF Integrator, Field Extrapolator, and Tensor Utilities#1392
Add BDF Integrator, Field Extrapolator, and Tensor Utilities#1392chvillanuevap wants to merge 13 commits intodevelopfrom
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.
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.
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.
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.
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.
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.
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: