-
Notifications
You must be signed in to change notification settings - Fork 101
Field3DParallel #3149
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: fci-auto-with-debug-higher-order
Are you sure you want to change the base?
Field3DParallel #3149
Conversation
Field3DParallel enforces that parallel derivatives can be taken. This means for FCI, parallel fields are present. It also ensures that if an operation is taken on such a field, the parallel fields are retained. This replaces part of fci-automagic, that always retained parallel fields on operations.
dicts have been preserving order for several releases now.
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
@@ -533,4 +533,13 @@ private: | |||
} | |||
}; | |||
|
|||
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:36:
- #include <bout/scorepwrapper.hxx>
+ #include "bout/field3d.hxx"
+ #include <bout/scorepwrapper.hxx>
@@ -533,4 +533,13 @@ private: | |||
} | |||
}; | |||
|
|||
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 "std::is_same" is directly included [misc-include-cleaner]
include/bout/deriv_store.hxx:34:
- #include <unordered_map>
+ #include <type_traits>
+ #include <unordered_map>
template <typename T> | ||
auto& getStore() { | ||
if constexpr (std::is_same<T, Field3DParallel>::value) { | ||
return DerivativeStore<Field3D>::getInstance(); |
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 "Field3D" is directly included [misc-include-cleaner]
return DerivativeStore<Field3D>::getInstance();
^
@@ -369,6 +364,11 @@ T VDDY(const T& vel, const T& f, CELL_LOC outloc = CELL_DEFAULT, | |||
return are_unaligned ? fromFieldAligned(result, region) : result; | |||
} | |||
} | |||
inline Field3D VDDY(const Field3D& v, const Field3DParallel& 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: 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"
result.setRegion(lhs.getMesh()->getCommonRegion(lhs.getRegionID(), rhs.getRegionID())); | ||
if (lhs.isFci()) { | ||
result.splitParallelSlices(); | ||
for (size_t i{0}; i < lhs.numberParallelSlices(); ++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 "size_t" is directly included [misc-include-cleaner]
src/field/generated_fieldops.cxx:7:
+ #include <cstddef>
@@ -1510,8 +1510,8 @@ Coordinates::FieldMetric Coordinates::DDY(const Field2D& f, CELL_LOC loc, | |||
return bout::derivatives::index::DDY(f, loc, method, region) / dy; | |||
} | |||
|
|||
Field3D Coordinates::DDY(const Field3D& f, CELL_LOC outloc, const std::string& method, | |||
const std::string& region) const { | |||
Field3D Coordinates::DDY(const Field3DParallel& f, CELL_LOC outloc, |
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]
Field3D Coordinates::DDY(const Field3DParallel& f, CELL_LOC outloc,
^
@@ -70,7 +70,7 @@ Coordinates::FieldMetric DDX(const Field2D& f, CELL_LOC outloc, const std::strin | |||
|
|||
////////////// Y DERIVATIVE ///////////////// | |||
|
|||
Field3D DDY(const Field3D& f, CELL_LOC outloc, const std::string& method, | |||
Field3D DDY(const Field3DParallel& f, CELL_LOC outloc, const std::string& method, |
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]
Field3D DDY(const Field3DParallel& f, CELL_LOC outloc, const std::string& method,
^
Nice, thanks @dschwoerer! Please could you add a docstring to the class to explain the motivation for it, when it should be used and how? I think most of the clang-tidy warnings can be fixed automatically if you run it locally |
Otherwise, the Field3DParallel is casted to Field3D and the wrong overloads are used
The communication was a no-op, as that did never calculate the parallel fields.
It is needed for e.g. calculating d1_dy
They should return Field3D, not Field3DParallel
It seems something changed, that make hypre be less precise
Bumps [ZedThree/clang-tidy-review](https://github.com/zedthree/clang-tidy-review) from 0.20.1 to 0.21.0. - [Release notes](https://github.com/zedthree/clang-tidy-review/releases) - [Changelog](https://github.com/ZedThree/clang-tidy-review/blob/master/CHANGELOG.md) - [Commits](ZedThree/clang-tidy-review@v0.20.1...v0.21.0) --- updated-dependencies: - dependency-name: ZedThree/clang-tidy-review dependency-version: 0.21.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
Bump ZedThree/clang-tidy-review from 0.20.1 to 0.21.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.
clang-tidy made some suggestions
@@ -177,6 +177,11 @@ T DDX(const T& f, CELL_LOC outloc = CELL_DEFAULT, const std::string& method = "D | |||
AUTO_TRACE(); | |||
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"
I tried git diff -U0 origin/fci-auto-with-debug-higher-order | \
clang-tidy-diff.py -p1 -path build-cont-debug/ -fix -config-file .clang-tidy -j 8 but that only added one header. Do you know how to run clang-tidy on this diff? |
The hypre3d test is failing with 2d metrics, as it seems it is not setting the y-boundaries in the SOL, but only in the core region. |
This is needed for 2D metrics, and in this case we probably want to clear the parallel fields.
the functions where implemented, but not defined in the header
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
BOUT_FOR(d, result.yup(i).getRegion(rgn)) { | ||
if (result.yup(i)[d] < f) { | ||
result.yup(i)[d] = f; | ||
if constexpr (std::is_same_v<T, 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.
warning: use of undeclared identifier 'Field3DParallel' [clang-diagnostic-error]
}
^
This should replace #3004