Chombo + EB + MF  3.2
List of all members
BlockBaseRegister< T > Class Template Reference

Class to implement a single data register a mapped multiblock domain block boundary. More...

#include <BlockBaseRegister.H>

Inheritance diagram for BlockBaseRegister< T >:
Inheritance graph
[legend]

Constructor, destructor, and defines.

enum  UseType {
  Invalid =-1, DST =0, SRC, EXC,
  NUM_USE_TYPES
}
 Builds an array of vectors of boxes, one for each direction-side combination, that corresponds to either the full register, the src for external register regions, or the image of the src external regions. More...
 
typedef std::map< int, int > BlockBdryIndexMap
 
DisjointBoxLayout m_grids
 
ProblemDomain m_domain
 
MultiBlockCoordSysm_coordsys
 
int m_ghost
 
int m_verbosity
 
bool m_isDefined
 
bool m_hasData
 
bool m_hasDefinedDataLayouts
 
std::string m_name
 
IntVect m_ghostVect
 
Vector< BlockBdryIndexMapm_blockBdryIndexMap
 
DisjointBoxLayout m_registerLayout [2 *CH_SPACEDIM]
 
LevelData< T > m_register [2 *CH_SPACEDIM]
 
DisjointBoxLayout m_excRegisterLayout [2 *CH_SPACEDIM]
 
LevelData< T > m_excRegister [2 *CH_SPACEDIM]
 
DisjointBoxLayout m_srcRegisterLayout [2 *CH_SPACEDIM]
 
LevelData< T > m_srcRegister [2 *CH_SPACEDIM]
 
LayoutData< DataIndexm_grdToDstMap [2 *CH_SPACEDIM]
 
LayoutData< DataIndexm_dstToExcMap [2 *CH_SPACEDIM]
 
LayoutData< DataIndexm_dstToSrcMap [2 *CH_SPACEDIM]
 
 BlockBaseRegister ()
 Empty constructor. More...
 
 BlockBaseRegister (const MultiBlockCoordSys *a_mblock, const DisjointBoxLayout &a_grids, const int &a_ghost=0)
 Constructor. More...
 
virtual ~BlockBaseRegister ()
 virtual destructor More...
 
void define (const MultiBlockCoordSys *a_mblock, const DisjointBoxLayout &a_grids, const int &a_ghost=0)
 Define function that matches constructor. More...
 
bool isDefined () const
 Returns true if class has been defined, false otherwise. More...
 
virtual void setVerbose (int a_verbose)
 Set verbosity. More...
 
void store (const T &a_data, const DataIndex &a_dataIndex, int a_dir, Side::LoHiSide a_side)
 Store data on block-boundary faces. More...
 
void increment (const T &a_flux, const DataIndex &a_dataIndex, int a_dir, Side::LoHiSide a_side)
 Increment data on block-boundary faces. More...
 
void exchange ()
 Exchange data to fill exterior register regions. More...
 
void zeroRegister (const int a_n_comp=-1)
 
bool hasInterface (const DataIndex &a_dataIndex, int a_dir, Side::LoHiSide a_side) const
 Returns whether or not a box has a block-boundary interface on one of its faces. More...
 
void fill (T &a_data, const DataIndex &a_dataIndex, int a_dir, Side::LoHiSide a_side, Side::LoHiSide a_sideData) const
 Return data on a block-boundary interface of a box, if hasInterface(a_dataIndex, a_dir, a_side) is true. More...
 
virtual void setName (const std::string &a_name)
 Set the name of the register. More...
 
bool isInterface (const int &a_block, const int &a_dir, const Side::LoHiSide &a_side) const
 Returns true if the block-boundary in this direction on this side is an interface between blocks, false otherwise. More...
 
bool hasData () const
 Returns true if data has been stored in the register, false otherwise. More...
 
int getBlockID (const DataIndex &a_dataIndex) const
 Returns the integer index of the block in which the box corresponding to the DataIndex resides. More...
 
const BoxgetBlockBox (const int &a_block) const
 Returns the box corresponding to the block specified by the block integer index. More...
 
