VTK  9.3.0
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
23#ifndef vtkHyperTreeGridGradient_h
24#define vtkHyperTreeGridGradient_h
25
26#include "vtkFiltersHyperTreeModule.h" // For export macro
27
28#include "vtkDeprecation.h" // for deprecatin S/GetRenderWindow
30#include "vtkNew.h" // for internal fields
31#include "vtkSmartPointer.h" // for internal fields
32
33#include <cstring> // for strdup, to initialize char*
34
35VTK_ABI_NAMESPACE_BEGIN
36
38class vtkBitArray;
39class vtkDoubleArray;
41
42class VTKFILTERSHYPERTREE_EXPORT vtkHyperTreeGridGradient : public vtkHyperTreeGridAlgorithm
43{
44public:
46 {
47 UNLIMITED = 0,
48 UNSTRUCTURED
49 };
50
53 void PrintSelf(ostream& os, vtkIndent indent) override;
54
56
60 vtkSetMacro(ComputeGradient, bool);
61 vtkGetMacro(ComputeGradient, bool);
62 vtkBooleanMacro(ComputeGradient, bool);
64
66
69 vtkSetStringMacro(GradientArrayName);
70 vtkGetStringMacro(GradientArrayName);
71 VTK_DEPRECATED_IN_9_3_0("Please use unambiguous SetGradientArrayName method instead.")
72 void SetResultArrayName(std::string name) { this->SetGradientArrayName(name.c_str()); }
73 VTK_DEPRECATED_IN_9_3_0("Please use unambiguous GetGradientArrayName method instead.")
74 std::string GetResultArrayName() { return std::string(this->GetGradientArrayName()); }
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
153protected:
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
210private:
212 void operator=(const vtkHyperTreeGridGradient&) = delete;
213};
214
215VTK_ABI_NAMESPACE_END
216#endif // vtkHyperTreeGridGradient_h
dynamic, self-adjusting array of bits
Definition vtkBitArray.h:29
general representation of visualization data
dynamic, self-adjusting array of double
Superclass for algorithms that produce a hyper tree grid as output.
Compute the gradient of a scalar field on a Hyper Tree Grid.
vtkNew< vtkDoubleArray > OutQCritArray
void RecursivelyProcessGradientTree(Cursor *, GradWorker &)
Recursively descend into tree down to leaves to compute gradient Uses a heavy supercursor.
vtkNew< vtkDoubleArray > OutGradArray
vtkNew< vtkDoubleArray > OutVortArray
vtkSmartPointer< vtkDataArray > InArray
Keep track of selected input scalars / vectors.
vtkNew< vtkDoubleArray > OutDivArray
int ProcessTrees(vtkHyperTreeGrid *, vtkDataObject *) override
Main routine to generate gradient of hyper tree grid.
static vtkHyperTreeGridGradient * New()
~vtkHyperTreeGridGradient() override
void ProcessFields(FieldsWorker &)
Compute Vorticity, Divergence and QCriterion upon request, from the Gradient cell array.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Objects for traversal a HyperTreeGrid.
A dataset containing a grid of vtkHyperTree instances arranged as a rectilinear grid.
a simple class to control print indentation
Definition vtkIndent.h:29
Allocate and hold a VTK object.
Definition vtkNew.h:51
Hold a reference to a vtkObjectBase instance.
dynamic, self-adjusting array of unsigned char
#define VTK_DEPRECATED_IN_9_3_0(reason)