Skip to content

Commit

Permalink
changed the way we fill the plot file data: Value of 2 is regular, 0 …
Browse files Browse the repository at this point in the history
…(or very tiny) is covered, and some cell values > 2 means multicuts
  • Loading branch information
ejyoo921 committed Sep 9, 2024
1 parent 75b419a commit 766e8a9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
6 changes: 3 additions & 3 deletions Src/EB/AMReX_EB2_2D_C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,10 @@ int build_faces (Box const& bx, Array4<EBCellFlag> const& cell,
if (fy(i ,j+1,0) == Type::irregular) { ++ncuts; }
if (ncuts > 2) {
Gpu::Atomic::Add(dp,1);
if (plt_multiple_cuts){
mcx(i,j,k) = ncuts;
}
}
if (plt_multiple_cuts){
mcx(i,j,k) = ncuts;
}
}
}
});
Expand Down
21 changes: 12 additions & 9 deletions Src/EB/AMReX_EB2_3D_C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,6 @@ int build_faces (Box const& bx, Array4<EBCellFlag> const& cell,

if (ncuts > 2) {
Gpu::Atomic::Add(dp,1);
if (plt_multiple_cuts){
mcx(i,j,k) = ncuts;
}
}

if ((ncuts > 2) || (lym <= small && lyp <= small && lzm <= small && lzp <= small)) {
Expand Down Expand Up @@ -498,6 +495,10 @@ int build_faces (Box const& bx, Array4<EBCellFlag> const& cell,
} else if (apx(i,j,k) == 1.0_rt) {
fx(i,j,k) = Type::regular;
}

if (plt_multiple_cuts){
mcx(i,j,k) = ncuts;
}
}
});

Expand Down Expand Up @@ -577,9 +578,6 @@ int build_faces (Box const& bx, Array4<EBCellFlag> const& cell,

if (ncuts > 2) {
Gpu::Atomic::Add(dp,1);
if (plt_multiple_cuts){
mcy(i,j,k) = ncuts;
}
}

if ((ncuts > 2) || (lxm <= small && lxp <= small && lzm <= small && lzp <= small)) {
Expand Down Expand Up @@ -609,6 +607,10 @@ int build_faces (Box const& bx, Array4<EBCellFlag> const& cell,
} else if (apy(i,j,k) == 1.0_rt) {
fy(i,j,k) = Type::regular;
}

if (plt_multiple_cuts){
mcy(i,j,k) = ncuts;
}
}
});

Expand Down Expand Up @@ -688,9 +690,6 @@ int build_faces (Box const& bx, Array4<EBCellFlag> const& cell,

if (ncuts > 2) {
Gpu::Atomic::Add(dp,1);
if (plt_multiple_cuts){
mcz(i,j,k) = ncuts;
}
}

if ((ncuts > 2) || (lxm <= small && lxp <= small && lym <= small && lyp <= small)) {
Expand Down Expand Up @@ -720,6 +719,10 @@ int build_faces (Box const& bx, Array4<EBCellFlag> const& cell,
} else if (apz(i,j,k) == 1.0_rt) {
fz(i,j,k) = Type::regular;
}

if (plt_multiple_cuts){
mcz(i,j,k) = ncuts;
}
}
});

Expand Down
11 changes: 6 additions & 5 deletions Src/EB/AMReX_EB2_Level.H
Original file line number Diff line number Diff line change
Expand Up @@ -498,23 +498,24 @@ GShopLevel<G>::define_fine (G const& gshop, const Geometry& geom,
if (plt_multiple_cuts && nmulticuts > 0)
{
amrex::Print() << "Total number of multicuts = " << nmulticuts << "\n";
amrex::Print() << "plotting multicut locations..." << "\n";
amrex::Print() << "Plotting multicut locations..." << "\n";
amrex::Print() << "Max is = " << multicut_face[0].max(0) << "\n";

#if (AMREX_SPACEDIM == 3)
if (!multicut_face[0].empty())
if (multicut_face[0].max(0) > 2)
{
WriteSingleLevelPlotfile("plt.multicut.x", multicut_face[0], {"multicut_fcx"}, geom, 0.0, 0);
}
if (!multicut_face[1].empty())
if (multicut_face[1].max(0) > 2)
{
WriteSingleLevelPlotfile("plt.multicut.y", multicut_face[1], {"multicut_fcy"}, geom, 0.0, 0);
}
if (!multicut_face[2].empty())
if (multicut_face[2].max(0) > 2)
{
WriteSingleLevelPlotfile("plt.multicut.z", multicut_face[2], {"multicut_fcz"}, geom, 0.0, 0);
}
#elif (AMREX_SPACEDIM == 2)
if (!multicut_face[0].empty())
if (multicut_face[0].max(0) > 2)
{
WriteSingleLevelPlotfile("plt.multicut", multicut_face[0], {"multicut_fcx"}, geom, 0.0, 0);
}
Expand Down

0 comments on commit 766e8a9

Please sign in to comment.