Chombo + EB + MF  3.2
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
EBIndexSpace Class Reference

#include <EBIndexSpace.H>

Public Member Functions

 EBIndexSpace ()
 
void define (const ProblemDomain &a_domain, const RealVect &a_origin, const Real &a_dx, const GeometryService &a_geoserver, int a_nCellMax=-1, int a_maxCoarsenings=-1)
 
void define (HDF5Handle &a_handle, ProblemDomain a_finestLevel)
 reads in all levels from finest level down More...
 
void define (HDF5Handle &a_handle, int a_maxCoarsenings=-1)
 defines from one level and then does coarsening More...
 
void define (EBISLevel *a_level0, int a_nCellMax=-1, int a_maxCoarsenings=-1)
 
void define (const ProblemDomain &a_entireDomain, const RealVect &a_origin, const Real &a_dx, const Vector< RefCountedPtr< EBIndexSpace > > &a_patches, const Vector< IntVect > &a_offsets, int a_maxCoarsenings=-1)
 
EBISLevelbuildFirstLevel (const ProblemDomain &a_domain, const RealVect &a_origin, const Real &a_dx, const GeometryService &a_geoserver, int a_nCellMax, int a_maxCoarsenings, bool a_fixRegularNextToMultiValued=true)
 
EBISLevelbuildNextLevel (const GeometryService &a_geoserver, int a_nCellMax, bool a_fixRegularNextToMultiValued=true)
 
 ~EBIndexSpace ()
 
bool setDistributedData ()
 
int numLevels () const
 
long long numVoFs (const ProblemDomain &a_domain) const
 
Real totalVolFrac (const ProblemDomain &a_domain) const
 
int getLevel (const ProblemDomain &a_domain) const
 
RealVect getOrigin () const
 
const ProblemDomaingetBox (int level) const
 
void fillEBISLayout (EBISLayout &a_ebis, const DisjointBoxLayout &a_grids, const ProblemDomain &a_domain, const int &a_nghost) const
 
bool isDefined () const
 
void clear ()
 
int getNCellMax () const
 
void write (HDF5Handle &a_handle, ProblemDomain a_outputLevel=ProblemDomain()) const
 
void writeInfo (HDF5Handle &handle) const
 
void writeAllLevels (HDF5Handle &a_handle) const
 
void readInAllLevels (HDF5Handle &a_handle, ProblemDomain a_finestLevel)
 
DisjointBoxLayout getIrregGrids (int level) const
 
DisjointBoxLayout getIrregGrids (const ProblemDomain &a_domain) const
 
DisjointBoxLayout getFlowGrids (int level) const
 
DisjointBoxLayout getGrids (const ProblemDomain &a_domain) const
 
DisjointBoxLayout getFlowGrids (const ProblemDomain &a_domain) const
 
DisjointBoxLayout getCoveredGrids (int level) const
 
DisjointBoxLayout getCoveredGrids (const ProblemDomain &a_domain) const
 
DisjointBoxLayout levelGrids (int level) const
 
Real dx (int level) const
 
IntVectSet irregCells (int depth=0) const
 
void setCellMax (int max)
 
void resetLevels (int nLevel)
 
Vector< RefCountedPtr< EBIndexSpace > > connectedComponents ()
 
Vector< RefCountedPtr< EBIndexSpace > > connectedComponentsNew ()
 
RefCountedPtr< EBIndexSpacebiggestConnectedComponent (int &a_numComponents)
 
RefCountedPtr< EBIndexSpacebiggestConnectedComponentNew (int &a_numComponents)
 

Static Public Attributes

static bool s_MFSingleBox
 
static bool s_useMemoryLoadBalance
 

Private Member Functions

Vector< RefCountedPtr< EBIndexSpace > > findConnectedComponents (int &a_numComponents, const bool &a_onlyBiggest)
 
Vector< RefCountedPtr< EBIndexSpace > > findConnectedComponentsNew (int &a_numComponents, const bool &a_onlyBiggest)
 
bool setAllConnectedVoFs (Real &a_totalVolFrac, EBCellFAB &a_curEBCellFAB, const EBGraph &a_curEBGraph, const EBISBox &a_curEBISBox, const VolIndex &a_curVoF, const VolIndex &a_lastVoF, const unsigned int &a_curNum)
 
