Skip to content

Conversation

@dschwoerer
Copy link
Contributor

Opened a PR to get the documentation build.

The PR needs likely be split up, in e.g. #2651 #2887 #3004 and once they are merged likely more ...

dschwoerer and others added 30 commits October 1, 2024 16:15
It is not that the parallel slices may not be set - but rather
that they must not be calculated by interpolation.
MAYBE_UNUSED seems to no be defined
Previously this flag was used to prevent the usage of parallel slices, now it
only prevents calculation.
Without this fix, boundary conditions set on yup/down fields are not
applied when a boundary is copied from one field to another.
Fix Field3D::setBoundaryTo for FCI methods
dschwoerer and others added 27 commits October 23, 2025 14:31
* next: (78 commits)
  Apply clang-format changes
  Add `has_hypre` to python `boutconfig`
  Update examples for LaplaceXY factory
  Fix call to virtual function in ctor
  CI: Don't warn about including PETSc or MPI symbols directly
  Try to appease clang-tidy `misc-include-cleaner`
  Remove private variables from base class
  Fix typo in define
  Apply clang-format changes
  Add factory for LaplaceXY, LaplaceXY2, LaplaceXY2Hypre
  Enable non-const iteration over `Options`
  snes solver: Consider timestep change at output
  Bump DOI
  Add shim for ARKodeGetNumRhsEvals
  Suppress warning from `nodiscard` function
  Remove `boututils` from requirements; bump `boutdata`
  Fix deprecation warning
  Bump bundled fmt
  Fix some easy clang-tidy snes warnings
  Fix reorder warning from snes
  ...
Copy link
Contributor

@github-actions github-actions bot left a 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 327. Check the log or trigger a new build to see more.

BoutReal extrapolate_sheath_free(const Field3D& f, SheathLimitMode mode) const {
const BoutReal fac =
bout::parallel_boundary_region::limitFreeScale(yprev(f), ythis(f), mode);
BoutReal val = ythis(f);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'val' of type 'BoutReal' (aka 'double') can be declared 'const' [misc-const-correctness]

Suggested change
BoutReal val = ythis(f);
BoutReal const val = ythis(f);

const BoutReal fac =
bout::parallel_boundary_region::limitFreeScale(yprev(f), ythis(f), mode);
BoutReal val = ythis(f);
BoutReal next = mode == SheathLimitMode::linear_free ? val + fac : val * fac;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'next' of type 'BoutReal' (aka 'double') can be declared 'const' [misc-const-correctness]

Suggested change
BoutReal next = mode == SheathLimitMode::linear_free ? val + fac : val * fac;
BoutReal const next = mode == SheathLimitMode::linear_free ? val + fac : val * fac;

}

bool is_lower() const {
ASSERT2(bx == 0);
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 "ASSERT2" is directly included [misc-include-cleaner]

    ASSERT2(bx == 0);
    ^

void limit_at_least(Field3D& f, BoutReal value) const {
if (ynext(f) < value) {
ynext(f) = value;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: use std::max instead of < [readability-use-std-min-max]

include/bout/boundary_iterator.hxx:2:

- #include "bout/mesh.hxx"
+ #include <algorithm>
+ 
+ #include "bout/mesh.hxx"
Suggested change
}
ynext(f) = std::max(ynext(f), value);

}
};

class BoundaryRegionIterY : public BoundaryRegionIter {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: destructor of 'BoundaryRegionIterY' is public and non-virtual [cppcoreguidelines-virtual-class-destructor]

class BoundaryRegionIterY : public BoundaryRegionIter {
      ^
Additional context

include/bout/boundary_iterator.hxx:164: make it public and virtual

class BoundaryRegionIterY : public BoundaryRegionIter {
      ^


int tracking_state{0};
Options* tracking{nullptr};
std::string selfname;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: member variable 'selfname' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]

  std::string selfname;
              ^

explicit Field3DParallel(Types... args) : Field3D(std::move(args)...) {
ensureFieldAligned();
}
Field3DParallel(const Field3D& f) : Field3D(std::move(f)) { ensureFieldAligned(); }
Copy link
Contributor

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 'f' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg]

Suggested change
Field3DParallel(const Field3D& f) : Field3D(std::move(f)) { ensureFieldAligned(); }
Field3DParallel(const Field3D& f) : Field3D(f) { ensureFieldAligned(); }

ensureFieldAligned();
}
Field3DParallel(const Field3D& f) : Field3D(std::move(f)) { ensureFieldAligned(); }
Field3DParallel(const Field2D& f) : Field3D(std::move(f)) { ensureFieldAligned(); }
Copy link
Contributor

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 'f' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg]

Suggested change
Field3DParallel(const Field2D& f) : Field3D(std::move(f)) { ensureFieldAligned(); }
Field3DParallel(const Field2D& f) : Field3D(f) { ensureFieldAligned(); }

};

Field3DParallel Field3D::asField3DParallel() { return Field3DParallel(*this); }
const Field3DParallel Field3D::asField3DParallel() const {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: return type 'const Field3DParallel' is 'const'-qualified at the top level, which may reduce code readability without improving const correctness [readability-const-return-type]

include/bout/field3d.hxx:533:

-   inline const Field3DParallel asField3DParallel() const;
+   inline Field3DParallel asField3DParallel() const;
Suggested change
const Field3DParallel Field3D::asField3DParallel() const {
Field3DParallel Field3D::asField3DParallel() const {


inline Field3DParallel
filledFrom(const Field3DParallel& f,
std::function<BoutReal(int yoffset, Ind3D index)> func) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: the parameter 'func' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

Suggested change
std::function<BoutReal(int yoffset, Ind3D index)> func) {
const std::function<BoutReal(int yoffset, Ind3D index)>& func) {

@dschwoerer
Copy link
Contributor Author

Replaced by #3197

@dschwoerer dschwoerer closed this Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants