OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Member Functions | List of all members
interpolation::TriLinearInterpolator Class Reference

#include <TriLinearInterpolator.h>

Inheritance diagram for interpolation::TriLinearInterpolator:
Inheritance graph
[legend]
Collaboration diagram for interpolation::TriLinearInterpolator:
Collaboration graph
[legend]

Public Member Functions

 TriLinearInterpolator (ThreeDGrid *grid, double ***F)
 
 TriLinearInterpolator (const TriLinearInterpolator &tli)
 
 ~TriLinearInterpolator ()
 
void function (const double Point[3], double Value[1]) const
 
virtual void function (const Mesh::Iterator &point, double *value) const
 
TriLinearInterpolatorclone () const
 
- Public Member Functions inherited from interpolation::Interpolator3dGridTo1d
 Interpolator3dGridTo1d (ThreeDGrid *grid, double ***F)
 
 Interpolator3dGridTo1d ()
 
virtual ~Interpolator3dGridTo1d ()
 
int getNumberOfXCoords () const
 
int getNumberOfYCoords () const
 
int getNumberOfZCoords () const
 
unsigned int getPointDimension () const
 
unsigned int getValueDimension () const
 
ThreeDGridgetMesh () const
 
void setGrid (ThreeDGrid *grid)
 
void setX (int nCoords, double *x)
 
void setY (int nCoords, double *y)
 
void setZ (int nCoords, double *z)
 
void setF (double ***inF)
 
void deleteFunc (double ***func)
 
double *** function () const
 
void setAll (ThreeDGrid *grid, double ***F)
 
void clear ()
 
- Public Member Functions inherited from interpolation::VectorMap
virtual void function (const double *point, double *value) const =0
 
virtual void functionAppend (const std::vector< std::vector< double > > &point_vec, std::vector< std::vector< double > > &value_vec) const
 
virtual bool checkPoint (const std::vector< double > &point) const
 
virtual bool checkValue (const std::vector< double > &value) const
 
virtual ~VectorMap ()
 

Additional Inherited Members

- Protected Attributes inherited from interpolation::Interpolator3dGridTo1d
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

◆ 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:

◆ function() [1/2]

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() [2/2]

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:

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