BlockBaseRegister< T > Class Template Reference

#include <BlockBaseRegister.H>

Inheritance diagram for BlockBaseRegister< T >:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<class T>
class BlockBaseRegister< T >

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

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.
 BlockBaseRegister (const MultiBlockCoordSys *a_mblock, const DisjointBoxLayout &a_grids, const int &a_ghost=0)
 Constructor.
virtual ~BlockBaseRegister ()
 virtual destructor
void define (const MultiBlockCoordSys *a_mblock, const DisjointBoxLayout &a_grids, const int &a_ghost=0)
 Define function that matches constructor.
bool isDefined () const
 Returns true if class has been defined, false otherwise.
virtual void setVerbose (int a_verbose)
 Set verbosity.
void store (const T &a_data, const DataIndex &a_dataIndex, int a_dir, Side::LoHiSide a_side)
 Store data on block-boundary faces.
void increment (const T &a_flux, const DataIndex &a_dataIndex, int a_dir, Side::LoHiSide a_side)
 Increment data on block-boundary faces.
void exchange ()
 Exchange data to fill exterior register regions.
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.
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.
virtual void setName (const std::string &a_name)
 Set the name of the register.
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.
bool hasData () const
 Returns true if data has been stored in the register, false otherwise.
int getBlockID (const DataIndex &a_dataIndex) const
 Returns the integer index of the block in which the box corresponding to the DataIndex resides.
const BoxgetBlockBox (const int &a_block) const
 Returns the box corresponding to the block specified by the block integer index.
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.
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.
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.
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.
void buildRegisterLayout ()
 Build all box layouts for the data register.
void buildSrcRegisterLayout ()
 Build all box layouts for the source boxes.
void buildExchangeRegisterLayout ()
 Build all disjoint box layouts for the data exchange.
void defineDataLayouts (const int a_ncomp)
 Define each of the three internally used data layouts.
void clearDataLayouts ()
 Undefine each of the three internally used data layouts.
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.
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.
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.
void copyToSrcRegister ()
 Copy, including parallel exchange, of data from interior exchange registers to exterior source registers.
void copyToDstRegister ()
 Local copy of data from exterior source registers to exterior full register.
void printRegisters () const
 Print all registers to pout().
void print (const LevelData< T > a_register[2 *CH_SPACEDIM]) const
 Print the specified register.
void print (const BoxLayoutData< T > a_register[2 *CH_SPACEDIM]) const
bool hasStorage () const

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 
) [inline]

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_grids  CELL-centered grids
a_ghost  ghost width for state variables

References BlockBaseRegister< T >::define().

template<class T>
BlockBaseRegister< T >::~BlockBaseRegister (  )  [inline, 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 
) [inline]

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

template<class T>
virtual void BlockBaseRegister< T >::setVerbose ( int  a_verbose  )  [inline, virtual]

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 
) [inline]

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

template<class T>
void BlockBaseRegister< T >::exchange ( void   )  [inline]

Exchange data to fill exterior register regions.

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

References CH_TIME, BlockBaseRegister< T >::copyToDstRegister(), BlockBaseRegister< T >::copyToSrcRegister(), MayDay::Error(), BlockBaseRegister< T >::hasData(), BlockBaseRegister< T >::isDefined(), BlockBaseRegister< T >::m_verbosity, and BlockBaseRegister< T >::printRegisters().

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

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

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 [inline]

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(), BlockBaseRegister< T >::hasData(), BlockBaseRegister< T >::hasInterface(), Side::Hi, BlockBaseRegister< T >::isDefined(), Side::Lo, BlockBaseRegister< T >::m_ghost, BlockBaseRegister< T >::m_grdToDstMap, BlockBaseRegister< T >::m_grids, BlockBaseRegister< T >::m_register, Box::shiftHalf(), and sign().

template<class T>
virtual void BlockBaseRegister< T >::setName ( const std::string &  a_name  )  [inline, virtual]

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 [inline, protected]

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 MultiBlockCoordSys::boundaries(), getBlockBdryIndex(), and BlockBaseRegister< T >::m_coordsys.

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

template<class T>
bool BlockBaseRegister< T >::hasData (  )  const [inline, protected]

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

Referenced by BlockBaseRegister< T >::exchange(), and BlockBaseRegister< T >::fill().

template<class T>
int BlockBaseRegister< T >::getBlockID ( const DataIndex a_dataIndex  )  const [inline, protected]

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

– a_dataIndex: Index of box.

References BlockBaseRegister< T >::m_coordsys, BlockBaseRegister< T >::m_grids, and MultiBlockCoordSys::whichBlock().

Referenced by BlockBaseRegister< T >::copyToDstRegister(), and BlockBaseRegister< T >::hasInterface().

template<class T>
const Box & BlockBaseRegister< T >::getBlockBox ( const int &  a_block  )  const [inline, protected]

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

– a_block: Index of the block.

References BlockBaseRegister< T >::m_coordsys, and MultiBlockCoordSys::mappingBlocks().

Referenced by BlockBaseRegister< T >::getNeighborBlockBox(), BlockBaseRegister< T >::getSrcBlockBdryIndex(), and BlockBaseRegister< T >::hasInterface().

template<class T>
const Box & BlockBaseRegister< T >::getNeighborBlockBox ( const int &  a_block,
const int &  a_blockBdryIndex 
) const [inline, protected]

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.

References MultiBlockCoordSys::boundaries(), BlockBaseRegister< T >::getBlockBox(), and BlockBaseRegister< T >::m_coordsys.

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

template<class T>
IndicesTransformation BlockBaseRegister< T >::getTransformation ( const int &  a_block,
const int &  a_blockBdryIndex 
) const [inline, protected]

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.

References MultiBlockCoordSys::boundaries(), and BlockBaseRegister< T >::m_coordsys.

Referenced by BlockBaseRegister< T >::buildBoxVectors(), BlockBaseRegister< T >::copyToDstRegister(), and BlockBaseRegister< T >::getSrcBlockBdryIndex().

template<class T>
int BlockBaseRegister< T >::getSrcBlockBdryIndex ( const int &  a_block,
const int &  a_dir,
const Side::LoHiSide a_side 
) [inline, protected]

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 
) [inline, protected]

template<class T>
void BlockBaseRegister< T >::buildInverseBlockBdryIndexMap ( Vector< int >  a_map[2 *CH_SPACEDIM]  )  [inline, 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 getBlockBdryIndex(), BlockBaseRegister< T >::getSrcBlockBdryIndex(), BlockBaseRegister< T >::hasInterface(), BoxLayout::layoutIterator(), BlockBaseRegister< T >::m_coordsys, BlockBaseRegister< T >::m_grids, and MultiBlockCoordSys::whichBlock().

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

template<class T>
void BlockBaseRegister< T >::buildRegisterLayout (  )  [inline, protected]

template<class T>
void BlockBaseRegister< T >::buildSrcRegisterLayout (  )  [inline, protected]

template<class T>
void BlockBaseRegister< T >::buildExchangeRegisterLayout (  )  [inline, protected]

template<class T>
void BlockBaseRegister< T >::defineDataLayouts ( const int  a_ncomp  )  [inline, protected]

template<class T>
void BlockBaseRegister< T >::clearDataLayouts (  )  [inline, protected]

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 
) [inline, protected]

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(), BlockBaseRegister< T >::m_domain, and List< T >::remove().

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

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] 
) [inline, protected]

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(), BlockBaseRegister< T >::m_domain, and List< T >::remove().

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

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 
) [inline, protected]

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(), BlockBaseRegister< T >::m_domain, and List< T >::remove().

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

template<class T>
void BlockBaseRegister< T >::copyToSrcRegister (  )  [inline, protected]

template<class T>
void BlockBaseRegister< T >::copyToDstRegister (  )  [inline, protected]

template<class T>
void BlockBaseRegister< T >::printRegisters (  )  const [inline, protected]

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

Print the specified register.

– a_register: Array of registers to print.

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

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

template<class T>
void BlockBaseRegister< T >::print ( const BoxLayoutData< T >  a_register[2 *CH_SPACEDIM]  )  const [inline, protected]

template<class T>
bool BlockBaseRegister< T >::hasStorage (  )  const [inline, protected]


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:

Generated on Wed Mar 29 03:26:55 2017 for Chombo + EB + MF by  doxygen 1.5.5