VTK  9.7.1
vtkIntegrationGaussianStrategy.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
22 #ifndef vtkIntegrationGaussianStrategy_h
23 #define vtkIntegrationGaussianStrategy_h
24 
25 #include "vtkCellType.h" // For VTKCellType
26 #include "vtkDataSet.h" // For Intermediate
27 #include "vtkFiltersParallelModule.h" // For export macro
28 #include "vtkIntegrationStrategy.h"
29 #include "vtkSmartPointer.h" // For Intermediate
30 
31 VTK_ABI_NAMESPACE_BEGIN
32 class vtkDataSet;
34 class vtkIdTypeArray;
40 
41 class VTKFILTERSPARALLEL_EXPORT vtkIntegrationGaussianStrategy : public vtkIntegrationStrategy
42 {
43 public:
45  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
49 
52  void IntegrateQuad(vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId,
53  vtkIdType pt1Id, vtkIdType pt2Id, vtkIdType pt3Id, vtkIdType pt4Id, double& sum,
54  double sumCenter[3], vtkIntegrateAttributesFieldList& cellFieldList,
55  vtkIntegrateAttributesFieldList& pointFieldList, int index) override;
56 
58  vtkIdType cellId, vtkIdType numPts, const vtkIdType* cellPtIds, vtkIdList* cellPtIdsList,
59  double& sum, double sumCenter[3], vtkIntegrateAttributesFieldList& cellFieldList,
60  vtkIntegrateAttributesFieldList& pointFieldList, int index) override;
61 
62  void IntegrateWedge(vtkDataSet* input, vtkUnstructuredGrid* output, vtkGenericCell* cell,
63  vtkIdType cellId, vtkIdType numPts, const vtkIdType* cellPtIds, vtkIdList* cellPtIdsList,
64  double& sum, double sumCenter[3], vtkIntegrateAttributesFieldList& cellFieldList,
65  vtkIntegrateAttributesFieldList& pointFieldList, int index) override;
66 
68  vtkIdType cellId, vtkIdType numPts, const vtkIdType* cellPtIds, vtkIdList* cellPtIdsList,
69  double& sum, double sumCenter[3], vtkIntegrateAttributesFieldList& cellFieldList,
70  vtkIntegrateAttributesFieldList& pointFieldList, int index) override;
72 
74 
78  void IntegratePolyLine(vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId,
79  vtkIdType numPts, const vtkIdType* cellPtIds, double& sum, double sumCenter[3],
81  int index) override;
82 
84  vtkIdType numPts, const vtkIdType* cellPtIds, double& sum, double sumCenter[3],
86  int index) override;
87 
88  void IntegrateTriangle(vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId,
89  vtkIdType pt1Id, vtkIdType pt2Id, vtkIdType pt3Id, double& sum, double sumCenter[3],
91  int index) override;
92 
93  void IntegrateTetrahedron(vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId,
94  vtkIdType pt1Id, vtkIdType pt2Id, vtkIdType pt3Id, vtkIdType pt4Id, double& sum,
95  double sumCenter[3], vtkIntegrateAttributesFieldList& cellFieldList,
96  vtkIntegrateAttributesFieldList& pointFieldList, int index) override;
97 
98  void IntegratePixel(vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId,
99  vtkIdType numPts, const vtkIdType* cellPtIds, double& sum, double sumCenter[3],
101  int index) override;
102 
103  void IntegrateVoxel(vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId,
104  vtkIdType numPts, const vtkIdType* cellPtIds, double& sum, double sumCenter[3],
106  int index) override;
107 
108  void IntegrateGeneral1DCell(vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId,
109  vtkIdType numPts, const vtkIdType* cellPtIds, double& sum, double sumCenter[3],
111  int index) override;
112 
113  void IntegrateGeneral2DCell(vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId,
114  vtkIdType numPts, const vtkIdType* cellPtIds, double& sum, double sumCenter[3],
116  int index) override;
117 
118  void IntegrateGeneral3DCell(vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId,
119  vtkIdType numPts, const vtkIdType* cellPtIds, double& sum, double sumCenter[3],
121  int index) override;
123 
125 
129  void IntegratePolygon(vtkDataSet* input, vtkUnstructuredGrid* output, vtkIdType cellId,
130  vtkIdType numPts, const vtkIdType* cellPtIds, double& sum, double sumCenter[3],
132  int index) override;
133 
135  vtkIdType cellId, vtkIdType numPts, vtkIdList* cellPtIds, double& sum, double sumCenter[3],
137  int index) override;
139 
141 
145  double k, vtkIntegrateAttributesFieldList& fieldlist, int fieldlist_index) override;
146 
148  vtkIdType pt2Id, double k, vtkIntegrateAttributesFieldList& fieldlist,
149  int fieldlist_index) override;
150 
152  vtkIdType pt2Id, vtkIdType pt3Id, double k, vtkIntegrateAttributesFieldList& fieldlist,
153  int fieldlist_index) override;
154 
156  vtkIdType pt2Id, vtkIdType pt3Id, vtkIdType pt4Id, double k,
157  vtkIntegrateAttributesFieldList& fieldlist, int fieldlist_index) override;
159 
163  void Initialize(vtkDataSet* input) override;
164 
165 protected:
166  vtkIntegrationGaussianStrategy() = default;
167  ~vtkIntegrationGaussianStrategy() override;
168 
169 private:
171  void operator=(const vtkIntegrationGaussianStrategy&) = delete;
172 
176  void IntegrateGaussian(vtkDataSet* input, vtkUnstructuredGrid* output, VTKCellType celltype,
177  vtkIdType cellId, vtkIdType numPts, const vtkIdType* cellPtIds, vtkIdList* cellPtIdsList,
178  double& sum, double sumCenter[3], vtkIntegrateAttributesFieldList& cellFieldList,
179  vtkIntegrateAttributesFieldList& pointFieldList, int index);
180 
184  void IntegratePointDataGaussian(vtkDataSetAttributes* outda, vtkIdType cellId,
185  int nQuadraturePoints, std::vector<double> partialArea,
186  vtkIntegrateAttributesFieldList& fieldList, int index);
187 
189 
192  double ComputeJacobianDet2D(const double dN[8], const std::vector<std::array<double, 3>>& pts);
193  double ComputeJacobianDet(
194  const double* dN, const std::vector<std::array<double, 3>>& pts, int nNodes);
196 
198 
201  void AddPointDataArray();
202  void InitializeQuadratureOffsets();
203  std::string GenerateUniqueArrayName(const std::string& baseName);
204  vtkSmartPointer<vtkQuadratureSchemeDefinition> CreateQuadratureSchemeDefinition(int cellType);
205  void InitializeQuadratureOffsetsArray(
207  void ComputeQuadratureInterpolation();
209 
211  vtkNew<vtkIdTypeArray> Offsets;
212  vtkSmartPointer<vtkDataSet> Intermediate = nullptr;
213  vtkQuadratureSchemeDefinition** CellDefinitionDictionnary = nullptr;
214 };
215 
216 VTK_ABI_NAMESPACE_END
217 #endif
virtual void IntegrateDefault(vtkDataSet *input, vtkUnstructuredGrid *output, vtkGenericCell *cell, vtkIdType cellId, vtkIdType numPts, vtkIdList *cellPtIds, double &sum, double sumCenter[3], vtkIntegrateAttributesFieldList &cellFieldList, vtkIntegrateAttributesFieldList &pointFieldList, int index)=0
Function to integrate the specified cell type.
virtual void IntegrateTetrahedron(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdType pt1Id, vtkIdType pt2Id, vtkIdType pt3Id, vtkIdType pt4Id, double &sum, double sumCenter[3], vtkIntegrateAttributesFieldList &cellFieldList, vtkIntegrateAttributesFieldList &pointFieldList, int index)=0
Function to integrate the specified cell type.
virtual void IntegrateTriangleStrip(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdType numPts, const vtkIdType *cellPtIds, double &sum, double sumCenter[3], vtkIntegrateAttributesFieldList &cellFieldList, vtkIntegrateAttributesFieldList &pointFieldList, int index)=0
Function to integrate the specified cell type.
Store vtkAlgorithm input/output information.
virtual void IntegratePixel(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdType numPts, const vtkIdType *cellPtIds, double &sum, double sumCenter[3], vtkIntegrateAttributesFieldList &cellFieldList, vtkIntegrateAttributesFieldList &pointFieldList, int index)=0
Function to integrate the specified cell type.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
virtual void IntegrateTriangle(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdType pt1Id, vtkIdType pt2Id, vtkIdType pt3Id, double &sum, double sumCenter[3], vtkIntegrateAttributesFieldList &cellFieldList, vtkIntegrateAttributesFieldList &pointFieldList, int index)=0
Function to integrate the specified cell type.
An Elemental data type that holds a definition of a numerical quadrature scheme.
dynamic, self-adjusting array of vtkIdType
virtual void IntegratePolygon(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdType numPts, const vtkIdType *cellPtIds, double &sum, double sumCenter[3], vtkIntegrateAttributesFieldList &cellFieldList, vtkIntegrateAttributesFieldList &pointFieldList, int index)=0
Function to integrate the specified cell type.
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:23
int vtkIdType
Definition: vtkType.h:363
virtual void IntegrateVoxel(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdType numPts, const vtkIdType *cellPtIds, double &sum, double sumCenter[3], vtkIntegrateAttributesFieldList &cellFieldList, vtkIntegrateAttributesFieldList &pointFieldList, int index)=0
Function to integrate the specified cell type.
abstract class to define an integration strategy for vtkIntegrateAttributes
provides thread-safe access to cells
VTKCellType
Definition: vtkCellType.h:34
virtual void IntegrateQuad(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdType pt1Id, vtkIdType pt2Id, vtkIdType pt3Id, vtkIdType pt4Id, double &sum, double sumCenter[3], vtkIntegrateAttributesFieldList &cellFieldList, vtkIntegrateAttributesFieldList &pointFieldList, int index)=0
Function to integrate the specified cell type.
virtual void IntegrateData1(vtkDataSetAttributes *inda, vtkDataSetAttributes *outda, vtkIdType pt1Id, double k, vtkIntegrateAttributesFieldList &fieldlist, int fieldlist_index)=0
Integrates on data arrays depending on the number of node of the shape.
virtual void IntegrateHexahedron(vtkDataSet *input, vtkUnstructuredGrid *output, vtkGenericCell *cell, vtkIdType cellId, vtkIdType numPts, const vtkIdType *cellPtIds, vtkIdList *cellPtIdsList, double &sum, double sumCenter[3], vtkIntegrateAttributesFieldList &cellFieldList, vtkIntegrateAttributesFieldList &pointFieldList, int index)=0
Function to integrate the specified cell type.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Helper class for vtkIntegrateAttributes.
a simple class to control print indentation
Definition: vtkIndent.h:28
list of point or cell ids
Definition: vtkIdList.h:25
dataset represents arbitrary combinations of all possible cell types
virtual void IntegrateGeneral2DCell(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdType numPts, const vtkIdType *cellPtIds, double &sum, double sumCenter[3], vtkIntegrateAttributesFieldList &cellFieldList, vtkIntegrateAttributesFieldList &pointFieldList, int index)=0
Function to integrate the specified cell type.
virtual void IntegratePyramid(vtkDataSet *input, vtkUnstructuredGrid *output, vtkGenericCell *cell, vtkIdType cellId, vtkIdType numPts, const vtkIdType *cellPtIds, vtkIdList *cellPtIdsList, double &sum, double sumCenter[3], vtkIntegrateAttributesFieldList &cellFieldList, vtkIntegrateAttributesFieldList &pointFieldList, int index)=0
Function to integrate the specified cell type.
Gaussian Quadrature Integration Strategy.
represent and manipulate attribute data in a dataset
virtual void IntegratePolyLine(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdType numPts, const vtkIdType *cellPtIds, double &sum, double sumCenter[3], vtkIntegrateAttributesFieldList &cellFieldList, vtkIntegrateAttributesFieldList &pointFieldList, int index)=0
Function to integrate the specified cell type.
virtual void IntegrateData4(vtkDataSetAttributes *inda, vtkDataSetAttributes *outda, vtkIdType pt1Id, vtkIdType pt2Id, vtkIdType pt3Id, vtkIdType pt4Id, double k, vtkIntegrateAttributesFieldList &fieldlist, int fieldlist_index)=0
Integrates on data arrays depending on the number of node of the shape.
virtual void Initialize(vtkDataSet *input)
Setup necessary precomputations Here does nothing, can be overridden if needed.
virtual void IntegrateData2(vtkDataSetAttributes *inda, vtkDataSetAttributes *outda, vtkIdType pt1Id, vtkIdType pt2Id, double k, vtkIntegrateAttributesFieldList &fieldlist, int fieldlist_index)=0
Integrates on data arrays depending on the number of node of the shape.
virtual void IntegrateGeneral3DCell(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdType numPts, const vtkIdType *cellPtIds, double &sum, double sumCenter[3], vtkIntegrateAttributesFieldList &cellFieldList, vtkIntegrateAttributesFieldList &pointFieldList, int index)=0
Function to integrate the specified cell type.
Linear Integration Strategy.
virtual void IntegrateWedge(vtkDataSet *input, vtkUnstructuredGrid *output, vtkGenericCell *cell, vtkIdType cellId, vtkIdType numPts, const vtkIdType *cellPtIds, vtkIdList *cellPtIdsList, double &sum, double sumCenter[3], vtkIntegrateAttributesFieldList &cellFieldList, vtkIntegrateAttributesFieldList &pointFieldList, int index)=0
Function to integrate the specified cell type.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void IntegrateData3(vtkDataSetAttributes *inda, vtkDataSetAttributes *outda, vtkIdType pt1Id, vtkIdType pt2Id, vtkIdType pt3Id, double k, vtkIntegrateAttributesFieldList &fieldlist, int fieldlist_index)=0
Integrates on data arrays depending on the number of node of the shape.
virtual void IntegrateGeneral1DCell(vtkDataSet *input, vtkUnstructuredGrid *output, vtkIdType cellId, vtkIdType numPts, const vtkIdType *cellPtIds, double &sum, double sumCenter[3], vtkIntegrateAttributesFieldList &cellFieldList, vtkIntegrateAttributesFieldList &pointFieldList, int index)=0
Function to integrate the specified cell type.