Viskores  1.0
Gradient.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 
19 #ifndef viskores_filter_vector_analysis_Gradient_h
20 #define viskores_filter_vector_analysis_Gradient_h
21 
22 #include <viskores/filter/Filter.h>
24 
25 namespace viskores
26 {
27 namespace filter
28 {
29 namespace vector_analysis
30 {
31 
42 class VISKORES_FILTER_VECTOR_ANALYSIS_EXPORT Gradient : public viskores::filter::Filter
43 {
44 public:
50  void SetComputePointGradient(bool enable) { ComputePointGradient = enable; }
52  bool GetComputePointGradient() const { return ComputePointGradient; }
53 
56  void SetComputeDivergence(bool enable) { ComputeDivergence = enable; }
58  bool GetComputeDivergence() const { return ComputeDivergence; }
59 
62  void SetDivergenceName(const std::string& name) { this->DivergenceName = name; }
64  const std::string& GetDivergenceName() const { return this->DivergenceName; }
65 
68  void SetComputeVorticity(bool enable) { ComputeVorticity = enable; }
70  bool GetComputeVorticity() const { return ComputeVorticity; }
71 
74  void SetVorticityName(const std::string& name) { this->VorticityName = name; }
76  const std::string& GetVorticityName() const { return this->VorticityName; }
77 
80  void SetComputeQCriterion(bool enable) { ComputeQCriterion = enable; }
82  bool GetComputeQCriterion() const { return ComputeQCriterion; }
83 
86  void SetQCriterionName(const std::string& name) { this->QCriterionName = name; }
88  const std::string& GetQCriterionName() const { return this->QCriterionName; }
89 
95  void SetComputeGradient(bool enable) { StoreGradient = enable; }
97  bool GetComputeGradient() const { return StoreGradient; }
98 
104  void SetColumnMajorOrdering() { RowOrdering = false; }
105 
109  void SetRowMajorOrdering() { RowOrdering = true; }
110 
111 private:
112  viskores::cont::DataSet DoExecute(const viskores::cont::DataSet& inputDataSet) override;
113 
114  bool ComputePointGradient = false;
115  bool ComputeDivergence = false;
116  bool ComputeVorticity = false;
117  bool ComputeQCriterion = false;
118  bool StoreGradient = true;
119  bool RowOrdering = true;
120 
121  std::string DivergenceName = "Divergence";
122  std::string GradientsName = "Gradients";
123  std::string QCriterionName = "QCriterion";
124  std::string VorticityName = "Vorticity";
125 };
126 
127 } // namespace vector_analysis
128 } // namespace filter
129 } // namespace viskores::filter
130 
131 #endif // viskores_filter_vector_analysis_Gradient_h
viskores::filter::vector_analysis::Gradient::SetRowMajorOrdering
void SetRowMajorOrdering()
Make the vector gradient output format be in C Row-major order.
Definition: Gradient.h:109
viskores::cont::DataSet
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
viskores::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:62
viskores::filter::vector_analysis::Gradient::SetComputeVorticity
void SetComputeVorticity(bool enable)
Add voriticity/curl field to the output data.
Definition: Gradient.h:68
viskores::filter::vector_analysis::Gradient::GetComputeVorticity
bool GetComputeVorticity() const
Add voriticity/curl field to the output data.
Definition: Gradient.h:70
viskores::filter::Filter
Base class for all filters.
Definition: Filter.h:171
viskores::filter::vector_analysis::Gradient::GetComputeGradient
bool GetComputeGradient() const
Add gradient field to the output data.
Definition: Gradient.h:97
viskores::filter::vector_analysis::Gradient
A general filter for gradient estimation.
Definition: Gradient.h:42
viskores::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:76
viskores::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:64
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::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:88
viskores::filter::vector_analysis::Gradient::GetComputeQCriterion
bool GetComputeQCriterion() const
Add Q-criterion field to the output data.
Definition: Gradient.h:82
viskores::filter::vector_analysis::Gradient::SetColumnMajorOrdering
void SetColumnMajorOrdering()
Make the vector gradient output format be in FORTRAN Column-major order.
Definition: Gradient.h:104
viskores::filter::vector_analysis::Gradient::SetComputePointGradient
void SetComputePointGradient(bool enable)
Specify whether to compute gradients.
Definition: Gradient.h:50
viskores::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:74
viskores::filter::vector_analysis::Gradient::SetComputeGradient
void SetComputeGradient(bool enable)
Add gradient field to the output data.
Definition: Gradient.h:95
viskores::filter::vector_analysis::Gradient::GetComputeDivergence
bool GetComputeDivergence() const
Add divergence field to the output data.
Definition: Gradient.h:58
viskores::filter::vector_analysis::Gradient::GetComputePointGradient
bool GetComputePointGradient() const
Specify whether to compute gradients.
Definition: Gradient.h:52
viskores::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:86
viskores_filter_vector_analysis_export.h
viskores::filter::vector_analysis::Gradient::SetComputeDivergence
void SetComputeDivergence(bool enable)
Add divergence field to the output data.
Definition: Gradient.h:56
viskores::filter::vector_analysis::Gradient::SetComputeQCriterion
void SetComputeQCriterion(bool enable)
Add Q-criterion field to the output data.
Definition: Gradient.h:80
Filter.h