bool setAllConnectedVoFsNew (Real &a_totalVolFrac, EBCellFAB &a_curEBCellFAB, const Box &a_curBox, const EBGraph &a_curEBGraph, const EBISBox &a_curEBISBox, const VolIndex &a_curVoF, const VolIndex &a_lastVoF, const unsigned int &a_curNum)
 
void resetAllConnectedVoFs (EBCellFAB &a_curEBCellFAB, const EBGraph &a_curEBGraph, const EBISBox &a_curEBISBox, const VolIndex &a_curVoF, const VolIndex &a_lastVoF)
 
void resetAllConnectedVoFsNew (EBCellFAB &a_curEBCellFAB, const Box &a_curBox, const EBGraph &a_curEBGraph, const EBISBox &a_curEBISBox, const VolIndex &a_curVoF, const VolIndex &a_lastVoF)
 
void operator= (const EBIndexSpace &ebiin)
 
 EBIndexSpace (const EBIndexSpace &ebiin)
 

Private Attributes

int m_nCellMax
 
bool m_isDefined
 
bool m_distributedData
 
Vector< EBISLevel * > m_ebisLevel
 
Vector< ProblemDomainm_domainLevel
 
int m_nlevels
 

Static Private Attributes

static Real s_tolerance
 
static bool s_verbose
 

Friends

class Chombo_EBIS
 

Detailed Description

EBIndexSpace represents the geometric information of the domain. It should be generated through the Chombo_EBIS class. This follows the singleton pattern.

Construction of the EBIndexSpace can follow one of methods

  1. From a previously written out HDF5 file. This is a representation of the EBIndexSpace at the finest level. When this is read back into a running application the EBIndexSpace at the coarser levels is regenerated on construction
  2. As a GeometryService. The base class for Geometry objects.
  3. As a Workshop object that reads the finest level EB boxes from the EBIndexSpace itself and fills in the data structure as it accepts it.
  4. As a Worshop object that has an already defined data decomposition

Constructor & Destructor Documentation

◆ EBIndexSpace() [1/2]

EBIndexSpace::EBIndexSpace ( )

◆ ~EBIndexSpace()

EBIndexSpace::~EBIndexSpace ( )

◆ EBIndexSpace() [2/2]

EBIndexSpace::EBIndexSpace ( const EBIndexSpace ebiin)
inlineprivate

References MayDay::Error().

Member Function Documentation

◆ define() [1/5]

void EBIndexSpace::define ( const ProblemDomain a_domain,
const RealVect a_origin,
const Real a_dx,
const GeometryService a_geoserver,
int  a_nCellMax = -1,
int  a_maxCoarsenings = -1 
)

If a_ncellMax is set, that is the max width of an internal grid. Otherwise use defaults of (16 in 3D, 64 in 2d)

This

◆ define() [2/5]

void EBIndexSpace::define ( HDF5Handle a_handle,
ProblemDomain  a_finestLevel 
)

reads in all levels from finest level down

◆ define() [3/5]

void EBIndexSpace::define ( HDF5Handle a_handle,
int  a_maxCoarsenings = -1 
)

defines from one level and then does coarsening

◆ define() [4/5]

void EBIndexSpace::define ( EBISLevel a_level0,
int  a_nCellMax = -1,
int  a_maxCoarsenings = -1 
)

◆ define() [5/5]

void EBIndexSpace::define ( const ProblemDomain a_entireDomain,
const RealVect a_origin,
const Real a_dx,
const Vector< RefCountedPtr< EBIndexSpace > > &  a_patches,
const Vector< IntVect > &  a_offsets,
int  a_maxCoarsenings = -1 
)

◆ buildFirstLevel()

EBISLevel* EBIndexSpace::buildFirstLevel ( const ProblemDomain a_domain,
const RealVect a_origin,
const Real a_dx,
const GeometryService a_geoserver,
int  a_nCellMax,
int  a_maxCoarsenings,
bool  a_fixRegularNextToMultiValued = true 
)

◆ buildNextLevel()

EBISLevel* EBIndexSpace::buildNextLevel ( const GeometryService a_geoserver,
int  a_nCellMax,
bool  a_fixRegularNextToMultiValued = true 
)

◆ setDistributedData()

bool EBIndexSpace::setDistributedData ( )
inline

Set a flag that indicates the data defining the EB is distributed. This will signal EBISLevel to hand grid generation off to the GeometryService. Function returns previous value of m_distributedData. Call this before define() if this functionality is desired.