const BoxgetNeighborBlockBox (const int &a_block, const int &a_blockBdryIndex) const
 Returns the box corresponding to the block opposite to the block specified by the block integer index through the block-boundary specified by the integer index. More...
 
IndicesTransformation getTransformation (const int &a_block, const int &a_blockBdryIndex) const
 Returns the index transformation box corresponding to the Blockboundary specified by the block integer index and the block-boundary index. More...
 
int getSrcBlockBdryIndex (const int &a_block, const int &a_dir, const Side::LoHiSide &a_side)
 Returns the index of the neighboring block opposite the block in the direction and side spceified. More...
 
void buildBoxVectors (Vector< Box > a_boxes[2 *CH_SPACEDIM], Vector< int > a_boxProcMap[2 *CH_SPACEDIM], Vector< DataIndex > a_dataIndex[2 *CH_SPACEDIM], const UseType a_type)
 
void buildInverseBlockBdryIndexMap (Vector< int > a_map[2 *CH_SPACEDIM])
 Builds a mapping from the block-boundary index of neighboring block to the local block-boundary index. More...
 
void buildRegisterLayout ()
 Build all box layouts for the data register. More...
 
void buildSrcRegisterLayout ()
 Build all box layouts for the source boxes. More...
 
void buildExchangeRegisterLayout ()
 Build all disjoint box layouts for the data exchange. More...
 
void defineDataLayouts (const int a_ncomp)
 Define each of the three internally used data layouts. More...
 
void clearDataLayouts ()
 Undefine each of the three internally used data layouts. More...
 
void createDstBoxLayout (DisjointBoxLayout &a_layout, LayoutData< DataIndex > &a_map, const Vector< Box > &a_boxes, const Vector< int > &a_procs, const Vector< DataIndex > &a_indices)
 Build a box layout for the data register given a vector of boxes with processor mappings and related DataIndices from the underlying disjoint box layout. More...
 
void createSrcBoxLayout (DisjointBoxLayout &a_layout, LayoutData< DataIndex > a_dstToSrcMap[2 *CH_SPACEDIM], const Vector< Box > &a_boxes, const Vector< int > &a_procs, const Vector< DataIndex > &a_indices, const Vector< int > &a_dstBlockBdryIndices, const LayoutData< DataIndex > a_grdToDstMap[2 *CH_SPACEDIM])
 Build the box layout and associated box mappings for the source boxes. More...
 
void createExchangeBoxLayout (DisjointBoxLayout &a_layout, LayoutData< DataIndex > &a_dstToExcMap, const Vector< Box > &a_boxes, const Vector< int > &a_procs, const Vector< DataIndex > &a_indices, const LayoutData< DataIndex > &a_grdToDstMap)
 Build the box layout and associated box mappings for the data exchange. More...
 
void copyToSrcRegister ()
 Copy, including parallel exchange, of data from interior exchange registers to exterior source registers. More...
 
void copyToDstRegister ()
 Local copy of data from exterior source registers to exterior full register. More...
 
void printRegisters () const
 Print all registers to pout(). More...
 
void print (const LevelData< T > a_register[2 *CH_SPACEDIM]) const
 Print the specified register. More...
 
void print (const BoxLayoutData< T > a_register[2 *CH_SPACEDIM]) const
 
bool hasStorage () const
 

Detailed Description

template<class T>
class BlockBaseRegister< T >

Class to implement a single data register a mapped multiblock domain block boundary.

Member Typedef Documentation

template<class T>
typedef std::map<int,int> BlockBaseRegister< T >::BlockBdryIndexMap
protected

Member Enumeration Documentation

template<class T>
enum BlockBaseRegister::UseType
protected

Builds an array of vectors of boxes, one for each direction-side combination, that corresponds to either the full register, the src for external register regions, or the image of the src external regions.

– a_boxes: Array of vector of boxes. – a_boxProcMap: Array of vector of processor mappings. – a_dataIndex: Array of vector of DataIndices that relate each box to a box in the underlying DisjointBoxLayout. – a_type: Type of register box to build [DST, SRC, or EXC].

