|
OPALX (Object Oriented Parallel Accelerator Library for Exascale) MINIorX
OPALX
|
Interpolator3dGridTo3d interpolates from 3d grid to a 3d vector. More...
#include <Interpolator3dGridTo3d.h>


Public Types | |
| enum | interpolationAlgorithm { TRILINEAR } |
| Enumerator encoding possible interpolation routines. More... | |
Public Member Functions | |
| Interpolator3dGridTo3d (ThreeDGrid *grid, double ***Bx, double ***By, double ***Bz, interpolationAlgorithm algo=TRILINEAR) | |
| Constructor for grids with constant spacing. More... | |
| Interpolator3dGridTo3d (const Interpolator3dGridTo3d &interpolator) | |
| Copy constructor deep copies 1d interpolators and mesh. More... | |
| ~Interpolator3dGridTo3d () | |
| Delete member interpolators and remove *this from the mesh smart pointer. More... | |
| Interpolator3dGridTo3d * | clone () const |
| Copy function (can be called on parent class) More... | |
| void | function (const double Point[3], double Value[3]) const |
| Return the interpolated data. More... | |
| virtual void | function (const Mesh::Iterator &point, double *value) const |
| Call function at a particular point in the mesh. More... | |
| void | functionPrime (const double Point[3], double Value[3], int axis) const |
| Do not use (just raises exception) - der. 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... | |
| ThreeDGrid * | getMesh () 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 | setAll (ThreeDGrid *grid, double ***Bx, double ***By, double ***Bz, interpolationAlgorithm algo=TRILINEAR) |
| Set function and mesh data. More... | |
| void | clear () |
| Clear all private 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... | |
| 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 | |
| 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().

|
inlinevirtualinherited |
Return true if point.size() is the same as this->PointDimension()
Definition at line 95 of file VectorMap.h.
|
inlinevirtualinherited |
Return true if value.size() is the same as this->ValueDimension()
Definition at line 99 of file VectorMap.h.
|
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().

|
pure virtualinherited |
Pure virtual function to fill the array value with data evaluated at point.
Implemented in interpolation::PolynomialPatch.
Referenced by interpolation::Interpolator3dGridTo1d::function(), function(), interpolation::TriLinearInterpolator::function(), interpolation::VectorMap::function(), interpolation::VectorMap::functionAppend(), and SectorMagneticFieldMap::getFieldstrength().
| 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().

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

| 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 nullptr, 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 nullptr, 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 nullptr, 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().