-
Notifications
You must be signed in to change notification settings - Fork 104
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?
Changes from all commits
70726f3
c64d439
2d64a0d
d59517e
a65b1d8
b71e978
df4ea45
93b6c48
095c980
6c674fe
6f7eff8
6934acb
50e01ae
9f3fb54
1f93c73
ec5fe92
bd2f36d
3ceef07
c42dc24
36a06f3
b4dd92f
a7e783a
33a72a5
4f2da4d
a1f4b46
b4bd5b8
5863856
57f0553
cc9d5cc
aef4215
bbc8e08
552c2fd
00233cf
136fa8a
0e089cd
7e1067a
d416b5d
6cca6a4
62b62bf
628a6ce
e5c9fc1
40dac59
9a98a8b
cb068ea
d7d7c91
3cc13b9
a05201b
7d73c5c
ebf2d07
ae1fcfe
8b7d97d
ad56d8e
2a48341
f73813b
ff7525d
1c44f98
42c0958
21d1985
4f39c1d
cabdc4c
aa7938d
d1dee59
5818327
aa2d8b6
007fed0
c40110b
2a10ccd
296cc15
31d7702
71dd37c
90a7f4f
db77ef3
147a874
81d929d
276007c
731db60
dc94e06
1823144
1e96b3e
ad8f403
5adf893
cd383e2
2d72bab
b3841fb
e052c26
63e8cb9
371c928
f2939c6
d74d2a7
ad09499
def8a06
f1534f2
0bcc047
f6106a2
8665a67
ff71182
d3bc5cc
8337531
fcc3af6
f925c94
51e7b58
1c8fb47
bfaf986
f4acdb0
23f5992
d05e733
35206d4
261442e
df490b9
eef32f9
9fd76bf
ee9dc99
be5e285
092c578
2fb1b34
7a1d061
a6be0ab
862f7fd
d1c5689
e01bda2
86dc232
167e39e
59445b6
1f3521f
8c40bad
3f859b3
58811c8
05dd58e
784d381
b880846
844f2d4
25fd12f
5e1a3df
e034ddd
cdcb380
da7865d
6a75dfc
79af980
cb29794
3e9bdfd
24e96d0
196138a
a7acfc3
b8da0fb
f32693d
0ecf55c
3012a22
63a78d9
2f98162
fdbbed6
cb643eb
86fc85b
857e8c3
e105d03
fa51a14
f18392d
d915bfb
a5c36b1
6a05d58
96e710b
baa56fe
28dec7a
0560964
c964ff6
2f239ad
b968273
43bfa9a
370c42d
107b518
4789b41
6b993da
705414c
36f19fa
aaa4600
e48cc34
a855c06
e2cd97c
89b0855
1704a4a
8c26fe3
ef744ea
d889ecf
122c39a
1a0af58
1e912bd
560b005
8910b61
d170ca8
bdef58e
969997c
3468db4
aee8ecc
8e9c0fc
6a4204f
07987ac
f6b7b9e
086d68c
23a79a1
a680c16
ac95a37
0b8e27d
cffe52d
a0de0c7
267d376
d8c3169
ffb69be
b1acf2c
5a1419f
3b86ba9
8879da7
760a24f
58e2673
10b0d40
4f34c70
27db65c
ec4148f
4c12e70
f25bb0f
99e28ca
ad30f00
f17d21a
8afbcbc
28b2192
698b6cf
6e428c1
346ff3d
96f792f
aad0182
281a115
87cc79a
ec8b6d4
9de0c34
b97b8c1
732f4de
abb5f90
0751957
fb73f9b
6aed3df
f286975
783968a
c8faf01
3dbed9a
4c4190b
c6d7644
f3f3545
5fb8f47
c58bf64
b55faaf
b8b565e
f08c257
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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)]) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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)])
^ |
||
|
|
||
| /****************************************************************** | ||
| * * | ||
|
|
@@ -153,7 +153,7 @@ typedef struct bandmat_type { | |
| * * | ||
| ******************************************************************/ | ||
|
|
||
| #define PVODE_BAND_COL(A,j) (((A->data)[j])+(A->smu)) | ||
| #define PVODE_BAND_COL(A, j) ((((A)->data)[j]) + ((A)->smu)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: function-like macro 'PVODE_BAND_COL' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage] #define PVODE_BAND_COL(A, j) ((((A)->data)[j]) + ((A)->smu))
^
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: function-like macro 'PVODE_BAND_COL' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage] #define PVODE_BAND_COL(A, j) ((((A)->data)[j]) + ((A)->smu))
^ |
||
|
|
||
| /****************************************************************** | ||
| * * | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,7 +153,7 @@ typedef struct bandmat_type { | |
| * * | ||
| ******************************************************************/ | ||
|
|
||
| #define BAND_COL(A, j) (((A->data)[j]) + (A->smu)) | ||
| #define PVODE_BAND_COL(A, j) ((((A)->data)[j]) + ((A)->smu)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: function-like macro 'PVODE_BAND_COL' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage] #define PVODE_BAND_COL(A, j) ((((A)->data)[j]) + ((A)->smu))
^
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: function-like macro 'PVODE_BAND_COL' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage] #define PVODE_BAND_COL(A, j) ((((A)->data)[j]) + ((A)->smu))
^ |
||
|
|
||
| /****************************************************************** | ||
| * * | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,217 @@ | ||||||||||
| #pragma once | ||||||||||
|
|
||||||||||
| #include "bout/assert.hxx" | ||||||||||
| #include "bout/bout_types.hxx" | ||||||||||
| #include "bout/mesh.hxx" | ||||||||||
| #include "bout/parallel_boundary_region.hxx" | ||||||||||
| #include "bout/region.hxx" | ||||||||||
| #include "bout/sys/parallel_stencils.hxx" | ||||||||||
| #include "bout/sys/range.hxx" | ||||||||||
|
|
||||||||||
| #include <algorithm> | ||||||||||
| #include <functional> | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: included header algorithm is not used directly [misc-include-cleaner]
Suggested change
|
||||||||||
|
|
||||||||||
| class BoundaryRegionIter { | ||||||||||
dschwoerer marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: destructor of 'BoundaryRegionIter' is public and non-virtual [cppcoreguidelines-virtual-class-destructor] class BoundaryRegionIter {
^Additional contextinclude/bout/boundary_iterator.hxx:13: make it public and virtual class BoundaryRegionIter {
^
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: class 'BoundaryRegionIter' defines a 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 BoundaryRegionIter {
^
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: class 'BoundaryRegionIter' defines a 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 BoundaryRegionIter {
^ |
||||||||||
| public: | ||||||||||
| BoundaryRegionIter(int x, int y, int bx, int by, Mesh* mesh) | ||||||||||
| : dir(bx + by), x(x), y(y), bx(bx), by(by), localmesh(mesh) { | ||||||||||
| ASSERT3(bx * by == 0); | ||||||||||
dschwoerer marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| } | ||||||||||
| bool operator!=(const BoundaryRegionIter& rhs) const { return ind() != rhs.ind(); } | ||||||||||
|
|
||||||||||
| Ind3D ind() const { return xyz2ind(x, y, z); } | ||||||||||
dschwoerer marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| BoundaryRegionIter& operator++() { | ||||||||||
| ASSERT3(z < nz()); | ||||||||||
| z++; | ||||||||||
| if (z == nz()) { | ||||||||||
| z = 0; | ||||||||||
| _next(); | ||||||||||
| } | ||||||||||
| return *this; | ||||||||||
| } | ||||||||||
| virtual void _next() = 0; | ||||||||||
| BoundaryRegionIter& operator*() { return *this; } | ||||||||||
|
|
||||||||||
| void dirichlet_o2(Field3D& f, BoutReal value) const { | ||||||||||
dschwoerer marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "Field3D" is directly included [misc-include-cleaner] include/bout/boundary_iterator.hxx:2: - #include "bout/mesh.hxx"
+ #include "bout/field3d.hxx"
+ #include "bout/mesh.hxx"
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "Field3D" is directly included [misc-include-cleaner] include/bout/boundary_iterator.hxx:4: - #include "bout/mesh.hxx"
+ #include "bout/field3d.hxx"
+ #include "bout/mesh.hxx" |
||||||||||
| ynext(f) = parallel_stencil::dirichlet_o2(1, f[ind()], 0.5, value); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| BoutReal extrapolate_grad_o2(const Field3D& f) const { return f[ind()] - yprev(f); } | ||||||||||
|
|
||||||||||
| BoutReal extrapolate_sheath_o2(const Field3D& f) const { | ||||||||||
| return (f[ind()] * 3 - yprev(f)) * 0.5; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| 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 { | ||||||||||
dschwoerer marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| return (2 * f(0, ind())) - f(0, ind().yp(-by).xp(-bx)); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| BoutReal interpolate_sheath_o2(const Field3D& f) const { | ||||||||||
| return (f[ind()] + ynext(f)) * 0.5; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| BoutReal | ||||||||||
| interpolate_sheath_o2(const std::function<BoutReal(int yoffset, Ind3D ind)>& f) const { | ||||||||||
| return (f(0, ind()) + f(0, ind().yp(-by).xp(-bx))) * 0.5; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| BoutReal | ||||||||||
| extrapolate_sheath_o2(const std::function<BoutReal(int yoffset, Ind3D ind)>& f) const { | ||||||||||
| return 0.5 * (3 * f(0, ind()) - f(0, ind().yp(-by).xp(-bx))); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| BoutReal extrapolate_sheath_free(const Field3D& f, SheathLimitMode mode) const { | ||||||||||
| const BoutReal fac = | ||||||||||
| bout::parallel_boundary_region::limitFreeScale(yprev(f), ythis(f), mode); | ||||||||||
| const BoutReal val = ythis(f); | ||||||||||
| const BoutReal next = mode == SheathLimitMode::linear_free ? val + fac : val * fac; | ||||||||||
| return 0.5 * (val + next); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| void set_free(Field3D& f, SheathLimitMode mode) const { | ||||||||||
| const BoutReal fac = | ||||||||||
| bout::parallel_boundary_region::limitFreeScale(yprev(f), ythis(f), mode); | ||||||||||
| BoutReal val = ythis(f); | ||||||||||
| if (mode == SheathLimitMode::linear_free) { | ||||||||||
| for (int i = 1; i <= localmesh->ystart; ++i) { | ||||||||||
| val += fac; | ||||||||||
| f[ind().yp(by * i).xp(bx * i)] = val; | ||||||||||
| } | ||||||||||
| } else { | ||||||||||
| for (int i = 1; i <= localmesh->ystart; ++i) { | ||||||||||
| val *= fac; | ||||||||||
| f[ind().yp(by * i).xp(bx * i)] = val; | ||||||||||
| } | ||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| void limitFree(Field3D& f) const { | ||||||||||
| const BoutReal fac = | ||||||||||
| bout::parallel_boundary_region::limitFreeScale(yprev(f), ythis(f)); | ||||||||||
| BoutReal val = ythis(f); | ||||||||||
| for (int i = 1; i <= localmesh->ystart; ++i) { | ||||||||||
| val *= fac; | ||||||||||
| f[ind().yp(by * i).xp(bx * i)] = val; | ||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| bool is_lower() const { | ||||||||||
| ASSERT2(bx == 0); | ||||||||||
dschwoerer marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| return by == -1; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| void neumann_o1(Field3D& f, BoutReal grad) const { | ||||||||||
| BoutReal val = ythis(f); | ||||||||||
| for (int i = 1; i <= localmesh->ystart; ++i) { | ||||||||||
| val += grad; | ||||||||||
| f[ind().yp(by * i).xp(bx * i)] = val; | ||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| void neumann_o2(Field3D& f, BoutReal grad) const { | ||||||||||
| BoutReal val = yprev(f) + grad; | ||||||||||
| for (int i = 1; i <= localmesh->ystart; ++i) { | ||||||||||
| val += grad; | ||||||||||
| f[ind().yp(by * i).xp(bx * i)] = val; | ||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| void limit_at_least(Field3D& f, BoutReal value) const { | ||||||||||
| if (ynext(f) < value) { | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: use
Suggested change
|
||||||||||
| ynext(f) = value; | ||||||||||
| } | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: use include/bout/boundary_iterator.hxx:2: - #include "bout/mesh.hxx"
+ #include <algorithm>
+
+ #include "bout/mesh.hxx"
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: use
Suggested change
|
||||||||||
| } | ||||||||||
|
|
||||||||||
| BoutReal& ynext(Field3D& f) const { return f[ind().yp(by).xp(bx)]; } | ||||||||||
| const BoutReal& ynext(const Field3D& f) const { return f[ind().yp(by).xp(bx)]; } | ||||||||||
| BoutReal& yprev(Field3D& f) const { return f[ind().yp(-by).xp(-bx)]; } | ||||||||||
| const BoutReal& yprev(const Field3D& f) const { return f[ind().yp(-by).xp(-bx)]; } | ||||||||||
| BoutReal& ythis(Field3D& f) const { return f[ind()]; } | ||||||||||
| const BoutReal& ythis(const Field3D& f) const { return f[ind()]; } | ||||||||||
|
|
||||||||||
| void setYPrevIfValid(Field3D& f, BoutReal val) const { yprev(f) = val; } | ||||||||||
| void setAll(Field3D& f, const BoutReal val) const { | ||||||||||
| for (int i = -localmesh->ystart; i <= localmesh->ystart; ++i) { | ||||||||||
| f[ind().yp(by * i).xp(bx * i)] = val; | ||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| static int abs_offset() { return 1; } | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "BOUT_USE_METRIC_3D" is directly included [misc-include-cleaner] include/bout/boundary_iterator.hxx:4: - #include "bout/mesh.hxx"
+ #include "bout/build_defines.hxx"
+ #include "bout/mesh.hxx" |
||||||||||
|
|
||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:4: - #include "bout/mesh.hxx"
+ #include "bout/field2d.hxx"
+ #include "bout/mesh.hxx" |
||||||||||
| #if BOUT_USE_METRIC_3D == 0 | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "BOUT_USE_METRIC_3D" is directly included [misc-include-cleaner] include/bout/boundary_iterator.hxx:4: - #include "bout/mesh.hxx"
+ #include "bout/build_defines.hxx"
+ #include "bout/mesh.hxx" |
||||||||||
| BoutReal& ynext(Field2D& f) const { return f[ind().yp(by).xp(bx)]; } | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:4: - #include "bout/mesh.hxx"
+ #include "bout/field2d.hxx"
+ #include "bout/mesh.hxx" |
||||||||||
| const BoutReal& ynext(const Field2D& f) const { return f[ind().yp(by).xp(bx)]; } | ||||||||||
| BoutReal& yprev(Field2D& f) const { return f[ind().yp(-by).xp(-bx)]; } | ||||||||||
| const BoutReal& yprev(const Field2D& f) const { return f[ind().yp(-by).xp(-bx)]; } | ||||||||||
| #endif | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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;
^
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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;
^ |
||||||||||
|
|
||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: '~BoundaryRegionIter' cannot be the name of a variable or data member [clang-diagnostic-error] virtual ~BoundaryRegionIter = default;
^ |
||||||||||
| const int dir; | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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;
^
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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;
^ |
||||||||||
| virtual ~BoundaryRegionIter() = default; | ||||||||||
|
|
||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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;
^ |
||||||||||
| protected: | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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}; | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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;
^
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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;
^
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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};
^ |
||||||||||
| int x; | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: member 'by' of type 'const int' is const qualified [cppcoreguidelines-avoid-const-or-ref-data-members] const int by;
^
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: member variable 'by' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes] const int by;
^
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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;
^ |
||||||||||
| int y; | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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;
^ |
||||||||||
| const int bx; | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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;
^
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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;
^ |
||||||||||
| const int by; | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: member 'by' of type 'const int' is const qualified [cppcoreguidelines-avoid-const-or-ref-data-members] const int by;
^
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: member variable 'by' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes] const int by;
^ |
||||||||||
|
|
||||||||||
| private: | ||||||||||
| Mesh* localmesh; | ||||||||||
| int nx() const { return localmesh->LocalNx; } | ||||||||||
| int ny() const { return localmesh->LocalNy; } | ||||||||||
| int nz() const { return localmesh->LocalNz; } | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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]
Suggested change
|
||||||||||
|
|
||||||||||
| Ind3D xyz2ind(int x, int y, int z) const { | ||||||||||
| return Ind3D{(x * ny() + y) * nz() + z, ny(), nz()}; | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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]
Suggested change
|
||||||||||
| } | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 contextinclude/bout/boundary_iterator.hxx:170: make it public and virtual class BoundaryRegionIterY : public BoundaryRegionIter {
^ |
||||||||||
| }; | ||||||||||
|
|
||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: the parameter 'r' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
Suggested change
|
||||||||||
| class BoundaryRegionIterY : public BoundaryRegionIter { | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 contextinclude/bout/boundary_iterator.hxx:173: make it public and virtual class BoundaryRegionIterY : public BoundaryRegionIter {
^ |
||||||||||
| public: | ||||||||||
| BoundaryRegionIterY(RangeIterator r, int y, int dir, bool is_end, Mesh* mesh) | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: the parameter 'r' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
Suggested change
|
||||||||||
| : BoundaryRegionIter(r.ind, y, 0, dir, mesh), r(r), is_end(is_end) {} | ||||||||||
|
|
||||||||||
| bool operator!=(const BoundaryRegionIterY& rhs) { | ||||||||||
| ASSERT2(y == rhs.y); | ||||||||||
| if (is_end) { | ||||||||||
| if (rhs.is_end) { | ||||||||||
| return false; | ||||||||||
| } | ||||||||||
| return !rhs.r.isDone(); | ||||||||||
| } | ||||||||||
| if (rhs.is_end) { | ||||||||||
| return !r.isDone(); | ||||||||||
| } | ||||||||||
| return x != rhs.x; | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: 'virtual' is redundant since the function is already declared 'override' [cppcoreguidelines-explicit-virtual-functions]
Suggested change
|
||||||||||
| } | ||||||||||
|
|
||||||||||
| virtual void _next() override { | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: 'virtual' is redundant since the function is already declared 'override' [cppcoreguidelines-explicit-virtual-functions]
Suggested change
|
||||||||||
| ++r; | ||||||||||
| x = r.ind; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| private: | ||||||||||
| RangeIterator r; | ||||||||||
| bool is_end; | ||||||||||
| }; | ||||||||||
|
|
||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: the parameter 'r' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
Suggested change
|
||||||||||
| class NewBoundaryRegionY { | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "std::move" is directly included [misc-include-cleaner] include/bout/boundary_iterator.hxx:12: + #include <utility>
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: passing result of std::move() as a const reference argument; no move will actually happen [performance-move-const-arg]
Suggested change
Additional contextinclude/bout/sys/range.hxx:26: 'RangeIterator' is not move assignable/constructible class RangeIterator {
^ |
||||||||||
| public: | ||||||||||
| NewBoundaryRegionY(Mesh* mesh, bool lower, RangeIterator r) | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: the parameter 'r' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
Suggested change
|
||||||||||
| : mesh(mesh), lower(lower), r(std::move(r)) {} | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "std::move" is directly included [misc-include-cleaner] include/bout/boundary_iterator.hxx:12: + #include <utility>
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: passing result of std::move() as a const reference argument; no move will actually happen [performance-move-const-arg]
Suggested change
Additional contextinclude/bout/sys/range.hxx:26: 'RangeIterator' is not move assignable/constructible class RangeIterator {
^ |
||||||||||
| BoundaryRegionIterY begin(bool begin = true) { | ||||||||||
| return BoundaryRegionIterY(r, lower ? mesh->ystart : mesh->yend, lower ? -1 : +1, | ||||||||||
| !begin, mesh); | ||||||||||
| } | ||||||||||
| BoundaryRegionIterY end() { return begin(false); } | ||||||||||
|
|
||||||||||
| private: | ||||||||||
| Mesh* mesh; | ||||||||||
| bool lower; | ||||||||||
| RangeIterator r; | ||||||||||
| }; | ||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -4,6 +4,9 @@ class BoundaryRegion; | |||||
| #ifndef BOUT_BNDRY_REGION_H | ||||||
| #define BOUT_BNDRY_REGION_H | ||||||
|
|
||||||
| #include "bout/mesh.hxx" | ||||||
| #include "bout/region.hxx" | ||||||
| #include "bout/sys/parallel_stencils.hxx" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: included header region.hxx is not used directly [misc-include-cleaner]
Suggested change
|
||||||
| #include <string> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: included header parallel_stencils.hxx is not used directly [misc-include-cleaner]
Suggested change
|
||||||
| #include <utility> | ||||||
|
|
||||||
|
|
||||||
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]