VTK  9.4.2
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
33#include "vtkDeprecation.h" // for deprecatin S/GetRenderWindow
35#include "vtkNew.h" // for internal fields
36#include "vtkSmartPointer.h" // for internal fields
37
38#include <cstring> // for strdup, to initialize char*
39
40VTK_ABI_NAMESPACE_BEGIN
41
43class vtkBitArray;
44class vtkDoubleArray;
46
47class VTKFILTERSHYPERTREE_EXPORT vtkHyperTreeGridGradient : public vtkHyperTreeGridAlgorithm
48{
49public:
51 {
52 UNLIMITED = 0,
53 UNSTRUCTURED
54 };
55
58 void PrintSelf(ostream& os, vtkIndent indent) override;
59
61
65 vtkSetMacro(ComputeGradient, bool);
66 vtkGetMacro(ComputeGradient, bool);
67 vtkBooleanMacro(ComputeGradient, bool);
69
71
74 vtkSetStringMacro(GradientArrayName);
75 vtkGetStringMacro(GradientArrayName);
76 VTK_DEPRECATED_IN_9_3_0("Please use unambiguous SetGradientArrayName method instead.")
77 void SetResultArrayName(std::string name) { this->SetGradientArrayName(name.c_str()); }
78 VTK_DEPRECATED_IN_9_3_0("Please use unambiguous GetGradientArrayName method instead.")
79 std::string GetResultArrayName() { return std::string(this->GetGradientArrayName()); }
81
83
89 vtkSetClampMacro(Mode, int, UNLIMITED, UNSTRUCTURED);
90 vtkGetMacro(Mode, int);
92
94
99 vtkSetMacro(ExtensiveComputation, bool);
100 vtkGetMacro(ExtensiveComputation, bool);
101 vtkBooleanMacro(ExtensiveComputation, bool);
103
105
109 vtkSetMacro(ComputeDivergence, bool);
110 vtkGetMacro(ComputeDivergence, bool);
111 vtkBooleanMacro(ComputeDivergence, bool);
113
115
118 vtkSetStringMacro(DivergenceArrayName);
119 vtkGetStringMacro(DivergenceArrayName);
121
123
127 vtkSetMacro(ComputeVorticity, bool);
128 vtkGetMacro(ComputeVorticity, bool);
129 vtkBooleanMacro(ComputeVorticity, bool);
131
133
136 vtkSetStringMacro(VorticityArrayName);
137 vtkGetStringMacro(VorticityArrayName);
139
141
145 vtkSetMacro(ComputeQCriterion, bool);
146 vtkGetMacro(ComputeQCriterion, bool);
147 vtkBooleanMacro(ComputeQCriterion, bool);
149
151
154 vtkSetStringMacro(QCriterionArrayName);
155 vtkGetStringMacro(QCriterionArrayName);
157
158protected:
161
166
171 template <class Cursor, class GradWorker>
172 void RecursivelyProcessGradientTree(Cursor*, GradWorker&);
173
178 template <class FieldsWorker>
179 void ProcessFields(FieldsWorker&);
180
181 // Fields
182 // ------
183
184 // Gradient
185 bool ComputeGradient = true;
187 char* GradientArrayName = strdup("Gradient");
188 int Mode = ComputeMode::UNLIMITED;
189 bool ExtensiveComputation = false;
190
191 // Divergence
192 bool ComputeDivergence = false;
194 char* DivergenceArrayName = strdup("Divergence");
195
196 // Vorticity
197 bool ComputeVorticity = false;
199 char* VorticityArrayName = strdup("Vorticity");
200
201 // QCriterion
202 bool ComputeQCriterion = false;
204 char* QCriterionArrayName = strdup("QCriterion");
205
210
211 // shortcut to HTG fields
212 vtkBitArray* InMask = nullptr;
213 vtkUnsignedCharArray* InGhostArray = nullptr;
214
215private:
217 void operator=(const vtkHyperTreeGridGradient&) = delete;
218};
219
220VTK_ABI_NAMESPACE_END
221#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:108
Allocate and hold a VTK object.
Definition vtkNew.h:167
Hold a reference to a vtkObjectBase instance.
dynamic, self-adjusting array of unsigned char
#define VTK_DEPRECATED_IN_9_3_0(reason)