VTK  9.7.20260727
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#include "vtkVector.h" // vtkVector2i, vtkVector3d
13
14#include <vector> // For scratch storage.
15
16// Define this to include support for a "complete" (21- vs 18-point) wedge.
17#define VTK_21_POINT_WEDGE true
18
19VTK_ABI_NAMESPACE_BEGIN
20class vtkPoints;
22
23class VTKCOMMONDATAMODEL_EXPORT vtkHigherOrderInterpolation : public vtkObject
24{
25public:
26 // static vtkHigherOrderInterpolation* New();
27 void PrintSelf(ostream& os, vtkIndent indent) override;
29
30 static int Tensor1ShapeFunctions(const int order[1], const double* pcoords, double* shape,
31 void (*function_evaluate_shape_functions)(int, double, double*));
32 static int Tensor1ShapeDerivatives(const int order[1], const double* pcoords, double* derivs,
33 void (*function_evaluate_shape_and_gradient)(int, double, double*, double*));
34
35 static int Tensor2ShapeFunctions(const int order[2], const double* pcoords, double* shape,
36 void (*function_evaluate_shape_functions)(int, double, double*));
37 static int Tensor2ShapeDerivatives(const int order[2], const double* pcoords, double* derivs,
38 void (*function_evaluate_shape_and_gradient)(int, double, double*, double*));
39
40 static int Tensor3ShapeFunctions(const int order[3], const double* pcoords, double* shape,
41 void (*function_evaluate_shape_functions)(int, double, double*));
42 static int Tensor3ShapeDerivatives(const int order[3], const double* pcoords, double* derivs,
43 void (*function_evaluate_shape_and_gradient)(int, double, double*, double*));
44
45 virtual void Tensor3EvaluateDerivative(const int order[3], const double* pcoords,
46 vtkPoints* points, const double* fieldVals, int fieldDim, double* fieldDerivs) = 0;
47
48 void Tensor3EvaluateDerivative(const int order[3], const double* pcoords, vtkPoints* points,
49 const double* fieldVals, int fieldDim, double* fieldDerivs,
50 void (*function_evaluate_shape_and_gradient)(int, double, double*, double*));
51
52 static void WedgeShapeFunctions(const int order[3], vtkIdType numberOfPoints,
53 const double* pcoords, double* shape, vtkHigherOrderTriangle& tri,
54 void (*function_evaluate_shape_functions)(int, double, double*));
55 static void WedgeShapeDerivatives(const int order[3], vtkIdType numberOfPoints,
56 const double* pcoords, double* derivs, vtkHigherOrderTriangle& tri,
57 void (*function_evaluate_shape_and_gradient)(int, double, double*, double*));
58
63 int JacobianInverse(vtkPoints* points, const double* derivs, double** inverse);
64 int JacobianInverseWedge(vtkPoints* points, const double* derivs, double** inverse);
65
66 virtual void WedgeEvaluate(const int order[3], vtkIdType numberOfPoints, const double* pcoords,
67 double* fieldVals, int fieldDim, double* fieldAtPCoords) = 0;
68
69 void WedgeEvaluate(const int order[3], vtkIdType numberOfPoints, const double* pcoords,
70 double* fieldVals, int fieldDim, double* fieldAtPCoords, vtkHigherOrderTriangle& tri,
71 void (*function_evaluate_shape_functions)(int, double, double*));
72
73 virtual void WedgeEvaluateDerivative(const int order[3], const double* pcoords, vtkPoints* points,
74 const double* fieldVals, int fieldDim, double* fieldDerivs) = 0;
75
76 void WedgeEvaluateDerivative(const int order[3], const double* pcoords, vtkPoints* points,
77 const double* fieldVals, int fieldDim, double* fieldDerivs, vtkHigherOrderTriangle& tri,
78 void (*function_evaluate_shape_and_gradient)(int, double, double*, double*));
79
82 static int GetVaryingParameterOfHexEdge(int edgeId);
84
85 static const int* GetPointIndicesBoundingHexFace(int faceId) VTK_SIZEHINT(4);
86 static const int* GetEdgeIndicesBoundingHexFace(int faceId) VTK_SIZEHINT(4);
88 static int GetFixedParameterOfHexFace(int faceId);
89
92 static int GetVaryingParameterOfWedgeEdge(int edgeId);
94
95 static const int* GetPointIndicesBoundingWedgeFace(int faceId) VTK_SIZEHINT(4);
96 static const int* GetEdgeIndicesBoundingWedgeFace(int faceId) VTK_SIZEHINT(4);
98 static int GetFixedParameterOfWedgeFace(int faceId);
99
100 static void AppendCurveCollocationPoints(vtkSmartPointer<vtkPoints>& pts, const int order[1]);
102 vtkSmartPointer<vtkPoints>& pts, const int order[2]);
104 vtkSmartPointer<vtkPoints>& pts, const int order[3]);
105 static void AppendWedgeCollocationPoints(vtkSmartPointer<vtkPoints>& pts, const int order[3]);
106
107 template <int N>
108 static int NumberOfIntervals(const int order[N]);
109
110protected:
113
114 void PrepareForOrder(const int order[3], vtkIdType numberOfPoints);
115
116 std::vector<double> ShapeSpace;
117 std::vector<double> DerivSpace;
118
119private:
121 void operator=(const vtkHigherOrderInterpolation&) = delete;
122};
123
124template <int N>
126{
127 int ni = 1;
128 for (int n = 0; n < N; ++n)
129 {
130 ni *= order[n];
131 }
132 return ni;
133}
134
135VTK_ABI_NAMESPACE_END
136#endif // vtkHigherOrderInterpolation_h
int JacobianInverseWedge(vtkPoints *points, const double *derivs, double **inverse)
static const int * GetPointIndicesBoundingWedgeFace(int faceId)
static vtkVector2i GetFixedParametersOfWedgeEdge(int edgeId)
static void AppendCurveCollocationPoints(vtkSmartPointer< vtkPoints > &pts, const int order[1])
static const int * GetEdgeIndicesBoundingWedgeFace(int faceId)
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 void WedgeShapeFunctions(const int order[3], vtkIdType numberOfPoints, const double *pcoords, double *shape, vtkHigherOrderTriangle &tri, void(*function_evaluate_shape_functions)(int, double, double *))
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 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)
static const int * GetEdgeIndicesBoundingHexFace(int faceId)
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 const int * GetPointIndicesBoundingHexFace(int faceId)
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 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:108
represent and manipulate 3D points
Definition vtkPoints.h:140
Hold a reference to a vtkObjectBase instance.
Some derived classes for the different vectors commonly used.
Definition vtkVector.h:450
int vtkIdType
Definition vtkType.h:363
#define VTK_SIZEHINT(...)