Skip to content

Commit

Permalink
sync wip
Browse files Browse the repository at this point in the history
  • Loading branch information
JBlaschke committed Nov 8, 2018
1 parent c41e57a commit 5a5fdfc
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 18 deletions.
24 changes: 12 additions & 12 deletions Src/EB/AMReX_EB2_Level.H
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ public:

const Geometry& Geom () const { return m_geom; }
IndexSpace const* getEBIndexSpace () const { return m_parent; }

protected:

Level (Level && rhs) = default;

Level (Level const& rhs) = delete;
Level& operator=(Level const& rhs) = delete;
Level& operator=(Level && rhs) = delete;

int coarsenFromFine (Level& fineLevel, bool fill_boundary);
void buildCellFlag ();
void fillLevelSet (MultiFab& levelset, const Geometry& geom) const;
Expand Down Expand Up @@ -185,19 +185,19 @@ GShopLevel<G>::GShopLevel (IndexSpace const* is, G const& gshop, const Geometry&
{
Array<BaseFab<Real>, AMREX_SPACEDIM> intercept;
Array<BaseFab<Real>, AMREX_SPACEDIM> M2;

for (MFIter mfi(m_mgf); mfi.isValid(); ++mfi)
{
auto& gfab = m_mgf[mfi];
const Box& vbx = gfab.validbox();

auto& levelset = gfab.getLevelSet();
gshop.fillFab(levelset, geom);

auto& cellflag = m_cellflag[mfi];

gfab.buildTypes(cellflag);

#if (AMREX_SPACEDIM == 3)
auto& facetype = gfab.getFaceType();
auto& edgetype = gfab.getEdgeType();
Expand All @@ -220,13 +220,13 @@ GShopLevel<G>::GShopLevel (IndexSpace const* is, G const& gshop, const Geometry&
const Box& b = facetype[idim].box();
M2[idim].resize(b,3);
}

// regular by default
for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
m_areafrac[idim][mfi].setVal(1.0);
m_facecent[idim][mfi].setVal(0.0);
}

amrex_eb2_build_faces(BL_TO_FORTRAN_BOX(vbx),
BL_TO_FORTRAN_ANYD(cellflag),
BL_TO_FORTRAN_ANYD(facetype[0]),
Expand All @@ -249,7 +249,7 @@ GShopLevel<G>::GShopLevel (IndexSpace const* is, G const& gshop, const Geometry&
BL_TO_FORTRAN_ANYD(M2[1]),
BL_TO_FORTRAN_ANYD(M2[2]),
dx, dxinv, problo);

// regular by default
m_volfrac[mfi].setVal(1.0);
m_centroid[mfi].setVal(0.0);
Expand All @@ -276,7 +276,7 @@ GShopLevel<G>::GShopLevel (IndexSpace const* is, G const& gshop, const Geometry&
BL_TO_FORTRAN_ANYD(m_bndryarea[mfi]),
BL_TO_FORTRAN_ANYD(m_bndrycent[mfi]),
BL_TO_FORTRAN_ANYD(m_bndrynorm[mfi]));

#elif (AMREX_SPACEDIM == 2)
auto& facetype = gfab.getFaceType();
for (int idim = 0; idim < AMREX_SPACEDIM; ++idim)
Expand Down Expand Up @@ -319,7 +319,7 @@ GShopLevel<G>::GShopLevel (IndexSpace const* is, G const& gshop, const Geometry&
m_bndryarea[mfi].setVal(0.0);
m_bndrycent[mfi].setVal(-1.0);
m_bndrynorm[mfi].setVal(0.0);

amrex_eb2_build_cells(BL_TO_FORTRAN_BOX(vbx),
BL_TO_FORTRAN_ANYD(cellflag),
BL_TO_FORTRAN_ANYD(facetype[0]),
Expand Down
17 changes: 12 additions & 5 deletions Src/EB/AMReX_EB_LSCore.H
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ class AmrMeshInSituBridge;
}
#endif

using namespace amrex;
//using namespace amrex;

namespace amrex {

class LSCore
: public amrex::AmrCore
Expand Down Expand Up @@ -120,9 +122,11 @@ private:
***************************************************************************/

// Paticle data (used for defining levelset)
Vector<particle_info> particle_data;
//Vector<particle_info> particle_data;
Vector<const EB2::Level *> eb_levels;

Vector<MultiFab> level_set;
Vector<MultiFab> level_set;
Vector<LSFactory> ls_factory;

// This is essentially a 2*DIM integer array storing the physical boundary
// condition types at the lo/hi walls in each direction
Expand All @@ -139,16 +143,19 @@ private:
std::string restart_chkfile = "";

// plotfile prefix and frequency
std::string plot_file {"plt"};
std::string plot_file {"ls_plt"};
int plot_int = -1;

// checkpoint prefix and frequency
std::string chk_file {"chk"};
std::string chk_file {"ls_chk"};
int chk_int = -1;

#if defined(BL_USE_SENSEI_INSITU)
amrex::AmrMeshInSituBridge *insitu_bridge;
#endif
};


}

#endif
11 changes: 10 additions & 1 deletion Src/EB/AMReX_EB_LSCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
#include <LSCore.H>
#include <LSCore_F.H>

using namespace amrex;
//using namespace amrex;
namespace amrex {

// constructor - reads in parameters from inputs file
// - sizes multilevel arrays and data structures
Expand All @@ -36,6 +37,7 @@ LSCore::LSCore () {
int nlevs_max = max_level + 1;

level_set.resize(nlevs_max);
ls_factory.resize(nlevs_max);

istep.resize(nlevs_max, 0);

Expand Down Expand Up @@ -131,6 +133,7 @@ void LSCore::RemakeLevel ( int lev, Real time, const BoxArray & ba,
// Delete level data overrides the pure virtual function in AmrCore
void LSCore::ClearLevel (int lev) {
level_set[lev].clear();
ls_factory[lev].clear();
}


Expand All @@ -143,6 +146,8 @@ 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, ));

const Real * dx = geom[lev].CellSize();

Expand Down Expand Up @@ -504,3 +509,7 @@ void LSCore::GotoNextLine (std::istream & is) {
constexpr std::streamsize bl_ignore_max { 100000 };
is.ignore(bl_ignore_max, '\n');
}



}

0 comments on commit 5a5fdfc

Please sign in to comment.