VTK  9.3.0
vtkGradientFilter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
34 #ifndef vtkGradientFilter_h
35 #define vtkGradientFilter_h
36 
37 #include "vtkDataSetAlgorithm.h"
38 #include "vtkFiltersGeneralModule.h" // For export macro
39 
40 VTK_ABI_NAMESPACE_BEGIN
42 
43 class VTKFILTERSGENERAL_EXPORT vtkGradientFilter : public vtkDataSetAlgorithm
44 {
45 public:
47 
52  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
57  {
58  All = 0,
59  Patch = 1,
60  DataSetMax = 2
61  };
62 
66  {
67  Zero = 0,
68  NaN = 1,
69  DataTypeMin = 2,
70  DataTypeMax = 3
71  };
72 
74 
80  virtual void SetInputScalars(int fieldAssociation, const char* name);
81  virtual void SetInputScalars(int fieldAssociation, int fieldAttributeType);
83 
85 
90  vtkGetStringMacro(ResultArrayName);
91  vtkSetStringMacro(ResultArrayName);
93 
95 
100  vtkGetStringMacro(DivergenceArrayName);
101  vtkSetStringMacro(DivergenceArrayName);
103 
105 
110  vtkGetStringMacro(VorticityArrayName);
111  vtkSetStringMacro(VorticityArrayName);
113 
115 
120  vtkGetStringMacro(QCriterionArrayName);
121  vtkSetStringMacro(QCriterionArrayName);
123 
125 
134  vtkGetMacro(FasterApproximation, vtkTypeBool);
135  vtkSetMacro(FasterApproximation, vtkTypeBool);
136  vtkBooleanMacro(FasterApproximation, vtkTypeBool);
138 
140 
145  vtkSetMacro(ComputeGradient, vtkTypeBool);
146  vtkGetMacro(ComputeGradient, vtkTypeBool);
147  vtkBooleanMacro(ComputeGradient, vtkTypeBool);
149 
151 
157  vtkSetMacro(ComputeDivergence, vtkTypeBool);
158  vtkGetMacro(ComputeDivergence, vtkTypeBool);
159  vtkBooleanMacro(ComputeDivergence, vtkTypeBool);
161 
163 
169  vtkSetMacro(ComputeVorticity, vtkTypeBool);
170  vtkGetMacro(ComputeVorticity, vtkTypeBool);
171  vtkBooleanMacro(ComputeVorticity, vtkTypeBool);
173 
175 
182  vtkSetMacro(ComputeQCriterion, vtkTypeBool);
183  vtkGetMacro(ComputeQCriterion, vtkTypeBool);
184  vtkBooleanMacro(ComputeQCriterion, vtkTypeBool);
186 
188 
192  vtkSetClampMacro(ContributingCellOption, int, 0, 2);
193  vtkGetMacro(ContributingCellOption, int);
195 
197 
202  vtkSetClampMacro(ReplacementValueOption, int, 0, 3);
203  vtkGetMacro(ReplacementValueOption, int);
205 
206 protected:
208  ~vtkGradientFilter() override;
209 
212 
218  virtual int ComputeUnstructuredGridGradient(vtkDataArray* Array, int fieldAssociation,
219  vtkDataSet* input, bool computeVorticity, bool computeQCriterion, bool computeDivergence,
220  vtkDataSet* output);
221 
227  virtual int ComputeRegularGridGradient(vtkDataArray* Array, int* dims, int fieldAssociation,
228  bool computeVorticity, bool computeQCriterion, bool computeDivergence, vtkDataSet* output,
229  vtkUnsignedCharArray* ghosts, unsigned char hiddenGhost);
230 
238 
244 
250 
256 
262 
273 
279 
286 
293 
300 
306 
313 
314 private:
315  vtkGradientFilter(const vtkGradientFilter&) = delete;
316  void operator=(const vtkGradientFilter&) = delete;
317 };
318 
319 VTK_ABI_NAMESPACE_END
320 #endif //_vtkGradientFilter_h
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:45
Superclass for algorithms that produce output of the same type as input.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:53
A general filter for gradient estimation.
char * QCriterionArrayName
If non-null then it contains the name of the outputted Q criterion array.
~vtkGradientFilter() override
int ReplacementValueOption
Option to specify what replacement value or entities that don't have any gradient computed over them ...
char * VorticityArrayName
If non-null then it contains the name of the outputted vorticity array.
virtual void SetInputScalars(int fieldAssociation, int fieldAttributeType)
These are basically a convenience method that calls SetInputArrayToProcess to set the array used as t...
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instantiation, obtaining type information, and printing.
vtkTypeBool ComputeVorticity
Flag to indicate that vorticity/curl of the input vector is to be computed.
vtkTypeBool ComputeGradient
Flag to indicate that the gradient of the input vector is to be computed.
int ContributingCellOption
Option to specify what cells to include in the gradient computation.
vtkTypeBool ComputeDivergence
Flag to indicate that the divergence of the input vector is to be computed.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
char * ResultArrayName
If non-null then it contains the name of the outputted gradient array.
ContributingCellEnum
Options to choose what cells contribute to the gradient calculation.
static vtkGradientFilter * New()
Standard methods for instantiation, obtaining type information, and printing.
int GetOutputArrayType(vtkDataArray *inputArray)
Get the proper array type to compute requested derivative quantities for.
virtual int ComputeUnstructuredGridGradient(vtkDataArray *Array, int fieldAssociation, vtkDataSet *input, bool computeVorticity, bool computeQCriterion, bool computeDivergence, vtkDataSet *output)
Compute the gradients for grids that are not a vtkImageData, vtkRectilinearGrid, or vtkStructuredGrid...
char * DivergenceArrayName
If non-null then it contains the name of the outputted divergence array.
virtual int ComputeRegularGridGradient(vtkDataArray *Array, int *dims, int fieldAssociation, bool computeVorticity, bool computeQCriterion, bool computeDivergence, vtkDataSet *output, vtkUnsignedCharArray *ghosts, unsigned char hiddenGhost)
Compute the gradients for either a vtkImageData, vtkRectilinearGrid or a vtkStructuredGrid.
virtual void SetInputScalars(int fieldAssociation, const char *name)
These are basically a convenience method that calls SetInputArrayToProcess to set the array used as t...
vtkTypeBool FasterApproximation
When this flag is on (default is off), the gradient filter will provide a less accurate (but close) a...
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when each filter in the pipeline decides what portion of its inp...
ReplacementValueEnum
The replacement value or entities that don't have any gradient computed over them based on the Contri...
vtkTypeBool ComputeQCriterion
Flag to indicate that the Q-criterion of the input vector is to be computed.
a simple class to control print indentation
Definition: vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of unsigned char
@ name
Definition: vtkX3D.h:219
int vtkTypeBool
Definition: vtkABI.h:64