OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
|
Patches together many SquarePolynomialVectors to make a multidimensional polynomial spline. More...
#include <PolynomialPatch.h>
Public Member Functions | |
PolynomialPatch (Mesh *grid_points_, Mesh *validity_region, std::vector< SquarePolynomialVector * > polynomials_) | |
PolynomialPatch () | |
~PolynomialPatch () | |
VectorMap * | clone () const |
virtual void | function (const double *point, double *value) const |
unsigned int | getPointDimension () const |
unsigned int | getValueDimension () const |
SquarePolynomialVector * | getPolynomialVector (const double *point) const |
Mesh * | getMesh () const |
std::vector< SquarePolynomialVector * > | getPolynomials () const |
Public Member Functions inherited from interpolation::VectorMap | |
virtual void | function (const double *point, double *value) const =0 |
virtual void | function (const Mesh::Iterator &point, double *value) const |
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 unsigned int | getPointDimension () const =0 |
virtual unsigned int | getValueDimension () const =0 |
virtual VectorMap * | clone () const =0 |
virtual | ~VectorMap () |
virtual Mesh * | getMesh () const |
Private Member Functions | |
PolynomialPatch (const PolynomialPatch &rhs) | |
PolynomialPatch & | operator= (const PolynomialPatch &rhs) |
Private Attributes | |
Mesh * | validity_region_ |
Mesh * | grid_points_ |
std::vector< SquarePolynomialVector * > | points_ |
unsigned int | point_dimension_ |
unsigned int | value_dimension_ |
Patches together many SquarePolynomialVectors to make a multidimensional polynomial spline.
SquarePolynomialVectors are distributed on a mesh.
grid_points_ | The grid points on which patches are defined. SquarePolynomialVector owns this memory (deletes on destructor). |
validity_region_ | Defines whether a region is valid or not. This is defined as a mesh for compatibility with the SectorMagneticFieldMap (but possibly this is the wrong way to do it - better as a lookup, like bool is_valid(point), which could be inherited from the VectorMap class) SquarePolynomialVector owns this memory (deletes on destructor). |
points_ | The PolynomialVector data SquarePolynomialVector owns this memory (deletes on destructor). |
point_dimension_ | Dimension of the ordinate |
value_dimension_ | Dimension of the abscissa |
Definition at line 55 of file PolynomialPatch.h.
interpolation::PolynomialPatch::PolynomialPatch | ( | Mesh * | grid_points_, |
Mesh * | validity_region, | ||
std::vector< SquarePolynomialVector * > | polynomials_ | ||
) |
Construct the PolynomialPatch
grid_points_ | the mesh over which the polynomials are distributed. PolynomialPatch takes ownership of this memory. |
validity_region | the mesh over which the grid points are valid; the validity region is defined by min/max values of the grid. PolynomialPatch takes ownership of this memory. |
polynomials_ | the set of polynomials which make up the patch. PolynomialPatch takes ownership of this memory. |
Definition at line 34 of file PolynomialPatch.cpp.
References interpolation::Mesh::end(), end(), interpolation::Mesh::getPositionDimension(), grid_points_, point_dimension_, points_, validity_region_, and value_dimension_.
interpolation::PolynomialPatch::PolynomialPatch | ( | ) |
Default constructor leaves validity_region_ and grid_points_ as nullptr
Note it is not safe to call some member functions e.g. function(...) on default constructed PolynomialPatch.
Definition at line 105 of file PolynomialPatch.cpp.
Referenced by clone().
interpolation::PolynomialPatch::~PolynomialPatch | ( | ) |
Destructor delets validity_region_, grid_points_ and points_
Definition at line 110 of file PolynomialPatch.cpp.
References grid_points_, points_, and validity_region_.
|
private |
|
virtual |
Deep copy the PolynomialPatch
This is the polymorphic copy constructor. Always returns a PolynomialPatch.
Implements interpolation::VectorMap.
Definition at line 85 of file PolynomialPatch.cpp.
References interpolation::Mesh::clone(), grid_points_, points_, PolynomialPatch(), and validity_region_.
|
virtual |
Get the value at a given point
point | array of length point_dimension_. Caller owns this memory. Not bound checked - it wants to be fast. |
value | array of length value_dimension_. Data gets overwritten by PolynomialPatch. Caller owns this memory. Not bound checked. |
Implements interpolation::VectorMap.
Definition at line 117 of file PolynomialPatch.cpp.
References interpolation::Mesh::getNearest(), interpolation::Mesh::Iterator::getPosition(), grid_points_, point_dimension_, points_, and interpolation::Mesh::Iterator::toInteger().
Referenced by PyOpal::PyPolynomialPatch::function().
|
inlinevirtual |
Get the validity region mesh
Note that the PolynomialVectors are distributed on the dual of this mesh
Reimplemented from interpolation::VectorMap.
Definition at line 114 of file PolynomialPatch.h.
References validity_region_.
|
inlinevirtual |
Get the point dimension (length of the ordinate)
Implements interpolation::VectorMap.
Definition at line 98 of file PolynomialPatch.h.
References point_dimension_.
Referenced by PyOpal::PyPolynomialPatch::function().
|
inline |
Get all polynomials in the PolynomialPatch
This is a borrowed reference - PolynomialPatch still owns this memory.
Definition at line 120 of file PolynomialPatch.h.
References points_.
SquarePolynomialVector * interpolation::PolynomialPatch::getPolynomialVector | ( | const double * | point | ) | const |
Get the nearest SquarePolynomialVector to point
point | array of length point_dimension_. Caller owns this memory. Not bound checked. |
Definition at line 127 of file PolynomialPatch.cpp.
References interpolation::Mesh::getNearest(), grid_points_, points_, and interpolation::Mesh::Iterator::toInteger().
|
inlinevirtual |
Get the value dimension (length of the abscissa)
Implements interpolation::VectorMap.
Definition at line 101 of file PolynomialPatch.h.
References value_dimension_.
Referenced by PyOpal::PyPolynomialPatch::function().
|
private |
|
private |
Definition at line 124 of file PolynomialPatch.h.
Referenced by clone(), function(), getPolynomialVector(), PolynomialPatch(), and ~PolynomialPatch().
|
private |
Definition at line 126 of file PolynomialPatch.h.
Referenced by function(), getPointDimension(), and PolynomialPatch().
|
private |
Definition at line 125 of file PolynomialPatch.h.
Referenced by clone(), function(), getPolynomials(), getPolynomialVector(), PolynomialPatch(), and ~PolynomialPatch().
|
private |
Definition at line 123 of file PolynomialPatch.h.
Referenced by clone(), getMesh(), PolynomialPatch(), and ~PolynomialPatch().
|
private |
Definition at line 127 of file PolynomialPatch.h.
Referenced by getValueDimension(), and PolynomialPatch().