-
Notifications
You must be signed in to change notification settings - Fork 104
Split out XZPetscHermiteSpline
#3223
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: next
Are you sure you want to change the base?
Conversation
- Include all relevant headers, remove unused ones, add some forward declarations - Make data `private` instead of `protected` - Add getter instead of `const` member - Change member reference to pointer - Move ctor to .cxx file - Use `std::array` instead of C array - Bunch of other small clang-tidy fixes
The Div_par operators use parallel slices of B -- with 2D metrics, these are just the field itself, in 3D we need the actual slices. While `Coordinates::geometry` does communicate the fields, it puts off calculating the parallel slices because that needs the fully constructed `Coordinates`. Upcoming changes should fix this and remove the need to explicitly communicate `Coordinates` members.
Co-authored-by: David Bold <dschwoerer@users.noreply.github.com>
This allows the user to control the clipping, allowing some overshoot Also restore the FCI MMS test with this interpolator
Includes bug fix: ```diff - BoutReal gL = n.c - n.L; - BoutReal gR = n.R - n.c; + BoutReal gL = n.c - n.m; + BoutReal gR = n.p - n.c; ```
Damp gradients of velocity rather than gradients of momentum
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.
clang-tidy made some suggestions
ecedb55 to
d6375f0
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.
clang-tidy made some suggestions
| /// Interpolate a field onto a perturbed set of points | ||
| const Field3D interpolate(const Field3D& f, const Field3D& delta_x, | ||
| const Field3D& delta_z); | ||
| Field3D interpolate(const Field3D& f, const Field3D& delta_x, const Field3D& delta_z); |
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.
warning: no header providing "Field3D" is directly included [misc-include-cleaner]
include/bout/interpolation_xz.hxx:26:
- #include <bout/bout_types.hxx>
+ #include "bout/field3d.hxx"
+ #include <bout/bout_types.hxx>| const Field3D interpolate(const Field2D& f, const Field3D& delta_x, | ||
| const Field3D& delta_z); | ||
| const Field3D interpolate(const Field2D& f, const Field3D& delta_x); | ||
| Field3D interpolate(const Field2D& f, const Field3D& delta_x, const Field3D& delta_z); |
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.
warning: no header providing "Field2D" is directly included [misc-include-cleaner]
include/bout/interpolation_xz.hxx:26:
- #include <bout/bout_types.hxx>
+ #include "bout/field2d.hxx"
+ #include <bout/bout_types.hxx>24b7c6a to
66b5f4b
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.
clang-tidy made some suggestions
Also removes protected data
66b5f4b to
aff19f0
Compare
| Field3D XZPetscHermiteSpline::interpolate(const Field3D& f, | ||
| const std::string& region) 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.
@dschwoerer region isn't actually used here and I don't really understand why not. This technically makes this version behave differently to the other implementations. Should they actually all use RGN_NOY/YPAR_<N>?
It doesn't look like we ever actually call interpolate with a region anywhere, so perhaps it would be better to remove the argument and fix all the implementations?
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.
@dschwoerer
regionisn't actually used here and I don't really understand why not.
Because I could not understand why any other region should ever be used.
This technically makes this version behave differently to the other implementations. Should they actually all use
RGN_NOY/YPAR_<N>?It doesn't look like we ever actually call
interpolatewith a region anywhere, so perhaps it would be better to remove the argument and fix all the implementations?
Yes, removing the argument is probably best.
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 intention was we might be able to use the regions for things like embedded boundaries, but at the minute that isn't possible out of the box without changes to parallel transforms and communicate, so probably best to just remove the argument for now.
|
I unified all the HermiteSpline interpolations, because they have a fair bit in common, it is much easier to keep the different versions aligned. Maybe we should move some of the |
|
Ok, I can make |
Includes #3200 for testing
XZPetscHermiteSplineas a separate implementation, this allows us to remove all the#ifdefmessXZInterpolationsinto the more usualimpls/directory layout