-
Notifications
You must be signed in to change notification settings - Fork 0
Fci auto with debug higher order #45
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
Changes from all commits
0ee0d07
49cd985
4566405
4935742
01a436c
147a872
cee68f2
15aaa05
eba722b
30ea7e3
66ff716
10d320f
4b05708
60224e4
608bb5d
88741c5
09f609b
d46efba
1fb921e
4a79fb4
b5bd5f0
6819718
fee27c9
96da2e9
e56981c
6b2c132
df2d661
263f9fe
bac4ca9
708bdcb
fa357c1
ca59edb
d88b454
8b1fbba
023bc41
affc995
71f5b6a
31fd461
17e46cf
9c0ae16
4a17b49
23d309f
4bbd9ba
4fac018
29a195f
4ee8630
2e216be
faa1046
414247b
6ba17ed
b319807
b814c9b
1260730
4a6fdba
0aca4a5
2f7c3c0
413e54f
d5d7c6a
652be61
7d48dbd
59cd39d
127fc9a
9b68bf2
d611758
db96b7e
1ed4f9e
6f3bbf5
a73080d
d8cf334
98da34a
e25884e
6b6ee52
03c98da
8bf4840
e39774a
22f493c
6c2c82c
c6c259b
de99acc
c35d773
22bbd27
4a6a7ef
bcc1418
61a2521
27db217
6b9e86e
d3b0d65
63a1f74
8e773f7
8485353
484a473
a45f681
1a26515
167ba2e
df42998
b53d27d
43669c8
b600cda
1ce3f2a
6bc5010
3831c37
35a2c4f
3e5bf8c
a78350f
f943880
a128be5
653d836
34c3f8f
b37ef0e
761bfc4
1d54e75
805b4c1
d2200cc
433df79
8112e98
5c80fbd
7b9b7e4
d91607f
e95636e
63531f0
2b1d9fb
749bddb
a00625f
1b4128f
4c50c6e
f88a35f
6384384
1ab7fb0
5f7a799
9535ab9
f7919e0
c9124f6
adf3e51
0619ffe
a19c9e8
ac212ef
0b053da
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
d10cd71
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)]) | ||||||||||||||||||
|
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: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
Suggested change
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: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
Suggested change
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: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
Suggested change
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: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
Suggested change
|
||||||||||||||||||
|
|
||||||||||||||||||
| /****************************************************************** | ||||||||||||||||||
| * * | ||||||||||||||||||
|
|
@@ -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)) | ||||||||||||||||||
|
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))
^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: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
Suggested change
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: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
Suggested change
|
||||||||||||||||||
|
|
||||||||||||||||||
| /****************************************************************** | ||||||||||||||||||
| * * | ||||||||||||||||||
|
|
||||||||||||||||||
| 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)) | ||||||||||
|
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))
^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: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
Suggested change
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: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
Suggested change
|
||||||||||
|
|
||||||||||
| /****************************************************************** | ||||||||||
| * * | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,166 @@ | ||||||
| #pragma once | ||||||
|
|
||||||
| #include "bout/mesh.hxx" | ||||||
| #include "bout/parallel_boundary_region.hxx" | ||||||
| #include "bout/sys/parallel_stencils.hxx" | ||||||
| #include "bout/sys/range.hxx" | ||||||
|
|
||||||
| class BoundaryRegionIter { | ||||||
|
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:7: make it public and virtual 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); | ||||||
|
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 "ASSERT3" is directly included [misc-include-cleaner] include/bout/boundary_iterator.hxx:2: - #include "bout/mesh.hxx"
+ #include "bout/assert.hxx"
+ #include "bout/mesh.hxx" |
||||||
| } | ||||||
| bool operator!=(const BoundaryRegionIter& rhs) { return ind() != rhs.ind(); } | ||||||
|
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: method 'operator!=' can be made const [readability-make-member-function-const]
Suggested change
|
||||||
|
|
||||||
| Ind3D ind() const { return xyz2ind(x, y, z); } | ||||||
|
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 "Ind3D" is directly included [misc-include-cleaner] include/bout/boundary_iterator.hxx:4: - #include "bout/sys/parallel_stencils.hxx"
+ #include "bout/region.hxx"
+ #include "bout/sys/parallel_stencils.hxx" |
||||||
| 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 { | ||||||
|
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 "BoutReal" is directly included [misc-include-cleaner] include/bout/boundary_iterator.hxx:2: - #include "bout/mesh.hxx"
+ #include "bout/bout_types.hxx"
+ #include "bout/mesh.hxx"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" |
||||||
| 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 { | ||||||
|
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::function" is directly included [misc-include-cleaner] include/bout/boundary_iterator.hxx:6: + #include <functional> |
||||||
| return 2 * f(0, ind()) - f(0, ind().yp(-by).xp(-bx)); | ||||||
| } | ||||||
|
|
||||||
| BoutReal interpolate_sheath_o1(const Field3D& f) const { | ||||||
| return (f[ind()] + ynext(f)) * 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))); | ||||||
| } | ||||||
|
|
||||||
| 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; | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| 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; | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| 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; | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| int abs_offset() const { return 1; } | ||||||
|
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: method 'abs_offset' can be made static [readability-convert-member-functions-to-static]
Suggested change
|
||||||
|
|
||||||
| #if BOUT_USE_METRIC_3D == 0 | ||||||
|
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:2: - #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)]; } | ||||||
|
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:2: - #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 | ||||||
|
|
||||||
| const int dir; | ||||||
|
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;
^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;
^ |
||||||
|
|
||||||
| protected: | ||||||
| int z{0}; | ||||||
|
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; | ||||||
|
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; | ||||||
| const int bx; | ||||||
| const int by; | ||||||
|
|
||||||
| private: | ||||||
| Mesh* localmesh; | ||||||
| int nx() const { return localmesh->LocalNx; } | ||||||
| int ny() const { return localmesh->LocalNy; } | ||||||
| int nz() const { return localmesh->LocalNz; } | ||||||
|
|
||||||
| Ind3D xyz2ind(int x, int y, int z) const { | ||||||
| return Ind3D{(x * ny() + y) * nz() + z, ny(), nz()}; | ||||||
| } | ||||||
| }; | ||||||
|
|
||||||
| class BoundaryRegionIterY : public BoundaryRegionIter { | ||||||
| public: | ||||||
| BoundaryRegionIterY(RangeIterator r, int y, int dir, bool is_end, Mesh* mesh) | ||||||
| : 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; | ||||||
| } | ||||||
|
|
||||||
| virtual void _next() override { | ||||||
| ++r; | ||||||
| x = r.ind; | ||||||
| } | ||||||
|
|
||||||
| private: | ||||||
| RangeIterator r; | ||||||
| bool is_end; | ||||||
| }; | ||||||
|
|
||||||
| class NewBoundaryRegionY { | ||||||
| public: | ||||||
| NewBoundaryRegionY(Mesh* mesh, bool lower, RangeIterator r) | ||||||
| : mesh(mesh), lower(lower), r(std::move(r)) {} | ||||||
| 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; | ||||||
| }; | ||||||
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]