diff --git a/Src/EB/AMReX_EB2_3D_C.cpp b/Src/EB/AMReX_EB2_3D_C.cpp index ff81ba613fc..c9d4b47491d 100644 --- a/Src/EB/AMReX_EB2_3D_C.cpp +++ b/Src/EB/AMReX_EB2_3D_C.cpp @@ -377,6 +377,10 @@ int build_faces (Box const& bx, Array4 const& cell, Gpu::Buffer nmulticuts = {0}; int* hp = nmulticuts.hostData(); int* dp = nmulticuts.data(); + // delete the previous dat_multicuts.txt file + std::ofstream ofs; + ofs.open("dat_multicuts.txt", std::ofstream::out | std::ofstream::trunc); + ofs.close(); #ifdef AMREX_USE_FLOAT constexpr Real small = 1.e-5_rt; @@ -468,9 +472,16 @@ int build_faces (Box const& bx, Array4 const& cell, mt_fcx(i,j,k,0) = 10.0; #ifndef AMREX_USE_GPU - amrex::PrintToFile("loc_multicuts") << "xbx = " << xbx << "\n"; - amrex::PrintToFile("loc_multicuts") << "-> fx: (i,j,k) = (" << i << ","<< j << "," << k << ") / " - << "(x,y,z) = (" << problo[0]+(i)*dx[0] << ","<< problo[1]+(j)*dx[1] << "," << problo[2]+(k)*dx[2] << ") \n"; + std::ofstream fout("dat_multicuts.txt", std::ios::app); + fout << "xbx = " << xbx << std::endl; + fout << "-> fx: (i,j,k) = (" << i << ","<< j << "," << k << ") / " + << "(x,y,z) = (" << + problo[0]+(i)*dx[0] << ","<< problo[1]+(j)*dx[1] << "," << problo[2]+(k)*dx[2] << ")" + << std::endl; + + // amrex::PrintToFile("loc_multicuts") << "xbx = " << xbx << "\n"; + // amrex::PrintToFile("loc_multicuts") << "-> fx: (i,j,k) = (" << i << ","<< j << "," << k << ") / " + // << "(x,y,z) = (" << problo[0]+(i)*dx[0] << ","<< problo[1]+(j)*dx[1] << "," << problo[2]+(k)*dx[2] << ") \n"; #endif } } @@ -585,9 +596,15 @@ int build_faces (Box const& bx, Array4 const& cell, mt_fcy(i,j,k,0) = 10.0; #ifndef AMREX_USE_GPU - amrex::PrintToFile("loc_multicuts") << "ybx = " << ybx << "\n"; - amrex::PrintToFile("loc_multicuts") << "-> fy: (i,j,k) = (" << i << ","<< j << "," << k << ") / " - << "(x,y,z) = (" << problo[0]+(i)*dx[0] << ","<< problo[1]+(j)*dx[1] << "," << problo[2]+(k)*dx[2] << ") \n"; + std::ofstream fout("dat_multicuts.txt", std::ios::app); + fout << "ybx = " << ybx << std::endl; + fout << "-> fy: (i,j,k) = (" << i << ","<< j << "," << k << ") / " + << "(x,y,z) = (" << + problo[0]+(i)*dx[0] << ","<< problo[1]+(j)*dx[1] << "," << problo[2]+(k)*dx[2] << ")" + << std::endl; + // amrex::PrintToFile("loc_multicuts") << "ybx = " << ybx << "\n"; + // amrex::PrintToFile("loc_multicuts") << "-> fy: (i,j,k) = (" << i << ","<< j << "," << k << ") / " + // << "(x,y,z) = (" << problo[0]+(i)*dx[0] << ","<< problo[1]+(j)*dx[1] << "," << problo[2]+(k)*dx[2] << ") \n"; #endif } } @@ -702,9 +719,15 @@ int build_faces (Box const& bx, Array4 const& cell, mt_fcz(i,j,k,0) = 10.0; #ifndef AMREX_USE_GPU - amrex::PrintToFile("loc_multicuts") << "zbx = " << zbx << "\n"; - amrex::PrintToFile("loc_multicuts") << "-> fz: (i,j,k) = (" << i << ","<< j << "," << k << ") / " - << "(x,y,z) = (" << problo[0]+(i)*dx[0] << ","<< problo[1]+(j)*dx[1] << "," << problo[2]+(k)*dx[2] << ") \n"; + std::ofstream fout("dat_multicuts.txt", std::ios::app); + fout << "zbx = " << zbx << std::endl; + fout << "-> fz: (i,j,k) = (" << i << ","<< j << "," << k << ") / " + << "(x,y,z) = (" << + problo[0]+(i)*dx[0] << ","<< problo[1]+(j)*dx[1] << "," << problo[2]+(k)*dx[2] << ")" + << std::endl; + // amrex::PrintToFile("loc_multicuts") << "zbx = " << zbx << "\n"; + // amrex::PrintToFile("loc_multicuts") << "-> fz: (i,j,k) = (" << i << ","<< j << "," << k << ") / " + // << "(x,y,z) = (" << problo[0]+(i)*dx[0] << ","<< problo[1]+(j)*dx[1] << "," << problo[2]+(k)*dx[2] << ") \n"; #endif } } @@ -798,8 +821,6 @@ int build_faces (Box const& bx, Array4 const& cell, }); } else { // Passing now to plot the location of multicuts before aborting! - amrex::Print() << "Total number of multicut cells = " << *hp << "\n"; - if (plt_multiple_cuts){ amrex::Print() << "Creating outputs for multicut locations..." << "\n"; } diff --git a/Src/EB/AMReX_EB2_Level.H b/Src/EB/AMReX_EB2_Level.H index 7e1692aed96..e78515caaaa 100644 --- a/Src/EB/AMReX_EB2_Level.H +++ b/Src/EB/AMReX_EB2_Level.H @@ -15,7 +15,6 @@ #include #include -//EY: Plotting #include #ifdef AMREX_USE_OMP @@ -174,14 +173,14 @@ GShopLevel::define_fine (G const& gshop, const Geometry& geom, Real small_volfrac = 1.e-14; #endif bool cover_multiple_cuts = false; - bool plt_multiple_cuts = false; //EY + bool plt_multiple_cuts = false; int maxiter = 32; { ParmParse pp("eb2"); pp.queryAdd("small_volfrac", small_volfrac); pp.queryAdd("cover_multiple_cuts", cover_multiple_cuts); pp.queryAdd("maxiter", maxiter); - pp.queryAdd("plt_multiple_cuts", plt_multiple_cuts); //EY + pp.queryAdd("plt_multiple_cuts", plt_multiple_cuts); } maxiter = std::min(100000, maxiter); @@ -300,19 +299,15 @@ GShopLevel::define_fine (G const& gshop, const Geometry& geom, m_bndrycent.define(m_grids, m_dmap, AMREX_SPACEDIM, ng, mf_info); m_bndrynorm.define(m_grids, m_dmap, AMREX_SPACEDIM, ng, mf_info); - multicut_fcx.define(m_grids, m_dmap, 1, ng, mf_info); //this is cell-centered values storage - multicut_fcy.define(m_grids, m_dmap, 1, ng, mf_info); // need to be fora similar to m_areafrac - multicut_fcz.define(m_grids, m_dmap, 1, ng, mf_info); // should be a face-centered boxes + multicut_fcx.define(m_grids, m_dmap, 1, ng, mf_info); + multicut_fcy.define(m_grids, m_dmap, 1, ng, mf_info); + multicut_fcz.define(m_grids, m_dmap, 1, ng, mf_info); for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) { m_areafrac[idim].define(amrex::convert(m_grids, IntVect::TheDimensionVector(idim)), m_dmap, 1, ng, mf_info); m_facecent[idim].define(amrex::convert(m_grids, IntVect::TheDimensionVector(idim)), m_dmap, AMREX_SPACEDIM-1, ng, mf_info); - // EY: multicuts------------------------------------------------------------------------ - multicut_face[idim].define(amrex::convert(m_grids, IntVect::TheDimensionVector(idim)), - m_dmap, AMREX_SPACEDIM-1, ng, mf_info); - //-------------------------------------------------------------------------------------- IntVect edge_type{1}; edge_type[idim] = 0; m_edgecent[idim].define(amrex::convert(m_grids, edge_type), m_dmap, 1, ng, mf_info); }