Skip to content

Commit

Permalink
Add extra check for multicut cell (AMReX-Codes#3087)
Browse files Browse the repository at this point in the history
For some edge EB geometry cases when building the faces during an EB
iteration, nodes can go from regular to covered. Additional check needs
to be added to label appropriate cells as a `multicut` cell.
  • Loading branch information
drangara authored Jan 4, 2023
1 parent b648023 commit dd46ab5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Src/EB/AMReX_EB2_3D_C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,22 @@ void set_eb_data (const int i, const int j, const int k,

// Check for multiple cuts
// We know there are no multiple cuts on faces by now.
// So we only need to check the case that there are two cuts
// Firstly, we need to check the case that there are two cuts
// at the opposite corners.
bool multi_cuts = (axm >= 0.5_rt && axm < 1.0_rt &&
axp >= 0.5_rt && axp < 1.0_rt &&
aym >= 0.5_rt && aym < 1.0_rt &&
ayp >= 0.5_rt && ayp < 1.0_rt &&
azm >= 0.5_rt && azm < 1.0_rt &&
azp >= 0.5_rt && azp < 1.0_rt);
// Secondly, we also need to check if area fractions became 0
// at any opposite face when building the faces
if ((axm == 0.0_rt && axp == 0.0_rt) ||
(aym == 0.0_rt && ayp == 0.0_rt) ||
(azm == 0.0_rt && azp == 0.0_rt)) {
multi_cuts = true;
}

if (multi_cuts) {
set_covered(i, j, k, cell, vfrac, vcent, barea, bcent, bnorm);
is_multicut = true;
Expand Down

0 comments on commit dd46ab5

Please sign in to comment.