References getLevel(), m_distributedData, numLevels(), numVoFs(), and totalVolFrac().

◆ numLevels()

int EBIndexSpace::numLevels ( ) const

Referenced by setDistributedData().

◆ numVoFs()

long long EBIndexSpace::numVoFs ( const ProblemDomain a_domain) const

Get the number of vofs over the entire domain. This is blocking as a broadcast and gather are required.

Referenced by setDistributedData().

◆ totalVolFrac()

Real EBIndexSpace::totalVolFrac ( const ProblemDomain a_domain) const

Get the total of the volume fractions over the entire domain. This is blocking as a broadcast and gather are required.

Referenced by setDistributedData().

◆ getLevel()

int EBIndexSpace::getLevel ( const ProblemDomain a_domain) const

return level index of domain. return -1 if a_domain does not correspond to any refinement of EBIS.

Referenced by getCoveredGrids(), getFlowGrids(), getGrids(), getIrregGrids(), and setDistributedData().

◆ getOrigin()

RealVect EBIndexSpace::getOrigin ( ) const
inline

References m_ebisLevel.

◆ getBox()

const ProblemDomain& EBIndexSpace::getBox ( int  level) const
inline

returns the problem domain box at a level of refinement

References clear(), fillEBISLayout(), getNCellMax(), isDefined(), and m_domainLevel.

◆ fillEBISLayout()

void EBIndexSpace::fillEBISLayout ( EBISLayout a_ebis,
const DisjointBoxLayout a_grids,
const ProblemDomain a_domain,
const int &  a_nghost 
) const

Referenced by getBox().

◆ isDefined()

bool EBIndexSpace::isDefined ( ) const

Return true if the define function has been called.

Referenced by getBox().

◆ clear()

void EBIndexSpace::clear ( )

Referenced by getBox().

◆ getNCellMax()

int EBIndexSpace::getNCellMax ( ) const

Referenced by getBox().

◆ write()

void EBIndexSpace::write ( HDF5Handle a_handle,
ProblemDomain  a_outputLevel = ProblemDomain() 
) const

Writes out finest level as a default. Writes at the level you are domain you want if a_outputLevel is defined.

◆ writeInfo()

void EBIndexSpace::writeInfo ( HDF5Handle handle) const

◆ writeAllLevels()

void EBIndexSpace::writeAllLevels ( HDF5Handle a_handle) const

Outputs ALL levels of the EBIS. this is the one to use if you want to do all definition through the file (no coarsening).

◆ readInAllLevels()

void EBIndexSpace::readInAllLevels ( HDF5Handle a_handle,
ProblemDomain  a_finestLevel 
)

Define entirely from the input file. a_finestLevel can be a coarsening of the finest level in the file. No coarsening algorithm is done.

◆ getIrregGrids() [1/2]

DisjointBoxLayout EBIndexSpace::getIrregGrids ( int  level) const
inline

References m_domainLevel, and m_ebisLevel.

◆ getIrregGrids() [2/2]

DisjointBoxLayout EBIndexSpace::getIrregGrids ( const ProblemDomain a_domain) const
inline

References getLevel(), and m_ebisLevel.

◆ getFlowGrids() [1/2]

DisjointBoxLayout EBIndexSpace::getFlowGrids ( int  level) const
inline

References m_domainLevel, and m_ebisLevel.

◆ getGrids()

DisjointBoxLayout EBIndexSpace::getGrids ( const ProblemDomain a_domain) const
inline

References getLevel(), and m_ebisLevel.

◆ getFlowGrids() [2/2]

DisjointBoxLayout EBIndexSpace::getFlowGrids ( const ProblemDomain a_domain) const
inline

References getLevel(), and m_ebisLevel.

◆ getCoveredGrids() [1/2]

DisjointBoxLayout EBIndexSpace::getCoveredGrids ( int  level) const
inline

References m_domainLevel, and m_ebisLevel.

◆ getCoveredGrids() [2/2]

DisjointBoxLayout EBIndexSpace::getCoveredGrids ( const ProblemDomain a_domain) const
inline

References getLevel(), and m_ebisLevel.

◆ levelGrids()

DisjointBoxLayout EBIndexSpace::levelGrids ( int  level) const
inline

References m_ebisLevel.

◆ dx()

Real EBIndexSpace::dx ( int  level) const
inline

