OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <Interpolator3dGridTo3d.h>
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 () | |
Interpolator3dGridTo3d * | clone () 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 |
ThreeDGrid * | getMesh () 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 |
virtual | ~VectorMap () |
Protected Attributes | |
ThreeDGrid * | coordinates_m |
Interpolator3dGridTo1d * | interpolator_m [3] |
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.
Enumerator encoding possible interpolation routines
Enumerator | |
---|---|
TRILINEAR |
Definition at line 56 of file Interpolator3dGridTo3d.h.
|
inline |
Constructor for grids with constant spacing
grid | 3d grid that indexes the data. *this is added to the smart pointer in the mesh |
Bx | value[0] data. 3D arrays go like [index_x][index_y][index_z], and Interpolator3dGridTo3d now owns this memory |
By | value[1] data. 3D arrays go like [index_x][index_y][index_z], and Interpolator3dGridTo3d now owns this memory |
Bz | value[2] data. 3D arrays go like [index_x][index_y][index_z], and Interpolator3dGridTo3d now owns this memory |
algo | interpolation algorithm (defaults to TRILINEAR) |
Definition at line 209 of file Interpolator3dGridTo3d.h.
References interpolator_m, and setAll().
Referenced by clone().
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.
|
inline |
Delete member interpolators and remove *this from the mesh smart pointer
Definition at line 83 of file Interpolator3dGridTo3d.h.
References 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().
|
inlinevirtual |
Copy function (can be called on parent class)
Implements interpolation::VectorMap.
Definition at line 86 of file Interpolator3dGridTo3d.h.
References Interpolator3dGridTo3d().
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 40 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().
|
inlinevirtual |
Call function at a particular point in the mesh
Reimplemented from interpolation::VectorMap.
Definition at line 99 of file Interpolator3dGridTo3d.h.
References interpolation::VectorMap::function().
void interpolation::Interpolator3dGridTo3d::functionPrime | ( | const double | Point[3], |
double | Value[3], | ||
int | axis | ||
) | const |
Do not use (just raises exception) - der
|
inlinevirtual |
Return a pointer to the mesh
Reimplemented from interpolation::VectorMap.
Definition at line 183 of file Interpolator3dGridTo3d.h.
References coordinates_m.
|
inline |
Number of x coordinates in the grid
Definition at line 163 of file Interpolator3dGridTo3d.h.
References coordinates_m, and interpolation::ThreeDGrid::xSize().
|
inline |
Number of y coordinates in the grid
Definition at line 167 of file Interpolator3dGridTo3d.h.
References coordinates_m, and interpolation::ThreeDGrid::ySize().
|
inline |
Number of z coordinates in the grid
Definition at line 171 of file Interpolator3dGridTo3d.h.
References coordinates_m, and interpolation::ThreeDGrid::zSize().
|
inlinevirtual |
Dimension of input points
Implements interpolation::VectorMap.
Definition at line 175 of file Interpolator3dGridTo3d.h.
|
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().
|
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().
|
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().
|
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().
|
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().
|
protected |
Definition at line 159 of file Interpolator3dGridTo3d.h.
Referenced by clear(), function(), getMesh(), getNumberOfXCoords(), getNumberOfYCoords(), getNumberOfZCoords(), Interpolator3dGridTo3d(), setAll(), setGrid(), setX(), setY(), and setZ().
|
protected |
Definition at line 160 of file Interpolator3dGridTo3d.h.
Referenced by clear(), function(), Interpolator3dGridTo3d(), and setAll().