OPALX (Object Oriented Parallel Accelerator Library for Exascale) MINIorX
OPALX
interpolation::ThreeDGrid Class Reference

ThreeDGrid holds grid information for a rectangular grid used in e.g. More...

#include <ThreeDGrid.h>

Inheritance diagram for interpolation::ThreeDGrid:
Inheritance graph
Collaboration diagram for interpolation::ThreeDGrid:
Collaboration graph

Public Member Functions

ThreeDGridclone ()
 Deep copy the grid. More...
 
Meshdual () const
 Not implemented (returns nullptr) More...
 
 ThreeDGrid ()
 Default constructor. More...
 
 ThreeDGrid (double dX, double dY, double dZ, double minX, double minY, double minZ, int numberOfXCoords, int numberOfYCoords, int numberOfZCoords)
 Make a regular rectangular ThreeDGrid. More...
 
 ThreeDGrid (int xSize, const double *x, int ySize, const double *y, int zSize, const double *z)
 Make a irregular rectangular ThreeDGrid. More...
 
 ThreeDGrid (std::vector< double > x, std::vector< double > y, std::vector< double > z)
 Make a irregular rectangular ThreeDGrid. More...
 
 ~ThreeDGrid ()
 Destructor. More...
 
double & x (const int &i)
 Get ith coordinate in x. More...
 
double & y (const int &j)
 Get ith coordinate in y. More...
 
double & z (const int &k)
 Get ith coordinate in z. More...
 
const double & x (const int &i) const
 Get ith coordinate in x. More...
 
const double & y (const int &j) const
 Get ith coordinate in y. More...
 
const double & z (const int &j) const
 Get ith coordinate in z. More...
 
int xSize () const
 Get size of x data. More...
 
int ySize () const
 Get size of y data. More...
 
int zSize () const
 Get size of z data. More...
 
std::vector< double > xVector ()
 Get vector containing x grid data. More...
 
std::vector< double > yVector ()
 Get vector containing y grid data. More...
 
std::vector< double > zVector ()
 Get vector containing z grid data. More...
 
double * newXArray ()
 Allocate a new array containing x grid data. More...
 
double * newYArray ()
 Allocate a new array containing y grid data. More...
 
double * newZArray ()
 Allocate a new array containing z grid data. More...
 
void xLowerBound (const double &x, int &xIndex) const
 Find the index of the nearest point less than x. More...
 
void yLowerBound (const double &y, int &yIndex) const
 Find the index of the nearest point less than y. More...
 
void zLowerBound (const double &z, int &zIndex) const
 Find the index of the nearest point less than z. More...
 
void lowerBound (const double &x, int &xIndex, const double &y, int &yIndex, const double &z, int &zIndex) const
 Find the indices of the nearest point on the grid less than x, y, z. More...
 
void lowerBound (const double &x, const double &y, const double &z, Mesh::Iterator &it) const
 Find the iterator of the nearest point on the grid less than x, y, z. More...
 
double minX () const
 Return the smallest value of x in the grid. More...
 
double maxX () const
 Return the largest value of x in the grid. More...
 
double minY () const
 Return the smallest value of y in the grid. More...
 
double maxY () const
 Return the largest value of y in the grid. More...
 
double minZ () const
 Return the smallest value of z in the grid. More...
 
double maxZ () const
 Return the largest value of z in the grid. More...
 
void setX (int nXCoords, double *x)
 Reset x grid points - note may need to set SetConstantSpacing() More...
 
void setY (int nYCoords, double *y)
 Reset y grid points - note may need to set SetConstantSpacing() More...
 
void setZ (int nZCoords, double *z)
 Reset z grid points - note may need to set SetConstantSpacing() More...
 
void add (VectorMap *map)
 Add *map to the maps_m list if it has not already been added. More...
 
void remove (VectorMap *map)
 Remove *map from the maps_m list if it has not already been removed. More...
 
Mesh::Iterator begin () const
 Return an iterator pointing at the first element in the ThreeDGrid. More...
 
Mesh::Iterator end () const
 Return an iterator pointing at the last+1 element in the ThreeDGrid. More...
 
virtual void getPosition (const Mesh::Iterator &it, double *position) const
 Fill position with the position of it. More...
 
int getPositionDimension () const
 Returns 3, the dimension of the space of the grid. More...
 
int toInteger (const Mesh::Iterator &lhs) const
 Converts from iterator to integer value. More...
 
void setConstantSpacing (bool spacing)
 Set to true to use constant spacing. More...
 
void setConstantSpacing ()
 Autodetect constant spacing with float tolerance of 1e-9. More...
 
bool getConstantSpacing () const
 Return true if using constant spacing. More...
 
Mesh::Iterator getNearest (const double *position) const
 Return the point in the mesh nearest to position. More...
 

Static Public Member Functions

static void vectorLowerBound (std::vector< double > vec, double x, int &index)
 Custom LowerBound routine like std::lower_bound. More...
 

Protected Member Functions

virtual Mesh::IteratoraddEquals (Mesh::Iterator &lhs, int difference) const
 Add difference to lhs and then return lhs. More...
 
virtual Mesh::IteratorsubEquals (Mesh::Iterator &lhs, int difference) const
 Subtract difference from lhs and then return lhs. More...
 
virtual Mesh::IteratoraddEquals (Mesh::Iterator &lhs, const Mesh::Iterator &rhs) const
 Add difference to lhs and then return lhs. More...
 
virtual Mesh::IteratorsubEquals (Mesh::Iterator &lhs, const Mesh::Iterator &rhs) const
 Subtract difference from lhs and then return lhs. More...
 
virtual Mesh::IteratoraddOne (Mesh::Iterator &lhs) const
 Increment position of lhs by one and then return lhs. More...
 
virtual Mesh::IteratorsubOne (Mesh::Iterator &lhs) const
 Decrement position of lhs by one and then return lhs. More...
 
virtual bool isGreater (const Mesh::Iterator &lhs, const Mesh::Iterator &rhs) const
 Return true if rhs is greater than lhs. More...
 

Private Attributes

std::vector< double > x_m
 
std::vector< double > y_m
 
std::vector< double > z_m
 
int xSize_m
 
int ySize_m
 
int zSize_m
 
std::vector< VectorMap * > maps_m
 
bool constantSpacing_m
 

Friends

Mesh::Iterator operator++ (Mesh::Iterator &lhs, int)
 Postfix increment operator it++ advances iterator by one. More...
 
Mesh::Iterator operator-- (Mesh::Iterator &lhs, int)
 Postfix decrement operator it– retreats iterator by one. More...
 
Mesh::Iteratoroperator++ (Mesh::Iterator &lhs)
 Prefix increment operator ++it. More...
 
Mesh::Iteratoroperator-- (Mesh::Iterator &lhs)
 Prefix decrement operator –it retreats iterator by one
More...
 
