OPALX (Object Oriented Parallel Accelerator Library for Exascale) MINIorX
OPALX
interpolation::TriLinearInterpolator Class Referenceabstract

TriLinearInterpolator performs a linear interpolation in x then y then z. More...

#include <TriLinearInterpolator.h>

Inheritance diagram for interpolation::TriLinearInterpolator:
Inheritance graph
Collaboration diagram for interpolation::TriLinearInterpolator:
Collaboration graph

Public Member Functions

 TriLinearInterpolator (ThreeDGrid *grid, double ***F)
 Constructor for grids with constant spacing. More...
 
 TriLinearInterpolator (const TriLinearInterpolator &tli)
 Copy constructor. More...
 
 ~TriLinearInterpolator ()
 Destructor - removes reference from the mesh and from the function data. More...
 
void function (const double Point[3], double Value[1]) const
 Get the interpolated value of the function at some point. More...
 
virtual void function (const Mesh::Iterator &point, double *value) const
 Call function at a particular point in the mesh. More...
 
TriLinearInterpolatorclone () const
 Copy function (can be called on parent class) More...
 
double *** function () const
 Return a pointer to the function data. More...
 
virtual void function (const double *point, double *value) const =0
 Pure virtual function to fill the array value with data evaluated at point. More...
 
int getNumberOfXCoords () const
 Number of x coordinates in the grid. More...
 
int getNumberOfYCoords () const
 Number of y coordinates in the grid. More...
 
int getNumberOfZCoords () const
 Number of z coordinates in the grid. More...
 
unsigned int getPointDimension () const
 Dimension of input points. More...
 
unsigned int getValueDimension () const
 Dimension of output values. More...
 
ThreeDGridgetMesh () const
 Return a pointer to the mesh. More...
 
void setGrid (ThreeDGrid *grid)
 Reset the mesh. More...
 
void setX (int nCoords, double *x)
 Set x coordinates in the mesh to an arbitrary set of points. More...
 
void setY (int nCoords, double *y)
 Set y coordinates in the mesh to an arbitrary set of points. More...
 
void setZ (int nCoords, double *z)
 Set z coordinates in the mesh to an arbitrary set of points. More...
 
void setF (double ***inF)
 Set function data, deleting any existing function data. More...
 
void deleteFunc (double ***func)
 Delete any existing function data. More...
 
void setAll (ThreeDGrid *grid, double ***F)
 Set function and mesh data. More...
 
void clear ()
 Clear all private data. More...
 
virtual void functionAppend (const std::vector< std::vector< double > > &point_vec, std::vector< std::vector< double > > &value_vec) const
 Calculate F, appending output values to value_vec. More...
 
virtual bool checkPoint (const std::vector< double > &point) const
 Return true if point.size() is the same as this->PointDimension() More...
 
virtual bool checkValue (const std::vector< double > &value) const
 Return true if value.size() is the same as this->ValueDimension() More...
 

Protected Attributes

ThreeDGridcoordinates_m
 
double *** f_m
 

Detailed Description

TriLinearInterpolator performs a linear interpolation in x then y then z.

Performs a linear interpolation in x then y then z returning a 1D value.

Definition at line 38 of file TriLinearInterpolator.h.

Constructor & Destructor Documentation

◆ TriLinearInterpolator() [1/2]

interpolation::TriLinearInterpolator::TriLinearInterpolator ( ThreeDGrid grid,
double ***  F 
)
inline

Constructor for grids with constant spacing.

Parameters
grid3d mesh on which data is stored - adds a reference to *this into the mesh smart pointer thing.
Ffunction data with points on each element of the grid. Indexing goes like [index_x][index_y][index_z]. Interpolator3dGridTo1d now owns this memory All the data handling is done at Interpolator3dGridTo1d

Definition at line 83 of file TriLinearInterpolator.h.

Referenced by clone().

◆ TriLinearInterpolator() [2/2]

interpolation::TriLinearInterpolator::TriLinearInterpolator ( const TriLinearInterpolator tli)

◆ ~TriLinearInterpolator()

interpolation::TriLinearInterpolator::~TriLinearInterpolator ( )
inline

Destructor - removes reference from the mesh and from the function data.

Definition at line 87 of file TriLinearInterpolator.h.

Member Function Documentation

◆ checkPoint()

bool interpolation::VectorMap::checkPoint ( const std::vector< double > &  point) const
inlinevirtualinherited

