OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Member Functions | Private Member Functions | Private Attributes | List of all members
interpolation::PolynomialPatch Class Reference

Patches together many SquarePolynomialVectors to make a multidimensional polynomial spline. More...

#include <PolynomialPatch.h>

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

Public Member Functions

 PolynomialPatch (Mesh *grid_points_, Mesh *validity_region, std::vector< SquarePolynomialVector * > polynomials_)
 
 PolynomialPatch ()
 
 ~PolynomialPatch ()
 
VectorMapclone () const
 
virtual void function (const double *point, double *value) const
 
unsigned int getPointDimension () const
 
unsigned int getValueDimension () const
 
SquarePolynomialVectorgetPolynomialVector (const double *point) const
 
MeshgetMesh () const
 
std::vector< SquarePolynomialVector * > getPolynomials () const
 
- Public Member Functions inherited from interpolation::VectorMap
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 ~VectorMap ()
 

Private Member Functions

 PolynomialPatch (const PolynomialPatch &rhs)
 
PolynomialPatchoperator= (const PolynomialPatch &rhs)
 

Private Attributes

Meshvalidity_region_
 
Meshgrid_points_
 
std::vector< SquarePolynomialVector * > points_
 
unsigned int point_dimension_
 
unsigned int value_dimension_
 

Detailed Description

Patches together many SquarePolynomialVectors to make a multidimensional polynomial spline.

SquarePolynomialVectors are distributed on a mesh.

Parameters
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.

Constructor & Destructor Documentation

◆ PolynomialPatch() [1/3]

interpolation::PolynomialPatch::PolynomialPatch ( Mesh grid_points_,
Mesh validity_region,
std::vector< SquarePolynomialVector * >  polynomials_ 
)

Construct the PolynomialPatch

Parameters
grid_points_the mesh over which the polynomials are distributed. PolynomialPatch takes ownership of this memory.
validity_regionthe 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_.

Here is the call graph for this function:

◆ PolynomialPatch() [2/3]

interpolation::PolynomialPatch::PolynomialPatch ( )

Default constructor leaves validity_region_ and grid_points_ as NULL

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

◆ ~PolynomialPatch()

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_.

◆ PolynomialPatch() [3/3]

interpolation::PolynomialPatch::PolynomialPatch ( const PolynomialPatch rhs)
private

Member Function Documentation

◆ clone()

VectorMap * interpolation::PolynomialPatch::clone ( ) const
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_.

Here is the call graph for this function:

◆ function()

void interpolation::PolynomialPatch::function ( const double *  point,
double *  value 
) const
virtual

Get the value at a given point

Parameters
pointarray of length point_dimension_. Caller owns this memory. Not bound checked - it wants to be fast.
valuearray 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().

Here is the call graph for this function:

◆ getMesh()

Mesh* interpolation::PolynomialPatch::getMesh ( ) const
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_.

◆ getPointDimension()

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

Get the point dimension (length of the ordinate)

Implements interpolation::VectorMap.

Definition at line 98 of file PolynomialPatch.h.

References point_dimension_.

◆ getPolynomials()

std::vector<SquarePolynomialVector*> interpolation::PolynomialPatch::getPolynomials ( ) const
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_.

◆ getPolynomialVector()

SquarePolynomialVector * interpolation::PolynomialPatch::getPolynomialVector ( const double *  point) const

Get the nearest SquarePolynomialVector to point

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

Here is the call graph for this function:

◆ getValueDimension()

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

Get the value dimension (length of the abscissa)

Implements interpolation::VectorMap.

Definition at line 101 of file PolynomialPatch.h.

References value_dimension_.

◆ operator=()

PolynomialPatch& interpolation::PolynomialPatch::operator= ( const PolynomialPatch rhs)
private

Member Data Documentation

◆ grid_points_

Mesh* interpolation::PolynomialPatch::grid_points_
private

◆ point_dimension_

unsigned int interpolation::PolynomialPatch::point_dimension_
private

Definition at line 126 of file PolynomialPatch.h.

Referenced by function(), getPointDimension(), and PolynomialPatch().

◆ points_

std::vector<SquarePolynomialVector*> interpolation::PolynomialPatch::points_
private

◆ validity_region_

Mesh* interpolation::PolynomialPatch::validity_region_
private

Definition at line 123 of file PolynomialPatch.h.

Referenced by clone(), getMesh(), PolynomialPatch(), and ~PolynomialPatch().

◆ value_dimension_

unsigned int interpolation::PolynomialPatch::value_dimension_
private

Definition at line 127 of file PolynomialPatch.h.

Referenced by getValueDimension(), and PolynomialPatch().


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