References m_ebisLevel.

◆ irregCells()

IntVectSet EBIndexSpace::irregCells ( int  depth = 0) const
inline

References m_ebisLevel.

◆ setCellMax()

void EBIndexSpace::setCellMax ( int  max)
inline

◆ resetLevels()

void EBIndexSpace::resetLevels ( int  nLevel)

Referenced by setCellMax().

◆ connectedComponents()

Vector<RefCountedPtr<EBIndexSpace> > EBIndexSpace::connectedComponents ( )

Referenced by setCellMax().

◆ connectedComponentsNew()

Vector<RefCountedPtr<EBIndexSpace> > EBIndexSpace::connectedComponentsNew ( )

Referenced by setCellMax().

◆ biggestConnectedComponent()

RefCountedPtr<EBIndexSpace> EBIndexSpace::biggestConnectedComponent ( int &  a_numComponents)

Referenced by setCellMax().

◆ biggestConnectedComponentNew()

RefCountedPtr<EBIndexSpace> EBIndexSpace::biggestConnectedComponentNew ( int &  a_numComponents)

Referenced by setCellMax().

◆ findConnectedComponents()

Vector<RefCountedPtr<EBIndexSpace> > EBIndexSpace::findConnectedComponents ( int &  a_numComponents,
const bool &  a_onlyBiggest 
)
private

◆ findConnectedComponentsNew()

Vector<RefCountedPtr<EBIndexSpace> > EBIndexSpace::findConnectedComponentsNew ( int &  a_numComponents,
const bool &  a_onlyBiggest 
)
private

◆ setAllConnectedVoFs()

bool EBIndexSpace::setAllConnectedVoFs ( Real a_totalVolFrac,
EBCellFAB a_curEBCellFAB,
const EBGraph a_curEBGraph,
const EBISBox a_curEBISBox,
const VolIndex a_curVoF,
const VolIndex a_lastVoF,
const unsigned int &  a_curNum 
)
private

◆ setAllConnectedVoFsNew()

bool EBIndexSpace::setAllConnectedVoFsNew ( Real a_totalVolFrac,
EBCellFAB a_curEBCellFAB,
const Box a_curBox,
const EBGraph a_curEBGraph,
const EBISBox a_curEBISBox,
const VolIndex a_curVoF,
const VolIndex a_lastVoF,
const unsigned int &  a_curNum 
)
private

◆ resetAllConnectedVoFs()

void EBIndexSpace::resetAllConnectedVoFs ( EBCellFAB a_curEBCellFAB,
const EBGraph a_curEBGraph,
const EBISBox a_curEBISBox,
const VolIndex a_curVoF,
const VolIndex a_lastVoF 
)
private

◆ resetAllConnectedVoFsNew()

void EBIndexSpace::resetAllConnectedVoFsNew ( EBCellFAB a_curEBCellFAB,
const Box a_curBox,
const EBGraph a_curEBGraph,
const EBISBox a_curEBISBox,
const VolIndex a_curVoF,
const VolIndex a_lastVoF 
)
private

◆ operator=()

void EBIndexSpace::operator= ( const EBIndexSpace ebiin)
inlineprivate

References MayDay::Error().

Friends And Related Function Documentation

◆ Chombo_EBIS

friend class Chombo_EBIS
friend

This makes Chombo_EBIS be the only function that can call the private constructor.

Member Data Documentation

◆ s_MFSingleBox

bool EBIndexSpace::s_MFSingleBox
static

◆ s_useMemoryLoadBalance

bool EBIndexSpace::s_useMemoryLoadBalance
static

◆ m_nCellMax

int EBIndexSpace::m_nCellMax
private

Referenced by setCellMax().

◆ m_isDefined

bool EBIndexSpace::m_isDefined
private

◆ m_distributedData

bool EBIndexSpace::m_distributedData
private

Referenced by setDistributedData().

◆ m_ebisLevel

Vector<EBISLevel*> EBIndexSpace::m_ebisLevel
private

◆ m_domainLevel

Vector<ProblemDomain> EBIndexSpace::m_domainLevel
private

◆ m_nlevels

int EBIndexSpace::m_nlevels
private

◆ s_tolerance

Real EBIndexSpace::s_tolerance
staticprivate

◆ s_verbose

bool EBIndexSpace::s_verbose
staticprivate

The documentation for this class was generated from the following file: