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

simple multiblock coordinate system for a cylinder More...

#include <CubedSphere2DCS.H>

Inheritance diagram for CubedSphere2DCS:
Inheritance graph
[legend]

Public Member Functions

 CubedSphere2DCS ()
 default constructor More...
 
 CubedSphere2DCS (int a_nResolution, int a_nLayers=0)
 
virtual ~CubedSphere2DCS ()
 
virtual void define (int a_nResolution, int a_nLayers=0)
 
virtual void define (const ProblemDomain &a_levelDomain, const RealVect &a_dx)
 
void setFlatMap (bool a_flatMap)
 
void setRadii (Real a_rMin, Real a_rMax)
 
void regrid (const DisjointBoxLayout &a_newGrids)
 
RealVect realCoord (const RealVect &a_X) const
 
RealVect mappedCoord (const RealVect &a_x) const
 
void vecTransMatrix_Pt (int a_nSourcePanel, int a_nDestPanel, Real a_dX, Real a_dY, Real *a_dT) const
 
void vecTransMatrix (int a_nSourcePanel, int a_nDestPanel, int a_nAlphaIx, int a_nBetaIx, Real a_dDeltaA, Real *a_dAvgT, Real *a_dAlphaGradT, Real *a_dBetaGradT) const
 
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...
 
void cartesianFromMapped (Real &xx, Real &yy, Real &zz, const RealVect &a_xiSrc, int a_nSrc) const
 convert from mapped coordinate to Cartesian coordinates More...
 
void mappedFromCartesian (RealVect &a_xiDst, int a_nDst, Real xx, Real yy, Real zz) const
 convert from Cartesian coordinates to mapped coordinate More...
 
virtual void blockRemapping (RealVect &a_xi_valid, int &a_n_valid, const RealVect &a_xiSrc, int a_nSrc) const
 block mapping conversion function More...
 
virtual RealVect blockRemappingGeneral (int a_nDst, const RealVect &a_xiSrc, int a_nSrc) 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 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...
 
virtual Real radialMappedToReal (Real a_rMapped) const
 Function to convert from 0:1 to m_rMin:m_rMax. More...
 
virtual Real radialRealToMapped (Real a_rReal) const
 Function to convert from m_rMin:m_rMax to 0:1. More...
 
- Public Member Functions inherited from MultiBlockCoordSys
 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 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 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, SpaceDimvectorBlockTransformationGrad (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 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...
 
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 setFortranCommon ()
 
void defineBoundaries ()
 
- Protected Member Functions inherited from MultiBlockCoordSys
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

int m_nResolution
 
int m_nLayers
 
bool m_flatMap
 
Real m_rMin
 
Real m_rMax
 
- Protected Attributes inherited from MultiBlockCoordSys
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

simple multiblock coordinate system for a cylinder

The CubedSphere2DCS coordinate system class is a multiblock example that takes place on a cubed inflated onto the surface of a sphere.

Constructor & Destructor Documentation

◆ CubedSphere2DCS() [1/2]

CubedSphere2DCS::CubedSphere2DCS ( )

default constructor

◆ CubedSphere2DCS() [2/2]

CubedSphere2DCS::CubedSphere2DCS ( int  a_nResolution,
int  a_nLayers = 0 
)

◆ ~CubedSphere2DCS()

virtual CubedSphere2DCS::~CubedSphere2DCS ( )
virtual

Destructor.

Member Function Documentation

◆ define() [1/2]

virtual void CubedSphere2DCS::define ( int  a_nResolution,
int  a_nLayers = 0 
)
virtual

◆ define() [2/2]

virtual void CubedSphere2DCS::define ( const ProblemDomain a_levelDomain,
const RealVect a_dx 
)
virtual

◆ setFlatMap()

void CubedSphere2DCS::setFlatMap ( bool  a_flatMap)

◆ setRadii()

void CubedSphere2DCS::setRadii ( Real  a_rMin,
Real  a_rMax 
)

◆ regrid()

void CubedSphere2DCS::regrid ( const DisjointBoxLayout a_newGrids)

◆ realCoord()

RealVect CubedSphere2DCS::realCoord ( const RealVect a_X) const

◆ mappedCoord()

RealVect CubedSphere2DCS::mappedCoord ( const RealVect a_x) const

◆ vecTransMatrix_Pt()

void CubedSphere2DCS::vecTransMatrix_Pt ( int  a_nSourcePanel,
int  a_nDestPanel,
Real  a_dX,
Real  a_dY,
Real a_dT 
) const

Calculate the pointwise transformation matrix using gnomonic coordinates on the source panel (a_dX, a_dY).

◆ vecTransMatrix()

void CubedSphere2DCS::vecTransMatrix ( int  a_nSourcePanel,
int  a_nDestPanel,
int  a_nAlphaIx,
int  a_nBetaIx,
Real  a_dDeltaA,
Real a_dAvgT,
Real a_dAlphaGradT,
Real a_dBetaGradT 
) const

◆ vectorBlockTransformation()

VectorTransformation CubedSphere2DCS::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 from MultiBlockCoordSys.

◆ cartesianFromMapped()

void CubedSphere2DCS::cartesianFromMapped ( Real xx,
Real yy,
Real zz,
const RealVect a_xiSrc,
int  a_nSrc 
) const

convert from mapped coordinate to Cartesian coordinates

given a_xiSrc in block a_nSrc, return 3D Cartesian coordinates of point.

◆ mappedFromCartesian()

void CubedSphere2DCS::mappedFromCartesian ( RealVect a_xiDst,
int  a_nDst,
Real  xx,
Real  yy,
Real  zz 
) const

convert from Cartesian coordinates to mapped coordinate

given 3D Cartesian coordinates of point and destination block returns mapped coordinates of that point. Radius information is discarded.

◆ blockRemapping()

virtual void CubedSphere2DCS::blockRemapping ( RealVect a_xi_valid,
int &  a_n_valid,
const RealVect a_xiSrc,
int  a_nSrc 
) const
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.

Implements MultiBlockCoordSys.

◆ blockRemappingGeneral()

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

given mapped coordinate a_xiSrc of a point in block a_nSrc return mapped coordinates in block a_nDst.

Reimplemented from MultiBlockCoordSys.

◆ displacements()

virtual Vector<RealVect> CubedSphere2DCS::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 from MultiBlockCoordSys.

◆ separateVolFlux()

virtual void CubedSphere2DCS::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 from MultiBlockCoordSys.

◆ radialMappedToReal()

virtual Real CubedSphere2DCS::radialMappedToReal ( Real  a_rMapped) const
virtual

Function to convert from 0:1 to m_rMin:m_rMax.

◆ radialRealToMapped()

virtual Real CubedSphere2DCS::radialRealToMapped ( Real  a_rReal) const
virtual

Function to convert from m_rMin:m_rMax to 0:1.

◆ setFortranCommon()

void CubedSphere2DCS::setFortranCommon ( )
protected

◆ defineBoundaries()

void CubedSphere2DCS::defineBoundaries ( )
protected

Member Data Documentation

◆ m_nResolution

int CubedSphere2DCS::m_nResolution
protected

◆ m_nLayers

int CubedSphere2DCS::m_nLayers
protected

◆ m_flatMap

bool CubedSphere2DCS::m_flatMap
protected

◆ m_rMin

Real CubedSphere2DCS::m_rMin
protected

◆ m_rMax

Real CubedSphere2DCS::m_rMax
protected

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