VTK  9.1.0
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
30class vtkPoints;
31class vtkVector2i;
32class vtkVector3d;
34
35class VTKCOMMONDATAMODEL_EXPORT vtkHigherOrderInterpolation : public vtkObject
36{
37public:
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
112 static void AppendCurveCollocationPoints(vtkSmartPointer<vtkPoints>& pts, const int order[1]);
114 vtkSmartPointer<vtkPoints>& pts, const int order[2]);
116 vtkSmartPointer<vtkPoints>& pts, const int order[3]);
117 static void AppendWedgeCollocationPoints(vtkSmartPointer<vtkPoints>& pts, const int order[3]);
118
119 template <int N>
120 static int NumberOfIntervals(const int order[N]);
121
122protected:
125
126 void PrepareForOrder(const int order[3], const vtkIdType numberOfPoints);
127
128 std::vector<double> ShapeSpace;
129 std::vector<double> DerivSpace;
130
131private:
133 void operator=(const vtkHigherOrderInterpolation&) = delete;
134};
135
136template <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
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], const 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 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], const 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)
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 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 *))
static int Tensor1ShapeDerivatives(const int order[1], const double *pcoords, double *derivs, void(*function_evaluate_shape_and_gradient)(int, double, double *, double *))
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)
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 *))
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 *))
virtual void WedgeEvaluate(const int order[3], const vtkIdType numberOfPoints, const double *pcoords, double *fieldVals, int fieldDim, double *fieldAtPCoords)=0
A 2D cell that represents an arbitrary order HigherOrder triangle.
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:82
represent and manipulate 3D points
Definition: vtkPoints.h:143
Hold a reference to a vtkObjectBase instance.
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:478
int vtkIdType
Definition: vtkType.h:332
#define VTK_SIZEHINT(...)