OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
IrregularDomain Class Referenceabstract

#include <IrregularDomain.h>

Inheritance diagram for IrregularDomain:
Collaboration diagram for IrregularDomain:

Classes

struct  Stencil

Public Types

typedef Stencil< int > StencilIndex_t
typedef Stencil< double > StencilValue_t
typedef Vektor< int, 3 > IntVector_t

Public Member Functions

 IrregularDomain (const IntVector_t &nr, const Vector_t &hr, const std::string &interpl)
virtual void compute (Vector_t hr, NDIndex< 3 > localId)=0
void getBoundaryStencil (int x, int y, int z, StencilValue_t &value, double &scaleFactor) const
void getBoundaryStencil (int id, StencilValue_t &value, double &scaleFactor) const
void getNeighbours (int x, int y, int z, StencilIndex_t &index) const
void getNeighbours (int idx, StencilIndex_t &index) const
virtual void getCoord (int idx, int &x, int &y, int &z) const
 Conversion from a 3D index to (x,y,z).
int getIdx (int x, int y, int z) const
 Conversion from (x,y,z) to index on the 3D grid.
virtual int getNumXY () const
virtual bool isInside (int x, int y, int z) const =0
IntVector_t getNr () const
Vector_t getHr () const
void setNr (IntVector_t nr)
void setHr (Vector_t hr)
void setMinMaxZ (double minz, double maxz)
double getMinZ () const
double getMaxZ () const
double getXRangeMin () const
double getXRangeMax () const
double getYRangeMin () const
double getYRangeMax () const
double getZRangeMin () const
double getZRangeMax () const
void setRangeMin (const Vector_t &min)
void setRangeMax (const Vector_t &max)
bool hasGeometryChanged () const
virtual ~IrregularDomain ()
virtual void resizeMesh (Vector_t &origin, Vector_t &hr, const Vector_t &, const Vector_t &, double)

Protected Member Functions

virtual int indexAccess (int x, int y, int z) const =0
virtual int coordAccess (int idx) const =0
virtual void constantInterpolation (int x, int y, int z, StencilValue_t &value, double &scaleFactor) const
 different interpolation methods for boundary points
virtual void linearInterpolation (int x, int y, int z, StencilValue_t &value, double &scaleFactor) const
virtual void quadraticInterpolation (int x, int y, int z, StencilValue_t &value, double &scaleFactor) const

Protected Attributes

IntVector_t nr_m
 number of mesh points in each direction
Vector_t hr_m
 mesh-spacings in each direction
double zMin_m
 min/max of bunch in floor coordinates
double zMax_m
Vector_t min_m
Vector_t max_m
bool hasGeometryChanged_m
 flag indicating if geometry has changed for the current time-step
int interpolationMethod_m
 interpolation type
std::map< int, int > idxMap_m
 mapping (x,y,z) -> idx
std::map< int, int > coordMap_m
 mapping idx -> (x,y,z)

Detailed Description

Definition at line 43 of file IrregularDomain.h.


Class Documentation

◆ IrregularDomain::Stencil

struct IrregularDomain::Stencil
template<typename T>
struct IrregularDomain::Stencil< T >

Definition at line 48 of file IrregularDomain.h.

Inheritance diagram for IrregularDomain::Stencil< T >:
Collaboration diagram for IrregularDomain::Stencil< T >:
Class Members
T back
T center
T east
T front
T north
T south
T west

Member Typedef Documentation

◆ IntVector_t

Definition at line 60 of file IrregularDomain.h.

◆ StencilIndex_t

Definition at line 58 of file IrregularDomain.h.

◆ StencilValue_t

Definition at line 59 of file IrregularDomain.h.

Constructor & Destructor Documentation

◆ IrregularDomain()

IrregularDomain::IrregularDomain ( const IntVector_t & nr,
const Vector_t & hr,
const std::string & interpl )

◆ ~IrregularDomain()

virtual IrregularDomain::~IrregularDomain ( )
inlinevirtual

Definition at line 140 of file IrregularDomain.h.

Member Function Documentation

◆ compute()

virtual void IrregularDomain::compute ( Vector_t hr,
NDIndex< 3 > localId )
pure virtual

method to compute the intersection points with the boundary geometry (stored in some appropriate data structure)

Parameters
hrupdated mesh spacings

Implemented in ArbitraryDomain, BoxCornerDomain, EllipticDomain, and RectangularDomain.

◆ constantInterpolation()

void IrregularDomain::constantInterpolation ( int x,
int y,
int z,
StencilValue_t & value,
double & scaleFactor ) const
protectedvirtual

different interpolation methods for boundary points

Reimplemented in ArbitraryDomain, and RegularDomain.

Definition at line 137 of file IrregularDomain.cpp.

Referenced by getBoundaryStencil().

◆ coordAccess()

virtual int IrregularDomain::coordAccess ( int idx) const
protectedpure virtual

