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

Fix bug in EBNodeFDLap #3271

Merged
merged 1 commit into from
Apr 25, 2023

Conversation

WeiqunZhang
Copy link
Member

@WeiqunZhang WeiqunZhang commented Apr 24, 2023

In this linear solver for WarpX, we missed a corner case where the edge with a length of exactly 1 has one end exactly on the EB surface. It is fixed by using the implicit function to detect covered nodes.

@WeiqunZhang WeiqunZhang marked this pull request as draft April 24, 2023 18:47
In this linear solver for WarpX, we missed a corner case where the edge with
a length of exactly 1 has one end exactly on the EB surface. It is fixed by
using the implicit function to detect covered nodes.
@WeiqunZhang WeiqunZhang marked this pull request as ready for review April 24, 2023 23:24
@WeiqunZhang
Copy link
Member Author

@RemiLehe

@WeiqunZhang WeiqunZhang requested a review from atmyers April 24, 2023 23:25
@WeiqunZhang WeiqunZhang merged commit adfb055 into AMReX-Codes:development Apr 25, 2023
@WeiqunZhang WeiqunZhang deleted the fix_MLEBNodeFDLap branch April 25, 2023 18:16
@ax3l ax3l added the bug label May 1, 2023
Comment on lines +348 to +349
tmp += -x(i,j,k) / hm * (r - Real(0.5) * hm * dr);
tmp0 += Real(-1.0) / hm * (r - Real(0.5) * hm * dr);
Copy link
Member

@ax3l ax3l May 1, 2023

Choose a reason for hiding this comment

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

This is a bug fix.

  • 2x hp -> hm: related to cut cell ratio

tmp += (x(i-1,j,k) - x(i,j,k)) * (r - Real(0.5) * dr);
} else {
hm = Real(1.0) - Real(2.) * ecx(i-1,j,k);
tmp += (xeb(i-1,j,k) - x(i,j,k)) / hm * (r - Real(0.5) * hp * dr);
tmp += (xeb(i-1,j,k) - x(i,j,k)) / hm * (r - Real(0.5) * hm * dr);
Copy link
Member Author

Choose a reason for hiding this comment

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

@RemiLehe This was also fixed by hp -> hm.

guj pushed a commit to guj/amrex that referenced this pull request Jul 13, 2023
In this linear solver for WarpX, we missed a corner case where the edge
with a length of exactly 1 has one end exactly on the EB surface. It is
fixed by using the implicit function to detect covered nodes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants