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

Virtual base class encapsulating mapped-grid coordinate systems. More...

#include <NewCoordSys.H>

Inheritance diagram for NewCoordSys:
Inheritance graph
[legend]

Public Member Functions

 NewCoordSys ()
 default constructor More...
 
virtual ~NewCoordSys ()
 
virtual RealVect realCoord (const RealVect &a_Xi) const =0
 given coordinate in mapped space, return its location in real space More...
 
virtual RealVect mappedCoord (const RealVect &a_x) const =0
 given coordinate in real space, return its location in the mapped space More...
 
virtual void realCoord (FArrayBox &a_x, const FArrayBox &a_Xi, const Box &a_box) const
 given coordinates in mapped space, return locations in real space More...
 
virtual void mappedCoord (FArrayBox &a_Xi, const FArrayBox &a_x, const Box &a_box) const
 given coordinate in real space, return its location in the mapped space More...
 
virtual void getCenterMappedCoordinates (FArrayBox &a_Xi, const Box &a_box) const
 given indices in a_box, return centers of cells (or of faces, or of edges) in mapped coordinates. The function does the right thing based on the centering of a_box, which must be the same centering as a_Xi. More...
 
virtual RealVect centerMappedCoordinates (const IntVect &a_iv) const
 given indices, return centers of cells in mapped coordinates More...
 
virtual void getNodeRealCoordinates (FArrayBox &a_nodeCoords, const Box &a_box) const =0
 return Cartesian XYZ locations of nodes More...
 
virtual Real dXdXi (const RealVect &a_Xi, int a_dirX, int a_dirXi) const =0
 note that a_Xi is in mapped space. More...
 
virtual void dXdXi (FArrayBox &a_dxdXi, const FArrayBox &a_Xi, int a_destComp, int a_dirX, int a_dirXi, const Box &a_box) const
 note that a_Xi is in mapped space. More...
 
virtual int getNumN () const =0
 returns number of components in the metric term matrix (N) More...
 
virtual int getNcomponent (const int a_row, const int a_col) const =0
 index function into face-centered metric terms More...
 
virtual int dimension () const
 returns dimensionality of the space More...
 
virtual void cellVol (FArrayBox &a_vol, const FluxBox &a_N, const Box &a_box) const =0
 computes cell volumes More...
 
virtual void getN (FluxBox &a_N, const Box &a_box) const =0
 computes integral of N over each face of a_box More...
 
virtual void getAvgJ (FArrayBox &a_avgJ, const Box &a_box) const =0
 computes cell-averaged J More...
 
virtual void getAvgJinverse (FluxBox &a_avgJinverse, const Box &a_box) const =0
 computes face-averaged 1/J More...
 
virtual Real pointwiseJ (const RealVect &a_Xi) const =0
 Jacobian evaluated at location Xi in mapped space. More...
 
virtual void pointwiseJ (FArrayBox &a_J, const FArrayBox &a_Xi, const Box &a_box) const
 Jacobian evaluated at locations Xi in mapped space. More...
 
virtual void computeDivergence (FArrayBox &a_divF, const FluxBox &a_F, const FluxBox &a_N, const Box &a_box, Interval &divInterval) const
 returns integral of divergence over mapped-grid cells More...
 
virtual void computeMetricTermProductAverage (FluxBox &a_product, const FluxBox &a_F, const FluxBox &a_N, const FluxBox &a_FforGrad, const Box &a_box, bool a_fourthOrder=true) const =0
 computes 4th-order average of product = N^T*F More...
 
virtual void computeMetricTermProductAverage (FluxBox &a_product, const FluxBox &a_F, const FluxBox &a_N, const Box &a_box, bool a_fourthOrder=true) const
 computes 4th-order average of product = N^T*F More...
 
virtual VectorTransformation vectorTransformationMappedToReal (const RealVect &a_Xi) const
 return matrix that transforms vector components from mapped space to real space at point a_Xi in mapped space More...
 
virtual VectorTransformation vectorTransformationRealToMapped (const RealVect &a_Xi) const
 return matrix that transforms vector components from real space to mapped space at point a_Xi in mapped space More...
 
virtual VectorTransformation vectorTransformationMappedToRealCenter (const IntVect &a_iv) const
 return matrix that transforms vector components from mapped space to real space at center of cell a_iv More...
 
virtual VectorTransformation vectorTransformationRealToMappedCenter (const IntVect &a_iv) const
 return matrix that transforms vector components from real space to mapped space at center of cell a_iv More...
 
virtual void vectorTransformMappedToRealCenterFab (FArrayBox &a_vectorFab) const
 transform a FAB of SpaceDim-vectors from mapped-coordinate basis to real-coordinate basis at cell centers More...
 
virtual void vectorTransformMappedToRealAvgFab (FArrayBox &a_vectorFab, const FArrayBox &a_gradVectorFab) const
 transform a FAB of SpaceDim-vectors from mapped-coordinate basis to real-coordinate basis, averaged over cells More...
 
virtual void vectorTransformRealToMappedCenterFab (FArrayBox &a_vectorFab) const
 transform a FAB of SpaceDim-vectors from real-coordinate basis to mapped-coordinate basis at cell centers More...
 
virtual void vectorTransformRealToMappedAvgFab (FArrayBox &a_vectorFab, const FArrayBox &a_gradVectorFab) const
 transform a FAB of SpaceDim-vectors from real-coordinate basis to mapped-coordinate basis, averaged over cells More...
 
virtual const RealVectdx () const =0
 access function to simplify things – returns mapped-space cell spacing More...
 
virtual void setTime (const Real &a_time) const
 Set time for moving grids. More...
 

Protected Member Functions

virtual void vectorTransformInternalAvgFab (FArrayBox &a_vectorFab, const FArrayBox &a_gradVectorFab, const BaseFab< VectorTransformation > &a_tfmCenterFab) const
 internal function to transform a FAB of SpaceDim-vectors from one basis to another, averaged over cells, given BaseFab of vector transformations at cell centers More...
 

Protected Attributes

Real m_time
 Const is already well entrenched. More...
 

Detailed Description

Virtual base class encapsulating mapped-grid coordinate systems.

The CoordSys class is a pure-virtual base class providing an API for performing operations in a mapped grid coordinate space. Implementations of specific coordinate systems will be provided by derived classes.

Constructor & Destructor Documentation

◆ NewCoordSys()

NewCoordSys::NewCoordSys ( )
inline

default constructor

◆ ~NewCoordSys()

virtual NewCoordSys::~NewCoordSys ( )
inlinevirtual

Member Function Documentation

◆ realCoord() [1/2]

virtual RealVect NewCoordSys::realCoord ( const RealVect a_Xi) const
pure virtual

◆ mappedCoord() [1/2]

virtual RealVect NewCoordSys::mappedCoord ( const RealVect a_x) const
pure virtual

◆ realCoord() [2/2]

virtual void NewCoordSys::realCoord ( FArrayBox a_x,
const FArrayBox a_Xi,
const Box a_box 
) const
virtual

given coordinates in mapped space, return locations in real space

Reimplemented in CubedSphereShellPanelCS, NewFourthOrderCoordSys, and CubedSphere2DPanelCS.

◆ mappedCoord() [2/2]

virtual void NewCoordSys::mappedCoord ( FArrayBox a_Xi,
const FArrayBox a_x,
const Box a_box 
) const
virtual

given coordinate in real space, return its location in the mapped space

Reimplemented in NewFourthOrderCoordSys.

◆ getCenterMappedCoordinates()

virtual void NewCoordSys::getCenterMappedCoordinates ( FArrayBox a_Xi,
const Box a_box 
) const
virtual

given indices in a_box, return centers of cells (or of faces, or of edges) in mapped coordinates. The function does the right thing based on the centering of a_box, which must be the same centering as a_Xi.

Referenced by ~NewCoordSys().

◆ centerMappedCoordinates()

virtual RealVect NewCoordSys::centerMappedCoordinates ( const IntVect a_iv) const
virtual

given indices, return centers of cells in mapped coordinates

Referenced by ~NewCoordSys().

◆ getNodeRealCoordinates()

virtual void NewCoordSys::getNodeRealCoordinates ( FArrayBox a_nodeCoords,
const Box a_box 
) const
pure virtual

return Cartesian XYZ locations of nodes

nodeCoords should have dimension returned by dimension()

Implemented in CubedSphereShellPanelCS, NewFourthOrderCoordSys, and CubedSphere2DPanelCS.

Referenced by ~NewCoordSys().

◆ dXdXi() [1/2]

virtual Real NewCoordSys::dXdXi ( const RealVect a_Xi,
int  a_dirX,
int  a_dirXi 
) const
pure virtual

◆ dXdXi() [2/2]

virtual void NewCoordSys::dXdXi ( FArrayBox a_dxdXi,
const FArrayBox a_Xi,
int  a_destComp,
int  a_dirX,
int  a_dirXi,
const Box a_box 
) const
virtual

note that a_Xi is in mapped space.

fills the destComp component of a_dxdXi with the derivative of x w/ respect to Xi in the dirX direction Note that the default implementation of this in FourthOrderCoordSys class throws an error, since there is no way to get real=space coordinate x from index location except in the derived class.. (default implementation is there in case derived class doesn't provide it)

Reimplemented in NewFourthOrderCoordSys, and XPointBlockCoordSys.

◆ getNumN()

virtual int NewCoordSys::getNumN ( ) const
pure virtual

returns number of components in the metric term matrix (N)

Implemented in NewFourthOrderCoordSys.

Referenced by ~NewCoordSys().

◆ getNcomponent()

virtual int NewCoordSys::getNcomponent ( const int  a_row,
const int  a_col 
) const
pure virtual

index function into face-centered metric terms

returns which component of the face-centered metric term in which N^row_col is stored

Implemented in NewFourthOrderCoordSys.

Referenced by ~NewCoordSys().

◆ dimension()

virtual int NewCoordSys::dimension ( ) const
inlinevirtual

returns dimensionality of the space

The dimensionality of the space may not be SpaceDim if, for example we're computing on a manifold. One example of this is the surface-of-a-sphere mapping, which is a 2D surface in a 3D space. For that case, dimension() would return 3 even though SpaceDim is 2. Default implementation returns SpaceDim.

Reimplemented in CubedSphereShellPanelCS, and CubedSphere2DPanelCS.

References cellVol(), computeDivergence(), computeMetricTermProductAverage(), dx(), getAvgJ(), getAvgJinverse(), getN(), pointwiseJ(), setTime(), SpaceDim, vectorTransformationMappedToReal(), vectorTransformationMappedToRealCenter(), vectorTransformationRealToMapped(), vectorTransformationRealToMappedCenter(), vectorTransformInternalAvgFab(), vectorTransformMappedToRealAvgFab(), vectorTransformMappedToRealCenterFab(), vectorTransformRealToMappedAvgFab(), and vectorTransformRealToMappedCenterFab().

◆ cellVol()

virtual void NewCoordSys::cellVol ( FArrayBox a_vol,
const FluxBox a_N,
const Box a_box 
) const
pure virtual

computes cell volumes

Return cell volume in a_vol on cells of a_box, using a_N from getN() defined on a_box grown by 1.

Implemented in NewFourthOrderCoordSys, CubedSphereShellPanelCS, and CubedSphere2DPanelCS.

Referenced by dimension().

◆ getN()

virtual void NewCoordSys::getN ( FluxBox a_N,
const Box a_box 
) const
pure virtual

computes integral of N over each face of a_box

Implemented in NewFourthOrderCoordSys, CubedSphereShellPanelCS, and CubedSphere2DPanelCS.

Referenced by dimension().

◆ getAvgJ()

virtual void NewCoordSys::getAvgJ ( FArrayBox a_avgJ,
const Box a_box 
) const
pure virtual

computes cell-averaged J

Implemented in NewFourthOrderCoordSys, CubedSphereShellPanelCS, and CubedSphere2DPanelCS.

Referenced by dimension().

◆ getAvgJinverse()

virtual void NewCoordSys::getAvgJinverse ( FluxBox a_avgJinverse,
const Box a_box 
) const
pure virtual

computes face-averaged 1/J

Implemented in NewFourthOrderCoordSys, CubedSphereShellPanelCS, and CubedSphere2DPanelCS.

Referenced by dimension().

◆ pointwiseJ() [1/2]

virtual Real NewCoordSys::pointwiseJ ( const RealVect a_Xi) const
pure virtual

Jacobian evaluated at location Xi in mapped space.

Implemented in NewFourthOrderCoordSys, CubedSphereShellPanelCS, and CubedSphere2DPanelCS.

Referenced by dimension().

◆ pointwiseJ() [2/2]

virtual void NewCoordSys::pointwiseJ ( FArrayBox a_J,
const FArrayBox a_Xi,
const Box a_box 
) const
virtual

Jacobian evaluated at locations Xi in mapped space.

Reimplemented in NewFourthOrderCoordSys, CubedSphereShellPanelCS, and CubedSphere2DPanelCS.

◆ computeDivergence()

virtual void NewCoordSys::computeDivergence ( FArrayBox a_divF,
const FluxBox a_F,
const FluxBox a_N,
const Box a_box,
Interval divInterval 
) const
virtual

returns integral of divergence over mapped-grid cells

Reimplemented in CubedSphereShellPanelCS, and CubedSphere2DPanelCS.

Referenced by dimension().

◆ computeMetricTermProductAverage() [1/2]

virtual void NewCoordSys::computeMetricTermProductAverage ( FluxBox a_product,
const FluxBox a_F,
const FluxBox a_N,
const FluxBox a_FforGrad,
const Box a_box,
bool  a_fourthOrder = true 
) const
pure virtual

computes 4th-order average of product = N^T*F

if a_fourthOrder is false, then only do a second-order dot product aFforGrad is the F used to compute grad_perp(F); returns results in a_product on a_box; both a_FforGrad and a_N (from getN()) must be defined on a_box grown by 1.

Implemented in NewFourthOrderCoordSys.

Referenced by dimension().

◆ computeMetricTermProductAverage() [2/2]

virtual void NewCoordSys::computeMetricTermProductAverage ( FluxBox a_product,
const FluxBox a_F,
const FluxBox a_N,
const Box a_box,
bool  a_fourthOrder = true 
) const
virtual

computes 4th-order average of product = N^T*F

if a_fourthOrder is false, then only do a second-order dot product; returns results in a_product on a_box; both a_F and a_N (from getN()) must be defined on a_box grown by 1.

Reimplemented in NewFourthOrderCoordSys.

◆ vectorTransformationMappedToReal()

virtual VectorTransformation NewCoordSys::vectorTransformationMappedToReal ( const RealVect a_Xi) const
virtual

return matrix that transforms vector components from mapped space to real space at point a_Xi in mapped space

Referenced by dimension().

◆ vectorTransformationRealToMapped()

virtual VectorTransformation NewCoordSys::vectorTransformationRealToMapped ( const RealVect a_Xi) const
virtual

return matrix that transforms vector components from real space to mapped space at point a_Xi in mapped space

Referenced by dimension().

◆ vectorTransformationMappedToRealCenter()

virtual VectorTransformation NewCoordSys::vectorTransformationMappedToRealCenter ( const IntVect a_iv) const
virtual

return matrix that transforms vector components from mapped space to real space at center of cell a_iv

Referenced by dimension().

◆ vectorTransformationRealToMappedCenter()

virtual VectorTransformation NewCoordSys::vectorTransformationRealToMappedCenter ( const IntVect a_iv) const
virtual

return matrix that transforms vector components from real space to mapped space at center of cell a_iv

Referenced by dimension().

◆ vectorTransformMappedToRealCenterFab()

virtual void NewCoordSys::vectorTransformMappedToRealCenterFab ( FArrayBox a_vectorFab) const
virtual

transform a FAB of SpaceDim-vectors from mapped-coordinate basis to real-coordinate basis at cell centers

Reimplemented in CubedSphereShellPanelCS, and CubedSphere2DPanelCS.

Referenced by dimension().

◆ vectorTransformMappedToRealAvgFab()

virtual void NewCoordSys::vectorTransformMappedToRealAvgFab ( FArrayBox a_vectorFab,
const FArrayBox a_gradVectorFab 
) const
virtual

transform a FAB of SpaceDim-vectors from mapped-coordinate basis to real-coordinate basis, averaged over cells

Referenced by dimension().

◆ vectorTransformRealToMappedCenterFab()

virtual void NewCoordSys::vectorTransformRealToMappedCenterFab ( FArrayBox a_vectorFab) const
virtual

transform a FAB of SpaceDim-vectors from real-coordinate basis to mapped-coordinate basis at cell centers

Reimplemented in CubedSphereShellPanelCS, and CubedSphere2DPanelCS.

Referenced by dimension().

◆ vectorTransformRealToMappedAvgFab()

virtual void NewCoordSys::vectorTransformRealToMappedAvgFab ( FArrayBox a_vectorFab,
const FArrayBox a_gradVectorFab 
) const
virtual

transform a FAB of SpaceDim-vectors from real-coordinate basis to mapped-coordinate basis, averaged over cells

Referenced by dimension().

◆ dx()

virtual const RealVect& NewCoordSys::dx ( ) const
pure virtual

access function to simplify things – returns mapped-space cell spacing

Implemented in NewFourthOrderCoordSys.

Referenced by dimension().

◆ setTime()

void NewCoordSys::setTime ( const Real a_time) const
inlinevirtual

Set time for moving grids.

Reimplemented in WarpedCS.

References m_time.

Referenced by dimension().

◆ vectorTransformInternalAvgFab()

virtual void NewCoordSys::vectorTransformInternalAvgFab ( FArrayBox a_vectorFab,
const FArrayBox a_gradVectorFab,
const BaseFab< VectorTransformation > &  a_tfmCenterFab 
) const
protectedvirtual

internal function to transform a FAB of SpaceDim-vectors from one basis to another, averaged over cells, given BaseFab of vector transformations at cell centers

Referenced by dimension().

Member Data Documentation

◆ m_time

Real NewCoordSys::m_time
mutableprotected

Const is already well entrenched.

Referenced by setTime().


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