OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
BoxCornerDomain Class Reference

#include <BoxCornerDomain.h>

Inheritance diagram for BoxCornerDomain:
Collaboration diagram for BoxCornerDomain:

Public Types

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

Public Member Functions

 BoxCornerDomain (double A, double B, double C, double L1, double L2, IntVector_t nr, Vector_t hr, std::string interpl)
 ~BoxCornerDomain ()
double getB (double z) const
 as a function of z, determine the height (B) of the geometry
bool isInside (int x, int y, int z) const override
 queries if a given (x,y,z) coordinate lies inside the domain
void compute (Vector_t hr, NDIndex< 3 > localId) override
int getNumXY () const override
void setNumXY (int nxy)
void resizeMesh (Vector_t &origin, Vector_t &hr, const Vector_t &rmin, const Vector_t &rmax, double dh) override
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.
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

Protected Member Functions

void robinBoundaryStencil (int z, double &F, double &B, double &C) const
 function to handle the open boundary condition in longitudinal direction

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)

Private Types

typedef std::multimap< std::pair< int, int >, double > BoxCornerPointList

Private Member Functions

double getXIntersection (double cx, int) const
double getYIntersection (double cy, int z) const
int toCoordIdx (int x, int y, int z) const
 conversion from (x,y,z) to index in xyz plane
int indexAccess (int x, int y, int z) const override
 conversion from (x,y,z) to index on the 3D grid
int coordAccess (int idx) const override
void linearInterpolation (int x, int y, int z, StencilValue_t &value, double &scaleFactor) const override
 different interpolation methods for boundary points
void quadraticInterpolation (int x, int y, int z, StencilValue_t &value, double &scaleFactor) const override
void constantInterpolation (int x, int y, int z, StencilValue_t &value, double &scaleFactor) const override
 different interpolation methods for boundary points

Private Attributes

BoxCornerPointList IntersectXDir
 all intersection points with grid lines in X direction
BoxCornerPointList IntersectYDir
 all intersection points with grid lines in Y direction
double actBMin_m
 because the geometry can change in the y direction
double actBMax_m
double C_m
 height of the corner
int nxy_m
 number of nodes in the xy plane (for this case: independent of the z coordinate)

Detailed Description

Definition at line 71 of file BoxCornerDomain.h.

Member Typedef Documentation

◆ BoxCornerPointList

typedef std::multimap< std::pair<int, int>, double > BoxCornerDomain::BoxCornerPointList
private