◆ getBoundaryStencil() [1/2]

void IrregularDomain::getBoundaryStencil ( int id,
StencilValue_t & value,
double & scaleFactor ) const

method to calculate the stencil at a boundary points

Parameters
idindex of the current element in the matrix
scaleFactorof stencil values

Definition at line 118 of file IrregularDomain.cpp.

References getBoundaryStencil(), and getCoord().

Here is the call graph for this function:

◆ getBoundaryStencil() [2/2]

void IrregularDomain::getBoundaryStencil ( int x,
int y,
int z,
StencilValue_t & value,
double & scaleFactor ) const

method to calculate the stencil at a boundary points

Parameters
xindex of the current element in the matrix
yindex of the current element in the matrix
zindex of the current element in the matrix
valuesof stencil element
scaleFactorof stencil values

Definition at line 95 of file IrregularDomain.cpp.

References IrregularDomain::Stencil< T >::center, CONSTANT, constantInterpolation(), interpolationMethod_m, LINEAR, linearInterpolation(), PAssert, QUADRATIC, and quadraticInterpolation().

Referenced by getBoundaryStencil().

Here is the call graph for this function:

◆ getCoord()

void IrregularDomain::getCoord ( int idx,
int & x,
int & y,
int & z ) const
virtual

Conversion from a 3D index to (x,y,z).

Definition at line 82 of file IrregularDomain.cpp.

References coordAccess(), getNumXY(), and nr_m.

Referenced by getBoundaryStencil(), and getNeighbours().

Here is the call graph for this function:

◆ getHr()

Vector_t IrregularDomain::getHr ( ) const
inline

Definition at line 115 of file IrregularDomain.h.

References hr_m.

Referenced by EllipticDomain::compute().

◆ getIdx()

int IrregularDomain::getIdx ( int x,
int y,
int z ) const

Conversion from (x,y,z) to index on the 3D grid.

Definition at line 89 of file IrregularDomain.cpp.

References indexAccess(), and isInside().

Referenced by getNeighbours().

Here is the call graph for this function:

◆ getMaxZ()

double IrregularDomain::getMaxZ ( ) const
inline

Definition at line 126 of file IrregularDomain.h.

References zMax_m.

Referenced by BoxCornerDomain::compute(), and RegularDomain::resizeMesh().

◆ getMinZ()

double IrregularDomain::getMinZ ( ) const
inline

Definition at line 125 of file IrregularDomain.h.

References zMin_m.

Referenced by BoxCornerDomain::compute(), and RegularDomain::resizeMesh().

◆ getNeighbours() [1/2]

void IrregularDomain::getNeighbours ( int idx,
StencilIndex_t & index ) const

Definition at line 75 of file IrregularDomain.cpp.

References getCoord(), and getNeighbours().

Here is the call graph for this function:

◆ getNeighbours() [2/2]

void IrregularDomain::getNeighbours ( int x,
int y,
int z,
StencilIndex_t & index ) const

method to calculate the neighbours in the matrix of the current index (x,y,z)

Parameters
xindex of the current element in the matrix
yindex of the current element in the matrix
zindex of the current element in the matrix
indexstencil indices of an element

Definition at line 46 of file IrregularDomain.cpp.

References IrregularDomain::Stencil< T >::back, IrregularDomain::Stencil< T >::east, IrregularDomain::Stencil< T >::front, getIdx(), isInside(), IrregularDomain::Stencil< T >::north, nr_m, IrregularDomain::Stencil< T >::south, and IrregularDomain::Stencil< T >::west.

Referenced by getNeighbours().

Here is the call graph for this function:

◆ getNr()

IntVector_t IrregularDomain::getNr ( ) const
inline

Definition at line 114 of file IrregularDomain.h.

References nr_m.

◆ getNumXY()

virtual int IrregularDomain::getNumXY ( ) const
inlinevirtual

Reimplemented in RegularDomain.

Definition at line 105 of file IrregularDomain.h.

References nr_m.

Referenced by getCoord().

◆ getXRangeMax()

◆ getXRangeMin()

◆ getYRangeMax()

double IrregularDomain::getYRangeMax ( ) const
inline

◆ getYRangeMin()

◆ getZRangeMax()

double IrregularDomain::getZRangeMax ( ) const
inline

Definition at line 133 of file IrregularDomain.h.

References max_m.

Referenced by BoxCornerDomain::getB().

◆ getZRangeMin()

double IrregularDomain::getZRangeMin ( ) const
inline

Definition at line 132 of file IrregularDomain.h.

References min_m.

Referenced by ArbitraryDomain::compute(), and BoxCornerDomain::getB().

◆ hasGeometryChanged()

bool IrregularDomain::hasGeometryChanged ( ) const
inline

Definition at line 138 of file IrregularDomain.h.

References hasGeometryChanged_m.

◆ indexAccess()

virtual int IrregularDomain::indexAccess ( int x,
int y,
int z ) const
protectedpure virtual

◆ isInside()

virtual bool IrregularDomain::isInside ( int x,
int y,
int z ) const
pure virtual

method that checks if a given point lies inside the boundary

Parameters
xindex of the current element in the matrix
yindex of the current element in the matrix
zindex of the current element in the matrix
Returns
boolean indicating if the point lies inside the boundary

Implemented in ArbitraryDomain, BoxCornerDomain, EllipticDomain, and RectangularDomain.

Referenced by RegularDomain::constantInterpolation(), getIdx(), and getNeighbours().

◆ linearInterpolation()

void IrregularDomain::linearInterpolation ( int x,
int y,
int z,
StencilValue_t & value,
double & scaleFactor ) const
protectedvirtual

Reimplemented in ArbitraryDomain, BoxCornerDomain, and EllipticDomain.

Definition at line 145 of file IrregularDomain.cpp.

Referenced by getBoundaryStencil().

◆ quadraticInterpolation()

void IrregularDomain::quadraticInterpolation ( int x,
int y,
int z,
StencilValue_t & value,
double & scaleFactor ) const
protectedvirtual

Reimplemented in BoxCornerDomain, and EllipticDomain.

Definition at line 153 of file IrregularDomain.cpp.

Referenced by getBoundaryStencil().

◆ resizeMesh()

void IrregularDomain::resizeMesh ( Vector_t & origin,
Vector_t & hr,
const Vector_t & ,
const Vector_t & ,
double  )
virtual

Reimplemented in RegularDomain.

Definition at line 127 of file IrregularDomain.cpp.

References max_m, min_m, and nr_m.

◆ setHr()

void IrregularDomain::setHr ( Vector_t hr)
inline

Definition at line 118 of file IrregularDomain.h.

References hr_m.

Referenced by ArbitraryDomain::compute(), BoxCornerDomain::compute(), and EllipticDomain::compute().

◆ setMinMaxZ()

void IrregularDomain::setMinMaxZ ( double minz,
double maxz )
inline

Definition at line 120 of file IrregularDomain.h.

References zMax_m, and zMin_m.

Referenced by EllipticDomain::EllipticDomain(), and RegularDomain::resizeMesh().

◆ setNr()

void IrregularDomain::setNr ( IntVector_t nr)
inline

Definition at line 117 of file IrregularDomain.h.

References nr, and nr_m.

◆ setRangeMax()

void IrregularDomain::setRangeMax ( const Vector_t & max)
inline

Definition at line 136 of file IrregularDomain.h.

References max(), and max_m.

Referenced by ArbitraryDomain::ArbitraryDomain(), BoxCornerDomain::BoxCornerDomain(), and EllipticDomain::EllipticDomain().

Here is the call graph for this function:

◆ setRangeMin()

void IrregularDomain::setRangeMin ( const Vector_t & min)
inline

Definition at line 135 of file IrregularDomain.h.

References min(), and min_m.

Referenced by ArbitraryDomain::ArbitraryDomain(), BoxCornerDomain::BoxCornerDomain(), and EllipticDomain::EllipticDomain().

Here is the call graph for this function:

Member Data Documentation

◆ coordMap_m

std::map<int, int> IrregularDomain::coordMap_m
protected

◆ hasGeometryChanged_m

bool IrregularDomain::hasGeometryChanged_m
protected

flag indicating if geometry has changed for the current time-step

Definition at line 177 of file IrregularDomain.h.

Referenced by ArbitraryDomain::compute(), BoxCornerDomain::compute(), EllipticDomain::compute(), and hasGeometryChanged().

◆ hr_m

◆ idxMap_m

std::map<int, int> IrregularDomain::idxMap_m
protected

◆ interpolationMethod_m

int IrregularDomain::interpolationMethod_m
protected

interpolation type

Definition at line 180 of file IrregularDomain.h.

Referenced by EllipticDomain::compute(), getBoundaryStencil(), and IrregularDomain().

◆ max_m

Vector_t IrregularDomain::max_m
protected

Definition at line 174 of file IrregularDomain.h.

Referenced by getXRangeMax(), getYRangeMax(), getZRangeMax(), resizeMesh(), and setRangeMax().

◆ min_m

Vector_t IrregularDomain::min_m
protected

Definition at line 173 of file IrregularDomain.h.

Referenced by getXRangeMin(), getYRangeMin(), getZRangeMin(), resizeMesh(), and setRangeMin().

◆ nr_m

◆ zMax_m

double IrregularDomain::zMax_m
protected

Definition at line 171 of file IrregularDomain.h.

Referenced by getMaxZ(), and setMinMaxZ().

◆ zMin_m

double IrregularDomain::zMin_m
protected

min/max of bunch in floor coordinates

Definition at line 170 of file IrregularDomain.h.

Referenced by getMinZ(), and setMinMaxZ().


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