VTK-m  2.0
Gradient.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 
11 #ifndef vtk_m_filter_vector_analysis_Gradient_h
12 #define vtk_m_filter_vector_analysis_Gradient_h
13 
15 #include <vtkm/filter/vector_analysis/vtkm_filter_vector_analysis_export.h>
16 
17 namespace vtkm
18 {
19 namespace filter
20 {
21 namespace vector_analysis
22 {
32 class VTKM_FILTER_VECTOR_ANALYSIS_EXPORT Gradient : public vtkm::filter::FilterField
33 {
34 public:
38  void SetComputePointGradient(bool enable) { ComputePointGradient = enable; }
39  bool GetComputePointGradient() const { return ComputePointGradient; }
40 
45  void SetComputeDivergence(bool enable) { ComputeDivergence = enable; }
46  bool GetComputeDivergence() const { return ComputeDivergence; }
47 
52  void SetComputeVorticity(bool enable) { ComputeVorticity = enable; }
53  bool GetComputeVorticity() const { return ComputeVorticity; }
54 
59  void SetComputeQCriterion(bool enable) { ComputeQCriterion = enable; }
60  bool GetComputeQCriterion() const { return ComputeQCriterion; }
61 
66  void SetComputeGradient(bool enable) { StoreGradient = enable; }
67  bool GetComputeGradient() const { return StoreGradient; }
68 
74  void SetColumnMajorOrdering() { RowOrdering = false; }
75 
79  void SetRowMajorOrdering() { RowOrdering = true; }
80 
81  void SetDivergenceName(const std::string& name) { this->DivergenceName = name; }
82  const std::string& GetDivergenceName() const { return this->DivergenceName; }
83 
84  void SetVorticityName(const std::string& name) { this->VorticityName = name; }
85  const std::string& GetVorticityName() const { return this->VorticityName; }
86 
87  void SetQCriterionName(const std::string& name) { this->QCriterionName = name; }
88  const std::string& GetQCriterionName() const { return this->QCriterionName; }
89 
90 private:
91  vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& inputDataSet) override;
92 
93  bool ComputePointGradient = false;
94  bool ComputeDivergence = false;
95  bool ComputeVorticity = false;
96  bool ComputeQCriterion = false;
97  bool StoreGradient = true;
98  bool RowOrdering = true;
99 
100  std::string DivergenceName = "Divergence";
101  std::string GradientsName = "Gradients";
102  std::string QCriterionName = "QCriterion";
103  std::string VorticityName = "Vorticity";
104 };
105 
106 } // namespace vector_analysis
107 } // namespace filter
108 } // namespace vtkm::filter
109 
110 #endif // vtk_m_filter_vector_analysis_Gradient_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::filter::vector_analysis::Gradient::GetComputeDivergence
bool GetComputeDivergence() const
Definition: Gradient.h:46
vtkm::filter::vector_analysis::Gradient::GetDivergenceName
const std::string & GetDivergenceName() const
Definition: Gradient.h:82
vtkm::filter::vector_analysis::Gradient::SetQCriterionName
void SetQCriterionName(const std::string &name)
Definition: Gradient.h:87
vtkm::filter::vector_analysis::Gradient::SetComputeDivergence
void SetComputeDivergence(bool enable)
Add divergence field to the output data.
Definition: Gradient.h:45
vtkm::filter::vector_analysis::Gradient::SetComputeQCriterion
void SetComputeQCriterion(bool enable)
Add Q-criterion field to the output data.
Definition: Gradient.h:59
vtkm::filter::vector_analysis::Gradient::SetComputeVorticity
void SetComputeVorticity(bool enable)
Add voriticity/curl field to the output data.
Definition: Gradient.h:52
vtkm::cont::DataSet
Definition: DataSet.h:34
vtkm::filter::vector_analysis::Gradient
A general filter for gradient estimation.
Definition: Gradient.h:32
vtkm::filter::vector_analysis::Gradient::GetQCriterionName
const std::string & GetQCriterionName() const
Definition: Gradient.h:88
vtkm::filter::vector_analysis::Gradient::SetVorticityName
void SetVorticityName(const std::string &name)
Definition: Gradient.h:84
vtkm::filter::vector_analysis::Gradient::SetComputePointGradient
void SetComputePointGradient(bool enable)
When this flag is on (default is off), the gradient filter will provide a point based gradients,...
Definition: Gradient.h:38
FilterField.h
vtkm::filter::FilterField
Definition: FilterField.h:21
vtkm::filter::vector_analysis::Gradient::GetComputeVorticity
bool GetComputeVorticity() const
Definition: Gradient.h:53
vtkm::filter::vector_analysis::Gradient::GetComputeQCriterion
bool GetComputeQCriterion() const
Definition: Gradient.h:60
vtkm::filter::vector_analysis::Gradient::SetComputeGradient
void SetComputeGradient(bool enable)
Add gradient field to the output data.
Definition: Gradient.h:66
vtkm::filter::vector_analysis::Gradient::GetComputePointGradient
bool GetComputePointGradient() const
Definition: Gradient.h:39
vtkm::filter::vector_analysis::Gradient::GetComputeGradient
bool GetComputeGradient() const
Definition: Gradient.h:67
vtkm::filter::vector_analysis::Gradient::SetDivergenceName
void SetDivergenceName(const std::string &name)
Definition: Gradient.h:81
vtkm::filter::vector_analysis::Gradient::SetRowMajorOrdering
void SetRowMajorOrdering()
Make the vector gradient output format be in C Row-major order.
Definition: Gradient.h:79
vtkm::filter::vector_analysis::Gradient::SetColumnMajorOrdering
void SetColumnMajorOrdering()
Make the vector gradient output format be in FORTRAN Column-major order.
Definition: Gradient.h:74
vtkm::filter::vector_analysis::Gradient::GetVorticityName
const std::string & GetVorticityName() const
Definition: Gradient.h:85