Skip to content

Commit

Permalink
add utility function automating levelset__eb_pad
Browse files Browse the repository at this point in the history
  • Loading branch information
JBlaschke committed Jan 1, 2019
1 parent df6b70d commit d314169
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
24 changes: 23 additions & 1 deletion Src/EB/AMReX_EB_levelset.H
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class LSUtility {
//! `geom`, and CellSize matching the LSFactory `level_set` EB resolution.
//! This is particularly useful for building EBFArrayBoxFactory objects
//! whose Geometry is what's expected by the LSFactory's filling routines.
static Geometry make_eb_geometry(const LSFactory & level_set, const Geometry& geom){
static Geometry make_eb_geometry(const LSFactory & level_set, const Geometry & geom){
// Set up refined geometry
Box dom_eb = geom.Domain();
dom_eb.refine(level_set.get_eb_ref());
Expand All @@ -296,6 +296,28 @@ class LSUtility {
}



//! Returns the minimum eb_pad (EB ghost cells) to ensure that the level-set
//! is able to resolve a length scale of at least `min_resolution`.

static int min_eb_pad (Real min_resolution, const Geometry & geom_eb) {

RealVect dx_eb(AMREX_D_DECL(geom_eb.CellSize()[0],
geom_eb.CellSize()[1],
geom_eb.CellSize()[2]));

#if (AMREX_SPACEDIM == 1)
const Real min_dx = dx_eb[0];
#elif (AMREX_SPACEDIM == 2)
const Real min_dx = std::min(dx_eb[0], dx_eb[1]);
#elif (AMREX_SPACEDIM == 3)
const Real min_dx = std::min(dx_eb[0], std::min(dx_eb[1], dx_eb[2]));
#endif

return min_resolution/min_dx;
}


//! Debug utility to help interrogate runtime flag types.
static void PrintFlagType(const Box & tile_box, const EBCellFlagFab & flag){

Expand Down
1 change: 0 additions & 1 deletion Src/EB/AMReX_EB_levelset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,6 @@ void LSFactory::fill_data (MultiFab & data, iMultiFab & valid,
geom_eb.CellSize()[2]));

// Don't use the ls_grid_pad for the eb_padding (goes wrong!)
//const int eb_pad = data.nGrow() + 1;
const int ls_pad = data.nGrow();

// Doesn't work with iMultiFabs
Expand Down

0 comments on commit d314169

Please sign in to comment.