Enumerator
Invalid 
DST 
SRC 
EXC 
NUM_USE_TYPES 

Constructor & Destructor Documentation

template<class T>
BlockBaseRegister< T >::BlockBaseRegister ( )
inline

Empty constructor.

template<class T >
BlockBaseRegister< T >::BlockBaseRegister ( const MultiBlockCoordSys a_mblock,
const DisjointBoxLayout a_grids,
const int &  a_ghost = 0 
)

Constructor.

– a_mblock: Pointer to multiblock coordinate system. – a_grids: DisjointBoxLayout over which multiblock grid is defined. – a_ghost: Extension of register domain for auxiliary data.

Parameters
a_gridsCELL-centered grids
a_ghostghost width for state variables

References BlockBaseRegister< T >::define().

template<class T >
BlockBaseRegister< T >::~BlockBaseRegister ( )
virtual

virtual destructor

Member Function Documentation

template<class T >
void BlockBaseRegister< T >::define ( const MultiBlockCoordSys a_mblock,
const DisjointBoxLayout a_grids,
const int &  a_ghost = 0 
)

Define function that matches constructor.

– a_mblock: Pointer to multiblock coordinate system. – a_grids: DisjointBoxLayout over which multiblock grid is defined. – a_ghost: Extension of register domain for auxiliary data.

Parameters
a_gridsCELL-centered grids
a_ghostghost width for state variables

References CH_SPACEDIM, CH_TIME, Box::define(), Box::grow(), and IntVect::Unit.

Referenced by BlockBaseRegister< T >::BlockBaseRegister().

template<class T>
bool BlockBaseRegister< T >::isDefined ( ) const
inline

Returns true if class has been defined, false otherwise.

template<class T>
virtual void BlockBaseRegister< T >::setVerbose ( int  a_verbose)
inlinevirtual

Set verbosity.

Default is 0. Positive values output increasing amounts of information.

template<class T>
void BlockBaseRegister< T >::store ( const T &  a_data,
const DataIndex a_dataIndex,
int  a_dir,
Side::LoHiSide  a_side 
)

Store data on block-boundary faces.

– a_flux: Face-centered data to be stored. – a_dataIndex: Index of box where flux has been computed. – a_dir: Direction of the face. – a_side: Low or high side of the box where the block-boundary face lies.

References CH_SPACEDIM, CH_TIME, Box::copy(), MayDay::Error(), getBlockBdryIndex(), Box::grow(), Box::growDir(), Box::shiftHalf(), and sign().

template<class T>
void BlockBaseRegister< T >::increment ( const T &  a_flux,
const DataIndex a_dataIndex,
int  a_dir,
Side::LoHiSide  a_side 
)

Increment data on block-boundary faces.

– a_flux: Face-centered flux to be stored. – a_dataIndex: Index of box where flux has been computed. – a_dir: Direction of the face. – a_side: Low or high side of the box where the block-boundary face lies.

References CH_SPACEDIM, CH_TIME, MayDay::Error(), getBlockBdryIndex(), Box::grow(), Box::growDir(), Box::shiftHalf(), and sign().

template<class T >
void BlockBaseRegister< T >::exchange ( void  )

Exchange data to fill exterior register regions.

Perform data manipulation so that both interior and exterior register data is current.

References CH_TIME, and MayDay::Error().

template<class T >
void BlockBaseRegister< T >::zeroRegister ( const int  a_n_comp = -1)

Sets the contents of the register to zero.

References CH_SPACEDIM, CH_TIME, MayDay::Error(), and zeroBoxLayoutData().

template<class T >
bool BlockBaseRegister< T >::hasInterface ( const DataIndex a_dataIndex,
int  a_dir,
Side::LoHiSide  a_side 
) const

Returns whether or not a box has a block-boundary interface on one of its faces.

– a_dataIndex: Index of box. – a_dir: Direction of the face of the box. – a_side: Low or high side of the box.

References CH_TIME, and Box::intersectsNotEmpty().

template<class T>
void BlockBaseRegister< T >::fill ( T &  a_data,
const DataIndex a_dataIndex,
int  a_dir,
Side::LoHiSide  a_side,
Side::LoHiSide  a_sideData 
) const

