-
Notifications
You must be signed in to change notification settings - Fork 370
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 option to interpolate data on faces linearly in the tangential di… #3794
Add option to interpolate data on faces linearly in the tangential di… #3794
Conversation
…rection -- previously we only did piecewise constant within the face
// We don't need to worry about face-based domain because this is only used in the tangential interpolation | ||
Box per_grown_domain = m_crse_geom.Domain(); | ||
for (int dim = 0; dim < AMREX_SPACEDIM; dim++) { | ||
if (m_crse_geom.isPeriodic(dim)) { | ||
per_grown_domain.grow(dim,1); | ||
} | ||
} | ||
|
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.
// We don't need to worry about face-based domain because this is only used in the tangential interpolation | |
Box per_grown_domain = m_crse_geom.Domain(); | |
for (int dim = 0; dim < AMREX_SPACEDIM; dim++) { | |
if (m_crse_geom.isPeriodic(dim)) { | |
per_grown_domain.grow(dim,1); | |
} | |
} |
Don't see it being used anywhere.
Src/AmrCore/AMReX_Interpolater.cpp
Outdated
|
||
for (int i = 0; i < AMREX_SPACEDIM; i++) { | ||
if (b.type(i) == IndexType::NODE) { | ||
ng[i] = 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.
ng[i] = 0; |
ng
is no longer being used at this point.
Src/AmrCore/AMReX_Interp_C.H
Outdated
if (!mask || mask(ci, cj, ck, n)) { | ||
fine(i, j, k, n) = crse(ci, cj, ck, n); | ||
#if (AMREX_SPACEDIM >= 2) | ||
if (cj != per_grown_domain.smallEnd(1) && cj != per_grown_domain.bigEnd(1) && ratio[1] > 1) { |
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.
Is the testing necessary? The CoarsenBox function grows the coarsened box by one cell. If the testing is necessary, it might be safer to test with >
and <
rather than !=
.
I should have made this a member of the AMReX_InterpFaceRegister class --
it is used in the calls to interp_face_reg.
Not sure whether it also needs to be a member of tags?
…On Tue, Mar 12, 2024 at 8:43 AM Weiqun Zhang ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In Src/AmrCore/AMReX_InterpFaceRegister.cpp
<#3794 (comment)>:
> + // We don't need to worry about face-based domain because this is only used in the tangential interpolation
+ Box per_grown_domain = m_crse_geom.Domain();
+ for (int dim = 0; dim < AMREX_SPACEDIM; dim++) {
+ if (m_crse_geom.isPeriodic(dim)) {
+ per_grown_domain.grow(dim,1);
+ }
+ }
+
⬇️ Suggested change
- // We don't need to worry about face-based domain because this is only used in the tangential interpolation
- Box per_grown_domain = m_crse_geom.Domain();
- for (int dim = 0; dim < AMREX_SPACEDIM; dim++) {
- if (m_crse_geom.isPeriodic(dim)) {
- per_grown_domain.grow(dim,1);
- }
- }
-
Don't see it being used anywhere.
—
Reply to this email directly, view it on GitHub
<#3794 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACRE6YR2GDP4MVBP4NLMBZLYX4PC5AVCNFSM6AAAAABEPO2752VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTSMZRGQ3DCNBXGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Ann Almgren
Senior Scientist; Dept. Head, Applied Mathematics
Pronouns: she/her/hers
|
The idea is for this to work without having filled ghost cell values of the
coarse data outside the domain.
More generally we would want to enforce the coarse data was filled there
…On Tue, Mar 12, 2024 at 9:19 AM Weiqun Zhang ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In Src/AmrCore/AMReX_Interp_C.H
<#3794 (comment)>:
> +#else
+ int cj = amrex::coarsen(j, ratio[1]);
+#endif
+
+#if (AMREX_SPACEDIM == 3)
+ int ck = amrex::coarsen(k, ratio[2]);
+#else
+ int ck = 0;
+#endif
+
+ if (dim == 0 && ci*ratio[0] == i) {
+ // Check solve mask to ensure we don't overwrite valid fine data.
+ if (!mask || mask(ci, cj, ck, n)) {
+ fine(i, j, k, n) = crse(ci, cj, ck, n);
+#if (AMREX_SPACEDIM >= 2)
+ if (cj != per_grown_domain.smallEnd(1) && cj != per_grown_domain.bigEnd(1) && ratio[1] > 1) {
Is the testing necessary? The CoarsenBox function grows the coarsened box
by one cell. If the testing is necessary, it might be safer to test with >
and < rather than !=.
—
Reply to this email directly, view it on GitHub
<#3794 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACRE6YTYFRKK6L4KQYRSRGTYX4TH7AVCNFSM6AAAAABEPO2752VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTSMZRGU2TCMJQG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Ann Almgren
Senior Scientist; Dept. Head, Applied Mathematics
Pronouns: she/her/hers
|
Not sure I understand. The current code with the checking has already relied on that the coarser data outside periodic boundary being filled. Otherwise the check should be using normal domain box, not |
…rection -- previously we only did piecewise constant within the face
Summary
Additional background
Checklist
The proposed changes: