Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/mesh/interpolation/bilinear_xz.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ XZBilinear::XZBilinear(int y_offset, Mesh* mesh)
: XZInterpolation(y_offset, mesh), w0(localmesh), w1(localmesh), w2(localmesh),
w3(localmesh) {

if (localmesh->getNXPE() > 1) {
throw BoutException("Do not support MPI splitting in X");
Copy link
Contributor

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:

- #include "bout/globals.hxx"
+ #include "bout/boutexception.hxx"
+ #include "bout/globals.hxx"

}

// 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);
Expand Down
14 changes: 8 additions & 6 deletions src/mesh/interpolation/hermite_spline_xz.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

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:

-   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) {

Expand Down Expand Up @@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

The 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;
Expand All @@ -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)]));
Expand All @@ -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.
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions src/mesh/interpolation/lagrange_4pt_xz.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Copy link
Contributor

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/lagrange_4pt_xz.cxx:22:

- #include "bout/globals.hxx"
+ #include "bout/boutexception.hxx"
+ #include "bout/globals.hxx"

}

// 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);
Expand Down
Loading