Return data on a block-boundary interface of a box, if hasInterface(a_dataIndex, a_dir, a_side) is true.

– a_data: Face-centered data returned. – a_dataIndex: Index of box. – a_dir: Direction of the face. – a_side: Low or high side of the box. – a_sideData: Low or high side of the block-boundary interface, from which data will be taken.

References CH_SPACEDIM, CH_TIME, Box::copy(), MayDay::Error(), getBlockBdryIndex(), Box::grow(), Box::growDir(), Side::Hi, Side::Lo, Box::shiftHalf(), and sign().

template<class T>
virtual void BlockBaseRegister< T >::setName ( const std::string &  a_name)
inlinevirtual

Set the name of the register.

String identifier for this register, useful for debugging output. Default is UNDEFINED.

template<class T >
bool BlockBaseRegister< T >::isInterface ( const int &  a_block,
const int &  a_dir,
const Side::LoHiSide a_side 
) const
inlineprotected

Returns true if the block-boundary in this direction on this side is an interface between blocks, false otherwise.

– a_block: Index of the block. – a_dir: Direction of the face. – a_side: Low or high side of the box.

References getBlockBdryIndex().

template<class T>
bool BlockBaseRegister< T >::hasData ( ) const
inlineprotected

Returns true if data has been stored in the register, false otherwise.

template<class T >
int BlockBaseRegister< T >::getBlockID ( const DataIndex a_dataIndex) const
inlineprotected

Returns the integer index of the block in which the box corresponding to the DataIndex resides.

– a_dataIndex: Index of box.

template<class T >
const Box & BlockBaseRegister< T >::getBlockBox ( const int &  a_block) const
inlineprotected

Returns the box corresponding to the block specified by the block integer index.

– a_block: Index of the block.

template<class T >
const Box & BlockBaseRegister< T >::getNeighborBlockBox ( const int &  a_block,
const int &  a_blockBdryIndex 
) const
inlineprotected

Returns the box corresponding to the block opposite to the block specified by the block integer index through the block-boundary specified by the integer index.

– a_block: Index of the block. – a_block: Index of the block boundary.

template<class T >
IndicesTransformation BlockBaseRegister< T >::getTransformation ( const int &  a_block,
const int &  a_blockBdryIndex 
) const
inlineprotected

Returns the index transformation box corresponding to the Blockboundary specified by the block integer index and the block-boundary index.

– a_block: Index of the block. – a_block: Index of the block boundary.

template<class T >
int BlockBaseRegister< T >::getSrcBlockBdryIndex ( const int &  a_block,
const int &  a_dir,
const Side::LoHiSide a_side 
)
inlineprotected

Returns the index of the neighboring block opposite the block in the direction and side spceified.

– a_block: Index of the block. – a_dir: Direction of the face. – a_side: Low or high side of the box.

References getBlockBdryIndex(), IndicesTransformation::getPermutation(), Box::growLo(), Side::Hi, Box::isEmpty(), and IndicesTransformation::transformFwd().

template<class T >
void BlockBaseRegister< T >::buildBoxVectors ( Vector< Box a_boxes[2 *CH_SPACEDIM],
Vector< int >  a_boxProcMap[2 *CH_SPACEDIM],
Vector< DataIndex a_dataIndex[2 *CH_SPACEDIM],
const UseType  a_type 
)
protected
template<class T >
void BlockBaseRegister< T >::buildInverseBlockBdryIndexMap ( Vector< int >  a_map[2 *CH_SPACEDIM])
protected

Builds a mapping from the block-boundary index of neighboring block to the local block-boundary index.

– a_map: Array of vector relating block-boundary indices.

References CH_SPACEDIM, getBlockBdryIndex(), LayoutIterator::ok(), and SideIterator::ok().

template<class T >
void BlockBaseRegister< T >::buildRegisterLayout ( )
protected

Build all box layouts for the data register.

References CH_SPACEDIM, getBlockBdryIndex(), and SideIterator::ok().

template<class T >
void BlockBaseRegister< T >::buildSrcRegisterLayout ( )
protected

