VTK  9.6.20260706
vtkTriQuadraticPyramid.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
80
81#ifndef vtkTriQuadraticPyramid_h
82#define vtkTriQuadraticPyramid_h
83
84#include "vtkCommonDataModelModule.h" // For export macro
85#include "vtkNonLinearCell3D.h"
86
87VTK_ABI_NAMESPACE_BEGIN
91class vtkTetra;
92class vtkPyramid;
93class vtkDoubleArray;
94
95class VTKCOMMONDATAMODEL_EXPORT vtkTriQuadraticPyramid : public vtkNonLinearCell3D
96{
97public:
100 void PrintSelf(ostream& os, vtkIndent indent) override;
101
103
107 int GetCellType() override { return VTK_TRIQUADRATIC_PYRAMID; }
108 int GetNumberOfEdges() override { return 8; }
109 int GetNumberOfFaces() override { return 5; }
110 vtkCell* GetEdge(int edgeId) override;
111 vtkCell* GetFace(int faceId) override;
113
114 int CellBoundary(int subId, const double pcoords[3], vtkIdList* pts) override;
115 void Contour(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
116 vtkCellArray* verts, vtkCellArray* lines, vtkCellArray* polys, vtkPointData* inPd,
117 vtkPointData* outPd, vtkCellData* inCd, vtkIdType cellId, vtkCellData* outCd) override;
118 int EvaluatePosition(const double x[3], double closestPoint[3], int& subId, double pcoords[3],
119 double& dist2, double weights[]) override;
120 void EvaluateLocation(int& subId, const double pcoords[3], double x[3], double* weights) override;
121
126 int IntersectWithLine(const double p1[3], const double p2[3], double tol, double& t, double x[3],
127 double pcoords[3], int& subId) override;
128
129 int TriangulateLocalIds(int index, vtkIdList* ptIds) override;
131 int subId, const double pcoords[3], const double* values, int dim, double* derivs) override;
132 double* GetParametricCoords() override;
133
139 void Clip(double value, vtkDataArray* cellScalars, vtkIncrementalPointLocator* locator,
140 vtkCellArray* tets, vtkPointData* inPd, vtkPointData* outPd, vtkCellData* inCd,
141 vtkIdType cellId, vtkCellData* outCd, int insideOut) override;
142
146 int GetParametricCenter(double pcoords[3]) override;
147
152 double GetParametricDistance(const double pcoords[3]) override;
153
154 static void InterpolationFunctions(const double pcoords[3], double weights[19]);
155 static void InterpolationDerivs(const double pcoords[3], double derivs[57]);
157
161 void InterpolateFunctions(const double pcoords[3], double weights[19]) override
162 {
164 }
165 void InterpolateDerivs(const double pcoords[3], double derivs[57]) override
166 {
168 }
169
170
176 void JacobianInverse(const double pcoords[3], double** inverse, double derivs[57]);
177
179
186 static const vtkIdType* GetEdgeArray(vtkIdType edgeId);
187 static const vtkIdType* GetFaceArray(vtkIdType faceId);
189
191
196 vtkIdType GetEdgePoints(vtkIdType edgeId, const vtkIdType*& pts) override;
197 vtkIdType GetFacePoints(vtkIdType faceId, const vtkIdType*& pts) override;
198 void GetEdgeToAdjacentFaces(vtkIdType edgeId, const vtkIdType*& faceIds) override;
199 vtkIdType GetFaceToAdjacentFaces(vtkIdType faceId, const vtkIdType*& faceIds) override;
200 vtkIdType GetPointToIncidentEdges(vtkIdType pointId, const vtkIdType*& edgeIds) override;
201 vtkIdType GetPointToIncidentFaces(vtkIdType pointId, const vtkIdType*& faceIds) override;
202 vtkIdType GetPointToOneRingPoints(vtkIdType pointId, const vtkIdType*& pts) override;
204
205protected:
207 ~vtkTriQuadraticPyramid() override = default;
208
215 vtkSmartPointer<vtkDoubleArray> Scalars; // used to avoid New/Delete in contouring/clipping
216
217private:
219 void operator=(const vtkTriQuadraticPyramid&) = delete;
220};
221//----------------------------------------------------------------------------
222// Return the center of the tri-quadratic pyramid in parametric coordinates.
223//
225{
226 pcoords[0] = pcoords[1] = 0.5;
227 // This is different compared to the last node, because the last node
228 // is the centroid of the nodes 0-4, and not the centroid of the nodes 0-17.
229 // So pcoords[2] is defined as followed to pass the requirement of TestGenericCell
230 pcoords[2] = 283.0 / 456.0;
231 return 0;
232}
233
234VTK_ABI_NAMESPACE_END
235#endif
cell represents a parabolic, 9-node isoparametric quad
cell represents a parabolic, isoparametric triangle
object to represent cell connectivity
represent and manipulate cell attribute data
virtual int GetParametricCenter(double pcoords[3])
Return center of the cell in parametric coordinates.
dynamic, self-adjusting array of double
list of point or cell ids
Definition vtkIdList.h:135
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition vtkIndent.h:108
PointType
Describes the topological role of a point within a non-linear cell.
vtkNonLinearCell3D()=default
Describes the topological role of a point within a non-linear cell.
represent and manipulate point attribute data
a 3D cell that represents a linear pyramid
Definition vtkPyramid.h:95
cell represents a parabolic, isoparametric edge
Hold a reference to a vtkObjectBase instance.
a 3D cell that represents a tetrahedron
Definition vtkTetra.h:113
static const vtkIdType * GetFaceArray(vtkIdType faceId)
Return the ids of the vertices defining edge/face (edgeId/‘faceId’).
vtkIdType GetPointToIncidentFaces(vtkIdType pointId, const vtkIdType *&faceIds) override
Implement the vtkNonLinearCell3D API.
static void InterpolationDerivs(const double pcoords[3], double derivs[57])
int GetNumberOfEdges() override
Implement the vtkCell API.
vtkSmartPointer< vtkPyramid > Pyramid
vtkCell * GetFace(int faceId) override
Implement the vtkCell API.
~vtkTriQuadraticPyramid() override=default
vtkSmartPointer< vtkBiQuadraticQuad > QuadFace
vtkSmartPointer< vtkBiQuadraticTriangle > TriangleFace2
int GetCellType() override
Implement the vtkCell API.
vtkIdType GetPointToOneRingPoints(vtkIdType pointId, const vtkIdType *&pts) override
Implement the vtkNonLinearCell3D API.
void Contour(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *verts, vtkCellArray *lines, vtkCellArray *polys, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd) override
Generate contouring primitives.
vtkCell * GetEdge(int edgeId) override
Implement the vtkCell API.
double GetParametricDistance(const double pcoords[3]) override
Return the distance of the parametric coordinate provided to the cell.
void EvaluateLocation(int &subId, const double pcoords[3], double x[3], double *weights) override
Determine global coordinate (x[3]) from subId and parametric coordinates.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void Derivatives(int subId, const double pcoords[3], const double *values, int dim, double *derivs) override
Compute derivatives given cell subId and parametric coordinates.
vtkSmartPointer< vtkTetra > Tetra
void InterpolateDerivs(const double pcoords[3], double derivs[57]) override
Compute the interpolation functions/derivatives (aka shape functions/derivatives)
void InterpolateFunctions(const double pcoords[3], double weights[19]) override
Compute the interpolation functions/derivatives (aka shape functions/derivatives)
int CellBoundary(int subId, const double pcoords[3], vtkIdList *pts) override
Given parametric coordinates of a point, return the closest cell boundary, and whether the point is i...
static void InterpolationFunctions(const double pcoords[3], double weights[19])
void GetEdgeToAdjacentFaces(vtkIdType edgeId, const vtkIdType *&faceIds) override
Implement the vtkNonLinearCell3D API.
static const vtkIdType * GetEdgeArray(vtkIdType edgeId)
Return the ids of the vertices defining edge/face (edgeId/‘faceId’).
vtkIdType GetFacePoints(vtkIdType faceId, const vtkIdType *&pts) override
Implement the vtkNonLinearCell3D API.
vtkSmartPointer< vtkDoubleArray > Scalars
static vtkTriQuadraticPyramid * New()
PointType GetPointType(vtkIdType pointId) override
Implement the vtkNonLinearCell3D API.
int IntersectWithLine(const double p1[3], const double p2[3], double tol, double &t, double x[3], double pcoords[3], int &subId) override
Line-edge intersection.
vtkSmartPointer< vtkBiQuadraticTriangle > TriangleFace
vtkIdType GetPointToIncidentEdges(vtkIdType pointId, const vtkIdType *&edgeIds) override
Implement the vtkNonLinearCell3D API.
vtkIdType GetFaceToAdjacentFaces(vtkIdType faceId, const vtkIdType *&faceIds) override
Implement the vtkNonLinearCell3D API.
vtkSmartPointer< vtkQuadraticEdge > Edge
double * GetParametricCoords() override
Return a contiguous array of parametric coordinates of the points defining this cell.
void JacobianInverse(const double pcoords[3], double **inverse, double derivs[57])
Given parametric coordinates compute inverse Jacobian transformation matrix.
int GetNumberOfFaces() override
Implement the vtkCell API.
int EvaluatePosition(const double x[3], double closestPoint[3], int &subId, double pcoords[3], double &dist2, double weights[]) override
Given a point x[3] return inside(=1), outside(=0) cell, or (-1) computational problem encountered; ev...
vtkIdType GetEdgePoints(vtkIdType edgeId, const vtkIdType *&pts) override
Implement the vtkNonLinearCell3D API.
int GetParametricCenter(double pcoords[3]) override
Return the center of the tri-quadratic pyramid in parametric coordinates.
int TriangulateLocalIds(int index, vtkIdList *ptIds) override
Generate simplices of proper dimension.
void Clip(double value, vtkDataArray *cellScalars, vtkIncrementalPointLocator *locator, vtkCellArray *tets, vtkPointData *inPd, vtkPointData *outPd, vtkCellData *inCd, vtkIdType cellId, vtkCellData *outCd, int insideOut) override
Clip this quadratic triangle using scalar value provided.
@ VTK_TRIQUADRATIC_PYRAMID
Definition vtkCellType.h:66
#define vtkDataArray
int vtkIdType
Definition vtkType.h:363