-
Notifications
You must be signed in to change notification settings - Fork 104
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
Changes from 2 commits
f3882d3
cfe4d40
11d0c17
81fd461
34b4f3b
49028fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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) | ||
|
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: constructor does not initialize these fields: petscWeights, rhs, result [cppcoreguidelines-pro-type-member-init] include/bout/interpolation_xz.hxx:163: - Mat petscWeights;
- Vec rhs, result;
+ Mat petscWeights{};
+ Vec rhs{}, result{}; |
||
| : 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,8 @@ Field3D XZHermiteSpline::interpolate(const Field3D& f, const std::string& region | |
| ASSERT1(f.getMesh() == localmesh); | ||
| Field3D f_interp{emptyFrom(f)}; | ||
|
|
||
| const auto region2 = fmt::format("RGN_YPAR_{:+d}", y_offset); | ||
|
||
|
|
||
| #if USE_NEW_WEIGHTS | ||
| #ifdef HS_USE_PETSC | ||
| BoutReal* ptr; | ||
|
|
@@ -355,7 +357,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 +376,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 +418,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, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,10 @@ | |
| XZLagrange4pt::XZLagrange4pt(int y_offset, Mesh* mesh) | ||
| : XZInterpolation(y_offset, mesh), t_x(localmesh), t_z(localmesh) { | ||
|
|
||
| if (localmesh->getNXPE() > 1) { | ||
| throw BoutException("Do not support MPI splitting in X"); | ||
|
||
| } | ||
|
|
||
| // Index arrays contain guard cells in order to get subscripts right | ||
| i_corner.reallocate(localmesh->LocalNx, localmesh->LocalNy, localmesh->LocalNz); | ||
| k_corner.reallocate(localmesh->LocalNx, localmesh->LocalNy, localmesh->LocalNz); | ||
|
|
||
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 "BoutException" is directly included [misc-include-cleaner]
src/mesh/interpolation/bilinear_xz.cxx:22: