OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
interpolation::Interpolator3dGridTo3d Class Referenceabstract

#include <Interpolator3dGridTo3d.h>

Inheritance diagram for interpolation::Interpolator3dGridTo3d:
Inheritance graph
Collaboration diagram for interpolation::Interpolator3dGridTo3d:
Collaboration graph

Public Types

enum  interpolationAlgorithm { TRILINEAR }
 

Public Member Functions

 Interpolator3dGridTo3d (ThreeDGrid *grid, double ***Bx, double ***By, double ***Bz, interpolationAlgorithm algo=TRILINEAR)
 
 Interpolator3dGridTo3d (const Interpolator3dGridTo3d &interpolator)
 
 ~Interpolator3dGridTo3d ()
 
Interpolator3dGridTo3dclone () const
 
void function (const double Point[3], double Value[3]) const
 
virtual void function (const Mesh::Iterator &point, double *value) const
 
void functionPrime (const double Point[3], double Value[3], int axis) const
 
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 setAll (ThreeDGrid *grid, double ***Bx, double ***By, double ***Bz, interpolationAlgorithm algo=TRILINEAR)
 
void clear ()
 
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
 

Protected Attributes

ThreeDGridcoordinates_m
 
Interpolator3dGridTo1dinterpolator_m [3]
 

Detailed Description

Interpolator3dGridTo3d interpolates from 3d grid to a 3d vector

Wraps three Interpolator3dGridTo1d, one for each variable in the output vector B. At the moment the wrapped Interpolator3dGridTo1d is encoded by means of an enumeration, with the only possible value trilinear interpolator

Function data for each of the 3d output data on the mesh is written as 3d arrays Bx, By, Bz and we make a TriLinear interpolator for each array

Could be that we make Interpolator3dGridTo3d an interface class and then make specific implementations for different interpolation routines (of which three trilinear interpolators is an implementation of the interface).

Definition at line 52 of file Interpolator3dGridTo3d.h.

Member Enumeration Documentation

◆ interpolationAlgorithm

Enumerator encoding possible interpolation routines

Enumerator
TRILINEAR 

Definition at line 55 of file Interpolator3dGridTo3d.h.

Constructor & Destructor Documentation

◆ Interpolator3dGridTo3d() [1/2]

interpolation::Interpolator3dGridTo3d::Interpolator3dGridTo3d ( ThreeDGrid grid,
double ***  Bx,
double ***  By,
double ***  Bz,
interpolationAlgorithm  algo = TRILINEAR 
)
inline

Constructor for grids with constant spacing

Parameters
grid3d grid that indexes the data. *this is added to the smart pointer in the mesh
Bxvalue[0] data. 3D arrays go like [index_x][index_y][index_z], and Interpolator3dGridTo3d now owns this memory
Byvalue[1] data. 3D arrays go like [index_x][index_y][index_z], and Interpolator3dGridTo3d now owns this memory
Bzvalue[2] data. 3D arrays go like [index_x][index_y][index_z], and Interpolator3dGridTo3d now owns this memory
algointerpolation algorithm (defaults to TRILINEAR)

Definition at line 191 of file Interpolator3dGridTo3d.h.

References interpolator_m, and setAll().

Here is the call graph for this function:

◆ Interpolator3dGridTo3d() [2/2]

interpolation::Interpolator3dGridTo3d::Interpolator3dGridTo3d ( const Interpolator3dGridTo3d interpolator)

Copy constructor deep copies 1d interpolators and mesh

Note this makes a whole bunch of extra meshes because each interpolator deep copy makes a new mesh - that's a bit of a mess

Definition at line 33 of file Interpolator3dGridTo3d.cpp.

References interpolation::Interpolator3dGridTo1d::clone(), coordinates_m, and interpolator_m.

Here is the call graph for this function:

◆ ~Interpolator3dGridTo3d()

interpolation::Interpolator3dGridTo3d::~Interpolator3dGridTo3d ( )
inline

Delete member interpolators and remove *this from the mesh smart pointer

Definition at line 82 of file Interpolator3dGridTo3d.h.

References clear().

Here is the call graph for this function:

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 94 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 98 of file VectorMap.h.

◆ clear()

void interpolation::Interpolator3dGridTo3d::clear ( )
inline

Clear all private data

Definition at line 200 of file Interpolator3dGridTo3d.h.

References coordinates_m, interpolator_m, and interpolation::ThreeDGrid::remove().

Referenced by ~Interpolator3dGridTo3d().

Here is the call graph for this function:

◆ clone()

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

Copy function (can be called on parent class)

Implements interpolation::VectorMap.

Definition at line 85 of file Interpolator3dGridTo3d.h.

◆ function() [1/3]

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