Return true if point.size() is the same as this->PointDimension()

Definition at line 95 of file VectorMap.h.

◆ checkValue()

bool interpolation::VectorMap::checkValue ( const std::vector< double > &  value) const
inlinevirtualinherited

Return true if value.size() is the same as this->ValueDimension()

Definition at line 99 of file VectorMap.h.

◆ clear()

void interpolation::Interpolator3dGridTo1d::clear ( )
inlineinherited

◆ clone()

TriLinearInterpolator * interpolation::TriLinearInterpolator::clone ( ) const
inlinevirtual

Copy function (can be called on parent class)

Implements interpolation::Interpolator3dGridTo1d.

Definition at line 90 of file TriLinearInterpolator.h.

References TriLinearInterpolator().

Here is the call graph for this function:

◆ deleteFunc()

void interpolation::Interpolator3dGridTo1d::deleteFunc ( double ***  func)
inherited

◆ function() [1/4]

double *** interpolation::Interpolator3dGridTo1d::function ( ) const
inlineinherited

Return a pointer to the function data.

Definition at line 207 of file Interpolator3dGridTo1d.h.

References interpolation::Interpolator3dGridTo1d::f_m.

◆ function() [2/4]

virtual void interpolation::VectorMap::function ( const double *  point,
double *  value 
) const
pure virtualinherited

◆ function() [3/4]

void interpolation::TriLinearInterpolator::function ( const double  Point[3],
double  Value[1] 
) const
virtual

Get the interpolated value of the function at some point.

First does bound checking, then makes linear interpolations using the standard 1d interpolation formula
\(y(x) \approx \frac{\Delta y}{\Delta x} dx + y_0\)
\(y(x) \approx \frac{y_1(x_1)-y_0(x_0)}{dx}(x-x_0) + y_0\)
Interpolate along 4 x grid lines to make a 2D problem, then interpolate along 2 y grid lines to make a 1D problem, then finally interpolate in z to get the value.

Implements interpolation::Interpolator3dGridTo1d.

Definition at line 48 of file TriLinearInterpolator.cpp.

References interpolation::Interpolator3dGridTo1d::coordinates_m, interpolation::Interpolator3dGridTo1d::f_m, interpolation::ThreeDGrid::lowerBound(), interpolation::ThreeDGrid::x(), interpolation::ThreeDGrid::xSize(), interpolation::ThreeDGrid::y(), interpolation::ThreeDGrid::ySize(), interpolation::ThreeDGrid::z(), and interpolation::ThreeDGrid::zSize().

Here is the call graph for this function:

◆ function() [4/4]

virtual void interpolation::TriLinearInterpolator::function ( const Mesh::Iterator point,
double *  value 
) const
inlinevirtual

Call function at a particular point in the mesh.

Reimplemented from interpolation::Interpolator3dGridTo1d.

Definition at line 74 of file TriLinearInterpolator.h.

References interpolation::VectorMap::function().

Here is the call graph for this function:

◆ functionAppend()

void interpolation::VectorMap::functionAppend ( const std::vector< std::vector< double > > &  point_vec,
std::vector< std::vector< double > > &  value_vec 
) const
inlinevirtualinherited

Calculate F, appending output values to value_vec.

For each item in point_vec not in value_vec, calculate value_vec (urgh)

Definition at line 109 of file VectorMap.h.

References interpolation::VectorMap::function(), and interpolation::VectorMap::getValueDimension().

Here is the call graph for this function:

◆ getMesh()

ThreeDGrid * interpolation::Interpolator3dGridTo1d::getMesh ( ) const
inlinevirtualinherited

Return a pointer to the mesh.

Reimplemented from interpolation::VectorMap.

Definition at line 176 of file Interpolator3dGridTo1d.h.

References interpolation::Interpolator3dGridTo1d::coordinates_m.

◆ getNumberOfXCoords()

int interpolation::Interpolator3dGridTo1d::getNumberOfXCoords ( ) const
inlineinherited

Number of x coordinates in the grid.

Definition at line 156 of file Interpolator3dGridTo1d.h.

References interpolation::Interpolator3dGridTo1d::coordinates_m, and interpolation::ThreeDGrid::xSize().

Referenced by interpolation::Interpolator3dGridTo1d::deleteFunc().

Here is the call graph for this function:

