Skip to content

Commit

Permalink
Erased everything for plotting; We now generate one text file loc_mul…
Browse files Browse the repository at this point in the history
…ticuts.0 that includes physical location of the multicut cells: The coordinates indicate the cell center.
  • Loading branch information
ejyoo921 committed Jul 19, 2024
1 parent b35cba5 commit 5c7561e
Showing 1 changed file with 3 additions and 60 deletions.
63 changes: 3 additions & 60 deletions Src/EB/AMReX_EB2_3D_C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,26 +465,7 @@ int build_faces (Box const& bx, Array4<EBCellFlag> const& cell,
if (ncuts > 2) {
Gpu::Atomic::Add(dp,1);
if (plt_multiple_cuts){
// EY: Write txt file to for multicuts index
const std::string& datafilename = amrex::Concatenate("index_multicuts", *hp);
amrex::PrintToFile(datafilename) << "fx(i,j,k) index: (i,j,k) = (" << i << "," << j << "," << k << ") \n";
// EY: write plot file *just for the locations of multi-cuts------------------------------------
amrex::MFIter::allowMultipleMFIters(true);
RealBox real_box({AMREX_D_DECL(problo[0]+(i)*dx[0], problo[1]+(j)*dx[1], problo[2]+(k)*dx[2])},
{AMREX_D_DECL(problo[0]+(i+1)*dx[0], problo[1]+(j+1)*dx[1], problo[2]+(k+1)*dx[2])});
Geometry geom(xbx,real_box,CoordSys::cartesian,{0,0,0});
BoxArray ba(xbx);
DistributionMapping dm(ba);

MultiFab flag_xbx;
BoxArray nodal_ba = amrex::convert(ba, IntVect::TheNodeVector());
int nghost = 1;
flag_xbx.define(nodal_ba, dm, 1, nghost);

// std::string m_plot_file{"plt."};
const std::string& plotfilename = amrex::Concatenate("plt", *hp);
WriteSingleLevelPlotfile(plotfilename, flag_xbx, {"marker_x"}, geom, 0.0, 0);
// Finished plot file ----------------------------------------------------------------------------
amrex::PrintToFile("loc_multicuts") << "fx: (x,y,z) = (" << problo[0]+(i)*dx[0] << ","<< problo[1]+(j)*dx[1] << "," << problo[2]+(k)*dx[2] << ") \n";
}
}

Expand Down Expand Up @@ -595,26 +576,7 @@ int build_faces (Box const& bx, Array4<EBCellFlag> const& cell,
if (ncuts > 2) {
Gpu::Atomic::Add(dp,1);
if (plt_multiple_cuts){
// EY: Write txt file to for multicuts index
const std::string& datafilename = amrex::Concatenate("index_multicuts", *hp);
amrex::PrintToFile(datafilename) << "fy(i,j,k) index: (i,j,k) = (" << i << "," << j << "," << k << ") \n";
// EY: write plot file *just for the locations of multi-cuts------------------------------------
amrex::MFIter::allowMultipleMFIters(true);
RealBox real_box({AMREX_D_DECL(problo[0]+(i)*dx[0], problo[1]+(j)*dx[1], problo[2]+(k)*dx[2])},
{AMREX_D_DECL(problo[0]+(i+1)*dx[0], problo[1]+(j+1)*dx[1], problo[2]+(k+1)*dx[2])});
Geometry geom(ybx,real_box,CoordSys::cartesian,{0,0,0});
BoxArray ba(ybx);
DistributionMapping dm(ba);

MultiFab flag_ybx;
BoxArray nodal_ba = amrex::convert(ba, IntVect::TheNodeVector());
int nghost = 1;
flag_ybx.define(nodal_ba, dm, 1, nghost);

// std::string m_plot_file{"plt."};
const std::string& plotfilename = amrex::Concatenate("plt", *hp);
WriteSingleLevelPlotfile(plotfilename, flag_ybx, {"marker_y"}, geom, 0.0, 0);
// Finished plot file ----------------------------------------------------------------------------
amrex::PrintToFile("loc_multicuts") << "fy: (x,y,z) = (" << problo[0]+(i)*dx[0] << ","<< problo[1]+(j)*dx[1] << "," << problo[2]+(k)*dx[2] << ") \n";
}
}

Expand Down Expand Up @@ -725,26 +687,7 @@ int build_faces (Box const& bx, Array4<EBCellFlag> const& cell,
if (ncuts > 2) {
Gpu::Atomic::Add(dp,1);
if (plt_multiple_cuts){
// EY: Write txt file to for multicuts index
const std::string& datafilename = amrex::Concatenate("index_multicuts", *hp);
amrex::PrintToFile(datafilename) << "fz(i,j,k) index: (i,j,k) = (" << i << "," << j << "," << k << ") \n";
// EY: write plot file *just for the locations of multi-cuts------------------------------------
amrex::MFIter::allowMultipleMFIters(true);
RealBox real_box({AMREX_D_DECL(problo[0]+(i)*dx[0], problo[1]+(j)*dx[1], problo[2]+(k)*dx[2])},
{AMREX_D_DECL(problo[0]+(i+1)*dx[0], problo[1]+(j+1)*dx[1], problo[2]+(k+1)*dx[2])});
Geometry geom(zbx,real_box,CoordSys::cartesian,{0,0,0});
BoxArray ba(zbx);
DistributionMapping dm(ba);

MultiFab flag_zbx;
BoxArray nodal_ba = amrex::convert(ba, IntVect::TheNodeVector());
int nghost = 1;
flag_zbx.define(nodal_ba, dm, 1, nghost);

// std::string m_plot_file{"plt"};
const std::string& plotfilename = amrex::Concatenate("plt", *hp);
WriteSingleLevelPlotfile(plotfilename, flag_zbx, {"marker_z"}, geom, 0.0, 0);
// Finished plot file ----------------------------------------------------------------------------
amrex::PrintToFile("loc_multicuts") << "fz: (x,y,z) = (" << problo[0]+(i)*dx[0] << ","<< problo[1]+(j)*dx[1] << "," << problo[2]+(k)*dx[2] << ") \n";
}
}

Expand Down

0 comments on commit 5c7561e

Please sign in to comment.