Build all box layouts for the source boxes.

References CH_SPACEDIM, getBlockBdryIndex(), and SideIterator::ok().

template<class T >
void BlockBaseRegister< T >::buildExchangeRegisterLayout ( )
protected

Build all disjoint box layouts for the data exchange.

References CH_SPACEDIM, getBlockBdryIndex(), and SideIterator::ok().

template<class T >
void BlockBaseRegister< T >::defineDataLayouts ( const int  a_ncomp)
protected

Define each of the three internally used data layouts.

References CH_SPACEDIM, and IntVect::Unit.

template<class T >
void BlockBaseRegister< T >::clearDataLayouts ( )
protected

Undefine each of the three internally used data layouts.

References CH_SPACEDIM.

template<class T >
void BlockBaseRegister< T >::createDstBoxLayout ( DisjointBoxLayout a_layout,
LayoutData< DataIndex > &  a_map,
const Vector< Box > &  a_boxes,
const Vector< int > &  a_procs,
const Vector< DataIndex > &  a_indices 
)
inlineprotected

Build a box layout for the data register given a vector of boxes with processor mappings and related DataIndices from the underlying disjoint box layout.

– a_layout: Resulting box layout. – a_map: Mapping between DataIndexes of the underlying disjoint box layout and DataIndexes of the resulting box layout. – a_boxes: Vector of boxes. – a_boxProcMap: Vector of processor mappings. – a_indices: Vector of DataIndices that relate each box to a box in the underlying DisjointBoxLayout.

References buildLocalIndexList(), DisjointBoxLayout::close(), BoxLayout::dataIterator(), DisjointBoxLayout::define(), Box::eq(), MayDay::Error(), List< T >::first(), List< T >::isNotEmpty(), LayoutIterator::ok(), ListIterator< T >::ok(), and List< T >::remove().

template<class T >
void BlockBaseRegister< T >::createSrcBoxLayout ( DisjointBoxLayout a_layout,
LayoutData< DataIndex a_dstToSrcMap[2 *CH_SPACEDIM],
const Vector< Box > &  a_boxes,
const Vector< int > &  a_procs,
const Vector< DataIndex > &  a_indices,
const Vector< int > &  a_dstBlockBdryIndices,
const LayoutData< DataIndex a_grdToDstMap[2 *CH_SPACEDIM] 
)
inlineprotected

Build the box layout and associated box mappings for the source boxes.

– a_layout: Resulting box layout. – a_dstToSrcMap: Array of mappings between DataIndexes of the destination box layout and DataIndexes of the resulting box layout. – a_boxes: Vector of boxes. – a_boxProcMap: Vector of processor mappings. – a_indices: Vector of DataIndices that relate each box to a box in the underlying DisjointBoxLayout. – a_dstBlockBdryIndices: Vector of DataIndices that relate each box to a block boundry of the destination block. – a_grdToDstMap: Array of vector of DataIndices that relate each in the underlying DisjointBoxLayout to a box in the destination register.

References buildLocalIndexList(), DisjointBoxLayout::close(), BoxLayout::dataIterator(), DisjointBoxLayout::define(), Box::eq(), MayDay::Error(), List< T >::first(), List< T >::isNotEmpty(), LayoutIterator::ok(), ListIterator< T >::ok(), and List< T >::remove().

template<class T >
void BlockBaseRegister< T >::createExchangeBoxLayout ( DisjointBoxLayout a_layout,
LayoutData< DataIndex > &  a_dstToExcMap,
const Vector< Box > &  a_boxes,
const Vector< int > &  a_procs,
const Vector< DataIndex > &  a_indices,
const LayoutData< DataIndex > &  a_grdToDstMap 
)
inlineprotected

Build the box layout and associated box mappings for the data exchange.

– a_layout: Resulting box layout. – a_dstToExcMap: Array of mappings between DataIndexes of the destination box layout and DataIndexes of the resulting box layout. – a_boxes: Vector of boxes. – a_boxProcMap: Vector of processor mappings. – a_indices: Vector of DataIndices that relate each box to a box in the underlying DisjointBoxLayout. – a_grdToDstMap: Array of vector of DataIndices that relate each in the underlying DisjointBoxLayout to a box in the destination register.

