-
Notifications
You must be signed in to change notification settings - Fork 107
Add some asserts for non parallelised XZ interpolation #3206
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f3882d3
Add some asserts for non parallelised XZ interpolation
dschwoerer cfe4d40
Always set region for hermite_spline_xz
dschwoerer 11d0c17
Ensure we only use special name for offsetted regions
dschwoerer 81fd461
Clarify message
dschwoerer 34b4f3b
Apply clang-format changes
dschwoerer 49028fe
Add doc strings
dschwoerer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,8 +101,8 @@ class IndConverter { | |
| } | ||
| }; | ||
|
|
||
| XZHermiteSpline::XZHermiteSpline(int y_offset, Mesh* mesh) | ||
| : XZInterpolation(y_offset, mesh), h00_x(localmesh), h01_x(localmesh), | ||
| XZHermiteSpline::XZHermiteSpline(int y_offset, Mesh* meshin) | ||
| : XZInterpolation(y_offset, meshin), h00_x(localmesh), h01_x(localmesh), | ||
| h10_x(localmesh), h11_x(localmesh), h00_z(localmesh), h01_z(localmesh), | ||
| h10_z(localmesh), h11_z(localmesh) { | ||
|
|
||
|
|
@@ -346,6 +346,9 @@ Field3D XZHermiteSpline::interpolate(const Field3D& f, const std::string& region | |
| ASSERT1(f.getMesh() == localmesh); | ||
| Field3D f_interp{emptyFrom(f)}; | ||
|
|
||
| const auto region2 = | ||
| y_offset == 0 ? "RGN_NOY" : fmt::format("RGN_YPAR_{:+d}", y_offset); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "fmt::format" is directly included [misc-include-cleaner] src/mesh/interpolation/hermite_spline_xz.cxx:23: - #include "bout/globals.hxx"
+ #include "fmt/format.h"
+ #include "bout/globals.hxx" |
||
|
|
||
| #if USE_NEW_WEIGHTS | ||
| #ifdef HS_USE_PETSC | ||
| BoutReal* ptr; | ||
|
|
@@ -355,7 +358,6 @@ Field3D XZHermiteSpline::interpolate(const Field3D& f, const std::string& region | |
| VecRestoreArray(rhs, &ptr); | ||
| MatMult(petscWeights, rhs, result); | ||
| VecGetArrayRead(result, &cptr); | ||
| const auto region2 = y_offset == 0 ? region : fmt::format("RGN_YPAR_{:+d}", y_offset); | ||
| BOUT_FOR(i, f.getRegion(region2)) { | ||
| f_interp[i] = cptr[int(i)]; | ||
| ASSERT2(std::isfinite(cptr[int(i)])); | ||
|
|
@@ -375,11 +377,10 @@ Field3D XZHermiteSpline::interpolate(const Field3D& f, const std::string& region | |
| } | ||
| } | ||
| #endif | ||
| return f_interp; | ||
| #else | ||
| // Derivatives are used for tension and need to be on dimensionless | ||
| // coordinates | ||
| const auto region2 = fmt::format("RGN_YPAR_{:+d}", y_offset); | ||
|
|
||
| // f has been communcated, and thus we can assume that the x-boundaries are | ||
| // also valid in the y-boundary. Thus the differentiated field needs no | ||
| // extra comms. | ||
|
|
@@ -418,8 +419,10 @@ Field3D XZHermiteSpline::interpolate(const Field3D& f, const std::string& region | |
| ASSERT2(std::isfinite(f_interp[iyp]) || i.x() < localmesh->xstart | ||
| || i.x() > localmesh->xend); | ||
| } | ||
| return f_interp; | ||
| #endif | ||
| f_interp.setRegion(region2); | ||
| ASSERT2(f_interp.getRegionID()); | ||
| return f_interp; | ||
| } | ||
|
|
||
| Field3D XZHermiteSpline::interpolate(const Field3D& f, const Field3D& delta_x, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: constructor does not initialize these fields: petscWeights, rhs, result [cppcoreguidelines-pro-type-member-init]
include/bout/interpolation_xz.hxx:163: