Chombo + EB + MF  3.2
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MultiBlockCoordSys Class Referenceabstract

virtual interface class encapsulating multi-block mapping API More...

#include <MultiBlockCoordSys.H>

Inheritance diagram for MultiBlockCoordSys:
Inheritance graph
[legend]

Public Member Functions

 MultiBlockCoordSys ()
 default constructor More...
 
virtual ~MultiBlockCoordSys ()
 destructor (should this delete the members of coordSysVect? More...
 
virtual int whichBlock (const Box &a_box) const
 returns block number in which a_box is contained in the global index space More...
 
virtual int whichBlock (const IntVect &a_iv) const
 returns block number in which a_iv is contained in the global index space More...
 
virtual int whichBlockOverlap (const Box &a_box) const
 returns block number that overlaps a_box in the global index space More...
 
virtual int whichBlockBuffered (const IntVect &a_iv, int a_bufferSize) const
 returns block number in which a_iv is contained within buffer of a_bufferSize More...
 
virtual void blockRemapping (RealVect &a_xi_valid, int &a_n_valid, const RealVect &a_xiSrc, int a_nSrc) const =0
 block mapping conversion function More...
 
virtual RealVect blockRemappingGeneral (int a_nDst, const RealVect &a_xiSrc, int a_nSrc) const
 general block mapping conversion function More...
 
virtual IntVect cellAvoidingBoundaries (const IntVect &a_cell, int a_blockNum, int a_radius) const
 return a cell that is far enough away from external boundaries More...
 
virtual void keepInDomain (Box &a_bx, int a_blockNum) const
 modify a_bx so that it lies entirely within the physical domain More...
 
virtual ProblemDomain problemDomain (const Box &a_baseBox, int a_numGhost) const
 return ProblemDomain within block, with box and ghost cells More...
 
virtual ProblemDomain blockDomainOfBox (const Box &a_baseBox) const
 return ProblemDomain of block containing a box More...
 
virtual VectorTransformation vectorBlockTransformation (int a_nDst, const RealVect &a_xiSrc, int a_nSrc) const
 return vector transformation from one block to another at a point. More...
 
virtual VectorTransformation vectorBlockTransformationCenter (int a_nDst, const IntVect &a_ivSrc, int a_nSrc) const
 return vector transformation from one block to another at center of a cell. More...
 
virtual void vectorBlockTransformationCenter (BaseFab< VectorTransformation > &a_vtFab, int a_nDst, const Box &a_srcBox, int a_nSrc) const
 
virtual VectorTransformation vectorBlockTransformationAvg (int a_nDst, const IntVect &a_ivSrc, int a_nSrc) const
 return average vector transformation from one block to another at a cell More...
 
virtual void vectorBlockTransformationAvg (BaseFab< VectorTransformation > &a_vtFab, int a_nDst, const Box &a_srcBox, int a_nSrc, Interval a_fixedDims=Interval()) const
 return average vector transformation from one block to another at a cell, with averaging over specified dimensions only More...
 
virtual Tuple
< VectorTransformation,
SpaceDim
vectorBlockTransformationGrad (int a_nDst, const IntVect &a_ivSrc, int a_nSrc) const
 return gradient of vector transformation from one block to another at a cell More...
 
virtual void vectorBlockTransformationGrad (BaseFab< VectorTransformation > &a_vtGradFab, int a_nDst, const Box &a_srcBox, int a_nSrc, Interval a_fixedDims=Interval()) const
 return gradient of vector transformation from one block to another at a cell, over specified dimensions only More...
 
virtual void vectorBlockAvgTransformation (BaseFab< VectorAvgTransformation > &a_vtAvgFab, int a_nDst, const Box &a_srcBox, int a_nSrc, Interval a_fixedDims=Interval()) const
 
virtual Vector< RealVectdisplacements (const Vector< RealVect > &a_dstCoords, const Vector< int > &a_dstBlocks, const RealVect &a_srcCoords, int a_srcBlock) const
 return displacements More...
 
virtual Real distance (const RealVect &a_srcCoords, int a_srcBlock, const RealVect &a_dstCoords, int a_dstBlock) const
 return distance between two points More...
 
virtual const NewCoordSysgetCoordSys (int a_n) const
 Return the mapping which corresponds to the block with the given index. More...
 
virtual const NewCoordSysgetCoordSys (const Box &a_box) const
 
const Vector< Box > & mappingBlocks () const
 const access to the mapping blocks More...
 
int numBlocks () const
 number of blocks More...
 
const Vector< Tuple
< BlockBoundary, 2 *SpaceDim > > & 
boundaries () const
 const access to the block boundaries More...
 
const BaseFab< int > & validNum (int a_block) const
 const access to m_validNum[a_block] More...
 
const BaseFab< int > & validBlocks (int a_block) const
 const access to m_validBlocks[a_block] More...
 
const BaseFab
< IndicesTransformation > & 
validTransformations (int a_block) const
 const access to m_validTransformations[a_block] More...
 
const IndicesTransformationblockTransformation (int a_blockSrc, int a_blockDst) const
 const access to m_allBlockTransformations[blockSrc][blockDst] More...
 
void initializeBlockTransformations ()
 Need to have m_boundaries for this. More...
 
void validBlocksCells (Vector< int > &a_validBlocks, Vector< IntVect > &a_validCells, int a_origBlock, const IntVect &a_origCell)
 Return list of valid blocks and cells corresponding to a_cell in a_block. More...
 
virtual void separateVolFlux (LevelData< FluxBox > &a_flux) const
 Have separate volume flux on each block. Normally does nothing, but cubed-sphere coordinate system needs it. More...
 
int realDim () const
 
RealVect dxVect () const
 
bool gotBoundaries () const
 
bool gotBlockTransformations () const
 
bool gotMappingBlocks () const
 
bool gotCoordSysVect () const
 
bool useScriptN () const
 
bool isDefined () const
 

Protected Member Functions

void permute (Vector< int > &a_vec, int a_start, int a_length, Vector< Vector< int > > &a_allPathsDir, const Vector< int > &a_changedDirs)
 
void setAllBoundaries (BlockBoundary::btype a_btype)
 
void setBoundaryFromFaces (int a_srcBlock, int a_srcFaceID, int a_dstBlock, int a_dstFaceID, IntVect a_sign=IntVect::Unit)
 

Protected Attributes

bool m_gotCoordSysVect
 Do we have m_coordSysVect? More...
 
Vector< NewCoordSys * > m_coordSysVect
 Vector of NewCoordSys – one for each mapping block. More...
 
bool m_gotMappingBlocks
 Do we have m_mappingBlocks? More...
 
Vector< Boxm_mappingBlocks
 Associated regions in index space over which each mapping is valid. More...
 
bool m_gotBoundaries
 
RealVect m_dxVect
 The grid spacing, must be the same across all mapping blocks. More...
 
int m_realDim
 Number of dimensions in real space; default SpaceDim. More...
 
Vector< Tuple< BlockBoundary,
2 *SpaceDim > > 
m_boundaries
 Description of each boundary face of each block; set these in derived class and then set m_gotBoundaries true. More...
 
bool m_gotBlockTransformations
 
Vector< Vector
< IndicesTransformation > > 
m_allBlockTransformations
 [blockSrc][blockDst] gives transformation from blockSrc to blockDst More...
 
Vector< BaseFab< int > * > m_validNum
 
Vector< BaseFab< int > * > m_validBlocks
 
Vector< BaseFab
< IndicesTransformation > * > 
m_validTransformations
 
bool m_useScriptN
 Whether scriptN is used in calculating N. More...
 

Detailed Description

virtual interface class encapsulating multi-block mapping API

The MultiBlockCoordSys is designed to represent multiblock mappings. Each mapping is represented by a separate NewCoordSys which has an associated valid region defined by a Box in index space.

Implementations of specific multiblock coordinate systems will be provided by derived classes.

Constructor & Destructor Documentation

MultiBlockCoordSys::MultiBlockCoordSys ( )

default constructor

virtual MultiBlockCoordSys::~MultiBlockCoordSys ( )
virtual

destructor (should this delete the members of coordSysVect?

Member Function Documentation

virtual int MultiBlockCoordSys::whichBlock ( const Box a_box) const
virtual

returns block number in which a_box is contained in the global index space

returns -1 if a_box isn't fully contained in the valid region of any block

Referenced by LevelGridMetrics::getBlock(), and getCoordSys().

virtual int MultiBlockCoordSys::whichBlock ( const IntVect a_iv) const
virtual

returns block number in which a_iv is contained in the global index space

returns -1 if a_iv isn't fully contained in the valid region of any block

virtual int MultiBlockCoordSys::whichBlockOverlap ( const Box a_box) const
virtual

returns block number that overlaps a_box in the global index space

returns -1 if either a_box doesn't overlap the valid region of any block, or a_box overlaps the valid region of more than one block.

virtual int MultiBlockCoordSys::whichBlockBuffered ( const IntVect a_iv,
int  a_bufferSize 
) const
virtual

returns block number in which a_iv is contained within buffer of a_bufferSize

returns -1 if a_iv isn't fully contained in the buffered region of any block

virtual void MultiBlockCoordSys::blockRemapping ( RealVect a_xi_valid,
int &  a_n_valid,
const RealVect a_xiSrc,
int  a_nSrc 
) const
pure virtual

block mapping conversion function

given a_xiSrc in block a_nSrc, returns which block (a_n_valid) contains that location in its valid region and its location a_xi_valid in that block's computational coordinate space.

Implemented in CubedSphereShellCS, CubedSphere2DCS, CubedSphereSolidCS, MultiCartesianCS, DoubleCartesianRotateCS, XPointCoordSys, CylinderCS, DoubleCartesianCS, TripleCartesianCS, and SingleBlockCSAdaptor.

virtual RealVect MultiBlockCoordSys::blockRemappingGeneral ( int  a_nDst,
const RealVect a_xiSrc,
int  a_nSrc 
) const
virtual

general block mapping conversion function

Given a_xiSrc in mapped space of block a_nSrc, and block index a_nDst, returns coordinates in mapped space of block a_nDst.

Default implementation goes through real space.

Reimplemented in CubedSphereShellCS, and CubedSphere2DCS.

virtual IntVect MultiBlockCoordSys::cellAvoidingBoundaries ( const IntVect a_cell,
int  a_blockNum,
int  a_radius 
) const
virtual

return a cell that is far enough away from external boundaries

Given a_cell in block a_blockNum, return another cell that is a_cell shifted as necessary away from the external boundaries so as to leave distance of at least a_radius to all external boundaries.

virtual void MultiBlockCoordSys::keepInDomain ( Box a_bx,
int  a_blockNum 
) const
virtual

modify a_bx so that it lies entirely within the physical domain

Modify a_bx by removing parts of it that lie off edges of block a_blockNum that correspond to physical boundaries. Cells lying off the block in other directions are retained.

Referenced by LevelGridMetrics::blockDomain().

virtual ProblemDomain MultiBlockCoordSys::problemDomain ( const Box a_baseBox,
int  a_numGhost 
) const
virtual

return ProblemDomain within block, with box and ghost cells

Return non-periodic ProblemDomain with base box grow(a_baseBox, a_numGhost), cropped at the physical boundaries. Cells lying off the block in other directions are retained.

virtual ProblemDomain MultiBlockCoordSys::blockDomainOfBox ( const Box a_baseBox) const
virtual

return ProblemDomain of block containing a box

Return non-periodic ProblemDomain consisting of the whole block box that contains a_baseBox.

virtual VectorTransformation MultiBlockCoordSys::vectorBlockTransformation ( int  a_nDst,
const RealVect a_xiSrc,
int  a_nSrc 
) const
virtual

return vector transformation from one block to another at a point.

Return object that transforms the components of a vector situated at a_xiSrc from basis of block a_nSrc to components in basis in block a_nDst.

Default implementation goes through real space.

Reimplemented in CubedSphereShellCS, and CubedSphere2DCS.

virtual VectorTransformation MultiBlockCoordSys::vectorBlockTransformationCenter ( int  a_nDst,
const IntVect a_ivSrc,
int  a_nSrc 
) const
virtual

return vector transformation from one block to another at center of a cell.

Return object that transforms the components of a vector situated at center of cell a_ivSrc from basis of block a_nSrc to components in basis in block a_nDst.

Calls vectorBlockTransformation.

virtual void MultiBlockCoordSys::vectorBlockTransformationCenter ( BaseFab< VectorTransformation > &  a_vtFab,
int  a_nDst,
const Box a_srcBox,
int  a_nSrc 
) const
virtual
virtual VectorTransformation MultiBlockCoordSys::vectorBlockTransformationAvg ( int  a_nDst,
const IntVect a_ivSrc,
int  a_nSrc 
) const
virtual

return average vector transformation from one block to another at a cell

Return average of object that transforms the components of a vector on the cell a_ivSrc from basis of block a_nSrc to components in basis in block a_nDst.

Calls vectorBlockTransformationCenter.

virtual void MultiBlockCoordSys::vectorBlockTransformationAvg ( BaseFab< VectorTransformation > &  a_vtFab,
int  a_nDst,
const Box a_srcBox,
int  a_nSrc,
Interval  a_fixedDims = Interval() 
) const
virtual

return average vector transformation from one block to another at a cell, with averaging over specified dimensions only

Return average of object that transforms the components of a vector on the cells of a_srcBox from basis of block a_nSrc to components in basis in block a_nDst, where averaging is done in all dimensions that are NOT in a_fixedDims.

This is returned in a_vtFab(a_srcBox, 0).

Calls vectorBlockTransformationCenter.

virtual Tuple<VectorTransformation, SpaceDim> MultiBlockCoordSys::vectorBlockTransformationGrad ( int  a_nDst,
const IntVect a_ivSrc,
int  a_nSrc 
) const
virtual

return gradient of vector transformation from one block to another at a cell

Return gradient (or more precisely, difference, or gradient multiplied by mesh spacing) of object that transforms the components of a vector at center of cell a_ivSrc from basis of block a_nSrc to components in basis in block a_nDst.

Calls vectorBlockTransformationCenter.

virtual void MultiBlockCoordSys::vectorBlockTransformationGrad ( BaseFab< VectorTransformation > &  a_vtGradFab,
int  a_nDst,
const Box a_srcBox,
int  a_nSrc,
Interval  a_fixedDims = Interval() 
) const
virtual

return gradient of vector transformation from one block to another at a cell, over specified dimensions only

Return gradient (or more precisely, difference, or gradient multiplied by mesh spacing) of object that transforms the components of a vector at center of cells in a_srcBox from basis of block a_nSrc to components in basis in block a_nDst, on all dimensions that are NOT in a_fixedDims.

This is returned in a_vtFab(a_srcBox, 0:a_interpDimsVect.size()-1).

Calls vectorBlockTransformationCenter.

virtual void MultiBlockCoordSys::vectorBlockAvgTransformation ( BaseFab< VectorAvgTransformation > &  a_vtAvgFab,
int  a_nDst,
const Box a_srcBox,
int  a_nSrc,
Interval  a_fixedDims = Interval() 
) const
virtual
virtual Vector<RealVect> MultiBlockCoordSys::displacements ( const Vector< RealVect > &  a_dstCoords,
const Vector< int > &  a_dstBlocks,
const RealVect a_srcCoords,
int  a_srcBlock 
) const
virtual

return displacements

Return a Vector of same length as a_dstCoords and a_dstBlocks, with component i of this Vector being the displacement from point a_srcCoords in mapped coordinates of block a_srcBlock to point a_dstCoords[i] in mapped coordinates of block a_dstBlocks[i].

If this method is not overwritten, then component i of the returned Vector is simply the displacement in physical coordinates from a_srcCoords to a_dstCoords[i].

Reimplemented in CubedSphereShellCS, CubedSphere2DCS, MultiCartesianCS, DoubleCartesianRotateCS, DoubleCartesianCS, and TripleCartesianCS.

virtual Real MultiBlockCoordSys::distance ( const RealVect a_srcCoords,
int  a_srcBlock,
const RealVect a_dstCoords,
int  a_dstBlock 
) const
virtual

return distance between two points

virtual const NewCoordSys* MultiBlockCoordSys::getCoordSys ( int  a_n) const
inlinevirtual

Return the mapping which corresponds to the block with the given index.

References m_coordSysVect.

Referenced by LevelGridMetrics::getCoordSys(), and LevelGridMetrics::getCoordSys2().

virtual const NewCoordSys* MultiBlockCoordSys::getCoordSys ( const Box a_box) const
inlinevirtual

Return the mapping which corresponds to the given box.

Parameters
a_boxThe Box for which the coordinate system is retrieved. This Box must be contained completely within a block or this method will fail.

References m_coordSysVect, and whichBlock().

const Vector<Box>& MultiBlockCoordSys::mappingBlocks ( ) const
inline

const access to the mapping blocks

References m_mappingBlocks.

Referenced by LevelGridMetrics::blockDomain().

int MultiBlockCoordSys::numBlocks ( ) const
inline

number of blocks

References m_mappingBlocks, and Vector< T >::size().

const Vector< Tuple<BlockBoundary, 2*SpaceDim> >& MultiBlockCoordSys::boundaries ( ) const
inline

const access to the block boundaries

References m_boundaries.

const BaseFab<int>& MultiBlockCoordSys::validNum ( int  a_block) const
inline

const access to m_validNum[a_block]

References m_validNum.

const BaseFab<int>& MultiBlockCoordSys::validBlocks ( int  a_block) const
inline

const access to m_validBlocks[a_block]

References m_validBlocks.

const BaseFab<IndicesTransformation>& MultiBlockCoordSys::validTransformations ( int  a_block) const
inline

const access to m_validTransformations[a_block]

References m_validTransformations.

const IndicesTransformation& MultiBlockCoordSys::blockTransformation ( int  a_blockSrc,
int  a_blockDst 
) const
inline

const access to m_allBlockTransformations[blockSrc][blockDst]

References m_allBlockTransformations.

void MultiBlockCoordSys::initializeBlockTransformations ( )

Need to have m_boundaries for this.

void MultiBlockCoordSys::validBlocksCells ( Vector< int > &  a_validBlocks,
Vector< IntVect > &  a_validCells,
int  a_origBlock,
const IntVect a_origCell 
)

Return list of valid blocks and cells corresponding to a_cell in a_block.

virtual void MultiBlockCoordSys::separateVolFlux ( LevelData< FluxBox > &  a_flux) const
virtual

Have separate volume flux on each block. Normally does nothing, but cubed-sphere coordinate system needs it.

Reimplemented in CubedSphereShellCS, CubedSphere2DCS, DoubleCartesianRotateCS, and DoubleCartesianCS.

int MultiBlockCoordSys::realDim ( ) const
inline

References m_realDim.

RealVect MultiBlockCoordSys::dxVect ( ) const
inline

References m_dxVect.

bool MultiBlockCoordSys::gotBoundaries ( ) const
inline

References m_gotBoundaries.

bool MultiBlockCoordSys::gotBlockTransformations ( ) const
inline
bool MultiBlockCoordSys::gotMappingBlocks ( ) const
inline

References m_gotMappingBlocks.

bool MultiBlockCoordSys::gotCoordSysVect ( ) const
inline

References m_gotCoordSysVect.

bool MultiBlockCoordSys::useScriptN ( ) const
inline

References m_useScriptN.

bool MultiBlockCoordSys::isDefined ( ) const
void MultiBlockCoordSys::permute ( Vector< int > &  a_vec,
int  a_start,
int  a_length,
Vector< Vector< int > > &  a_allPathsDir,
const Vector< int > &  a_changedDirs 
)
protected
void MultiBlockCoordSys::setAllBoundaries ( BlockBoundary::btype  a_btype)
protected
void MultiBlockCoordSys::setBoundaryFromFaces ( int  a_srcBlock,
int  a_srcFaceID,
int  a_dstBlock,
int  a_dstFaceID,
IntVect  a_sign = IntVect::Unit 
)
protected

Member Data Documentation

bool MultiBlockCoordSys::m_gotCoordSysVect
protected

Do we have m_coordSysVect?

Referenced by gotCoordSysVect().

Vector<NewCoordSys*> MultiBlockCoordSys::m_coordSysVect
protected

Vector of NewCoordSys – one for each mapping block.

Referenced by getCoordSys().

bool MultiBlockCoordSys::m_gotMappingBlocks
protected

Do we have m_mappingBlocks?

Referenced by gotMappingBlocks().

Vector<Box> MultiBlockCoordSys::m_mappingBlocks
protected

Associated regions in index space over which each mapping is valid.

Referenced by mappingBlocks(), and numBlocks().

bool MultiBlockCoordSys::m_gotBoundaries
protected

Have we filled in m_boundaries? covers m_boundaries

Referenced by gotBoundaries().

RealVect MultiBlockCoordSys::m_dxVect
protected

The grid spacing, must be the same across all mapping blocks.

Referenced by dxVect().

int MultiBlockCoordSys::m_realDim
protected

Number of dimensions in real space; default SpaceDim.

Referenced by realDim().

Vector< Tuple<BlockBoundary, 2*SpaceDim> > MultiBlockCoordSys::m_boundaries
protected

Description of each boundary face of each block; set these in derived class and then set m_gotBoundaries true.

Referenced by boundaries().

bool MultiBlockCoordSys::m_gotBlockTransformations
protected

have we filled in transformations in initializeBlockTransformations()? covers m_allBlockTransformations, m_validNum, m_validBlocks, m_validTransformations

Referenced by gotBlockTransformations().

Vector< Vector<IndicesTransformation> > MultiBlockCoordSys::m_allBlockTransformations
protected

[blockSrc][blockDst] gives transformation from blockSrc to blockDst

Referenced by blockTransformation().

Vector< BaseFab<int>* > MultiBlockCoordSys::m_validNum
protected

number of valid blocks containing ghost cells of each block in each direction: this is the number of components in m_validBlocks and m_validTransformations. m_validNum lives on [-1:1]^SpaceDim and has 1 component.

Referenced by validNum().

Vector< BaseFab<int>* > MultiBlockCoordSys::m_validBlocks
protected

for each block, block numbers of valid blocks containing its ghost cells in each direction. m_validBlocks[iblock] lives on [-1:1]^SpaceDim and has SpaceDim! components, of which we use m_validNum[iblock](offset, 0) for each offset in [-1:1]^SpaceDim.

Referenced by validBlocks().

Vector< BaseFab<IndicesTransformation>* > MultiBlockCoordSys::m_validTransformations
protected

for each block, transformation from each block to valid blocks containing its ghost cells in each direction. m_validTransformation[iblock] lives on [-1:1]^SpaceDim and has SpaceDim! components, of which we use m_validNum[iblock](offset, 0) for each offset in [-1:1]^SpaceDim.

Referenced by validTransformations().

bool MultiBlockCoordSys::m_useScriptN
protected

Whether scriptN is used in calculating N.

Referenced by useScriptN().


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