Map from a ([(x or y], z) to a list of intersection values with boundary.

Definition at line 112 of file BoxCornerDomain.h.

◆ IntVector_t

typedef Vektor<int, 3> IrregularDomain::IntVector_t
inherited

Definition at line 60 of file IrregularDomain.h.

◆ StencilIndex_t

typedef Stencil<int> IrregularDomain::StencilIndex_t
inherited

Definition at line 58 of file IrregularDomain.h.

◆ StencilValue_t

typedef Stencil<double> IrregularDomain::StencilValue_t
inherited

Definition at line 59 of file IrregularDomain.h.

Constructor & Destructor Documentation

◆ BoxCornerDomain()

BoxCornerDomain::BoxCornerDomain ( double A,
double B,
double C,
double L1,
double L2,
IntVector_t nr,
Vector_t hr,
std::string interpl )
Parameters
Adepth of the box
Bmaximal height of the box
Cheight of the corner
lengthof the structure
L1length of the first part of the structure
L2length of the corner

Definition at line 36 of file BoxCornerDomain.cpp.

References C_m, nr, RegularDomain::RegularDomain(), IrregularDomain::setRangeMax(), and IrregularDomain::setRangeMin().

Here is the call graph for this function:

◆ ~BoxCornerDomain()

BoxCornerDomain::~BoxCornerDomain ( )

Definition at line 49 of file BoxCornerDomain.cpp.

Member Function Documentation

◆ compute()

void BoxCornerDomain::compute ( Vector_t hr,
NDIndex< 3 > localId )
overridevirtual

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

Parameters
hrupdated mesh spacings

Implements IrregularDomain.

Definition at line 59 of file BoxCornerDomain.cpp.

References actBMax_m, actBMin_m, IrregularDomain::coordMap_m, getB(), IrregularDomain::getMaxZ(), IrregularDomain::getMinZ(), IrregularDomain::getYRangeMin(), IrregularDomain::hasGeometryChanged_m, IrregularDomain::idxMap_m, IntersectXDir, IntersectYDir, isInside(), IrregularDomain::nr_m, IrregularDomain::setHr(), and toCoordIdx().

Here is the call graph for this function:

◆ constantInterpolation()

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

different interpolation methods for boundary points

Reimplemented from IrregularDomain.

Definition at line 48 of file RegularDomain.cpp.

References IrregularDomain::Stencil< T >::back, IrregularDomain::Stencil< T >::center, IrregularDomain::Stencil< T >::east, IrregularDomain::Stencil< T >::front, IrregularDomain::hr_m, IrregularDomain::isInside(), IrregularDomain::Stencil< T >::north, robinBoundaryStencil(), IrregularDomain::Stencil< T >::south, and IrregularDomain::Stencil< T >::west.

Here is the call graph for this function:

◆ coordAccess()

int BoxCornerDomain::coordAccess ( int idx) const
inlineoverrideprivatevirtual

Implements IrregularDomain.

Definition at line 146 of file BoxCornerDomain.h.

References IrregularDomain::coordMap_m.

◆ getB()

double BoxCornerDomain::getB ( double z) const
inline

as a function of z, determine the height (B) of the geometry

Definition at line 88 of file BoxCornerDomain.h.

References C_m, IrregularDomain::getYRangeMax(), IrregularDomain::getZRangeMax(), and IrregularDomain::getZRangeMin().

Referenced by compute(), getYIntersection(), and isInside().

Here is the call graph for this function:

◆ getBoundaryStencil() [1/2]

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

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
inherited

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
virtualinherited

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
inlineinherited

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
inherited

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
inlineinherited

Definition at line 126 of file IrregularDomain.h.

References zMax_m.

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

◆ getMinZ()

double IrregularDomain::getMinZ ( ) const
inlineinherited

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
inherited

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
inherited

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
inlineinherited

Definition at line 114 of file IrregularDomain.h.

References nr_m.

◆ getNumXY()

int RegularDomain::getNumXY ( ) const
inlineoverridevirtualinherited

◆ getXIntersection()

double BoxCornerDomain::getXIntersection ( double cx,
int  ) const
inlineprivate

Definition at line 128 of file BoxCornerDomain.h.

References IrregularDomain::getXRangeMax(), and IrregularDomain::getXRangeMin().

Referenced by linearInterpolation(), and quadraticInterpolation().

Here is the call graph for this function:

◆ getXRangeMax()

double IrregularDomain::getXRangeMax ( ) const
inlineinherited

◆ getXRangeMin()

double IrregularDomain::getXRangeMin ( ) const
inlineinherited

◆ getYIntersection()

double BoxCornerDomain::getYIntersection ( double cy,
int z ) const
inlineprivate

Definition at line 132 of file BoxCornerDomain.h.

References getB(), IrregularDomain::getYRangeMin(), and IrregularDomain::hr_m.

Referenced by linearInterpolation(), and quadraticInterpolation().

Here is the call graph for this function:

◆ getYRangeMax()

double IrregularDomain::getYRangeMax ( ) const
inlineinherited

◆ getYRangeMin()

◆ getZRangeMax()

double IrregularDomain::getZRangeMax ( ) const
inlineinherited

Definition at line 133 of file IrregularDomain.h.

References max_m.

Referenced by BoxCornerDomain::getB().

◆ getZRangeMin()

double IrregularDomain::getZRangeMin ( ) const
inlineinherited

Definition at line 132 of file IrregularDomain.h.

References min_m.

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

◆ hasGeometryChanged()

bool IrregularDomain::hasGeometryChanged ( ) const
inlineinherited

Definition at line 138 of file IrregularDomain.h.

References hasGeometryChanged_m.

◆ indexAccess()

int BoxCornerDomain::indexAccess ( int x,
int y,
int z ) const
inlineoverrideprivatevirtual

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

Implements IrregularDomain.

Definition at line 142 of file BoxCornerDomain.h.

References IrregularDomain::idxMap_m, and toCoordIdx().

Here is the call graph for this function:

◆ isInside()

bool BoxCornerDomain::isInside ( int x,
int y,
int z ) const
inlineoverridevirtual

queries if a given (x,y,z) coordinate lies inside the domain

Implements IrregularDomain.

Definition at line 96 of file BoxCornerDomain.h.

References getB(), IrregularDomain::getXRangeMax(), IrregularDomain::hr_m, and IrregularDomain::nr_m.

Referenced by compute(), linearInterpolation(), and quadraticInterpolation().

Here is the call graph for this function:

◆ linearInterpolation()

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

different interpolation methods for boundary points

Reimplemented from IrregularDomain.

Definition at line 131 of file BoxCornerDomain.cpp.

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

Here is the call graph for this function:

◆ quadraticInterpolation()

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

◆ resizeMesh()

void RegularDomain::resizeMesh ( Vector_t & origin,
Vector_t & hr,
const Vector_t & rmin,
const Vector_t & rmax,
double dh )
overridevirtualinherited

Reimplemented from IrregularDomain.

Definition at line 29 of file RegularDomain.cpp.

References IrregularDomain::getMaxZ(), IrregularDomain::getMinZ(), IrregularDomain::getXRangeMax(), IrregularDomain::getXRangeMin(), IrregularDomain::getYRangeMax(), IrregularDomain::getYRangeMin(), IrregularDomain::nr_m, and IrregularDomain::setMinMaxZ().

Here is the call graph for this function:

◆ robinBoundaryStencil()

void RegularDomain::robinBoundaryStencil ( int z,
double & F,
double & B,
double & C ) const
protectedinherited

function to handle the open boundary condition in longitudinal direction

Definition at line 84 of file RegularDomain.cpp.

References IrregularDomain::hr_m, and IrregularDomain::nr_m.

Referenced by constantInterpolation(), EllipticDomain::linearInterpolation(), and EllipticDomain::quadraticInterpolation().

◆ setHr()

void IrregularDomain::setHr ( Vector_t hr)
inlineinherited

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 )
inlineinherited

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)
inlineinherited