Mesh::Iterator operator- (const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 Subtraction operator - subtracts offset of rhs relative to Begin() from lhs. More...
 
Mesh::Iterator operator+ (const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 Addition operator - adds offset of rhs of rhs relative to Begin() to lhs. More...
 
Mesh::Iteratoroperator-= (Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 Subtraction operator - subtracts offset of rhs relative to Begin() from lhs and returns lhs. More...
 
Mesh::Iteratoroperator+= (Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 Addition operator - adds offset of rhs of rhs relative to Begin() to lhs and returns lhs. More...
 
bool operator== (const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 Return true if lhs indexes the same position as rhs. More...
 
bool operator!= (const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 Return true if lhs does not index the same position as rhs. More...
 
bool operator>= (const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 Return true if lhs indexes a position greater than or equal to rhs i.e. More...
 
bool operator<= (const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 Return true if lhs indexes a position less than or equal to rhs i.e. More...
 
bool operator< (const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 Return true if lhs indexes a position less than rhs i.e. More...
 
bool operator> (const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
 Return true if lhs indexes a position greater than rhs i.e. More...
 

Detailed Description

ThreeDGrid holds grid information for a rectangular grid used in e.g.

interpolation

ThreeDGrid holds the necessary information for regular and irregular grid data for interpolation routines.

Constructor is provided to generate a regular grid given grid spacing etc and an irregular grid given lists of x, y, z data for the grid points. Nearest either calculates nearest grid point a priori for regular grids or uses std::lower_bound to calculate nearest grid point (list bisection or somesuch). Controlled by _constantSpacing flag. The regular spacing lookup is quicker, so prefer constant spacing.

ThreeDGrid holds a list of pointers to VectorMaps that use the grid for interpolation and functions to Add and Remove VectorMaps. If the Remove function removes the last VectorMap, then the ThreeDGrid is deleted. It's a sort of smart pointer.

Definition at line 57 of file ThreeDGrid.h.

Constructor & Destructor Documentation

◆ ThreeDGrid() [1/4]

interpolation::ThreeDGrid::ThreeDGrid ( )

Default constructor.

Definition at line 33 of file ThreeDGrid.cpp.

References setConstantSpacing(), x_m, y_m, and z_m.

Referenced by clone(), and dual().

Here is the call graph for this function:

◆ ThreeDGrid() [2/4]

interpolation::ThreeDGrid::ThreeDGrid ( double  dX,
double  dY,
double  dZ,
double  minX,
double  minY,
double  minZ,
int  numberOfXCoords,
int  numberOfYCoords,
int  numberOfZCoords 
)

Make a regular rectangular ThreeDGrid.

Set up a ThreeDGrid with regular grid spacing (same distance between every point)

Parameters
dXstep size in x; should be positive
dYstep size in y; should be positive
dZstep size in z; should be positive
minXx position of grid lower edge
minYy position of grid lower edge
minZz position of grid lower edge
numberOfXCoordsnumber of x coordinates on grid; should be > 1
numberOfYCoordsnumber of y coordinates on grid; should be > 1
numberOfZCoordsnumber of z coordinates on grid; should be > 1

Definition at line 70 of file ThreeDGrid.cpp.

References minX(), minY(), minZ(), setConstantSpacing(), x_m, y_m, and z_m.

Here is the call graph for this function:

◆ ThreeDGrid() [3/4]

interpolation::ThreeDGrid::ThreeDGrid ( int  xSize,
const double *  x,
int  ySize,
const double *  y,
int  zSize,
const double *  z 
)

Make a irregular rectangular ThreeDGrid.

Set up a ThreeDGrid with irregular grid spacing

Parameters
xSizenumber of points in x
xx points array
ySizenumber of points in y
yy points array
zSizenumber of points in Z
zz point array ThreeDGrid deep copies the data pointed to by x, y, z (i.e. it does not take ownership of these arrays).

Definition at line 40 of file ThreeDGrid.cpp.

References setConstantSpacing(), xSize_m, ySize_m, and zSize_m.

Here is the call graph for this function:

◆ ThreeDGrid() [4/4]

interpolation::ThreeDGrid::ThreeDGrid ( std::vector< double >  x,
std::vector< double >  y,
std::vector< double >  z 
)

Make a irregular rectangular ThreeDGrid.

Set up a ThreeDGrid with irregular grid spacing

Parameters
xx points array
yy points array
zz point array

Definition at line 55 of file ThreeDGrid.cpp.

References setConstantSpacing(), xSize_m, ySize_m, and zSize_m.

Here is the call graph for this function:

◆ ~ThreeDGrid()

interpolation::ThreeDGrid::~ThreeDGrid ( )

Destructor.

Definition at line 87 of file ThreeDGrid.cpp.

Member Function Documentation

◆ add()

void interpolation::ThreeDGrid::add ( VectorMap map)

Add *map to the maps_m list if it has not already been added.

Definition at line 257 of file ThreeDGrid.cpp.

References Expressions::find(), and maps_m.

Referenced by interpolation::Interpolator3dGridTo3d::setAll(), interpolation::Interpolator3dGridTo1d::setGrid(), interpolation::Interpolator3dGridTo3d::setGrid(), and interpolation::TriLinearInterpolator::TriLinearInterpolator().

Here is the call graph for this function:

◆ addEquals() [1/2]

Mesh::Iterator & interpolation::ThreeDGrid::addEquals ( Mesh::Iterator lhs,
const Mesh::Iterator rhs 
) const
protectedvirtual

Add difference to lhs and then return lhs.

Implements interpolation::Mesh.

Definition at line 192 of file ThreeDGrid.cpp.

References addEquals(), and interpolation::Mesh::Iterator::toInteger().

Here is the call graph for this function:

◆ addEquals() [2/2]

Mesh::Iterator & interpolation::ThreeDGrid::addEquals ( Mesh::Iterator lhs,
int  difference 
) const
protectedvirtual

Add difference to lhs and then return lhs.

Implements interpolation::Mesh.

Definition at line 124 of file ThreeDGrid.cpp.

References interpolation::Mesh::Iterator::state_m, subEquals(), ySize_m, and zSize_m.

Referenced by addEquals(), and subEquals().

Here is the call graph for this function:

◆ addOne()

Mesh::Iterator & interpolation::ThreeDGrid::addOne ( Mesh::Iterator lhs) const
protectedvirtual

Increment position of lhs by one and then return lhs.

Implements interpolation::Mesh.

Definition at line 202 of file ThreeDGrid.cpp.

References interpolation::Mesh::Iterator::state_m, ySize_m, and zSize_m.

◆ begin()

Mesh::Iterator interpolation::ThreeDGrid::begin ( ) const
virtual

Return an iterator pointing at the first element in the ThreeDGrid.

Implements interpolation::Mesh.

Definition at line 91 of file ThreeDGrid.cpp.

Referenced by DumpFields::writeFieldThis().

◆ clone()

ThreeDGrid * interpolation::ThreeDGrid::clone ( )
inlinevirtual

Deep copy the grid.

Implements interpolation::Mesh.

Definition at line 62 of file ThreeDGrid.h.

References ThreeDGrid().

Referenced by DumpFields::clone().

Here is the call graph for this function:

◆ dual()

Mesh * interpolation::ThreeDGrid::dual ( ) const
virtual

Not implemented (returns nullptr)

Implements interpolation::Mesh.

Definition at line 108 of file ThreeDGrid.cpp.

References ThreeDGrid(), x_m, y_m, and z_m.

Here is the call graph for this function:

◆ end()

Mesh::Iterator interpolation::ThreeDGrid::end ( ) const
virtual

Return an iterator pointing at the last+1 element in the ThreeDGrid.

Implements interpolation::Mesh.

Definition at line 95 of file ThreeDGrid.cpp.

References end(), and xSize_m.

Referenced by end(), and DumpFields::writeFieldThis().

Here is the call graph for this function:

◆ getConstantSpacing()

bool interpolation::ThreeDGrid::getConstantSpacing ( ) const
inline

Return true if using constant spacing.

Definition at line 472 of file ThreeDGrid.h.

References constantSpacing_m.

◆ getNearest()

Mesh::Iterator interpolation::ThreeDGrid::getNearest ( const double *  position) const
virtual

Return the point in the mesh nearest to position.

Implements interpolation::Mesh.

Definition at line 284 of file ThreeDGrid.cpp.

References lowerBound(), x_m, xSize_m, y_m, ySize_m, z_m, and zSize_m.

Here is the call graph for this function:

◆ getPosition()

void interpolation::ThreeDGrid::getPosition ( const Mesh::Iterator it,
double *  position 
) const
virtual

Fill position with the position of it.

Parameters
ititerator pointing at a grid position
positionarray of length >= 3 that will be filled with the position of it

Implements interpolation::Mesh.

Definition at line 101 of file ThreeDGrid.cpp.

References interpolation::Mesh::Iterator::state_m, x(), y(), and z().

Here is the call graph for this function:

◆ getPositionDimension()

int interpolation::ThreeDGrid::getPositionDimension ( ) const
inlinevirtual

Returns 3, the dimension of the space of the grid.

Implements interpolation::Mesh.

Definition at line 458 of file ThreeDGrid.h.

◆ isGreater()

bool interpolation::ThreeDGrid::isGreater ( const Mesh::Iterator lhs,
const Mesh::Iterator rhs 
) const
protectedvirtual

Return true if rhs is greater than lhs.

Implements interpolation::Mesh.

Definition at line 230 of file ThreeDGrid.cpp.

References interpolation::Mesh::Iterator::state_m.

◆ lowerBound() [1/2]

void interpolation::ThreeDGrid::lowerBound ( const double &  x,
const double &  y,
const double &  z,
Mesh::Iterator it 
) const
inline

Find the iterator of the nearest point on the grid less than x, y, z.

Note that in the case of a regular grid there is no bound checking; in the case of an irregular grid we always return an element in the grid

Definition at line 387 of file ThreeDGrid.h.

References x(), xLowerBound(), y(), yLowerBound(), z(), and zLowerBound().

Here is the call graph for this function:

◆ lowerBound() [2/2]

void interpolation::ThreeDGrid::lowerBound ( const double &  x,
int &  xIndex,
const double &  y,
int &  yIndex,
const double &  z,
int &  zIndex 
) const
inline

Find the indices of the nearest point on the grid less than x, y, z.

Note that in the case of a regular grid there is no bound checking; in the case of an irregular grid we always return an element in the grid

Definition at line 379 of file ThreeDGrid.h.

References x(), xLowerBound(), y(), yLowerBound(), z(), and zLowerBound().

Referenced by interpolation::TriLinearInterpolator::function(), and getNearest().

Here is the call graph for this function:

◆ maxX()

double interpolation::ThreeDGrid::maxX ( ) const
inline

Return the largest value of x in the grid.

Definition at line 426 of file ThreeDGrid.h.

References x_m, and xSize_m.

Referenced by interpolation::Interpolator3dGridTo3d::function(), and SectorMagneticFieldMap::setInterpolator().

◆ maxY()

double interpolation::ThreeDGrid::maxY ( ) const
inline

Return the largest value of y in the grid.

Definition at line 434 of file ThreeDGrid.h.

References y_m, and ySize_m.

Referenced by interpolation::Interpolator3dGridTo3d::function(), and SectorMagneticFieldMap::setInterpolator().

◆ maxZ()

double interpolation::ThreeDGrid::maxZ ( ) const
inline

Return the largest value of z in the grid.

Definition at line 442 of file ThreeDGrid.h.

References z_m, and zSize_m.

Referenced by interpolation::Interpolator3dGridTo3d::function(), SectorMagneticFieldMap::getDeltaPhi(), and SectorMagneticFieldMap::setInterpolator().

◆ minX()

double interpolation::ThreeDGrid::minX ( ) const
inline

Return the smallest value of x in the grid.

Definition at line 422 of file ThreeDGrid.h.

References x_m.

Referenced by interpolation::Interpolator3dGridTo3d::function(), SectorMagneticFieldMap::setInterpolator(), and ThreeDGrid().

◆ minY()

double interpolation::ThreeDGrid::minY ( ) const
inline

Return the smallest value of y in the grid.

Definition at line 430 of file ThreeDGrid.h.

References y_m.

Referenced by interpolation::Interpolator3dGridTo3d::function(), SectorMagneticFieldMap::setInterpolator(), and ThreeDGrid().

◆ minZ()

double interpolation::ThreeDGrid::minZ ( ) const
inline

◆ newXArray()

double * interpolation::ThreeDGrid::newXArray ( )
inline

Allocate a new array containing x grid data.

Definition at line 358 of file ThreeDGrid.h.

References x(), and x_m.

Here is the call graph for this function:

◆ newYArray()

double * interpolation::ThreeDGrid::newYArray ( )
inline

Allocate a new array containing y grid data.

Definition at line 365 of file ThreeDGrid.h.

References y(), and y_m.

Here is the call graph for this function:

◆ newZArray()

double * interpolation::ThreeDGrid::newZArray ( )
inline

Allocate a new array containing z grid data.

Definition at line 372 of file ThreeDGrid.h.

References z(), and z_m.

Here is the call graph for this function:

◆ remove()

void interpolation::ThreeDGrid::remove ( VectorMap map)

Remove *map from the maps_m list if it has not already been removed.

If there are no more maps in the list, delete this

Definition at line 245 of file ThreeDGrid.cpp.

References Expressions::find(), and maps_m.

Referenced by interpolation::Interpolator3dGridTo1d::clear(), interpolation::Interpolator3dGridTo3d::clear(), interpolation::Interpolator3dGridTo3d::setAll(), interpolation::Interpolator3dGridTo1d::setGrid(), and interpolation::Interpolator3dGridTo3d::setGrid().

Here is the call graph for this function:

◆ setConstantSpacing() [1/2]

void interpolation::ThreeDGrid::setConstantSpacing ( )

Autodetect constant spacing with float tolerance of 1e-9.

Definition at line 265 of file ThreeDGrid.cpp.

References constantSpacing_m, Physics::e, x_m, y_m, and z_m.

Referenced by ThreeDGrid().

◆ setConstantSpacing() [2/2]

void interpolation::ThreeDGrid::setConstantSpacing ( bool  spacing)
inline

Set to true to use constant spacing.

If constant spacing is true, assume regular grid with spacing given by separation of first two elements in each dimension

Definition at line 468 of file ThreeDGrid.h.

References constantSpacing_m.

Referenced by SectorMagneticFieldMap::IO::generateGrid().

◆ setX()

void interpolation::ThreeDGrid::setX ( int  nXCoords,
double *  x 
)
inline

Reset x grid points - note may need to set SetConstantSpacing()

Definition at line 446 of file ThreeDGrid.h.

References x(), and x_m.

Referenced by interpolation::Interpolator3dGridTo1d::setX(), and interpolation::Interpolator3dGridTo3d::setX().

Here is the call graph for this function:

◆ setY()

void interpolation::ThreeDGrid::setY ( int  nYCoords,
double *  y 
)
inline

Reset y grid points - note may need to set SetConstantSpacing()

Definition at line 450 of file ThreeDGrid.h.

References y(), and y_m.

Referenced by interpolation::Interpolator3dGridTo1d::setY(), and interpolation::Interpolator3dGridTo3d::setY().

Here is the call graph for this function:

◆ setZ()

void interpolation::ThreeDGrid::setZ ( int  nZCoords,
double *  z 
)
inline

Reset z grid points - note may need to set SetConstantSpacing()

Definition at line 454 of file ThreeDGrid.h.

References z(), and z_m.

Referenced by interpolation::Interpolator3dGridTo1d::setZ(), and interpolation::Interpolator3dGridTo3d::setZ().

Here is the call graph for this function:

◆ subEquals() [1/2]

Mesh::Iterator & interpolation::ThreeDGrid::subEquals ( Mesh::Iterator lhs,
const Mesh::Iterator rhs 
) const
protectedvirtual

Subtract difference from lhs and then return lhs.

Implements interpolation::Mesh.

Definition at line 197 of file ThreeDGrid.cpp.

References subEquals(), and interpolation::Mesh::Iterator::toInteger().

Here is the call graph for this function:

◆ subEquals() [2/2]

Mesh::Iterator & interpolation::ThreeDGrid::subEquals ( Mesh::Iterator lhs,
int  difference 
) const
protectedvirtual

Subtract difference from lhs and then return lhs.

Implements interpolation::Mesh.

Definition at line 146 of file ThreeDGrid.cpp.

References addEquals(), interpolation::Mesh::Iterator::state_m, ySize_m, and zSize_m.

Referenced by addEquals(), and subEquals().

Here is the call graph for this function:

◆ subOne()

Mesh::Iterator & interpolation::ThreeDGrid::subOne ( Mesh::Iterator lhs) const
protectedvirtual

Decrement position of lhs by one and then return lhs.

Implements interpolation::Mesh.

Definition at line 215 of file ThreeDGrid.cpp.

References interpolation::Mesh::Iterator::state_m, ySize_m, and zSize_m.

◆ toInteger()

int interpolation::ThreeDGrid::toInteger ( const Mesh::Iterator lhs) const
inlinevirtual

Converts from iterator to integer value.

0 corresponds to the mesh beginning. integers index (right most index) indexes z, middle index is y, most significant (left most index) indexes x.

Implements interpolation::Mesh.

Definition at line 462 of file ThreeDGrid.h.

References interpolation::Mesh::Iterator::getState(), ySize_m, and zSize_m.

Here is the call graph for this function:

◆ vectorLowerBound()

void interpolation::ThreeDGrid::vectorLowerBound ( std::vector< double >  vec,
double  x,
int &  index 
)
static

Custom LowerBound routine like std::lower_bound.

Make a binary search to find the element in vec with vec[i] <= x.

Parameters
vecSTL vector object (could make this any sorted iterator...)
xobject for which to search.
indexvectorLowerBound sets index to the position of the element. If x < vec[0], vectorLowerBound fills with -1.

Definition at line 168 of file ThreeDGrid.cpp.

References x().

Referenced by xLowerBound(), yLowerBound(), and zLowerBound().

Here is the call graph for this function:

◆ x() [1/2]

double & interpolation::ThreeDGrid::x ( const int &  i)
inline

Get ith coordinate in x.

Round bracket indexing starts at 1 goes to nCoords

Definition at line 122 of file ThreeDGrid.h.

References x_m.

Referenced by interpolation::TriLinearInterpolator::function(), getPosition(), lowerBound(), newXArray(), setX(), vectorLowerBound(), and xLowerBound().

◆ x() [2/2]

const double & interpolation::ThreeDGrid::x ( const int &  i) const
inline

Get ith coordinate in x.

Round bracket indexing starts at 1 goes to nCoords

Definition at line 140 of file ThreeDGrid.h.

References x_m.

◆ xLowerBound()

void interpolation::ThreeDGrid::xLowerBound ( const double &  x,
int &  xIndex 
) const
inline

Find the index of the nearest point less than x.

Note that in the case of a regular grid there is no bound checking; in the case of an irregular grid we always return an element in the grid

Definition at line 399 of file ThreeDGrid.h.

References constantSpacing_m, vectorLowerBound(), x(), and x_m.

Referenced by lowerBound().

Here is the call graph for this function:

◆ xSize()

◆ xVector()

std::vector< double > interpolation::ThreeDGrid::xVector ( )
inline

Get vector containing x grid data.

Definition at line 164 of file ThreeDGrid.h.

References x_m.

◆ y() [1/2]

double & interpolation::ThreeDGrid::y ( const int &  j)
inline

Get ith coordinate in y.

Round bracket indexing starts at 1 goes to nCoords

Definition at line 128 of file ThreeDGrid.h.

References y_m.

Referenced by interpolation::TriLinearInterpolator::function(), getPosition(), lowerBound(), newYArray(), setY(), and yLowerBound().

◆ y() [2/2]

const double & interpolation::ThreeDGrid::y ( const int &  j) const
inline

Get ith coordinate in y.

Round bracket indexing starts at 1 goes to nCoords

Definition at line 146 of file ThreeDGrid.h.

References y_m.

◆ yLowerBound()

void interpolation::ThreeDGrid::yLowerBound ( const double &  y,
int &  yIndex 
) const
inline

Find the index of the nearest point less than y.

Note that in the case of a regular grid there is no bound checking; in the case of an irregular grid we always return an element in the grid

Definition at line 408 of file ThreeDGrid.h.

References constantSpacing_m, vectorLowerBound(), y(), and y_m.

Referenced by lowerBound().

Here is the call graph for this function:

◆ ySize()

◆ yVector()

std::vector< double > interpolation::ThreeDGrid::yVector ( )
inline

Get vector containing y grid data.

Definition at line 167 of file ThreeDGrid.h.

References y_m.

◆ z() [1/2]

const double & interpolation::ThreeDGrid::z ( const int &  j) const
inline

Get ith coordinate in z.

Round bracket indexing starts at 1 goes to nCoords

Definition at line 152 of file ThreeDGrid.h.

References z_m.

◆ z() [2/2]

double & interpolation::ThreeDGrid::z ( const int &  k)
inline

Get ith coordinate in z.

Round bracket indexing starts at 1 goes to nCoords

Definition at line 134 of file ThreeDGrid.h.

References z_m.

Referenced by interpolation::TriLinearInterpolator::function(), getPosition(), lowerBound(), newZArray(), setZ(), and zLowerBound().

◆ zLowerBound()

void interpolation::ThreeDGrid::zLowerBound ( const double &  z,
int &  zIndex 
) const
inline

Find the index of the nearest point less than z.

Note that in the case of a regular grid there is no bound checking; in the case of an irregular grid we always return an element in the grid

Definition at line 415 of file ThreeDGrid.h.

References constantSpacing_m, vectorLowerBound(), z(), and z_m.

Referenced by lowerBound().

Here is the call graph for this function:

◆ zSize()

◆ zVector()

std::vector< double > interpolation::ThreeDGrid::zVector ( )
inline

Get vector containing z grid data.

Definition at line 170 of file ThreeDGrid.h.

References z_m.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Return true if lhs does not index the same position as rhs.

◆ operator+

Mesh::Iterator operator+ ( const Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Addition operator - adds offset of rhs of rhs relative to Begin() to lhs.

◆ operator++ [1/2]

Mesh::Iterator & operator++ ( Mesh::Iterator lhs)
friend

Prefix increment operator ++it.

◆ operator++ [2/2]

Mesh::Iterator operator++ ( Mesh::Iterator lhs,
int   
)
friend

Postfix increment operator it++ advances iterator by one.

◆ operator+=

Mesh::Iterator & operator+= ( Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Addition operator - adds offset of rhs of rhs relative to Begin() to lhs and returns lhs.

◆ operator-

Mesh::Iterator operator- ( const Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Subtraction operator - subtracts offset of rhs relative to Begin() from lhs.

◆ operator-- [1/2]

Mesh::Iterator & operator-- ( Mesh::Iterator lhs)
friend

Prefix decrement operator –it retreats iterator by one

◆ operator-- [2/2]

Mesh::Iterator operator-- ( Mesh::Iterator lhs,
int   
)
friend

Postfix decrement operator it– retreats iterator by one.

◆ operator-=

Mesh::Iterator & operator-= ( Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Subtraction operator - subtracts offset of rhs relative to Begin() from lhs and returns lhs.

◆ operator<

bool operator< ( const Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Return true if lhs indexes a position less than rhs i.e.

successive operation of decrement operator would eventually reach lhs

◆ operator<=

bool operator<= ( const Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Return true if lhs indexes a position less than or equal to rhs i.e.

successive operation of decrement operator would eventually reach lhs

◆ operator==

bool operator== ( const Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Return true if lhs indexes the same position as rhs.

◆ operator>

bool operator> ( const Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Return true if lhs indexes a position greater than rhs i.e.

successive operation of increment operator would eventually reach lhs

◆ operator>=

bool operator>= ( const Mesh::Iterator lhs,
const Mesh::Iterator rhs 
)
friend

Return true if lhs indexes a position greater than or equal to rhs i.e.

successive operation of increment operator would eventually reach lhs

Member Data Documentation

◆ constantSpacing_m

bool interpolation::ThreeDGrid::constantSpacing_m
private

◆ maps_m

std::vector<VectorMap*> interpolation::ThreeDGrid::maps_m
private

Definition at line 328 of file ThreeDGrid.h.

Referenced by add(), and remove().

◆ x_m

std::vector<double> interpolation::ThreeDGrid::x_m
private

◆ xSize_m

int interpolation::ThreeDGrid::xSize_m
private

Definition at line 325 of file ThreeDGrid.h.

Referenced by end(), getNearest(), maxX(), and ThreeDGrid().

◆ y_m

std::vector<double> interpolation::ThreeDGrid::y_m
private

◆ ySize_m

int interpolation::ThreeDGrid::ySize_m
private

Definition at line 326 of file ThreeDGrid.h.

Referenced by addEquals(), addOne(), getNearest(), maxY(), subEquals(), subOne(), ThreeDGrid(), and toInteger().

◆ z_m

std::vector<double> interpolation::ThreeDGrid::z_m
private

◆ zSize_m

int interpolation::ThreeDGrid::zSize_m
private

Definition at line 327 of file ThreeDGrid.h.

Referenced by addEquals(), addOne(), getNearest(), maxZ(), subEquals(), subOne(), ThreeDGrid(), and toInteger().


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