-
Notifications
You must be signed in to change notification settings - Fork 105
Field3DParallel + more FCI changes #3197
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
We have the info, so might as well store it
Taken from hermes-3, adopted for higher order
lower_bound takes into account the data is sorted
Ensures we all ways check for monotonicity
Tags were different for sender and receiver
Otherwise mpi might wait for the wrong request.
to avoid confusion whether the offsets are for sending or receiving
This allows to write code for FCI and non-FCI using templates.
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
There were too many comments to post at once. Showing the first 25 out of 288. Check the log or trigger a new build to see more.
| const FieldMetric& Jxz() const; | ||
|
|
||
| private: | ||
| mutable std::optional<FieldMetric> _g_22_ylow, _g_22_yhigh; |
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 "std::optional" is directly included [misc-include-cleaner]
include/bout/coordinates.hxx:40:
+ #include <optional>
include/bout/coordinates.hxx
Outdated
|
|
||
| private: | ||
| mutable std::optional<FieldMetric> _g_22_ylow, _g_22_yhigh; | ||
| mutable std::optional<FieldMetric> _Jxz_ylow, _Jxz_yhigh, _Jxz_centre; |
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: declaration uses identifier '_Jxz_centre', which is a reserved identifier [bugprone-reserved-identifier]
| mutable std::optional<FieldMetric> _Jxz_ylow, _Jxz_yhigh, _Jxz_centre; | |
| mutable std::optional<FieldMetric> _Jxz_ylow, _Jxz_yhigh, Jxz_centre; |
include/bout/coordinates.hxx
Outdated
|
|
||
| private: | ||
| mutable std::optional<FieldMetric> _g_22_ylow, _g_22_yhigh; | ||
| mutable std::optional<FieldMetric> _Jxz_ylow, _Jxz_yhigh, _Jxz_centre; |
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: declaration uses identifier '_Jxz_yhigh', which is a reserved identifier [bugprone-reserved-identifier]
| mutable std::optional<FieldMetric> _Jxz_ylow, _Jxz_yhigh, _Jxz_centre; | |
| mutable std::optional<FieldMetric> _Jxz_ylow, Jxz_yhigh, _Jxz_centre; |
include/bout/coordinates.hxx
Outdated
|
|
||
| private: | ||
| mutable std::optional<FieldMetric> _g_22_ylow, _g_22_yhigh; | ||
| mutable std::optional<FieldMetric> _Jxz_ylow, _Jxz_yhigh, _Jxz_centre; |
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: declaration uses identifier '_Jxz_ylow', which is a reserved identifier [bugprone-reserved-identifier]
| mutable std::optional<FieldMetric> _Jxz_ylow, _Jxz_yhigh, _Jxz_centre; | |
| mutable std::optional<FieldMetric> Jxz_ylow, _Jxz_yhigh, _Jxz_centre; |
|
|
||
| template <typename T> | ||
| auto& getStore() { | ||
| if constexpr (std::is_same<T, Field3DParallel>::value) { |
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 "Field3DParallel" is directly included [misc-include-cleaner]
include/bout/deriv_store.hxx:37:
- #include <bout/scorepwrapper.hxx>
+ #include "bout/field3d.hxx"
+ #include <bout/scorepwrapper.hxx>| #include <bout/mesh.hxx> | ||
| #if CHECK > 0 | ||
| #include <bout/output_bout_types.hxx> | ||
| #endif |
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: included header output_bout_types.hxx is not used directly [misc-include-cleaner]
| #endif | |
| #endif |
| // Left and right cell face values | ||
| BoutReal L, R; | ||
| /// Cell centre values | ||
| BoutReal c; |
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 "BoutReal" is directly included [misc-include-cleaner]
include/bout/fv_ops.hxx:7:
- #include "bout/build_defines.hxx"
+ #include "bout/bout_types.hxx"
+ #include "bout/build_defines.hxx"| BoutReal m; | ||
| BoutReal p; | ||
| BoutReal mm = BoutNaN; | ||
| BoutReal pp = BoutNaN; |
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 "BoutNaN" is directly included [misc-include-cleaner]
BoutNaN;
^| BoutReal flux = NAN; | ||
|
|
||
| if (mesh->lastY(i) && (j == mesh->yend) && !mesh->periodicY(i)) { | ||
| if (is_last_y && (j == mesh->yend) && !is_periodic_y) { |
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 "NAN" is directly included [misc-include-cleaner]
Real flux = NAN;
^| const auto& v_down = v_in.ydown(); | ||
|
|
||
| Field3D result{emptyFrom(f_in)}; | ||
| BOUT_FOR(i, f_in.getRegion("RGN_NOBNDRY")) { |
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 "emptyFrom" is directly included [misc-include-cleaner]
emptyFrom(f_in)};
^_[A-Z].* is preserved for compilers, thus use _[a-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.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 25 out of 267. Check the log or trigger a new build to see more.
| result[i] = B[i] * (term + penalty) / (2 * dy[i] * sqrt(g_22[i])); | ||
|
|
||
| #if CHECK > 0 | ||
| if (!std::isfinite(result[i])) { |
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 "std::isfinite" is directly included [misc-include-cleaner]
);
^|
|
||
| return standardDerivative<T, DIRECTION::X, DERIV::Standard>(f, outloc, method, region); | ||
| } | ||
| inline Field3D DDX(const Field3DParallel& f, CELL_LOC outloc = CELL_DEFAULT, |
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 "Field3DParallel" is directly included [misc-include-cleaner]
include/bout/index_derivs_interface.hxx:31:
- #include "bout/traits.hxx"
+ #include "bout/field3d.hxx"
+ #include "bout/traits.hxx"| if (f.isFci()) { | ||
| ASSERT1(f.getDirectionY() == YDirectionType::Standard); | ||
| if (!f.hasParallelSlices()) { | ||
| throw BoutException( |
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]
include/bout/index_derivs_interface.hxx:31:
- #include "bout/traits.hxx"
+ #include "bout/boutexception.hxx"
+ #include "bout/traits.hxx"|
|
||
| class XZHermiteSpline : public XZInterpolation { | ||
| template <bool monotonic> | ||
| class XZHermiteSplineBase : public XZInterpolation { |
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: class 'XZHermiteSplineBase' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions]
class XZHermiteSplineBase : public XZInterpolation {
^| Tensor<SpecificInd<IND_TYPE::IND_3D>> i_corner; // index of bottom-left grid point | ||
| Tensor<int> k_corner; // z-index of bottom-left grid point | ||
|
|
||
| std::unique_ptr<GlobalField3DAccess> gf3daccess; |
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: member variable 'gf3daccess' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
std::unique_ptr<GlobalField3DAccess> gf3daccess;
^| IndicesIter bndry_position; | ||
| struct Indices { | ||
| // Indices of the boundary point | ||
| Ind3D index; |
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 "Ind3D" is directly included [misc-include-cleaner]
include/bout/parallel_boundary_region.hxx:8:
- #include "bout/sys/parallel_stencils.hxx"
+ #include "bout/region.hxx"
+ #include "bout/sys/parallel_stencils.hxx"| signed char valid; | ||
| signed char offset; | ||
| unsigned char abs_offset; | ||
| Indices(Ind3D index, RealPoint&& intersection, BoutReal length, signed char valid, |
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: rvalue reference parameter 'intersection' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved]
Indices(Ind3D index, RealPoint&& intersection, BoutReal length, signed char valid,
^| switch (mode) { | ||
| case SheathLimitMode::limit_free: | ||
| case SheathLimitMode::exponential_free: | ||
| fp = SQ(fc) / fm; // Exponential |
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 "SQ" is directly included [misc-include-cleaner]
include/bout/parallel_boundary_region.hxx:9:
- #include <bout/field3d.hxx>
+ #include "bout/utils.hxx"
+ #include <bout/field3d.hxx>| fp = SQ(fc) / fm; // Exponential | ||
| break; | ||
| case SheathLimitMode::linear_free: | ||
| fp = 2.0 * fc - fm; // Linear |
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: '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
| fp = 2.0 * fc - fm; // Linear | |
| fp = (2.0 * fc) - fm; // Linear |
| BoutReal length, signed char valid) { | ||
| bndry_points.push_back({xyz2ind(ix, iy, iz, localmesh), {x, y, z}, length, valid}); | ||
|
|
||
| #if CHECKLEVEL >= 2 |
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 "CHECKLEVEL" is directly included [misc-include-cleaner]
include/bout/parallel_boundary_region.hxx:3:
- #include "bout/boundary_region.hxx"
+ #include "bout/assert.hxx"
+ #include "bout/boundary_region.hxx"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
There were too many comments to post at once. Showing the first 25 out of 242. Check the log or trigger a new build to see more.
| bndry_points.push_back({xyz2ind(ix, iy, iz, localmesh), {x, y, z}, length, valid}); | ||
|
|
||
| #if CHECKLEVEL >= 2 | ||
| if (!std::isfinite(fp)) { |
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 "std::isfinite" is directly included [misc-include-cleaner]
include/bout/parallel_boundary_region.hxx:5:
- #include <functional>
+ #include <cmath>
+ #include <functional>| // extrapolate a given point to the boundary | ||
| BoutReal extrapolate_sheath_o1(const Field3D& f) const { return ythis(f); } | ||
| BoutReal extrapolate_sheath_o2(const Field3D& f) const { | ||
| ASSERT3(valid() >= 0); |
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 "ASSERT3" is directly included [misc-include-cleaner]
ASSERT3(valid() >= 0);
^| } | ||
| return ythis(f) * (1 + length()) - yprev(f) * length(); | ||
| } | ||
| inline BoutReal |
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: function 'extrapolate_sheath_o1' has inline specifier but is implicitly inlined [readability-redundant-inline-specifier]
| inline BoutReal | |
| BoutReal |
| extrapolate_sheath_o1(const std::function<BoutReal(int yoffset, Ind3D ind)>& f) const { | ||
| return ythis(f); | ||
| } | ||
| inline BoutReal |
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: function 'extrapolate_sheath_o2' has inline specifier but is implicitly inlined [readability-redundant-inline-specifier]
| inline BoutReal | |
| BoutReal |
| // extrapolate a given point to the boundary | ||
| BoutReal extrapolate_o1(const Field3D& f) const { return f[ind()]; } | ||
| BoutReal extrapolate_o2(const Field3D& f) const { | ||
| inline BoutReal interpolate_sheath_o2(const Field3D& f) 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.
warning: function 'interpolate_sheath_o2' has inline specifier but is implicitly inlined [readability-redundant-inline-specifier]
| inline BoutReal interpolate_sheath_o2(const Field3D& f) const { | |
| BoutReal interpolate_sheath_o2(const Field3D& f) const { |
| #endif | ||
|
|
||
| private: | ||
| const IndicesVec& bndry_points; |
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: member 'bndry_points' of type 'const std::vectorbout::parallel_boundary_region::Indices &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members]
const IndicesVec& bndry_points;
^| const BoutReal& yprev(const Field3D& f) const { return f.ynext(-dir)[ind().yp(-dir)]; } | ||
| BoutReal& yprev(Field3D& f) const { return f.ynext(-dir)[ind().yp(-dir)]; } | ||
| public: | ||
| const int dir; |
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: member 'dir' of type 'const int' is const qualified [cppcoreguidelines-avoid-const-or-ref-data-members]
const int dir;
^| const BoutReal& yprev(const Field3D& f) const { return f.ynext(-dir)[ind().yp(-dir)]; } | ||
| BoutReal& yprev(Field3D& f) const { return f.ynext(-dir)[ind().yp(-dir)]; } | ||
| public: | ||
| const int dir; |
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: member variable 'dir' has public visibility [cppcoreguidelines-non-private-member-variables-in-classes]
const int dir;
^| BoutReal& yprev(Field3D& f) const { return f.ynext(-dir)[ind().yp(-dir)]; } | ||
| public: | ||
| const int dir; | ||
| Mesh* localmesh; |
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: member variable 'localmesh' has public visibility [cppcoreguidelines-non-private-member-variables-in-classes]
Mesh* localmesh;
^|
|
||
| class BoundaryRegionPar : public BoundaryRegionBase { | ||
| public: | ||
| BoundaryRegionPar(const std::string& name, int dir, Mesh* passmesh) |
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 "std::string" is directly included [misc-include-cleaner]
include/bout/parallel_boundary_region.hxx:6:
- #include <vector>
+ #include <string>
+ #include <vector>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
There were too many comments to post at once. Showing the first 25 out of 217. Check the log or trigger a new build to see more.
| public: | ||
| BoundaryRegionPar(const std::string& name, int dir, Mesh* passmesh) | ||
| : BoundaryRegionBase(name, passmesh), dir(dir) { | ||
| ASSERT0(std::abs(dir) == 1); |
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 "ASSERT0" is directly included [misc-include-cleaner]
ASSERT0(std::abs(dir) == 1);
^| public: | ||
| BoundaryRegionPar(const std::string& name, int dir, Mesh* passmesh) | ||
| : BoundaryRegionBase(name, passmesh), dir(dir) { | ||
| ASSERT0(std::abs(dir) == 1); |
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 "std::abs" is directly included [misc-include-cleaner]
include/bout/parallel_boundary_region.hxx:5:
- #include <functional>
+ #include <cstdlib>
+ #include <functional>| bool isDone() final { return (bndry_position == std::end(bndry_points)); } | ||
|
|
||
| bool contains(const BoundaryRegionPar& bndry) const { | ||
| ASSERT2(is_sorted); |
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 "ASSERT2" is directly included [misc-include-cleaner]
ASSERT2(is_sorted);
^|
|
||
| bool contains(const BoundaryRegionPar& bndry) const { | ||
| ASSERT2(is_sorted); | ||
| return std::binary_search(std::begin(bndry_points), std::end(bndry_points), |
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 "std::binary_search" is directly included [misc-include-cleaner]
include/bout/parallel_boundary_region.hxx:5:
- #include <functional>
+ #include <algorithm>
+ #include <functional>|
|
||
| bool contains(const int ix, const int iy, const int iz) const { | ||
| const auto i2 = xyz2ind(ix, iy, iz, localmesh); | ||
| for (auto i1 : bndry_points) { |
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: replace loop by 'std::any_of()' [readability-use-anyofallof]
for (auto i1 : bndry_points) {
^| inline BoutReal dirichlet_o1(BoutReal UNUSED(spacing0), BoutReal value0) { | ||
| return value0; | ||
| } | ||
| inline BoutReal dirichlet_o2(BoutReal spacing0, BoutReal value0, BoutReal spacing1, |
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: unknown type name 'BoutReal' [clang-diagnostic-error]
inline BoutReal dirichlet_o2(BoutReal spacing0, BoutReal value0, BoutReal spacing1,
^| inline BoutReal dirichlet_o1(BoutReal UNUSED(spacing0), BoutReal value0) { | ||
| return value0; | ||
| } | ||
| inline BoutReal dirichlet_o2(BoutReal spacing0, BoutReal value0, BoutReal spacing1, |
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: unknown type name 'BoutReal' [clang-diagnostic-error]
inline BoutReal dirichlet_o2(BoutReal spacing0, BoutReal value0, BoutReal spacing1,
^| inline BoutReal dirichlet_o1(BoutReal UNUSED(spacing0), BoutReal value0) { | ||
| return value0; | ||
| } | ||
| inline BoutReal dirichlet_o2(BoutReal spacing0, BoutReal value0, BoutReal spacing1, |
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: unknown type name 'BoutReal' [clang-diagnostic-error]
inline BoutReal dirichlet_o2(BoutReal spacing0, BoutReal value0, BoutReal spacing1,
^| return value0; | ||
| } | ||
| inline BoutReal dirichlet_o2(BoutReal spacing0, BoutReal value0, BoutReal spacing1, | ||
| BoutReal value1) { |
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: unknown type name 'BoutReal' [clang-diagnostic-error]
BoutReal value1) {
^| BoutReal value1) { | ||
| return (spacing0 * value1 - spacing1 * value0) / (spacing0 - spacing1); | ||
| } | ||
| inline BoutReal neumann_o2(BoutReal UNUSED(spacing0), BoutReal value0, BoutReal spacing1, |
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: unknown type name 'BoutReal' [clang-diagnostic-error]
inline BoutReal neumann_o2(BoutReal UNUSED(spacing0), BoutReal value0, BoutReal spacing1,
^This allows dependent projects to check whether BOUT++ was compiled e.g. with 3D metrics.
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
There were too many comments to post at once. Showing the first 25 out of 190. Check the log or trigger a new build to see more.
| BoutReal value1) { | ||
| return (spacing0 * value1 - spacing1 * value0) / (spacing0 - spacing1); | ||
| } | ||
| inline BoutReal neumann_o2(BoutReal UNUSED(spacing0), BoutReal value0, BoutReal spacing1, |
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: unknown type name 'BoutReal' [clang-diagnostic-error]
inline BoutReal neumann_o2(BoutReal UNUSED(spacing0), BoutReal value0, BoutReal spacing1,
^| BoutReal value1) { | ||
| return (spacing0 * value1 - spacing1 * value0) / (spacing0 - spacing1); | ||
| } | ||
| inline BoutReal neumann_o2(BoutReal UNUSED(spacing0), BoutReal value0, BoutReal spacing1, |
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: unknown type name 'BoutReal' [clang-diagnostic-error]
inline BoutReal neumann_o2(BoutReal UNUSED(spacing0), BoutReal value0, BoutReal spacing1,
^| BoutReal value1) { | ||
| return (spacing0 * value1 - spacing1 * value0) / (spacing0 - spacing1); | ||
| } | ||
| inline BoutReal neumann_o2(BoutReal UNUSED(spacing0), BoutReal value0, BoutReal spacing1, |
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: unknown type name 'BoutReal' [clang-diagnostic-error]
inline BoutReal neumann_o2(BoutReal UNUSED(spacing0), BoutReal value0, BoutReal spacing1,
^| BoutReal value1) { | ||
| return (spacing0 * value1 - spacing1 * value0) / (spacing0 - spacing1); | ||
| } | ||
| inline BoutReal neumann_o2(BoutReal UNUSED(spacing0), BoutReal value0, BoutReal spacing1, |
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: unknown type name 'spacing0' [clang-diagnostic-error]
inline BoutReal neumann_o2(BoutReal UNUSED(spacing0), BoutReal value0, BoutReal spacing1,
^| return (spacing0 * value1 - spacing1 * value0) / (spacing0 - spacing1); | ||
| } | ||
| inline BoutReal neumann_o2(BoutReal UNUSED(spacing0), BoutReal value0, BoutReal spacing1, | ||
| BoutReal value1) { |
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: unknown type name 'BoutReal' [clang-diagnostic-error]
BoutReal value1) {
^|
|
||
| Field2D::Field2D(Mesh* localmesh, CELL_LOC location_in, DirectionTypes directions_in) | ||
| Field2D::Field2D(Mesh* localmesh, CELL_LOC location_in, DirectionTypes directions_in, | ||
| std::optional<size_t> UNUSED(regionID)) |
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 "std::optional" is directly included [misc-include-cleaner]
src/field/field2d.cxx:40:
+ #include <optional>| /// Constructor | ||
| Field3D::Field3D(Mesh* localmesh, CELL_LOC location_in, DirectionTypes directions_in) | ||
| : Field(localmesh, location_in, directions_in) { | ||
| Field3D::Field3D(Mesh* localmesh, CELL_LOC location_in, DirectionTypes directions_in, |
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 "CELL_LOC" is directly included [misc-include-cleaner]
src/field/field3d.cxx:27:
- #include "bout/build_defines.hxx"
+ #include "bout/bout_types.hxx"
+ #include "bout/build_defines.hxx"| /// Constructor | ||
| Field3D::Field3D(Mesh* localmesh, CELL_LOC location_in, DirectionTypes directions_in) | ||
| : Field(localmesh, location_in, directions_in) { | ||
| Field3D::Field3D(Mesh* localmesh, CELL_LOC location_in, DirectionTypes directions_in, |
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 "DirectionTypes" is directly included [misc-include-cleaner]
Field3D::Field3D(Mesh* localmesh, CELL_LOC location_in, DirectionTypes directions_in,
^| Field3DParallel::Field3DParallel(const BoutReal val, Mesh* localmesh) | ||
| : Field3D(localmesh) { | ||
|
|
||
| TRACE("Field3DParallel: Copy constructor from value"); |
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 "TRACE" is directly included [misc-include-cleaner]
src/field/field3d.cxx:29:
- #include <bout/boutcomm.hxx>
+ #include "bout/index_derivs_interface.hxx"
+ #include <bout/boutcomm.hxx>|
|
||
| FieldPerp::FieldPerp(Mesh* localmesh, CELL_LOC location_in, int yindex_in, | ||
| DirectionTypes directions) | ||
| DirectionTypes directions, std::optional<size_t> UNUSED(regionID)) |
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 "DirectionTypes" is directly included [misc-include-cleaner]
DirectionTypes directions, std::optional<size_t> UNUSED(regionID))
^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
There were too many comments to post at once. Showing the first 25 out of 165. Check the log or trigger a new build to see more.
| result[index] = lhs[index] * rhs[index]; | ||
| } | ||
|
|
||
| #if BOUT_USE_TRACK |
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 "BOUT_USE_TRACK" is directly included [misc-include-cleaner]
src/field/generated_fieldops.cxx:1:
- #include <bout/field2d.hxx>
+ #include "bout/build_defines.hxx"
+ #include <bout/field2d.hxx>| } | ||
|
|
||
| #if BOUT_USE_TRACK | ||
| result.name = fmt::format("{:s} * {:s}", lhs.name, rhs.name); |
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 "fmt::format" is directly included [misc-include-cleaner]
src/field/generated_fieldops.cxx:1:
- #include <bout/field2d.hxx>
+ #include "fmt/format.h"
+ #include <bout/field2d.hxx>|
|
||
| track(rhs, "operator*="); | ||
| #if BOUT_USE_TRACK | ||
| name = fmt::format("{:s} *= {:s}", this->name, rhs.name); |
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 "fmt::format" is directly included [misc-include-cleaner]
name = fmt::format("{:s} *= {:s}", this->name, rhs.name);
^| } | ||
|
|
||
| #if BOUT_USE_TRACK | ||
| result.name = fmt::format("{:s} * {:s}", lhs.name, "BR"); |
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 "fmt::format" is directly included [misc-include-cleaner]
result.name = fmt::format("{:s} * {:s}", lhs.name, "BR");
^|
|
||
| track(rhs, "operator*="); | ||
| #if BOUT_USE_TRACK | ||
| name = fmt::format("{:s} *= {:s}", this->name, "BR"); |
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 "fmt::format" is directly included [misc-include-cleaner]
name = fmt::format("{:s} *= {:s}", this->name, "BR");
^| } | ||
| // If the initial guess is not set to zero | ||
| if (!isGlobalFlagSet(INVERT_START_NEW)) { | ||
| KSPSetInitialGuessNonzero(ksp, static_cast<PetscBool>(true)); |
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 "KSPSetInitialGuessNonzero" is directly included [misc-include-cleaner]
KSPSetInitialGuessNonzero(ksp, static_cast<PetscBool>(true));
^| } | ||
| // If the initial guess is not set to zero | ||
| if (!isGlobalFlagSet(INVERT_START_NEW)) { | ||
| KSPSetInitialGuessNonzero(ksp, static_cast<PetscBool>(true)); |
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 "PetscBool" is directly included [misc-include-cleaner]
KSPSetInitialGuessNonzero(ksp, static_cast<PetscBool>(true));
^| // construction of the object | ||
| if (pctype == PCSHELL) { | ||
| // User-supplied preconditioner function | ||
| PCShellSetApply(pc, laplacePCapply); |
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 "PCShellSetApply" is directly included [misc-include-cleaner]
PCShellSetApply(pc, laplacePCapply);
^| if (pctype == PCSHELL) { | ||
| // User-supplied preconditioner function | ||
| PCShellSetApply(pc, laplacePCapply); | ||
| PCShellSetContext(pc, this); |
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 "PCShellSetContext" is directly included [misc-include-cleaner]
PCShellSetContext(pc, this);
^| PCShellSetApply(pc, laplacePCapply); | ||
| PCShellSetContext(pc, this); | ||
| if (rightprec) { | ||
| KSPSetPCSide(ksp, PC_RIGHT); // Right preconditioning |
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 "KSPSetPCSide" is directly included [misc-include-cleaner]
KSPSetPCSide(ksp, PC_RIGHT); // Right preconditioning
^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
There were too many comments to post at once. Showing the first 25 out of 144. Check the log or trigger a new build to see more.
| #endif | ||
|
|
||
| /// Factors to allow for some wiggleroom | ||
| BoutReal abs_fac_monotonic{1e-2}; |
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: member variable 'abs_fac_monotonic' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
BoutReal abs_fac_monotonic{1e-2};
^| #endif | ||
|
|
||
| /// Factors to allow for some wiggleroom | ||
| BoutReal abs_fac_monotonic{1e-2}; |
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 "BoutReal" is directly included [misc-include-cleaner]
include/bout/interpolation_xz.hxx:26:
- #include "bout/build_defines.hxx"
+ #include "bout/bout_types.hxx"
+ #include "bout/build_defines.hxx"|
|
||
| /// Factors to allow for some wiggleroom | ||
| BoutReal abs_fac_monotonic{1e-2}; | ||
| BoutReal rel_fac_monotonic{1e-1}; |
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: member variable 'rel_fac_monotonic' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
BoutReal rel_fac_monotonic{1e-1};
^| PCShellSetApply(pc, laplacePCapply); | ||
| PCShellSetContext(pc, this); | ||
| if (rightprec) { | ||
| KSPSetPCSide(ksp, PC_RIGHT); // Right preconditioning |
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 "PC_RIGHT" is directly included [misc-include-cleaner]
KSPSetPCSide(ksp, PC_RIGHT); // Right preconditioning
^| if (rightprec) { | ||
| KSPSetPCSide(ksp, PC_RIGHT); // Right preconditioning | ||
| } else { | ||
| KSPSetPCSide(ksp, PC_LEFT); // Left preconditioning |
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 "PC_LEFT" is directly included [misc-include-cleaner]
KSPSetPCSide(ksp, PC_LEFT); // Left preconditioning
^|
|
||
| const Coordinates::FieldMetric& Coordinates::Jg() const { | ||
| if (not JgCache.has_value()) { | ||
| auto* coords = this; // |
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: 'auto *coords' can be declared as 'const auto *coords' [readability-qualified-auto]
| auto* coords = this; // | |
| const auto* coords = this; // |
| if (_g_22_ylow.has_value()) { | ||
| return *_g_22_ylow; | ||
| } | ||
| _g_22_ylow.emplace(emptyFrom(g_22)); |
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 "emptyFrom" is directly included [misc-include-cleaner]
_g_22_ylow.emplace(emptyFrom(g_22));
^| } | ||
| _g_22_ylow.emplace(emptyFrom(g_22)); | ||
| //_g_22_ylow->setLocation(CELL_YLOW); | ||
| auto mesh = Bxy.getMesh(); |
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: 'auto mesh' can be declared as 'auto *mesh' [readability-qualified-auto]
| auto mesh = Bxy.getMesh(); | |
| auto *mesh = Bxy.getMesh(); |
| //_g_22_ylow->setLocation(CELL_YLOW); | ||
| auto mesh = Bxy.getMesh(); | ||
| if (Bxy.isFci()) { | ||
| if (mesh->get(_g_22_ylow.value(), "g_22_cell_ylow", 0.0, false)) { //, CELL_YLOW)) { |
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: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
| if (mesh->get(_g_22_ylow.value(), "g_22_cell_ylow", 0.0, false)) { //, CELL_YLOW)) { | |
| if (mesh->get(_g_22_ylow.value(), "g_22_cell_ylow", 0.0, false) != 0) { //, CELL_YLOW)) { |
| } else { | ||
| ASSERT0(mesh->ystart > 0); | ||
| BOUT_FOR(i, g_22.getRegion("RGN_NOY")) { | ||
| _g_22_ylow.value()[i] = SQ(0.5 * (sqrt(g_22[i]) + sqrt(g_22[i.ym()]))); |
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 "sqrt" is directly included [misc-include-cleaner]
_g_22_ylow.value()[i] = SQ(0.5 * (sqrt(g_22[i]) + sqrt(g_22[i.ym()])));
^Co-authored-by: Peter Hill <peter.hill@york.ac.uk>
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
There were too many comments to post at once. Showing the first 25 out of 118. Check the log or trigger a new build to see more.
| } | ||
| _g_22_yhigh.emplace(emptyFrom(g_22)); | ||
| //_g_22_yhigh->setLocation(CELL_YHIGH); | ||
| auto mesh = Bxy.getMesh(); |
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: 'auto mesh' can be declared as 'auto *mesh' [readability-qualified-auto]
| auto mesh = Bxy.getMesh(); | |
| auto *mesh = Bxy.getMesh(); |
| //_g_22_yhigh->setLocation(CELL_YHIGH); | ||
| auto mesh = Bxy.getMesh(); | ||
| if (Bxy.isFci()) { | ||
| if (mesh->get(_g_22_yhigh.value(), "g_22_cell_yhigh", 0.0, |
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: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
src/mesh/coordinates.cxx:2083:
- false)) { //, CELL_YHIGH)) {
+ false) != 0) { //, CELL_YHIGH)) {| } | ||
|
|
||
| Coordinates::FieldMetric& Coordinates::g_22_yhigh() { | ||
| return const_cast<Coordinates::FieldMetric&>( |
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: do not use const_cast to remove const qualifier [cppcoreguidelines-pro-type-const-cast]
return const_cast<Coordinates::FieldMetric&>(
^| } | ||
|
|
||
| Coordinates::FieldMetric& Coordinates::g_22_ylow() { | ||
| return const_cast<Coordinates::FieldMetric&>( |
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: do not use const_cast to remove const qualifier [cppcoreguidelines-pro-type-const-cast]
return const_cast<Coordinates::FieldMetric&>(
^| if (!_jxz_ylow.has_value()) { | ||
| _compute_Jxz_cell_faces(); | ||
| } | ||
| return *_jxz_ylow; |
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: unchecked access to optional value [bugprone-unchecked-optional-access]
return *_jxz_ylow;
^| if (!fci) { | ||
| yzresult.setDirectionY(YDirectionType::Aligned); | ||
| } | ||
| yzresult.setDirectionY(YDirectionType::Aligned); |
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 "YDirectionType" is directly included [misc-include-cleaner]
mesh);
^| } else { | ||
| result += fromFieldAligned(yzresult); | ||
| } | ||
| result += fromFieldAligned(yzresult); |
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 "fromFieldAligned" is directly included [misc-include-cleaner]
}
^| Field3D Div_par_K_Grad_par(const Field3D& Kin, const Field3D& fin, bool bndry_flux) { | ||
|
|
||
| if (Kin.isFci()) { | ||
| return ::Div_par_K_Grad_par(Kin, fin); |
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 "Div_par_K_Grad_par" is directly included [misc-include-cleaner]
src/mesh/fv_ops.cxx:0:
- #include <bout/fv_ops.hxx>
+ #include "bout/difops.hxx"
+ #include <bout/fv_ops.hxx>|
|
||
| const auto region2 = | ||
| y_offset == 0 ? "RGN_NOY" : fmt::format("RGN_YPAR_{:+d}", y_offset); | ||
| std::unique_ptr<GlobalField3DAccessInstance> gf; |
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: variable 'gf' of type 'std::unique_ptr' can be declared 'const' [misc-const-correctness]
| std::unique_ptr<GlobalField3DAccessInstance> gf; | |
| std::unique_ptr<GlobalField3DAccessInstance> const gf; |
|
|
||
| if constexpr (monotonic) { | ||
| #endif | ||
| const auto corners = {(*gf)[IndG3D(g3dinds[i][0])], (*gf)[IndG3D(g3dinds[i][1])], |
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 "IndG3D" is directly included [misc-include-cleaner]
const auto corners = {(*gf)[IndG3D(g3dinds[i][0])], (*gf)[IndG3D(g3dinds[i][1])],
^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
There were too many comments to post at once. Showing the first 25 out of 93. Check the log or trigger a new build to see more.
| f_interp[iyp] = std::min(f_interp[iyp], minmax.second + diff); | ||
| } | ||
| #if USE_NEW_WEIGHTS and defined(HS_USE_PETSC) | ||
| ASSERT2(std::isfinite(cptr[int(i)])); |
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 "std::isfinite" is directly included [misc-include-cleaner]
ASSERT2(std::isfinite(cptr[int(i)]));
^| #if USE_NEW_WEIGHTS and defined(HS_USE_PETSC) | ||
| ASSERT2(std::isfinite(cptr[int(i)])); | ||
| } | ||
| VecRestoreArrayRead(result, &cptr); |
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 "VecRestoreArrayRead" is directly included [misc-include-cleaner]
VecRestoreArrayRead(result, &cptr);
^|
|
||
| // Derivatives are used for tension and need to be on dimensionless | ||
| // coordinates | ||
| Field3D fx = bout::derivatives::index::DDX(f, CELL_DEFAULT, "DEFAULT"); |
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 "CELL_DEFAULT" is directly included [misc-include-cleaner]
Field3D fx = bout::derivatives::index::DDX(f, CELL_DEFAULT, "DEFAULT");
^|
|
||
| // Then in X | ||
| f_interp(x, y_next, z) = lagrange_4pt(xvals, t_x(x, y, z)); | ||
| ASSERT2(std::isfinite(f_interp(x, y_next, 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 "ASSERT2" is directly included [misc-include-cleaner]
ASSERT2(std::isfinite(f_interp(x, y_next, z)));
^|
|
||
| // Then in X | ||
| f_interp(x, y_next, z) = lagrange_4pt(xvals, t_x(x, y, z)); | ||
| ASSERT2(std::isfinite(f_interp(x, y_next, 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 "std::isfinite" is directly included [misc-include-cleaner]
ASSERT2(std::isfinite(f_interp(x, y_next, z)));
^| proc = npe - 1; | ||
| } | ||
| } | ||
| int loc = id - local * proc; |
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: '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
| int loc = id - local * proc; | |
| int loc = id - (local * proc); |
| proc = npe - 1; | ||
| } | ||
| } | ||
| int loc = id - local * proc; |
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: variable 'loc' of type 'int' can be declared 'const' [misc-const-correctness]
| int loc = id - local * proc; | |
| int const loc = id - local * proc; |
| #if CHECK > 1 | ||
| if ((loc < 0 or loc > localwith or proc < 0 or proc >= npe) | ||
| or (periodic and (loc < mg or loc >= local + mg))) { | ||
| printf("globalToLocal1D failure: %d %d, %d %d, %d %d %s\n", id, idwo, globalwith, |
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: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
printf("globalToLocal1D failure: %d %d, %d %d, %d %d %s\n", id, idwo, globalwith,
^| #if CHECK > 1 | ||
| if ((loc < 0 or loc > localwith or proc < 0 or proc >= npe) | ||
| or (periodic and (loc < mg or loc >= local + mg))) { | ||
| printf("globalToLocal1D failure: %d %d, %d %d, %d %d %s\n", id, idwo, globalwith, |
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 "printf" is directly included [misc-include-cleaner]
src/mesh/parallel/fci_comm.hxx:34:
- #include <map>
+ #include <cstdio>
+ #include <map>| }; | ||
| template <class ind> | ||
| struct XYZ2Ind { | ||
| const int nx; |
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: member 'nx' of type 'const int' is const qualified [cppcoreguidelines-avoid-const-or-ref-data-members]
const int nx;
^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
There were too many comments to post at once. Showing the first 25 out of 68. Check the log or trigger a new build to see more.
| template <class ind> | ||
| struct XYZ2Ind { | ||
| const int nx; | ||
| const int ny; |
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: member 'ny' of type 'const int' is const qualified [cppcoreguidelines-avoid-const-or-ref-data-members]
const int ny;
^| struct XYZ2Ind { | ||
| const int nx; | ||
| const int ny; | ||
| const int nz; |
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: member 'nz' of type 'const int' is const qualified [cppcoreguidelines-avoid-const-or-ref-data-members]
const int nz;
^| const int ny; | ||
| const int nz; | ||
| ind convert(const int x, const int y, const int z) const { | ||
| return {z + (y + x * ny) * nz, ny, nz}; |
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: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
| return {z + (y + x * ny) * nz, ny, nz}; | |
| return {z + ((y + x * ny) * nz), ny, nz}; |
|
|
||
| GlobalField3DAccessInstance(const GlobalField3DAccess* gfa, | ||
| const std::vector<BoutReal>&& data) | ||
| : gfa(*gfa), data(std::move(data)){}; |
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: std::move of the const variable 'data' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg]
| : gfa(*gfa), data(std::move(data)){}; | |
| : gfa(*gfa), data(data){}; |
| : gfa(*gfa), data(std::move(data)){}; | ||
|
|
||
| private: | ||
| const GlobalField3DAccess& gfa; |
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: member 'gfa' of type 'const GlobalField3DAccess &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members]
const GlobalField3DAccess& gfa;
^| int cnt = 0; | ||
| for ([[maybe_unused]] auto dummy : reqs) { | ||
| int ind{0}; | ||
| auto ret = MPI_Waitany(reqs.size(), &reqs[0], &ind, MPI_STATUS_IGNORE); |
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: 'data' should be used for accessing the data pointer instead of taking the address of the 0-th element [readability-container-data-pointer]
| auto ret = MPI_Waitany(reqs.size(), &reqs[0], &ind, MPI_STATUS_IGNORE); | |
| auto ret = MPI_Waitany(reqs.size(), reqs.data(), &ind, MPI_STATUS_IGNORE); |
| int cnt = 0; | ||
| for ([[maybe_unused]] auto dummy : reqs) { | ||
| int ind{0}; | ||
| auto ret = MPI_Waitany(reqs.size(), &reqs[0], &ind, MPI_STATUS_IGNORE); |
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: narrowing conversion from 'size_type' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
auto ret = MPI_Waitany(reqs.size(), &reqs[0], &ind, MPI_STATUS_IGNORE);
^| sendBufferSize += toSendSizes[ind]; | ||
| toSend[ind].resize(toSendSizes[ind], -1); | ||
|
|
||
| ret = MPI_Irecv(static_cast<void*>(toSend[ind].data()), toSend[ind].size(), MPI_INT, |
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: narrowing conversion from 'size_type' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
ret = MPI_Irecv(static_cast<void*>(toSend[ind].data()), toSend[ind].size(), MPI_INT,
^| ASSERT0(ret == MPI_SUCCESS); | ||
| } | ||
| for (size_t proc = 0; proc < toGet.size(); ++proc) { | ||
| if (toGet[proc].size() != 0) { |
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: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty]
| if (toGet[proc].size() != 0) { | |
| if (!toGet[proc].empty()) { |
Additional context
/usr/include/c++/15/bits/stl_vector.h:1222: method 'vector'::empty() defined here
empty() const _GLIBCXX_NOEXCEPT
^| for (size_t proc = 0; proc < toGet.size(); ++proc) { | ||
| if (toGet[proc].size() != 0) { | ||
| const auto ret = MPI_Send(static_cast<void*>(toGet[proc].data()), | ||
| toGet[proc].size(), MPI_INT, proc, 666 * 666, comm); |
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: narrowing conversion from 'size_t' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
toGet[proc].size(), MPI_INT, proc, 666 * 666, comm);
^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
There were too many comments to post at once. Showing the first 25 out of 68. Check the log or trigger a new build to see more.
| template <class ind> | ||
| struct XYZ2Ind { | ||
| const int nx; | ||
| const int ny; |
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: member 'ny' of type 'const int' is const qualified [cppcoreguidelines-avoid-const-or-ref-data-members]
const int ny;
^| struct XYZ2Ind { | ||
| const int nx; | ||
| const int ny; | ||
| const int nz; |
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: member 'nz' of type 'const int' is const qualified [cppcoreguidelines-avoid-const-or-ref-data-members]
const int nz;
^| const int ny; | ||
| const int nz; | ||
| ind convert(const int x, const int y, const int z) const { | ||
| return {z + (y + x * ny) * nz, ny, nz}; |
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: '*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
| return {z + (y + x * ny) * nz, ny, nz}; | |
| return {z + ((y + x * ny) * nz), ny, nz}; |
|
|
||
| GlobalField3DAccessInstance(const GlobalField3DAccess* gfa, | ||
| const std::vector<BoutReal>&& data) | ||
| : gfa(*gfa), data(std::move(data)){}; |
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: std::move of the const variable 'data' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg]
| : gfa(*gfa), data(std::move(data)){}; | |
| : gfa(*gfa), data(data){}; |
| : gfa(*gfa), data(std::move(data)){}; | ||
|
|
||
| private: | ||
| const GlobalField3DAccess& gfa; |
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: member 'gfa' of type 'const GlobalField3DAccess &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members]
const GlobalField3DAccess& gfa;
^| int cnt = 0; | ||
| for ([[maybe_unused]] auto dummy : reqs) { | ||
| int ind{0}; | ||
| auto ret = MPI_Waitany(reqs.size(), &reqs[0], &ind, MPI_STATUS_IGNORE); |
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: 'data' should be used for accessing the data pointer instead of taking the address of the 0-th element [readability-container-data-pointer]
| auto ret = MPI_Waitany(reqs.size(), &reqs[0], &ind, MPI_STATUS_IGNORE); | |
| auto ret = MPI_Waitany(reqs.size(), reqs.data(), &ind, MPI_STATUS_IGNORE); |
| int cnt = 0; | ||
| for ([[maybe_unused]] auto dummy : reqs) { | ||
| int ind{0}; | ||
| auto ret = MPI_Waitany(reqs.size(), &reqs[0], &ind, MPI_STATUS_IGNORE); |
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: narrowing conversion from 'size_type' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
auto ret = MPI_Waitany(reqs.size(), &reqs[0], &ind, MPI_STATUS_IGNORE);
^| sendBufferSize += toSendSizes[ind]; | ||
| toSend[ind].resize(toSendSizes[ind], -1); | ||
|
|
||
| ret = MPI_Irecv(static_cast<void*>(toSend[ind].data()), toSend[ind].size(), MPI_INT, |
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: narrowing conversion from 'size_type' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
ret = MPI_Irecv(static_cast<void*>(toSend[ind].data()), toSend[ind].size(), MPI_INT,
^| ASSERT0(ret == MPI_SUCCESS); | ||
| } | ||
| for (size_t proc = 0; proc < toGet.size(); ++proc) { | ||
| if (toGet[proc].size() != 0) { |
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: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty]
| if (toGet[proc].size() != 0) { | |
| if (!toGet[proc].empty()) { |
Additional context
/usr/include/c++/15/bits/stl_vector.h:1222: method 'vector'::empty() defined here
empty() const _GLIBCXX_NOEXCEPT
^| for (size_t proc = 0; proc < toGet.size(); ++proc) { | ||
| if (toGet[proc].size() != 0) { | ||
| const auto ret = MPI_Send(static_cast<void*>(toGet[proc].data()), | ||
| toGet[proc].size(), MPI_INT, proc, 666 * 666, comm); |
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: narrowing conversion from 'size_t' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
toGet[proc].size(), MPI_INT, proc, 666 * 666, comm);
^
Here a summary of the changes:
Field3DParallel
A Field3DParallel is essentially a Field3D, that preserves the parallel slices.
This allows to avoid unnecessary computation of of parallel fields, that are not needed.
It also ensures parallel slices are present (for FCI) when later parallel derivatives are computed.
So any function that will call
DDYlater on, can change the signature toField3DParallelto declare that parallel slices need to be present for FCI.New Y-Boundary Operators
Custom sheath boundary conditions can now be implemented using an abstraction. The documentation is on RTD
That allows having one code path for FCI and FA, for upper and lower sheath BC, all in one place.
Various small fixups
loadParallelMetrics
For FCI the parallel slices of the metric components are loaded, as they are sometimes needed.
This makes FCI essentially 3D only.
There is now also the option to say a field is not allow to compute the parallel slices, to avoid overwriting them:
allowCalcParallelSlices.Tracking on failure
Only if the simulation fails to evolve (Currently euler and pvode only):
The different components of timederivate are dumped to a
BOUT.debug.*.ncwhich can be handy for figuring out which term is causing the instability. No more having to re-run the simulation with some terms disabled to debug such issues. This causes (an unkown) memory overhead - but ONLY if the solver has failed already.More names of parallel boundary region + cleanup of code
Support things like
bndry_par_xinorbndry_par_yup.Add monotonichermitespline for all cases
Merged into hermitespline and works also in parallel.
Support several parallel slices for FCI
MYG=2is now supported.