28 #ifndef _CLASSIC_FIELDS_THREEDGRID_HH_
29 #define _CLASSIC_FIELDS_THREEDGRID_HH_
38 namespace interpolation {
87 int numberOfXCoords,
int numberOfYCoords,
int numberOfZCoords);
102 int ySize,
const double *
y,
103 int zSize,
const double *
z);
113 std::vector<double>
y,
114 std::vector<double>
z);
123 inline double&
x(
const int& i) {
return x_m[i-1];}
129 inline double&
y(
const int& j) {
return y_m[j-1];}
135 inline double&
z(
const int& k) {
return z_m[k-1];}
141 inline const double&
x(
const int& i)
const {
return x_m[i-1];}
147 inline const double&
y(
const int& j)
const {
return y_m[j-1];}
153 inline const double&
z(
const int& j)
const {
return z_m[j-1];}
156 inline int xSize()
const {
return static_cast<int>(
x_m.size());}
159 inline int ySize()
const {
return static_cast<int>(
y_m.size());}
162 inline int zSize()
const {
return static_cast<int>(
z_m.size());}
165 std::vector<double>
xVector() {
return std::vector<double>(
x_m);}
168 std::vector<double>
yVector() {
return std::vector<double>(
y_m);}
171 std::vector<double>
zVector() {
return std::vector<double>(
z_m);}
187 inline void xLowerBound(
const double&
x,
int& xIndex)
const;
194 inline void yLowerBound(
const double&
y,
int& yIndex)
const;
201 inline void zLowerBound(
const double&
z,
int& zIndex)
const;
208 inline void lowerBound(
const double&
x,
int& xIndex,
209 const double&
y,
int& yIndex,
210 const double&
z,
int& zIndex)
const;
217 inline void lowerBound(
const double&
x,
const double&
y,
const double&
z,
221 inline double minX()
const;
224 inline double maxX()
const;
227 inline double minY()
const;
230 inline double maxY()
const;
233 inline double minZ()
const;
236 inline double maxZ()
const;
239 inline void setX(
int nXCoords,
double *
x);
242 inline void setY(
int nYCoords,
double *
y);
245 inline void setZ(
int nZCoords,
double *
z);
309 int difference)
const;
311 int difference)
const;
360 double *
x =
new double[
x_m.size()];
361 for (
unsigned int i = 0; i <
x_m.size(); i++)
367 double *
y =
new double[
y_m.size()];
368 for (
unsigned int i = 0; i <
y_m.size(); i++)
374 double *
z =
new double[
z_m.size()];
375 for (
unsigned int i = 0; i <
z_m.size(); i++)
381 const double& y,
int& yIndex,
382 const double& z,
int& zIndex)
const {
448 x_m = std::vector<double>(
x, x+nXCoords);
452 y_m = std::vector<double>(
y, y+nYCoords);
456 z_m = std::vector<double>(
z, z+nZCoords);
void xLowerBound(const double &x, int &xIndex) const
Mesh::Iterator getNearest(const double *position) const
Mesh::Iterator end() const
std::vector< double > xVector()
const double & z(const int &j) const
void zLowerBound(const double &z, int &zIndex) const
friend bool operator!=(const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
std::vector< double > z_m
friend Mesh::Iterator operator++(Mesh::Iterator &lhs, int)
void setZ(int nZCoords, double *z)
virtual Mesh::Iterator & subOne(Mesh::Iterator &lhs) const
std::vector< double > zVector()
const double & x(const int &i) const
void setY(int nYCoords, double *y)
const double & y(const int &j) const
std::vector< double > y_m
bool getConstantSpacing() const
virtual Mesh::Iterator & subEquals(Mesh::Iterator &lhs, int difference) const
friend bool operator>=(const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
virtual void getPosition(const Mesh::Iterator &it, double *position) const
void yLowerBound(const double &y, int &yIndex) const
void setConstantSpacing()
friend bool operator>(const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
Mesh::Iterator begin() const
virtual bool isGreater(const Mesh::Iterator &lhs, const Mesh::Iterator &rhs) const
int toInteger(const Mesh::Iterator &lhs) const
static void vectorLowerBound(std::vector< double > vec, double x, int &index)
void setX(int nXCoords, double *x)
virtual Mesh::Iterator & addEquals(Mesh::Iterator &lhs, int difference) const
Base class for meshing routines.
friend bool operator==(const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
std::vector< VectorMap * > maps_m
std::vector< int > getState() const
friend Mesh::Iterator operator--(Mesh::Iterator &lhs, int)
virtual Mesh::Iterator & addOne(Mesh::Iterator &lhs) const
friend bool operator<(const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
void lowerBound(const double &x, int &xIndex, const double &y, int &yIndex, const double &z, int &zIndex) const
int getPositionDimension() const
friend bool operator<=(const Mesh::Iterator &lhs, const Mesh::Iterator &rhs)
std::vector< double > yVector()
PETE_TUTree< FnFloor, typename T::PETE_Expr_t > floor(const PETE_Expr< T > &l)
std::vector< double > x_m