Skip to content
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

Merged

Conversation

asalmgren
Copy link
Member

…rection -- previously we only did piecewise constant within the face

Summary

Additional background

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • [X ] add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

…rection -- previously we only did piecewise constant within the face
@asalmgren asalmgren requested review from WeiqunZhang and cgilet March 11, 2024 01:51
Comment on lines 23 to 30
// 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);
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.


for (int i = 0; i < AMREX_SPACEDIM; i++) {
if (b.type(i) == IndexType::NODE) {
ng[i] = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ng[i] = 0;

ng is no longer being used at this point.

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) {
Copy link
Member

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 !=.

@asalmgren
Copy link
Member Author

asalmgren commented Mar 12, 2024 via email

@asalmgren
Copy link
Member Author

asalmgren commented Mar 12, 2024 via email

@WeiqunZhang
Copy link
Member

WeiqunZhang commented Mar 12, 2024

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

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 per_grown_domain, unless the idea is we only fill one ghost cell of the coarse data, not more than one.

@WeiqunZhang WeiqunZhang merged commit ae3af43 into AMReX-Codes:development Mar 12, 2024
69 checks passed
@WeiqunZhang WeiqunZhang deleted the face_cons_linear_interp branch March 12, 2024 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants