-
Notifications
You must be signed in to change notification settings - Fork 104
Changes for FCI with hermes-3 #3079
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
Conversation
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
* 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 ...
Add Field3DParallel
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 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); |
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 'val' of type 'BoutReal' (aka 'double') can be declared 'const' [misc-const-correctness]
| 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; |
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 'next' of type 'BoutReal' (aka 'double') can be declared 'const' [misc-const-correctness]
| 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); |
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(bx == 0);
^| void limit_at_least(Field3D& f, BoutReal value) const { | ||
| if (ynext(f) < value) { | ||
| ynext(f) = 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: 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"| } | |
| ynext(f) = std::max(ynext(f), value); |
| } | ||
| }; | ||
|
|
||
| class BoundaryRegionIterY : public BoundaryRegionIter { |
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: 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; |
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 '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(); } |
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 'f' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg]
| 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(); } |
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 'f' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg]
| 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 { |
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: 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;| const Field3DParallel Field3D::asField3DParallel() const { | |
| Field3DParallel Field3D::asField3DParallel() const { |
|
|
||
| inline Field3DParallel | ||
| filledFrom(const Field3DParallel& f, | ||
| std::function<BoutReal(int yoffset, Ind3D index)> func) { |
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 parameter 'func' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
| std::function<BoutReal(int yoffset, Ind3D index)> func) { | |
| const std::function<BoutReal(int yoffset, Ind3D index)>& func) { |
|
Replaced by #3197 |
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 ...