VTK-m  2.2
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 
14 #include <vtkm/filter/Filter.h>
16 
17 namespace vtkm
18 {
19 namespace filter
20 {
21 namespace vector_analysis
22 {
23 
35 {
36 public:
42  void SetComputePointGradient(bool enable) { ComputePointGradient = enable; }
44  bool GetComputePointGradient() const { return ComputePointGradient; }
45 
48  void SetComputeDivergence(bool enable) { ComputeDivergence = enable; }
50  bool GetComputeDivergence() const { return ComputeDivergence; }
51 
54  void SetDivergenceName(const std::string& name) { this->DivergenceName = name; }
56  const std::string& GetDivergenceName() const { return this->DivergenceName; }
57 
60  void SetComputeVorticity(bool enable) { ComputeVorticity = enable; }
62  bool GetComputeVorticity() const { return ComputeVorticity; }
63 
66  void SetVorticityName(const std::string& name) { this->VorticityName = name; }
68  const std::string& GetVorticityName() const { return this->VorticityName; }
69 
72  void SetComputeQCriterion(bool enable) { ComputeQCriterion = enable; }
74  bool GetComputeQCriterion() const { return ComputeQCriterion; }
75 
78  void SetQCriterionName(const std::string& name) { this->QCriterionName = name; }
80  const std::string& GetQCriterionName() const { return this->QCriterionName; }
81 
87  void SetComputeGradient(bool enable) { StoreGradient = enable; }
89  bool GetComputeGradient() const { return StoreGradient; }
90 
96  void SetColumnMajorOrdering() { RowOrdering = false; }
97 
101  void SetRowMajorOrdering() { RowOrdering = true; }
102 
103 private:
104  vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& inputDataSet) override;
105 
106  bool ComputePointGradient = false;
107  bool ComputeDivergence = false;
108  bool ComputeVorticity = false;
109  bool ComputeQCriterion = false;
110  bool StoreGradient = true;
111  bool RowOrdering = true;
112 
113  std::string DivergenceName = "Divergence";
114  std::string GradientsName = "Gradients";
115  std::string QCriterionName = "QCriterion";
116  std::string VorticityName = "Vorticity";
117 };
118 
119 } // namespace vector_analysis
120 } // namespace filter
121 } // namespace vtkm::filter
122 
123 #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
Add divergence field to the output data.
Definition: Gradient.h:50
vtkm::filter::vector_analysis::Gradient::GetDivergenceName
const std::string & GetDivergenceName() const
When SetComputeDivergence() is enabled, the result is stored in a field of this name.
Definition: Gradient.h:56
vtkm::filter::vector_analysis::Gradient::SetQCriterionName
void SetQCriterionName(const std::string &name)
When SetComputeQCriterion() is enabled, the result is stored in a field of this name.
Definition: Gradient.h:78
vtkm::filter::vector_analysis::Gradient::SetComputeDivergence
void SetComputeDivergence(bool enable)
Add divergence field to the output data.
Definition: Gradient.h:48
vtkm::filter::vector_analysis::Gradient::SetComputeQCriterion
void SetComputeQCriterion(bool enable)
Add Q-criterion field to the output data.
Definition: Gradient.h:72
vtkm::filter::vector_analysis::Gradient::SetComputeVorticity
void SetComputeVorticity(bool enable)
Add voriticity/curl field to the output data.
Definition: Gradient.h:60
vtkm::cont::DataSet
Contains and manages the geometric data structures that VTK-m operates on.
Definition: DataSet.h:57
vtkm::filter::vector_analysis::Gradient
A general filter for gradient estimation.
Definition: Gradient.h:34
vtkm::filter::vector_analysis::Gradient::GetQCriterionName
const std::string & GetQCriterionName() const
When SetComputeQCriterion() is enabled, the result is stored in a field of this name.
Definition: Gradient.h:80
VTKM_FILTER_VECTOR_ANALYSIS_EXPORT
#define VTKM_FILTER_VECTOR_ANALYSIS_EXPORT
Definition: vtkm_filter_vector_analysis_export.h:44
vtkm::filter::vector_analysis::Gradient::SetVorticityName
void SetVorticityName(const std::string &name)
When SetComputeVorticity() is enabled, the result is stored in a field of this name.
Definition: Gradient.h:66
vtkm_filter_vector_analysis_export.h
vtkm::filter::vector_analysis::Gradient::SetComputePointGradient
void SetComputePointGradient(bool enable)
Specify whether to compute gradients.
Definition: Gradient.h:42
vtkm::filter::vector_analysis::Gradient::GetComputeVorticity
bool GetComputeVorticity() const
Add voriticity/curl field to the output data.
Definition: Gradient.h:62
vtkm::filter::vector_analysis::Gradient::GetComputeQCriterion
bool GetComputeQCriterion() const
Add Q-criterion field to the output data.
Definition: Gradient.h:74
vtkm::filter::vector_analysis::Gradient::SetComputeGradient
void SetComputeGradient(bool enable)
Add gradient field to the output data.
Definition: Gradient.h:87
vtkm::filter::Filter
Base class for all filters.
Definition: Filter.h:163
vtkm::filter::vector_analysis::Gradient::GetComputePointGradient
bool GetComputePointGradient() const
Specify whether to compute gradients.
Definition: Gradient.h:44
vtkm::filter::vector_analysis::Gradient::GetComputeGradient
bool GetComputeGradient() const
Add gradient field to the output data.
Definition: Gradient.h:89
vtkm::filter::vector_analysis::Gradient::SetDivergenceName
void SetDivergenceName(const std::string &name)
When SetComputeDivergence() is enabled, the result is stored in a field of this name.
Definition: Gradient.h:54
vtkm::filter::vector_analysis::Gradient::SetRowMajorOrdering
void SetRowMajorOrdering()
Make the vector gradient output format be in C Row-major order.
Definition: Gradient.h:101
vtkm::filter::vector_analysis::Gradient::SetColumnMajorOrdering
void SetColumnMajorOrdering()
Make the vector gradient output format be in FORTRAN Column-major order.
Definition: Gradient.h:96
vtkm::filter::vector_analysis::Gradient::GetVorticityName
const std::string & GetVorticityName() const
When SetComputeVorticity() is enabled, the result is stored in a field of this name.
Definition: Gradient.h:68
Filter.h