VTK  9.0.1
vtkHigherOrderInterpolation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHigherOrderInterpolation.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 // .NAME vtkHigherOrderInterpolation
16 // .SECTION Description
17 // .SECTION See Also
18 #ifndef vtkHigherOrderInterpolation_h
19 #define vtkHigherOrderInterpolation_h
20 
21 #include "vtkCommonDataModelModule.h" // For export macro.
22 #include "vtkObject.h"
23 #include "vtkSmartPointer.h" // For API.
24 
25 #include <vector> // For scratch storage.
26 
27 // Define this to include support for a "complete" (21- vs 18-point) wedge.
28 #define VTK_21_POINT_WEDGE true
29 
30 class vtkPoints;
31 class vtkVector2i;
32 class vtkVector3d;
34 
35 class VTKCOMMONDATAMODEL_EXPORT vtkHigherOrderInterpolation : public vtkObject
36 {
37 public:
38  // static vtkHigherOrderInterpolation* New();
39  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
42  static int Tensor1ShapeFunctions(const int order[1], const double* pcoords, double* shape,
43  void (*function_evaluate_shape_functions)(int, double, double*));
44  static int Tensor1ShapeDerivatives(const int order[1], const double* pcoords, double* derivs,
45  void (*function_evaluate_shape_and_gradient)(int, double, double*, double*));
46 
47  static int Tensor2ShapeFunctions(const int order[2], const double* pcoords, double* shape,
48  void (*function_evaluate_shape_functions)(int, double, double*));
49  static int Tensor2ShapeDerivatives(const int order[2], const double* pcoords, double* derivs,
50  void (*function_evaluate_shape_and_gradient)(int, double, double*, double*));
51 
52  static int Tensor3ShapeFunctions(const int order[3], const double* pcoords, double* shape,
53  void (*function_evaluate_shape_functions)(int, double, double*));
54  static int Tensor3ShapeDerivatives(const int order[3], const double* pcoords, double* derivs,
55  void (*function_evaluate_shape_and_gradient)(int, double, double*, double*));
56 
57  virtual void Tensor3EvaluateDerivative(const int order[3], const double* pcoords,
58  vtkPoints* points, const double* fieldVals, int fieldDim, double* fieldDerivs) = 0;
59 
60  void Tensor3EvaluateDerivative(const int order[3], const double* pcoords, vtkPoints* points,
61  const double* fieldVals, int fieldDim, double* fieldDerivs,
62  void (*function_evaluate_shape_and_gradient)(int, double, double*, double*));
63 
64  static void WedgeShapeFunctions(const int order[3], const vtkIdType numberOfPoints,
65  const double* pcoords, double* shape, vtkHigherOrderTriangle& tri,
66  void (*function_evaluate_shape_functions)(int, double, double*));
67  static void WedgeShapeDerivatives(const int order[3], const vtkIdType numberOfPoints,
68  const double* pcoords, double* derivs, vtkHigherOrderTriangle& tri,
69  void (*function_evaluate_shape_and_gradient)(int, double, double*, double*));
70 
75  int JacobianInverse(vtkPoints* points, const double* derivs, double** inverse);
76  int JacobianInverseWedge(vtkPoints* points, const double* derivs, double** inverse);
77 
78  virtual void WedgeEvaluate(const int order[3], const vtkIdType numberOfPoints,
79  const double* pcoords, double* fieldVals, int fieldDim, double* fieldAtPCoords) = 0;
80 
81  void WedgeEvaluate(const int order[3], const vtkIdType numberOfPoints, const double* pcoords,
82  double* fieldVals, int fieldDim, double* fieldAtPCoords, vtkHigherOrderTriangle& tri,
83  void (*function_evaluate_shape_functions)(int, double, double*));
84 
85  virtual void WedgeEvaluateDerivative(const int order[3], const double* pcoords, vtkPoints* points,
86  const double* fieldVals, int fieldDim, double* fieldDerivs) = 0;
87 
88  void WedgeEvaluateDerivative(const int order[3], const double* pcoords, vtkPoints* points,
89  const double* fieldVals, int fieldDim, double* fieldDerivs, vtkHigherOrderTriangle& tri,
90  void (*function_evaluate_shape_and_gradient)(int, double, double*, double*));
91 
94  static int GetVaryingParameterOfHexEdge(int edgeId);
96 
97  static const int* GetPointIndicesBoundingHexFace(int faceId) VTK_SIZEHINT(4);
98  static const int* GetEdgeIndicesBoundingHexFace(int faceId) VTK_SIZEHINT(4);
100  static int GetFixedParameterOfHexFace(int faceId);
101 
104  static int GetVaryingParameterOfWedgeEdge(int edgeId);
106 
107  static const int* GetPointIndicesBoundingWedgeFace(int faceId) VTK_SIZEHINT(4);
108  static const int* GetEdgeIndicesBoundingWedgeFace(int faceId) VTK_SIZEHINT(4);
110  static int GetFixedParameterOfWedgeFace(int faceId);
111 
114  vtkSmartPointer<vtkPoints>& pts, const int order[2]);
116  vtkSmartPointer<vtkPoints>& pts, const int order[3]);
118 
119  template <int N>
120  static int NumberOfIntervals(const int order[N]);
121 
122 protected:
125 
126  void PrepareForOrder(const int order[3], const vtkIdType numberOfPoints);
127 
128  std::vector<double> ShapeSpace;
129  std::vector<double> DerivSpace;
130 
131 private:
133  void operator=(const vtkHigherOrderInterpolation&) = delete;
134 };
135 
136 template <int N>
138 {
139  int ni = 1;
140  for (int n = 0; n < N; ++n)
141  {
142  ni *= order[n];
143  }
144  return ni;
145 }
146 
147 #endif // vtkHigherOrderInterpolation_h
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:34
vtkHigherOrderInterpolation::PrepareForOrder
void PrepareForOrder(const int order[3], const vtkIdType numberOfPoints)
vtkHigherOrderInterpolation::NumberOfIntervals
static int NumberOfIntervals(const int order[N])
Definition: vtkHigherOrderInterpolation.h:137
vtkHigherOrderInterpolation::Tensor1ShapeDerivatives
static int Tensor1ShapeDerivatives(const int order[1], const double *pcoords, double *derivs, void(*function_evaluate_shape_and_gradient)(int, double, double *, double *))
vtkHigherOrderInterpolation::JacobianInverseWedge
int JacobianInverseWedge(vtkPoints *points, const double *derivs, double **inverse)
vtkHigherOrderInterpolation::GetFixedParametersOfHexEdge
static vtkVector2i GetFixedParametersOfHexEdge(int edgeId)
vtkHigherOrderInterpolation::Tensor2ShapeDerivatives
static int Tensor2ShapeDerivatives(const int order[2], const double *pcoords, double *derivs, void(*function_evaluate_shape_and_gradient)(int, double, double *, double *))
vtkHigherOrderInterpolation::GetVaryingParameterOfHexEdge
static int GetVaryingParameterOfHexEdge(int edgeId)
vtkHigherOrderInterpolation::~vtkHigherOrderInterpolation
~vtkHigherOrderInterpolation() override
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkHigherOrderInterpolation::ShapeSpace
std::vector< double > ShapeSpace
Definition: vtkHigherOrderInterpolation.h:128
vtkHigherOrderInterpolation::WedgeEvaluate
void WedgeEvaluate(const int order[3], const vtkIdType numberOfPoints, const double *pcoords, double *fieldVals, int fieldDim, double *fieldAtPCoords, vtkHigherOrderTriangle &tri, void(*function_evaluate_shape_functions)(int, double, double *))
vtkHigherOrderInterpolation::GetPointIndicesBoundingWedgeFace
static const int * GetPointIndicesBoundingWedgeFace(int faceId)
vtkSmartPointer< vtkPoints >
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:54
vtkHigherOrderInterpolation::Tensor3EvaluateDerivative
virtual void Tensor3EvaluateDerivative(const int order[3], const double *pcoords, vtkPoints *points, const double *fieldVals, int fieldDim, double *fieldDerivs)=0
vtkHigherOrderInterpolation::JacobianInverse
int JacobianInverse(vtkPoints *points, const double *derivs, double **inverse)
Compute the inverse of the Jacobian and put the values in inverse.
vtkHigherOrderInterpolation::GetParametricWedgeCoordinates
static vtkVector3d GetParametricWedgeCoordinates(int vertexId)
vtkHigherOrderInterpolation::Tensor3ShapeDerivatives
static int Tensor3ShapeDerivatives(const int order[3], const double *pcoords, double *derivs, void(*function_evaluate_shape_and_gradient)(int, double, double *, double *))
vtkHigherOrderInterpolation::GetEdgeIndicesBoundingHexFace
static const int * GetEdgeIndicesBoundingHexFace(int faceId)
vtkHigherOrderInterpolation::Tensor3EvaluateDerivative
void Tensor3EvaluateDerivative(const int order[3], const double *pcoords, vtkPoints *points, const double *fieldVals, int fieldDim, double *fieldDerivs, void(*function_evaluate_shape_and_gradient)(int, double, double *, double *))
vtkHigherOrderInterpolation::GetPointIndicesBoundingHexEdge
static vtkVector2i GetPointIndicesBoundingHexEdge(int edgeId)
vtkHigherOrderInterpolation::GetVaryingParametersOfHexFace
static vtkVector2i GetVaryingParametersOfHexFace(int faceId)
vtkX3D::points
@ points
Definition: vtkX3D.h:452
vtkHigherOrderInterpolation::GetPointIndicesBoundingHexFace
static const int * GetPointIndicesBoundingHexFace(int faceId)
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
vtkHigherOrderInterpolation::GetVaryingParameterOfWedgeEdge
static int GetVaryingParameterOfWedgeEdge(int edgeId)
vtkHigherOrderInterpolation::AppendCurveCollocationPoints
static void AppendCurveCollocationPoints(vtkSmartPointer< vtkPoints > &pts, const int order[1])
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkHigherOrderInterpolation::vtkHigherOrderInterpolation
vtkHigherOrderInterpolation()
vtkSmartPointer.h
vtkHigherOrderInterpolation::Tensor1ShapeFunctions
static int Tensor1ShapeFunctions(const int order[1], const double *pcoords, double *shape, void(*function_evaluate_shape_functions)(int, double, double *))
vtkHigherOrderInterpolation::WedgeShapeDerivatives
static void WedgeShapeDerivatives(const int order[3], const vtkIdType numberOfPoints, const double *pcoords, double *derivs, vtkHigherOrderTriangle &tri, void(*function_evaluate_shape_and_gradient)(int, double, double *, double *))
vtkHigherOrderInterpolation::AppendWedgeCollocationPoints
static void AppendWedgeCollocationPoints(vtkSmartPointer< vtkPoints > &pts, const int order[3])
vtkHigherOrderInterpolation::AppendHexahedronCollocationPoints
static void AppendHexahedronCollocationPoints(vtkSmartPointer< vtkPoints > &pts, const int order[3])
vtkObject.h
vtkX3D::order
@ order
Definition: vtkX3D.h:446
vtkHigherOrderInterpolation::DerivSpace
std::vector< double > DerivSpace
Definition: vtkHigherOrderInterpolation.h:129
vtkHigherOrderInterpolation::GetVaryingParametersOfWedgeFace
static vtkVector2i GetVaryingParametersOfWedgeFace(int faceId)
vtkHigherOrderInterpolation::WedgeEvaluateDerivative
virtual void WedgeEvaluateDerivative(const int order[3], const double *pcoords, vtkPoints *points, const double *fieldVals, int fieldDim, double *fieldDerivs)=0
vtkHigherOrderInterpolation::AppendQuadrilateralCollocationPoints
static void AppendQuadrilateralCollocationPoints(vtkSmartPointer< vtkPoints > &pts, const int order[2])
vtkHigherOrderInterpolation::Tensor3ShapeFunctions
static int Tensor3ShapeFunctions(const int order[3], const double *pcoords, double *shape, void(*function_evaluate_shape_functions)(int, double, double *))
vtkHigherOrderInterpolation::WedgeEvaluate
virtual void WedgeEvaluate(const int order[3], const vtkIdType numberOfPoints, const double *pcoords, double *fieldVals, int fieldDim, double *fieldAtPCoords)=0
vtkHigherOrderInterpolation::WedgeShapeFunctions
static void WedgeShapeFunctions(const int order[3], const vtkIdType numberOfPoints, const double *pcoords, double *shape, vtkHigherOrderTriangle &tri, void(*function_evaluate_shape_functions)(int, double, double *))
vtkHigherOrderInterpolation::GetFixedParameterOfHexFace
static int GetFixedParameterOfHexFace(int faceId)
vtkHigherOrderInterpolation::GetParametricHexCoordinates
static vtkVector3d GetParametricHexCoordinates(int vertexId)
vtkHigherOrderInterpolation
Definition: vtkHigherOrderInterpolation.h:36
vtkHigherOrderInterpolation::Tensor2ShapeFunctions
static int Tensor2ShapeFunctions(const int order[2], const double *pcoords, double *shape, void(*function_evaluate_shape_functions)(int, double, double *))
vtkVector2i
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:420
vtkHigherOrderInterpolation::WedgeEvaluateDerivative
void WedgeEvaluateDerivative(const int order[3], const double *pcoords, vtkPoints *points, const double *fieldVals, int fieldDim, double *fieldDerivs, vtkHigherOrderTriangle &tri, void(*function_evaluate_shape_and_gradient)(int, double, double *, double *))
vtkHigherOrderInterpolation::GetEdgeIndicesBoundingWedgeFace
static const int * GetEdgeIndicesBoundingWedgeFace(int faceId)
vtkHigherOrderInterpolation::GetFixedParametersOfWedgeEdge
static vtkVector2i GetFixedParametersOfWedgeEdge(int edgeId)
vtkHigherOrderInterpolation::GetFixedParameterOfWedgeFace
static int GetFixedParameterOfWedgeFace(int faceId)
vtkHigherOrderInterpolation::GetPointIndicesBoundingWedgeEdge
static vtkVector2i GetPointIndicesBoundingWedgeEdge(int edgeId)
vtkVector3d
Definition: vtkVector.h:489
vtkHigherOrderTriangle
A 2D cell that represents an arbitrary order HigherOrder triangle.
Definition: vtkHigherOrderTriangle.h:48
vtkHigherOrderInterpolation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.