VTK  9.3.0
vtkHigherOrderInterpolation.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 // .NAME vtkHigherOrderInterpolation
4 // .SECTION Description
5 // .SECTION See Also
6 #ifndef vtkHigherOrderInterpolation_h
7 #define vtkHigherOrderInterpolation_h
8 
9 #include "vtkCommonDataModelModule.h" // For export macro.
10 #include "vtkObject.h"
11 #include "vtkSmartPointer.h" // For API.
12 
13 #include <vector> // For scratch storage.
14 
15 // Define this to include support for a "complete" (21- vs 18-point) wedge.
16 #define VTK_21_POINT_WEDGE true
17 
18 VTK_ABI_NAMESPACE_BEGIN
19 class vtkPoints;
20 class vtkVector2i;
21 class vtkVector3d;
23 
24 class VTKCOMMONDATAMODEL_EXPORT vtkHigherOrderInterpolation : public vtkObject
25 {
26 public:
27  // static vtkHigherOrderInterpolation* New();
28  void PrintSelf(ostream& os, vtkIndent indent) override;
30 
31  static int Tensor1ShapeFunctions(const int order[1], const double* pcoords, double* shape,
32  void (*function_evaluate_shape_functions)(int, double, double*));
33  static int Tensor1ShapeDerivatives(const int order[1], const double* pcoords, double* derivs,
34  void (*function_evaluate_shape_and_gradient)(int, double, double*, double*));
35 
36  static int Tensor2ShapeFunctions(const int order[2], const double* pcoords, double* shape,
37  void (*function_evaluate_shape_functions)(int, double, double*));
38  static int Tensor2ShapeDerivatives(const int order[2], const double* pcoords, double* derivs,
39  void (*function_evaluate_shape_and_gradient)(int, double, double*, double*));
40 
41  static int Tensor3ShapeFunctions(const int order[3], const double* pcoords, double* shape,
42  void (*function_evaluate_shape_functions)(int, double, double*));
43  static int Tensor3ShapeDerivatives(const int order[3], const double* pcoords, double* derivs,
44  void (*function_evaluate_shape_and_gradient)(int, double, double*, double*));
45 
46  virtual void Tensor3EvaluateDerivative(const int order[3], const double* pcoords,
47  vtkPoints* points, const double* fieldVals, int fieldDim, double* fieldDerivs) = 0;
48 
49  void Tensor3EvaluateDerivative(const int order[3], const double* pcoords, vtkPoints* points,
50  const double* fieldVals, int fieldDim, double* fieldDerivs,
51  void (*function_evaluate_shape_and_gradient)(int, double, double*, double*));
52 
53  static void WedgeShapeFunctions(const int order[3], vtkIdType numberOfPoints,
54  const double* pcoords, double* shape, vtkHigherOrderTriangle& tri,
55  void (*function_evaluate_shape_functions)(int, double, double*));
56  static void WedgeShapeDerivatives(const int order[3], vtkIdType numberOfPoints,
57  const double* pcoords, double* derivs, vtkHigherOrderTriangle& tri,
58  void (*function_evaluate_shape_and_gradient)(int, double, double*, double*));
59 
64  int JacobianInverse(vtkPoints* points, const double* derivs, double** inverse);
65  int JacobianInverseWedge(vtkPoints* points, const double* derivs, double** inverse);
66 
67  virtual void WedgeEvaluate(const int order[3], vtkIdType numberOfPoints, const double* pcoords,
68  double* fieldVals, int fieldDim, double* fieldAtPCoords) = 0;
69 
70  void WedgeEvaluate(const int order[3], vtkIdType numberOfPoints, const double* pcoords,
71  double* fieldVals, int fieldDim, double* fieldAtPCoords, vtkHigherOrderTriangle& tri,
72  void (*function_evaluate_shape_functions)(int, double, double*));
73 
74  virtual void WedgeEvaluateDerivative(const int order[3], const double* pcoords, vtkPoints* points,
75  const double* fieldVals, int fieldDim, double* fieldDerivs) = 0;
76 
77  void WedgeEvaluateDerivative(const int order[3], const double* pcoords, vtkPoints* points,
78  const double* fieldVals, int fieldDim, double* fieldDerivs, vtkHigherOrderTriangle& tri,
79  void (*function_evaluate_shape_and_gradient)(int, double, double*, double*));
80 
83  static int GetVaryingParameterOfHexEdge(int edgeId);
85 
86  static const int* GetPointIndicesBoundingHexFace(int faceId) VTK_SIZEHINT(4);
87  static const int* GetEdgeIndicesBoundingHexFace(int faceId) VTK_SIZEHINT(4);
89  static int GetFixedParameterOfHexFace(int faceId);
90 
93  static int GetVaryingParameterOfWedgeEdge(int edgeId);
95 
96  static const int* GetPointIndicesBoundingWedgeFace(int faceId) VTK_SIZEHINT(4);
97  static const int* GetEdgeIndicesBoundingWedgeFace(int faceId) VTK_SIZEHINT(4);
99  static int GetFixedParameterOfWedgeFace(int faceId);
100 
103  vtkSmartPointer<vtkPoints>& pts, const int order[2]);
105  vtkSmartPointer<vtkPoints>& pts, const int order[3]);
107 
108  template <int N>
109  static int NumberOfIntervals(const int order[N]);
110 
111 protected:
114 
115  void PrepareForOrder(const int order[3], vtkIdType numberOfPoints);
116 
117  std::vector<double> ShapeSpace;
118  std::vector<double> DerivSpace;
119 
120 private:
122  void operator=(const vtkHigherOrderInterpolation&) = delete;
123 };
124 
125 template <int N>
127 {
128  int ni = 1;
129  for (int n = 0; n < N; ++n)
130  {
131  ni *= order[n];
132  }
133  return ni;
134 }
135 
136 VTK_ABI_NAMESPACE_END
137 #endif // vtkHigherOrderInterpolation_h
int JacobianInverseWedge(vtkPoints *points, const double *derivs, double **inverse)
static vtkVector2i GetFixedParametersOfWedgeEdge(int edgeId)
static void AppendCurveCollocationPoints(vtkSmartPointer< vtkPoints > &pts, const int order[1])
static vtkVector2i GetVaryingParametersOfWedgeFace(int faceId)
static int Tensor1ShapeFunctions(const int order[1], const double *pcoords, double *shape, void(*function_evaluate_shape_functions)(int, double, double *))
static void AppendHexahedronCollocationPoints(vtkSmartPointer< vtkPoints > &pts, const int order[3])
static int Tensor3ShapeDerivatives(const int order[3], const double *pcoords, double *derivs, void(*function_evaluate_shape_and_gradient)(int, double, double *, double *))
static int Tensor2ShapeDerivatives(const int order[2], const double *pcoords, double *derivs, void(*function_evaluate_shape_and_gradient)(int, double, double *, double *))
static const int * GetPointIndicesBoundingWedgeFace(int faceId)
static void WedgeShapeFunctions(const int order[3], vtkIdType numberOfPoints, const double *pcoords, double *shape, vtkHigherOrderTriangle &tri, void(*function_evaluate_shape_functions)(int, double, double *))
static const int * GetPointIndicesBoundingHexFace(int faceId)
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 *))
static const int * GetEdgeIndicesBoundingHexFace(int faceId)
static vtkVector2i GetPointIndicesBoundingHexEdge(int edgeId)
static vtkVector2i GetVaryingParametersOfHexFace(int faceId)
static void WedgeShapeDerivatives(const int order[3], vtkIdType numberOfPoints, const double *pcoords, double *derivs, vtkHigherOrderTriangle &tri, void(*function_evaluate_shape_and_gradient)(int, double, double *, double *))
static int Tensor2ShapeFunctions(const int order[2], const double *pcoords, double *shape, void(*function_evaluate_shape_functions)(int, double, double *))
static int GetFixedParameterOfWedgeFace(int faceId)
void PrepareForOrder(const int order[3], vtkIdType numberOfPoints)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static int NumberOfIntervals(const int order[N])
static int GetVaryingParameterOfHexEdge(int edgeId)
void WedgeEvaluate(const int order[3], vtkIdType numberOfPoints, const double *pcoords, double *fieldVals, int fieldDim, double *fieldAtPCoords, vtkHigherOrderTriangle &tri, void(*function_evaluate_shape_functions)(int, double, double *))
static int GetVaryingParameterOfWedgeEdge(int edgeId)
virtual void WedgeEvaluateDerivative(const int order[3], const double *pcoords, vtkPoints *points, const double *fieldVals, int fieldDim, double *fieldDerivs)=0
static void AppendQuadrilateralCollocationPoints(vtkSmartPointer< vtkPoints > &pts, const int order[2])
~vtkHigherOrderInterpolation() override
static vtkVector2i GetPointIndicesBoundingWedgeEdge(int edgeId)
static const int * GetEdgeIndicesBoundingWedgeFace(int faceId)
static int Tensor1ShapeDerivatives(const int order[1], const double *pcoords, double *derivs, void(*function_evaluate_shape_and_gradient)(int, double, double *, double *))
virtual void WedgeEvaluate(const int order[3], vtkIdType numberOfPoints, const double *pcoords, double *fieldVals, int fieldDim, double *fieldAtPCoords)=0
int JacobianInverse(vtkPoints *points, const double *derivs, double **inverse)
Compute the inverse of the Jacobian and put the values in inverse.
static vtkVector3d GetParametricWedgeCoordinates(int vertexId)
static vtkVector2i GetFixedParametersOfHexEdge(int edgeId)
static int GetFixedParameterOfHexFace(int faceId)
static void AppendWedgeCollocationPoints(vtkSmartPointer< vtkPoints > &pts, const int order[3])
virtual void Tensor3EvaluateDerivative(const int order[3], const double *pcoords, vtkPoints *points, const double *fieldVals, int fieldDim, double *fieldDerivs)=0
static vtkVector3d GetParametricHexCoordinates(int vertexId)
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 *))
static int Tensor3ShapeFunctions(const int order[3], const double *pcoords, double *shape, void(*function_evaluate_shape_functions)(int, double, double *))
A 2D cell that represents an arbitrary order HigherOrder triangle.
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract base class for most VTK objects
Definition: vtkObject.h:61
represent and manipulate 3D points
Definition: vtkPoints.h:38
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:420
@ points
Definition: vtkX3D.h:446
@ order
Definition: vtkX3D.h:440
int vtkIdType
Definition: vtkType.h:315
#define VTK_SIZEHINT(...)