VTK  9.7.1
vtkDGInterpolateCalculator.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
11 #ifndef vtkDGInterpolateCalculator_h
12 #define vtkDGInterpolateCalculator_h
13 
14 #include "vtkCellAttribute.h" // For CellTypeInfo.
15 #include "vtkDGArrayOutputAccessor.h" // For ivars.
16 #include "vtkDGArraysInputAccessor.h" // For ivars.
17 #include "vtkDGCell.h" // For ivar.
18 #include "vtkDGOperation.h" // For ivars.
20 #include "vtkSMPThreadLocal.h" // For thread-local data
21 #include "vtkSmartPointer.h" // For ivar.
22 #include "vtkStringToken.h" // For ivar.
23 
24 VTK_ABI_NAMESPACE_BEGIN
25 
26 class vtkCellAttribute;
28 class vtkDoubleArray;
29 class vtkDataArray;
30 class vtkIdTypeArray;
31 class vtkTypeInt64Array;
32 
36 class VTKFILTERSCELLGRID_EXPORT vtkDGInterpolateCalculator : public vtkInterpolateCalculator
37 {
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
43  void Evaluate(vtkIdType cellId, const vtkVector3d& rst, std::vector<double>& value) override;
44  void Evaluate(vtkIdTypeArray* cellIds, vtkDataArray* rst, vtkDataArray* result) override;
45 
46  bool AnalyticDerivative() const override;
47  void EvaluateDerivative(vtkIdType cellId, const vtkVector3d& rst, std::vector<double>& jacobian,
48  double neighborhood) override;
49  void EvaluateDerivative(
50  vtkIdTypeArray* cellIds, vtkDataArray* rst, vtkDataArray* result) override;
51 
53  vtkCellMetadata* cell, vtkCellAttribute* field) override;
54 
55 protected:
56  friend class vtkDGRangeResponder;
57  vtkDGInterpolateCalculator() = default;
58  ~vtkDGInterpolateCalculator() override = default;
59 
60  template <bool UseShape>
61  void InternalDerivative(
62  vtkIdType cellId, const vtkVector3d& rst, std::vector<double>& jacobian, double neighborhood);
63 
67  vtkDGCell* CellType{ nullptr };
71  vtkCellAttribute* Field{ nullptr };
72 
74  {
78 
82 
89 
94 
99 
100  bool Initialized{ false };
101 
102  ThreadLocalData();
103  ThreadLocalData(const ThreadLocalData& other);
104  void Swap(ThreadLocalData& other);
105  ThreadLocalData& operator=(ThreadLocalData other);
106 
107  void EnsureInitialized(vtkDGCell* cellType, vtkCellAttribute* field);
108  };
109 
111 
113  int Dimension{ 3 };
116 
121 
122 private:
124  void operator=(const vtkDGInterpolateCalculator&) = delete;
125 };
126 
127 VTK_ABI_NAMESPACE_END
128 #endif // vtkDGInterpolateCalculator_h
virtual vtkSmartPointer< vtkCellAttributeCalculator > PrepareForGrid(vtkCellMetadata *cell, vtkCellAttribute *field)
Subclasses should override this to create an instance of their class with member variables set to per...
Store values interpolated from DG cells into a vtkDoubleArray instance.
vtkSMPThreadLocal< ThreadLocalData > LocalData
static vtkCellAttributeCalculator * New()
Metadata for a particular type of cell (finite element).
Calculate field values at a point in a cell's parametric space.
vtkSmartPointer< vtkDoubleArray > LocalField
Used when an array passed to Evaluate()/EvaluateDerivative() is not a double-array.
vtkCellAttribute::CellTypeInfo FieldCellInfo
The function space, basis, etc.
RealT rst
Definition: TetF2Basis.h:17
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:363
dynamic, self-adjusting array of double
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void Evaluate(vtkIdType cellId, const vtkVector3d &rst, std::vector< double > &value)=0
Subclasses may override this method to perform multiple evaluations at a time.
vtkDGOperation< vtkDGArraysInputAccessor, vtkDGArrayOutputAccessor > FieldDerivative
Used to compute a field derivative for a cell.
A function defined over the physical domain of a vtkCellGrid.
!< For HCURL
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
Calculate field values at a point in a cell's parametric space.
Base class for a discontinuous Galerkin cells of all shapes.
Definition: vtkDGCell.h:43
virtual bool AnalyticDerivative() const
Return true if the function has an analytic derivative.
vtkDGOperation< vtkDGArraysInputAccessor, vtkDGArrayOutputAccessor > FieldEvaluator
Used to compute a field value for a cell.
Evaluate DG cells whose indices and parameters are provided by vtkDataArray instances.
virtual void EvaluateDerivative(vtkIdType cellId, const vtkVector3d &rst, std::vector< double > &jacobian, double neighborhood=1e-3)
Return the derivative of the function at rst.
Shape
All possible shapes for DG cells.
Definition: vtkDGCell.h:70
Compute the range of a cell-attribute over any vtkDGCell.