-
Notifications
You must be signed in to change notification settings - Fork 102
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
base: next
Are you sure you want to change the base?
Conversation
mesh may not be initialised or be a different mesh
Use the new track feature (better name required) to dump the different components of the ddt() as well as the residuum for the evolved fields.
This keeps track of all the changes done to the field and stores them to a OptionsObject.
This keeps track of all the changes done to the field and stores them to a OptionsObject.
This reverts commit 8485353. The parallel metric components are loaded, thus we can take meaningful derivatives in y-direction.
Directly iterate over the 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.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 25 out of 381. Check the log or trigger a new build to see more.
@@ -138,7 +138,7 @@ typedef struct bandmat_type { | |||
* * | |||
******************************************************************/ | |||
|
|||
#define PVODE_BAND_ELEM(A,i,j) ((A->data)[j][i-j+(A->smu)]) | |||
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + (A->smu)]) |
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-like macro 'PVODE_BAND_ELEM' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + (A->smu)])
^
@@ -138,7 +138,7 @@ | |||
* * | |||
******************************************************************/ | |||
|
|||
#define PVODE_BAND_ELEM(A,i,j) ((A->data)[j][i-j+(A->smu)]) | |||
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + (A->smu)]) |
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: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + (A->smu)]) | |
#define PVODE_BAND_ELEM(A, i, j) (((A)->data)[j][i - j + (A->smu)]) |
@@ -138,7 +138,7 @@ | |||
* * | |||
******************************************************************/ | |||
|
|||
#define PVODE_BAND_ELEM(A,i,j) ((A->data)[j][i-j+(A->smu)]) | |||
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + (A->smu)]) |
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: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + (A->smu)]) | |
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][(i) - j + (A->smu)]) |
@@ -138,7 +138,7 @@ | |||
* * | |||
******************************************************************/ | |||
|
|||
#define PVODE_BAND_ELEM(A,i,j) ((A->data)[j][i-j+(A->smu)]) | |||
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + (A->smu)]) |
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: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + (A->smu)]) | |
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - (j) + (A->smu)]) |
@@ -138,7 +138,7 @@ | |||
* * | |||
******************************************************************/ | |||
|
|||
#define PVODE_BAND_ELEM(A,i,j) ((A->data)[j][i-j+(A->smu)]) | |||
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + (A->smu)]) |
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: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + (A->smu)]) | |
#define PVODE_BAND_ELEM(A, i, j) ((A->data)[j][i - j + ((A)->smu)]) |
int abs_offset() const { return 1; } | ||
|
||
#if BOUT_USE_METRIC_3D == 0 | ||
BoutReal& ynext(Field2D& f) const { return f[ind().yp(by).xp(bx)]; } |
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 "Field2D" is directly included [misc-include-cleaner]
include/bout/boundary_iterator.hxx:2:
- #include "bout/mesh.hxx"
+ #include "bout/field2d.hxx"
+ #include "bout/mesh.hxx"
const BoutReal& yprev(const Field2D& f) const { return f[ind().yp(-by).xp(-bx)]; } | ||
#endif | ||
|
||
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 Field2D& f) const { return f[ind().yp(-by).xp(-bx)]; } | ||
#endif | ||
|
||
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;
^
const int dir; | ||
|
||
protected: | ||
int z{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: member variable 'z' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
int z{0};
^
|
||
protected: | ||
int z{0}; | ||
int x; |
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 'x' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
int x;
^
This avoids errors in the MMS tests
This partially reverts 0bcc047 It seems the achieved accuracy depends on some factors that are not well controlled.
Likely this is not needed.
…ci-auto-with-debug-higher-order
That might format more code at once, but should avoid a CI loop.
b1ee735
to
be5e285
Compare
@@ -12,10 +12,41 @@ | |||
{% if lhs == rhs == "Field3D" %} | |||
{{out.name}}.setRegion({{lhs.name}}.getMesh()->getCommonRegion({{lhs.name}}.getRegionID(), | |||
{{rhs.name}}.getRegionID())); | |||
#if BOUT_USE_FCI_AUTOMAGIC |
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.
I think BOUT_USE_FCI_AUTOMAGIC
may be useful to get something working, but I don't think it's a good way to go: We will have code that either breaks when this is turned off, or performs too many operations when it is turned on. I think the options are:
a) Have two functions / operators: One that discards yup/ydown, and the other that keeps them.
b) Always operate on yup/down if they are present, but add a method to fields e.g withoutParallelSlices()
that returns a copy of the field without the yup/down slices. That could be used e.g in assignment
Field3D f = g; // f has copies of g.yup and g.ydown
Field3D f = g.withoutParallelSlices(); // f has no parallel slices
I suspect that operating on two fields, one with slices and one without, should be an error: Either they should both have slices, or neither have.
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 417. Check the log or trigger a new build to see more.
return (f[ind()] * 3 - yprev(f)) * 0.5; | ||
} | ||
|
||
BoutReal extrapolate_next_o2(const Field3D& f) const { return 2 * f[ind()] - yprev(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: '*' has higher precedence than '-'; add parentheses to explicitly specify the order of operations [readability-math-missing-parentheses]
BoutReal extrapolate_next_o2(const Field3D& f) const { return 2 * f[ind()] - yprev(f); } | |
BoutReal extrapolate_next_o2(const Field3D& f) const { return (2 * f[ind()]) - yprev(f); } |
|
||
BoutReal | ||
extrapolate_next_o2(const std::function<BoutReal(int yoffset, Ind3D ind)>& f) const { | ||
return 2 * f(0, ind()) - f(0, ind().yp(-by).xp(-bx)); |
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 2 * f(0, ind()) - f(0, ind().yp(-by).xp(-bx)); | |
return (2 * f(0, ind())) - f(0, ind().yp(-by).xp(-bx)); |
protected: | ||
int z{0}; | ||
int x; | ||
int 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: member variable 'y' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
int y;
^
int z{0}; | ||
int x; | ||
int y; | ||
const int bx; |
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 'bx' of type 'const int' is const qualified [cppcoreguidelines-avoid-const-or-ref-data-members]
const int bx;
^
int z{0}; | ||
int x; | ||
int y; | ||
const int bx; |
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 'bx' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
const int bx;
^
return result; | ||
} | ||
|
||
#undef FIELD_FUNC | ||
|
||
template <typename T, typename = bout::utils::EnableIfField<T>, class... Types> | ||
inline void setName(T& f, const std::string& name, Types... args) { | ||
#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]
{
^
} | ||
|
||
template <typename T, typename = bout::utils::EnableIfField<T>, class... Types> | ||
inline T setName(T&& f, const std::string& name, Types... args) { |
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: forwarding reference parameter 'f' is never forwarded inside the function body [cppcoreguidelines-missing-std-forward]
>
^
@@ -66,7 +66,8 @@ public: | |||
*/ | |||
Field2D(Mesh* localmesh = nullptr, CELL_LOC location_in = CELL_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: function 'Field2D::Field2D' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]
Field2D(Mesh* localmesh = nullptr, CELL_LOC location_in = CELL_CENTRE,
^
Additional context
src/field/field2d.cxx:50: the definition seen here
Field2D::Field2D(Mesh* localmesh, CELL_LOC location_in, DirectionTypes directions_in,
^
include/bout/field2d.hxx:66: differing parameters are named here: ('region'), in definition: ('UNUSED_regionID')
Field2D(Mesh* localmesh = nullptr, CELL_LOC location_in = CELL_CENTRE,
^
@@ -66,7 +66,8 @@ | |||
*/ | |||
Field2D(Mesh* localmesh = nullptr, CELL_LOC location_in = CELL_CENTRE, | |||
DirectionTypes directions_in = {YDirectionType::Standard, | |||
ZDirectionType::Average}); | |||
ZDirectionType::Average}, |
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 "ZDirectionType" is directly included [misc-include-cleaner]
ZDirectionType::Average},
^
@@ -66,7 +66,8 @@ | |||
*/ | |||
Field2D(Mesh* localmesh = nullptr, CELL_LOC location_in = CELL_CENTRE, | |||
DirectionTypes directions_in = {YDirectionType::Standard, | |||
ZDirectionType::Average}); | |||
ZDirectionType::Average}, | |||
std::optional<size_t> region = {}); |
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]
include/bout/field2d.hxx:26:
- class Field2D;
+ #include <cstddef>
+ class Field2D;
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 ...