35 Mesh* validity_region,
36 std::vector<SquarePolynomialVector*> polynomials) {
43 "PolynomialPatch::PolynomialPatch",
44 "PolynomialPatch grid_points_ was nullptr");
47 "PolynomialPatch::PolynomialPatch",
48 "PolynomialPatch validity_region_ was nullptr");
51 "PolynomialPatch::PolynomialPatch",
52 "Could not make PolynomialPatch with 0 length polynomials vector");
57 "PolynomialPatch::PolynomialPatch",
58 "Could not make PolynomialPatch with bad length polynomials vector"
64 "PolynomialPatch::PolynomialPatch",
65 "PolynomialPatch validity_region_ has bad dimension");
68 for (
size_t i = 0; i <
points_.size(); ++i) {
71 "PolynomialPatch::PolynomialPatch",
72 "PolynomialPatch points_ element was nullptr");
75 "PolynomialPatch::PolynomialPatch",
76 "Polynomial with mismatched PointDimension in PolynomialPatch");
80 "PolynomialPatch::PolynomialPatch",
81 "Polynomial with mismatched ValueDimension in PolynomialPatch");
86 Mesh* new_mesh =
nullptr;
90 Mesh* new_validity =
nullptr;
94 std::vector<SquarePolynomialVector*> new_points(
points_.size());
95 for (
size_t i = 0; i <
points_.size(); ++i) {
97 new_points[i] =
nullptr;
106 : validity_region_(nullptr), grid_points_(nullptr), points_(), point_dimension_(0),
107 value_dimension_(0) {
113 for (
size_t i = 0; i <
points_.size(); ++i)
120 std::vector<double> nearest_pos = nearest.
getPosition();
122 point_temp[i] = point[i] - nearest_pos[i];
124 points_[points_index]->F(&point_temp[0], value);
PartBunch< T, Dim >::ConstIterator end(PartBunch< T, Dim > const &bunch)
Base class for meshing routines.
virtual int getPositionDimension() const =0
Return the dimension of the mesh.
virtual Mesh::Iterator getNearest(const double *position) const =0
Find the point on the mesh nearest to given point.
virtual Mesh::Iterator end() const =0
Return the last+1 point on the mesh.
virtual Mesh * clone()=0
Return a copy of child object.
Used to loop over some, or all, points in the mesh, as in stl Enables e.g.
virtual void getPosition(double *point) const
Return the position referenced by the iterator;.
int toInteger() const
Return an integer representation of the iterator.
std::vector< SquarePolynomialVector * > points_
unsigned int point_dimension_
virtual void function(const double *point, double *value) const
Get the value at a given point.
SquarePolynomialVector * getPolynomialVector(const double *point) const
Get the nearest SquarePolynomialVector to point.
VectorMap * clone() const
Deep copy the PolynomialPatch.
PolynomialPatch()
Default constructor leaves validity_region_ and grid_points_ as nullptr.
unsigned int value_dimension_
~PolynomialPatch()
Destructor delets validity_region_, grid_points_ and points_.
SquarePolynomialVector, an arbitrary order polynomial vector class.
VectorMap is an abstract class that defines mapping from one vector to another.