Definition at line 117 of file IrregularDomain.h.

References nr, and nr_m.

◆ setNumXY()

void RegularDomain::setNumXY ( int nxy)
inlineinherited

Definition at line 36 of file RegularDomain.h.

References nxy_m.

Referenced by EllipticDomain::compute().

◆ setRangeMax()

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

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)
inlineinherited

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:

◆ toCoordIdx()

int BoxCornerDomain::toCoordIdx ( int x,
int y,
int z ) const
inlineprivate

conversion from (x,y,z) to index in xyz plane

Definition at line 137 of file BoxCornerDomain.h.

References IrregularDomain::nr_m.

Referenced by compute(), and indexAccess().

Member Data Documentation

◆ actBMax_m

double BoxCornerDomain::actBMax_m
private

Definition at line 123 of file BoxCornerDomain.h.

Referenced by compute().

◆ actBMin_m

double BoxCornerDomain::actBMin_m
private

because the geometry can change in the y direction

Definition at line 121 of file BoxCornerDomain.h.

Referenced by compute().

◆ C_m

double BoxCornerDomain::C_m
private

height of the corner

Definition at line 126 of file BoxCornerDomain.h.

Referenced by BoxCornerDomain(), and getB().

◆ coordMap_m

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

◆ hasGeometryChanged_m

bool IrregularDomain::hasGeometryChanged_m
protectedinherited

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
protectedinherited

◆ interpolationMethod_m

int IrregularDomain::interpolationMethod_m
protectedinherited

interpolation type

Definition at line 180 of file IrregularDomain.h.

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

◆ IntersectXDir

BoxCornerPointList BoxCornerDomain::IntersectXDir
private

all intersection points with grid lines in X direction

Definition at line 115 of file BoxCornerDomain.h.

Referenced by compute().

◆ IntersectYDir

BoxCornerPointList BoxCornerDomain::IntersectYDir
private

all intersection points with grid lines in Y direction

Definition at line 118 of file BoxCornerDomain.h.

Referenced by compute().

◆ max_m

Vector_t IrregularDomain::max_m
protectedinherited

Definition at line 174 of file IrregularDomain.h.

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

◆ min_m

Vector_t IrregularDomain::min_m
protectedinherited

Definition at line 173 of file IrregularDomain.h.

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

◆ nr_m

◆ nxy_m

int RegularDomain::nxy_m
privateinherited

number of nodes in the xy plane (for this case: independent of the z coordinate)

Definition at line 50 of file RegularDomain.h.

Referenced by getNumXY(), RegularDomain(), and setNumXY().

◆ zMax_m

double IrregularDomain::zMax_m
protectedinherited

Definition at line 171 of file IrregularDomain.h.

Referenced by getMaxZ(), and setMinMaxZ().

◆ zMin_m

double IrregularDomain::zMin_m
protectedinherited

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: