diff --git a/.gitignore b/.gitignore index 756b8a51f72..46736be80a6 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,8 @@ Docs/sphinx/build # catalyst/libsim Tutorials/Amr/Advection_AmrLevel/Exec/SingleVortex/*.png Tutorials/Amr/Advection_AmrCore/Exec/SingleVortex/*.png +Tutorials/EB/LevelSet/Exec/ImpFunc* +Tutorials/EB/LevelSet/Exec/LevelSet* *.vth *.vti *.pvd diff --git a/Src/EB/AMReX_EB2_IF_Intersection.H b/Src/EB/AMReX_EB2_IF_Intersection.H index f53a0677acb..b123ef9fae2 100644 --- a/Src/EB/AMReX_EB2_IF_Intersection.H +++ b/Src/EB/AMReX_EB2_IF_Intersection.H @@ -21,7 +21,7 @@ namespace IIF_detail { { return f(p); } - + template Real do_min (const RealArray& p, F&& f, Fs&... fs) { diff --git a/Src/EB/AMReX_EB_LSCore.H b/Src/EB/AMReX_EB_LSCore.H index 4332f42c522..134b2329959 100644 --- a/Src/EB/AMReX_EB_LSCore.H +++ b/Src/EB/AMReX_EB_LSCore.H @@ -28,6 +28,8 @@ class AmrMeshInSituBridge; namespace amrex { + +template class LSCore : public amrex::AmrCore { @@ -39,7 +41,7 @@ public: // Constructor - reads amr in parameters from inputs file // - sizes multilevel arrays and data structures - LSCore (); + LSCore (EB2::GeometryShop gshop); virtual ~LSCore (); // Initializes multilevel data @@ -128,6 +130,9 @@ private: Vector level_set; Vector ls_factory; + + int eb_pad; + // This is essentially a 2*DIM integer array storing the physical boundary // condition types at the lo/hi walls in each direction BCRec bcs; diff --git a/Src/EB/AMReX_EB_LSCore.cpp b/Src/EB/AMReX_EB_LSCoreI.H similarity index 94% rename from Src/EB/AMReX_EB_LSCore.cpp rename to Src/EB/AMReX_EB_LSCoreI.H index 49486c1f8c4..fe52fbce0ce 100644 --- a/Src/EB/AMReX_EB_LSCore.cpp +++ b/Src/EB/AMReX_EB_LSCoreI.H @@ -84,19 +84,16 @@ void LSCore::InitData () { InitFromScratch(time); AverageDown(); - if (chk_int > 0) { + if (chk_int > 0) WriteCheckpointFile(); - } - } - else { + } else { // restart from a checkpoint ReadCheckpointFile(); } - if (plot_int > 0) { + if (plot_int > 0) WritePlotFile(); - } } @@ -146,8 +143,12 @@ void LSCore::MakeNewLevelFromScratch (int lev, Real time, const BoxArray & ba, const int nghost = 1; level_set[lev].define(ba, dm, ncomp, nghost); - // NOTE: use move semantics since LSFactory contains unique_ptrs - ls_factory[lev] = std::move(LSFacory(0, )); + // NOTE: use move semantics since LSFactory contains unique_ptrs. + int levelset_pad = 1; + int levelset_eb_pad = 1; + ls_factory[lev] = std::move( + LSFacory(lev, 1, 1, levelset_pad, levelset_eb_pad, ba, geom[lev], dm) + ); const Real * dx = geom[lev].CellSize(); @@ -243,34 +244,13 @@ void LSCore::ErrorEst (int lev, TagBoxArray& tags, Real time, int ngrow) { // read in some parameters from inputs file void LSCore::ReadParameters () { - /************************************************************************ * Parse inputs * ***********************************************************************/ + ParmParse pp("eb_amr"); + pp.query("eb_pad", eb_pad); - { - ParmParse pp("particles"); - - int n_part; - Vector pos, rad; - - pp.query("n_particles", n_part); - pp.getarr("positions", pos, 0, 3 * n_part); - pp.getarr("radii", rad, 0, n_part); - - - // Convert input arrays to vectors of type particle_info - int i_part = 0; - for(int i = 0; i + 2 < pos.size(); i += 3) { - particle_info particle; - - particle.pos = RealVect(pos[i], pos[i+1], pos[i+2]); - particle.radius = rad[i_part]; - particle_data.push_back(particle); - i_part ++; - } - } } @@ -326,8 +306,8 @@ void LSCore::FillPatch (int lev, Real time, MultiFab& mf, int icomp, int ncomp) void LSCore::FillCoarsePatch (int lev, Real time, MultiFab& mf, int icomp, int ncomp) { BL_ASSERT(lev > 0); - PhysBCFunct cphysbc(geom[lev-1],bcs,BndryFunctBase(phifill)); - PhysBCFunct fphysbc(geom[lev ],bcs,BndryFunctBase(phifill)); + PhysBCFunct cphysbc(geom[lev-1], bcs, BndryFunctBase(phifill)); + PhysBCFunct fphysbc(geom[lev ], bcs, BndryFunctBase(phifill)); Interpolater * mapper = & cell_cons_interp; diff --git a/Src/EB/AMReX_EB_levelset.H b/Src/EB/AMReX_EB_levelset.H index 7bc48ac2f3f..afa8b0e361d 100644 --- a/Src/EB/AMReX_EB_levelset.H +++ b/Src/EB/AMReX_EB_levelset.H @@ -21,10 +21,13 @@ class LSFactory { private: // MultiFab pointers storing level-set data - // -> ls_phi: nodal MultiFab storing signed distance function to the nearest wall - // -> ls_valid: cell-centered iMultiFab storing integer flags assuming the following values: + // -> ls_phi: nodal MultiFab storing signed distance function to the + // nearest wall + // -> ls_valid: cell-centered iMultiFab storing integer flags + // assuming the following values: // -1 : not all nodes around cell have been initialized - // 0 : none of the cell's neighbours contain negative vlaues of ls_phi on its nodes + // 0 : none of the cell's neighbours contain negative vlaues of + // ls_phi on its nodes // 1 : the cell is in the neighbourhood of phi < 0 std::unique_ptr ls_grid;