◆ getNumberOfYCoords()

int interpolation::Interpolator3dGridTo1d::getNumberOfYCoords ( ) const
inlineinherited

Number of y coordinates in the grid.

Definition at line 160 of file Interpolator3dGridTo1d.h.

References interpolation::Interpolator3dGridTo1d::coordinates_m, and interpolation::ThreeDGrid::ySize().

Referenced by interpolation::Interpolator3dGridTo1d::deleteFunc().

Here is the call graph for this function:

◆ getNumberOfZCoords()

int interpolation::Interpolator3dGridTo1d::getNumberOfZCoords ( ) const
inlineinherited

Number of z coordinates in the grid.

Definition at line 164 of file Interpolator3dGridTo1d.h.

References interpolation::Interpolator3dGridTo1d::coordinates_m, and interpolation::ThreeDGrid::zSize().

Here is the call graph for this function:

◆ getPointDimension()

unsigned int interpolation::Interpolator3dGridTo1d::getPointDimension ( ) const
inlinevirtualinherited

Dimension of input points.

Implements interpolation::VectorMap.

Definition at line 168 of file Interpolator3dGridTo1d.h.

◆ getValueDimension()

unsigned int interpolation::Interpolator3dGridTo1d::getValueDimension ( ) const
inlinevirtualinherited

Dimension of output values.

Implements interpolation::VectorMap.

Definition at line 172 of file Interpolator3dGridTo1d.h.

◆ setAll()

void interpolation::Interpolator3dGridTo1d::setAll ( ThreeDGrid grid,
double ***  F 
)
inlineinherited

Set function and mesh data.

Definition at line 211 of file Interpolator3dGridTo1d.h.

References interpolation::Interpolator3dGridTo1d::setF(), and interpolation::Interpolator3dGridTo1d::setGrid().

Referenced by interpolation::Interpolator3dGridTo1d::Interpolator3dGridTo1d().

Here is the call graph for this function:

◆ setF()

void interpolation::Interpolator3dGridTo1d::setF ( double ***  inF)
inlineinherited

Set function data, deleting any existing function data.

Definition at line 180 of file Interpolator3dGridTo1d.h.

References interpolation::Interpolator3dGridTo1d::deleteFunc(), and interpolation::Interpolator3dGridTo1d::f_m.

Referenced by interpolation::Interpolator3dGridTo1d::setAll().

Here is the call graph for this function:

◆ setGrid()

void interpolation::Interpolator3dGridTo1d::setGrid ( ThreeDGrid grid)
inlineinherited

Reset the mesh.

Removes reference to this from mesh smart pointer if appropriate

Definition at line 185 of file Interpolator3dGridTo1d.h.

References interpolation::ThreeDGrid::add(), interpolation::Interpolator3dGridTo1d::coordinates_m, and interpolation::ThreeDGrid::remove().

Referenced by interpolation::Interpolator3dGridTo1d::setAll().

Here is the call graph for this function:

◆ setX()

void interpolation::Interpolator3dGridTo1d::setX ( int  nCoords,
double *  x 
)
inlineinherited

Set x coordinates in the mesh to an arbitrary set of points.

If mesh is nullptr, does nothing

Definition at line 192 of file Interpolator3dGridTo1d.h.

References interpolation::Interpolator3dGridTo1d::coordinates_m, and interpolation::ThreeDGrid::setX().

Here is the call graph for this function:

◆ setY()

void interpolation::Interpolator3dGridTo1d::setY ( int  nCoords,
double *  y 
)
inlineinherited

Set y coordinates in the mesh to an arbitrary set of points.

If mesh is nullptr, does nothing

Definition at line 197 of file Interpolator3dGridTo1d.h.

References interpolation::Interpolator3dGridTo1d::coordinates_m, and interpolation::ThreeDGrid::setY().

Here is the call graph for this function:

◆ setZ()

void interpolation::Interpolator3dGridTo1d::setZ ( int  nCoords,
double *  z 
)
inlineinherited

Set z coordinates in the mesh to an arbitrary set of points.

If mesh is nullptr, does nothing

Definition at line 202 of file Interpolator3dGridTo1d.h.

References interpolation::Interpolator3dGridTo1d::coordinates_m, and interpolation::ThreeDGrid::setZ().

Here is the call graph for this function:

Member Data Documentation

◆ coordinates_m

◆ f_m


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