VTK  9.7.1
vtkHyperTreeGridGradient.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
28 #ifndef vtkHyperTreeGridGradient_h
29 #define vtkHyperTreeGridGradient_h
30 
31 #include "vtkFiltersHyperTreeModule.h" // For export macro
32 
34 #include "vtkNew.h" // for internal fields
35 #include "vtkSmartPointer.h" // for internal fields
36 
37 #include <cstring> // for strdup, to initialize char*
38 
39 VTK_ABI_NAMESPACE_BEGIN
40 
42 class vtkBitArray;
43 class vtkDoubleArray;
45 
46 class VTKFILTERSHYPERTREE_EXPORT vtkHyperTreeGridGradient : public vtkHyperTreeGridAlgorithm
47 {
48 public:
50  {
51  UNLIMITED = 0,
52  UNSTRUCTURED
53  };
54 
55  static vtkHyperTreeGridGradient* New();
57  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
60 
64  vtkSetMacro(ComputeGradient, bool);
65  vtkGetMacro(ComputeGradient, bool);
66  vtkBooleanMacro(ComputeGradient, bool);
68 
70 
73  vtkSetStringMacro(GradientArrayName);
74  vtkGetStringMacro(GradientArrayName);
76 
78 
84  vtkSetClampMacro(Mode, int, UNLIMITED, UNSTRUCTURED);
85  vtkGetMacro(Mode, int);
87 
89 
94  vtkSetMacro(ExtensiveComputation, bool);
95  vtkGetMacro(ExtensiveComputation, bool);
96  vtkBooleanMacro(ExtensiveComputation, bool);
98 
100 
104  vtkSetMacro(ComputeDivergence, bool);
105  vtkGetMacro(ComputeDivergence, bool);
106  vtkBooleanMacro(ComputeDivergence, bool);
108 
110 
113  vtkSetStringMacro(DivergenceArrayName);
114  vtkGetStringMacro(DivergenceArrayName);
116 
118 
122  vtkSetMacro(ComputeVorticity, bool);
123  vtkGetMacro(ComputeVorticity, bool);
124  vtkBooleanMacro(ComputeVorticity, bool);
126 
128 
131  vtkSetStringMacro(VorticityArrayName);
132  vtkGetStringMacro(VorticityArrayName);
134 
136 
140  vtkSetMacro(ComputeQCriterion, bool);
141  vtkGetMacro(ComputeQCriterion, bool);
142  vtkBooleanMacro(ComputeQCriterion, bool);
144 
146 
149  vtkSetStringMacro(QCriterionArrayName);
150  vtkGetStringMacro(QCriterionArrayName);
152 
153 protected:
155  ~vtkHyperTreeGridGradient() override;
156 
161 
166  template <class Cursor, class GradWorker>
167  void RecursivelyProcessGradientTree(Cursor*, GradWorker&);
168 
173  template <class FieldsWorker>
174  void ProcessFields(FieldsWorker&);
175 
176  // Fields
177  // ------
178 
179  // Gradient
180  bool ComputeGradient = true;
182  char* GradientArrayName = strdup("Gradient");
183  int Mode = ComputeMode::UNLIMITED;
184  bool ExtensiveComputation = false;
185 
186  // Divergence
187  bool ComputeDivergence = false;
189  char* DivergenceArrayName = strdup("Divergence");
190 
191  // Vorticity
192  bool ComputeVorticity = false;
194  char* VorticityArrayName = strdup("Vorticity");
195 
196  // QCriterion
197  bool ComputeQCriterion = false;
199  char* QCriterionArrayName = strdup("QCriterion");
200 
205 
206  // shortcut to HTG fields
207  vtkBitArray* InMask = nullptr;
208  vtkUnsignedCharArray* InGhostArray = nullptr;
209 
210 private:
212  void operator=(const vtkHyperTreeGridGradient&) = delete;
213 };
214 
215 VTK_ABI_NAMESPACE_END
216 #endif // vtkHyperTreeGridGradient_h
vtkNew< vtkDoubleArray > OutVortArray
vtkNew< vtkDoubleArray > OutDivArray
vtkSmartPointer< vtkDataArray > InArray
Keep track of selected input scalars / vectors.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
Objects for traversal a HyperTreeGrid.
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition: vtkIndent.h:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
dynamic, self-adjusting array of unsigned char
vtkNew< vtkDoubleArray > OutGradArray
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:32
Superclass for algorithms that produce a hyper tree grid as output.
static vtkAlgorithm * New()
VTKACCELERATORSVTKMDATAMODEL_EXPORT void ProcessFields(vtkDataSet *input, viskores::cont::DataSet &dataset, tovtkm::FieldsFlag fields)
Compute the gradient of a scalar field on a Hyper Tree Grid.
general representation of visualization data
Definition: vtkDataObject.h:55
vtkNew< vtkDoubleArray > OutQCritArray
virtual int ProcessTrees(vtkHyperTreeGrid *, vtkDataObject *)=0
Main routine to process individual trees in the grid This is pure virtual method to be implemented by...