-
Notifications
You must be signed in to change notification settings - Fork 95
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
Add Array<int> to options, additional limiters for grids (rebase) #2767
base: next
Are you sure you want to change the base?
Changes from 4 commits
cc1672d
e654af6
3597663
1c1d834
0156c0e
c1c1b70
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 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -2073,6 +2073,35 @@ void BoutMesh::topology() { | |||||||||
add_target(ny_inner - 1, 0, nx); | ||||||||||
} | ||||||||||
|
||||||||||
// Additional limiters | ||||||||||
// Each limiter needs 3 indices: A Y index, start and end X indices | ||||||||||
int limiter_count = 0; | ||||||||||
Mesh::get(limiter_count, "limiter_count", 0); | ||||||||||
if (limiter_count > 0) { | ||||||||||
std::vector<int> limiter_yinds, limiter_xstarts, limiter_xends; | ||||||||||
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: multiple declarations in a single statement reduces readability [readability-isolate-declaration]
Suggested change
|
||||||||||
if (!source->get(this, limiter_yinds, "limiter_yinds", limiter_count)) { | ||||||||||
throw BoutException("Couldn't read limiter_yinds vector of length {} from mesh", | ||||||||||
limiter_count); | ||||||||||
} | ||||||||||
if (!source->get(this, limiter_xstarts, "limiter_xstarts", limiter_count)) { | ||||||||||
throw BoutException("Couldn't read limiter_xstarts vector of length {} from mesh", | ||||||||||
limiter_count); | ||||||||||
} | ||||||||||
if (!source->get(this, limiter_xends, "limiter_xends", limiter_count)) { | ||||||||||
throw BoutException("Couldn't read limiter_xend vector of length {} from mesh", | ||||||||||
limiter_count); | ||||||||||
} | ||||||||||
|
||||||||||
for (int i = 0; i < limiter_count; ++i) { | ||||||||||
int yind = limiter_yinds[i]; | ||||||||||
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: variable 'yind' of type 'int' can be declared 'const' [misc-const-correctness]
Suggested change
|
||||||||||
int xstart = limiter_xstarts[i]; | ||||||||||
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: variable 'xstart' of type 'int' can be declared 'const' [misc-const-correctness]
Suggested change
|
||||||||||
int xend = limiter_xends[i]; | ||||||||||
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: variable 'xend' of type 'int' can be declared 'const' [misc-const-correctness]
Suggested change
|
||||||||||
output_info.write("Adding a limiter between y={} and {}. X indices {} to {}\n", | ||||||||||
yind, yind + 1, xstart, xend); | ||||||||||
add_target(yind, xstart, xend); | ||||||||||
} | ||||||||||
} | ||||||||||
|
||||||||||
if ((ixseps_inner > 0) | ||||||||||
&& (((PE_YIND * MYSUB > jyseps1_1) && (PE_YIND * MYSUB <= jyseps2_1)) | ||||||||||
|| ((PE_YIND * MYSUB > jyseps1_2) && (PE_YIND * MYSUB <= jyseps2_2)))) { | ||||||||||
|
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 name 'it' is too short, expected at least 3 characters [readability-identifier-length]