◆ function() [2/3]

void interpolation::Interpolator3dGridTo3d::function ( const double  Point[3],
double  Value[3] 
) const

Return the interpolated data

Calls each child interpolator in turn and sets the value. Note that this means we get 3 sets of bound checks plus bound checking on the parent which is a bit unpleasant. I think that the actual interpolation however does have to be done independently for each variable.

Definition at line 39 of file Interpolator3dGridTo3d.cpp.

References coordinates_m, interpolation::Interpolator3dGridTo1d::function(), interpolator_m, interpolation::ThreeDGrid::maxX(), interpolation::ThreeDGrid::maxY(), interpolation::ThreeDGrid::maxZ(), interpolation::ThreeDGrid::minX(), interpolation::ThreeDGrid::minY(), and interpolation::ThreeDGrid::minZ().

Here is the call graph for this function:

◆ function() [3/3]

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

Call function at a particular point in the mesh

Reimplemented from interpolation::VectorMap.

Definition at line 97 of file Interpolator3dGridTo3d.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:

◆ functionPrime()

void interpolation::Interpolator3dGridTo3d::functionPrime ( const double  Point[3],
double  Value[3],
int  axis 
) const

Do not use (just raises exception) - der

◆ getMesh()

ThreeDGrid * interpolation::Interpolator3dGridTo3d::getMesh ( ) const
inlinevirtual

Return a pointer to the mesh

Reimplemented from interpolation::VectorMap.

Definition at line 171 of file Interpolator3dGridTo3d.h.

References coordinates_m.

◆ getNumberOfXCoords()

int interpolation::Interpolator3dGridTo3d::getNumberOfXCoords ( ) const
inline

Number of x coordinates in the grid

Definition at line 161 of file Interpolator3dGridTo3d.h.

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

Here is the call graph for this function:

◆ getNumberOfYCoords()

int interpolation::Interpolator3dGridTo3d::getNumberOfYCoords ( ) const
inline

Number of y coordinates in the grid

Definition at line 163 of file Interpolator3dGridTo3d.h.

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

Here is the call graph for this function:

◆ getNumberOfZCoords()

int interpolation::Interpolator3dGridTo3d::getNumberOfZCoords ( ) const
inline

Number of z coordinates in the grid

Definition at line 165 of file Interpolator3dGridTo3d.h.

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

Here is the call graph for this function:

◆ getPointDimension()

unsigned int interpolation::Interpolator3dGridTo3d::getPointDimension ( ) const
inlinevirtual

Dimension of input points

Implements interpolation::VectorMap.

Definition at line 167 of file Interpolator3dGridTo3d.h.

◆ getValueDimension()

unsigned int interpolation::Interpolator3dGridTo3d::getValueDimension ( ) const
inlinevirtual

Dimension of output values

Implements interpolation::VectorMap.

Definition at line 169 of file Interpolator3dGridTo3d.h.

◆ setAll()

void interpolation::Interpolator3dGridTo3d::setAll ( ThreeDGrid grid,
double ***  Bx,
double ***  By,
double ***  Bz,
interpolationAlgorithm  algo = TRILINEAR 
)

Set function and mesh data

Definition at line 54 of file Interpolator3dGridTo3d.cpp.

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

Referenced by Interpolator3dGridTo3d().

Here is the call graph for this function:

◆ setGrid()

void interpolation::Interpolator3dGridTo3d::setGrid ( ThreeDGrid grid)
inline

Reset the mesh

Removes reference to this from mesh smart pointer if appropriate

Definition at line 173 of file Interpolator3dGridTo3d.h.

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

Here is the call graph for this function:

◆ setX()

void interpolation::Interpolator3dGridTo3d::setX ( int  nCoords,
double *  x 
)
inline

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

If mesh is nullptr, does nothing

Definition at line 179 of file Interpolator3dGridTo3d.h.

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

Here is the call graph for this function:

◆ setY()

void interpolation::Interpolator3dGridTo3d::setY ( int  nCoords,
double *  y 
)
inline

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

If mesh is nullptr, does nothing

Definition at line 183 of file Interpolator3dGridTo3d.h.

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

Here is the call graph for this function:

◆ setZ()

void interpolation::Interpolator3dGridTo3d::setZ ( int  nCoords,
double *  z 
)
inline

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

If mesh is nullptr, does nothing

Definition at line 187 of file Interpolator3dGridTo3d.h.

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

Here is the call graph for this function:

Member Data Documentation

◆ coordinates_m

ThreeDGrid* interpolation::Interpolator3dGridTo3d::coordinates_m
protected

◆ interpolator_m

Interpolator3dGridTo1d* interpolation::Interpolator3dGridTo3d::interpolator_m[3]
protected

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