OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
interpolation::PolynomialPatch Class Reference

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

#include <PolynomialPatch.h>

Inheritance diagram for interpolation::PolynomialPatch:
Collaboration diagram for interpolation::PolynomialPatch:

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

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 end(), grid_points_, point_dimension_, points_, validity_region_, and value_dimension_.

Referenced by operator=(), and PolynomialPatch().

Here is the call graph for this function:

◆ PolynomialPatch() [2/3]

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.

References grid_points_, point_dimension_, points_, validity_region_, and value_dimension_.

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

References PolynomialPatch().

Here is the call graph for this function:

Member Function Documentation

◆ checkPoint()

bool interpolation::VectorMap::checkPoint ( const std::vector< double > & point) const
inlinevirtualinherited

Return true if point.size() is the same as this->PointDimension()

Definition at line 95 of file VectorMap.h.

◆ checkValue()

bool interpolation::VectorMap::checkValue ( const std::vector< double > & value) const
inlinevirtualinherited

Return true if value.size() is the same as this->ValueDimension()

Definition at line 99 of file VectorMap.h.

◆ 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 grid_points_, points_, PolynomialPatch(), and validity_region_.

Here is the call graph for this function:

◆ function() [1/2]

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::Iterator::getPosition(), grid_points_, point_dimension_, points_, and interpolation::Mesh::Iterator::toInteger().

Referenced by PyOpal::PyPolynomialPatch::function().

Here is the call graph for this function:

◆ function() [2/2]

void interpolation::VectorMap::function ( const Mesh::Iterator & point,
double * value ) const
inlinevirtualinherited

Fill the array value with function data at a point on the mesh.

Implemented for default case where Mesh point dimension is the same as this point dimension (usual case). No default checking for array sizes.

Reimplemented in interpolation::Interpolator3dGridTo1d, interpolation::Interpolator3dGridTo3d, and interpolation::TriLinearInterpolator.

Definition at line 103 of file VectorMap.h.

References function(), getPointDimension(), and interpolation::Mesh::Iterator::getPosition().

Here is the call graph for this function:

◆ functionAppend()

void interpolation::VectorMap::functionAppend ( const std::vector< std::vector< double > > & point_vec,
std::vector< std::vector< double > > & value_vec ) const
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 function(), and getValueDimension().

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

Referenced by PyOpal::PyPolynomialPatch::function().

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

Referenced by PyOpal::PyPolynomialPatch::function().

◆ operator=()

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

References PolynomialPatch().

Here is the call graph for this function:

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(), PolynomialPatch(), 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(), PolynomialPatch(), and ~PolynomialPatch().

◆ value_dimension_

unsigned int interpolation::PolynomialPatch::value_dimension_
private

Definition at line 127 of file PolynomialPatch.h.

Referenced by getValueDimension(), PolynomialPatch(), and PolynomialPatch().


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