OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Types | Public Member Functions | Protected Attributes | List of all members
interpolation::Interpolator3dGridTo3d Class Reference

#include <Interpolator3dGridTo3d.h>

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

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

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 53 of file Interpolator3dGridTo3d.h.

Member Enumeration Documentation

Enumerator encoding possible interpolation routines

Enumerator
TRILINEAR 

Definition at line 56 of file Interpolator3dGridTo3d.h.

Constructor & Destructor Documentation

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 209 of file Interpolator3dGridTo3d.h.

References interpolator_m, and setAll().

Referenced by clone().

Here is the call graph for this function:

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 34 of file Interpolator3dGridTo3d.cpp.

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

Here is the call graph for this function:

interpolation::Interpolator3dGridTo3d::~Interpolator3dGridTo3d ( )
inline

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

Definition at line 83 of file Interpolator3dGridTo3d.h.

References clear().

Here is the call graph for this function:

Member Function Documentation

void interpolation::Interpolator3dGridTo3d::clear ( )
inline

Clear all private data

Definition at line 218 of file Interpolator3dGridTo3d.h.

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

Referenced by ~Interpolator3dGridTo3d().

Here is the call graph for this function:

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

Copy function (can be called on parent class)

Implements interpolation::VectorMap.

Definition at line 86 of file Interpolator3dGridTo3d.h.

References Interpolator3dGridTo3d().

Here is the call graph for this function:

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 41 of file Interpolator3dGridTo3d.cpp.

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 100 of file Interpolator3dGridTo3d.h.

References interpolation::VectorMap::function().

Here is the call graph for this function:

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

Do not use (just raises exception) - der

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

Return a pointer to the mesh

Reimplemented from interpolation::VectorMap.

Definition at line 183 of file Interpolator3dGridTo3d.h.

References coordinates_m.

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

Number of x coordinates in the grid

Definition at line 163 of file Interpolator3dGridTo3d.h.

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

Here is the call graph for this function:

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

Number of y coordinates in the grid

Definition at line 167 of file Interpolator3dGridTo3d.h.

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

Here is the call graph for this function:

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

Number of z coordinates in the grid

Definition at line 171 of file Interpolator3dGridTo3d.h.

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

Here is the call graph for this function:

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

Dimension of input points

Implements interpolation::VectorMap.

Definition at line 175 of file Interpolator3dGridTo3d.h.

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

Dimension of output values

Implements interpolation::VectorMap.

Definition at line 179 of file Interpolator3dGridTo3d.h.

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

Set function and mesh data

Definition at line 56 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:

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

Reset the mesh

Removes reference to this from mesh smart pointer if appropriate

Definition at line 187 of file Interpolator3dGridTo3d.h.

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

Here is the call graph for this function:

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

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

If mesh is NULL, does nothing

Definition at line 194 of file Interpolator3dGridTo3d.h.

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

Here is the call graph for this function:

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

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

If mesh is NULL, does nothing

Definition at line 199 of file Interpolator3dGridTo3d.h.

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

Here is the call graph for this function:

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

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

If mesh is NULL, does nothing

Definition at line 204 of file Interpolator3dGridTo3d.h.

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

Here is the call graph for this function:

Member Data Documentation

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

Definition at line 160 of file Interpolator3dGridTo3d.h.

Referenced by clear(), Interpolator3dGridTo3d(), and setAll().


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