References buildLocalIndexList(), DisjointBoxLayout::close(), BoxLayout::dataIterator(), DisjointBoxLayout::define(), Box::eq(), MayDay::Error(), List< T >::first(), List< T >::isNotEmpty(), LayoutIterator::ok(), ListIterator< T >::ok(), and List< T >::remove().

template<class T >
void BlockBaseRegister< T >::copyToSrcRegister ( )
inlineprotected

Copy, including parallel exchange, of data from interior exchange registers to exterior source registers.

References CH_SPACEDIM, LevelData< T >::copyTo(), LevelData< T >::disjointBoxLayout(), LevelData< T >::exchange(), getBlockBdryIndex(), Copier::ghostDefine(), LevelData< T >::ghostVect(), and SideIterator::ok().

template<class T >
void BlockBaseRegister< T >::copyToDstRegister ( )
inlineprotected
template<class T >
void BlockBaseRegister< T >::printRegisters ( ) const
protected

Print all registers to pout().

References pout().

template<class T>
void BlockBaseRegister< T >::print ( const LevelData< T >  a_register[2 *CH_SPACEDIM]) const
inlineprotected

Print the specified register.

– a_register: Array of registers to print.

References BoxIterator::begin(), CH_SPACEDIM, LayoutData< T >::dataIterator(), getBlockBdryIndex(), BoxLayoutData< T >::isDefined(), BoxIterator::ok(), SideIterator::ok(), and pout().

template<class T>
void BlockBaseRegister< T >::print ( const BoxLayoutData< T >  a_register[2 *CH_SPACEDIM]) const
inlineprotected
template<class T>
bool BlockBaseRegister< T >::hasStorage ( ) const
inlineprotected

Member Data Documentation

template<class T>
DisjointBoxLayout BlockBaseRegister< T >::m_grids
protected
template<class T>
ProblemDomain BlockBaseRegister< T >::m_domain
protected
template<class T>
MultiBlockCoordSys* BlockBaseRegister< T >::m_coordsys
protected
template<class T>
int BlockBaseRegister< T >::m_ghost
protected
template<class T>
int BlockBaseRegister< T >::m_verbosity
protected
template<class T>
bool BlockBaseRegister< T >::m_isDefined
protected
template<class T>
bool BlockBaseRegister< T >::m_hasData
protected
template<class T>
bool BlockBaseRegister< T >::m_hasDefinedDataLayouts
protected
template<class T>
std::string BlockBaseRegister< T >::m_name
protected
template<class T>
IntVect BlockBaseRegister< T >::m_ghostVect
protected
template<class T>
Vector<BlockBdryIndexMap> BlockBaseRegister< T >::m_blockBdryIndexMap
protected
template<class T>
DisjointBoxLayout BlockBaseRegister< T >::m_registerLayout[2 *CH_SPACEDIM]
protected
template<class T>
LevelData<T> BlockBaseRegister< T >::m_register[2 *CH_SPACEDIM]
protected
template<class T>
DisjointBoxLayout BlockBaseRegister< T >::m_excRegisterLayout[2 *CH_SPACEDIM]
protected
template<class T>
LevelData<T> BlockBaseRegister< T >::m_excRegister[2 *CH_SPACEDIM]
protected
template<class T>
DisjointBoxLayout BlockBaseRegister< T >::m_srcRegisterLayout[2 *CH_SPACEDIM]
protected
template<class T>
LevelData<T> BlockBaseRegister< T >::m_srcRegister[2 *CH_SPACEDIM]
protected
template<class T>
LayoutData<DataIndex> BlockBaseRegister< T >::m_grdToDstMap[2 *CH_SPACEDIM]
protected
template<class T>
LayoutData<DataIndex> BlockBaseRegister< T >::m_dstToExcMap[2 *CH_SPACEDIM]
protected
template<class T>
LayoutData<DataIndex> BlockBaseRegister< T >::m_dstToSrcMap[2 *CH_SPACEDIM]
protected

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