VTK-m  2.0
Lagrangian.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_flow_Lagrangian_h
12 #define vtk_m_filter_flow_Lagrangian_h
13 
14 #include <vtkm/Particle.h>
16 #include <vtkm/filter/flow/vtkm_filter_flow_export.h>
17 
18 namespace vtkm
19 {
20 namespace filter
21 {
22 namespace flow
23 {
24 
25 class VTKM_FILTER_FLOW_EXPORT Lagrangian : public vtkm::filter::FilterField
26 {
27 public:
28  VTKM_CONT
29  bool CanThread() const override { return false; }
30 
31  VTKM_CONT
32  void SetInitFlag(bool val) { this->InitFlag = val; }
33 
34  VTKM_CONT
35  void SetExtractFlows(bool val) { this->ExtractFlows = val; }
36 
37  VTKM_CONT
38  void SetResetParticles(bool val) { this->ResetParticles = val; }
39 
40  VTKM_CONT
41  void SetStepSize(vtkm::Float32 val) { this->StepSize = val; }
42 
43  VTKM_CONT
44  void SetWriteFrequency(vtkm::Id val) { this->WriteFrequency = val; }
45 
46  VTKM_CONT
47  void SetSeedResolutionInX(vtkm::Id val) { this->ResX = val; }
48 
49  VTKM_CONT
50  void SetSeedResolutionInY(vtkm::Id val) { this->ResY = val; }
51 
52  VTKM_CONT
53  void SetSeedResolutionInZ(vtkm::Id val) { this->ResZ = val; }
54 
55  VTKM_CONT
56  void SetCustomSeedResolution(vtkm::Id val) { this->CustRes = val; }
57 
58  VTKM_CONT
59  void SetSeedingResolution(vtkm::Id3 val) { this->SeedRes = val; }
60 
61  VTKM_CONT
62  void UpdateSeedResolution(vtkm::cont::DataSet input);
63 
64  VTKM_CONT
65  void InitializeSeedPositions(const vtkm::cont::DataSet& input);
66 
67  VTKM_CONT
68  void SetCycle(vtkm::Id cycle) { this->Cycle = cycle; }
69  VTKM_CONT
70  vtkm::Id GetCycle() const { return this->Cycle; }
71 
72  VTKM_CONT
74  {
75  this->BasisParticles = basisParticles;
76  }
77  VTKM_CONT
78  vtkm::cont::ArrayHandle<vtkm::Particle> GetBasisParticles() const { return this->BasisParticles; }
79 
80  VTKM_CONT
82  {
83  this->BasisParticlesOriginal = basisParticles;
84  }
85  VTKM_CONT
87  {
88  return this->BasisParticlesOriginal;
89  }
90 
91  VTKM_CONT
93  {
94  this->BasisParticlesValidity = valid;
95  }
96  VTKM_CONT
98  {
99  return this->BasisParticlesValidity;
100  }
101 
102 private:
103  VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& inData) override;
104 
108  vtkm::Id CustRes = 0;
109  vtkm::Id Cycle = 0;
110  bool ExtractFlows = false;
111  bool InitFlag = true;
112  bool ResetParticles = true;
113  vtkm::Id ResX = 1;
114  vtkm::Id ResY = 1;
115  vtkm::Id ResZ = 1;
117  vtkm::Id3 SeedRes = { 1, 1, 1 };
118  vtkm::Id WriteFrequency = 0;
119 };
120 
121 }
122 }
123 } //vtkm::filter::flow
124 
125 #endif // #define vtk_m_filter_flow_Lagrangian_h
vtkm::cont::ArrayHandle< vtkm::Particle >
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::filter::flow::Lagrangian::SetWriteFrequency
VTKM_CONT void SetWriteFrequency(vtkm::Id val)
Definition: Lagrangian.h:44
vtkm::filter::flow::Lagrangian::SetInitFlag
VTKM_CONT void SetInitFlag(bool val)
Definition: Lagrangian.h:32
vtkm::filter::flow::Lagrangian::SetBasisParticles
VTKM_CONT void SetBasisParticles(const vtkm::cont::ArrayHandle< vtkm::Particle > &basisParticles)
Definition: Lagrangian.h:73
vtkm::filter::flow::Lagrangian::BasisParticles
vtkm::cont::ArrayHandle< vtkm::Particle > BasisParticles
Definition: Lagrangian.h:105
vtkm::filter::flow::Lagrangian::BasisParticlesValidity
vtkm::cont::ArrayHandle< vtkm::Id > BasisParticlesValidity
Definition: Lagrangian.h:107
vtkm::filter::flow::Lagrangian::SetCustomSeedResolution
VTKM_CONT void SetCustomSeedResolution(vtkm::Id val)
Definition: Lagrangian.h:56
vtkm::filter::flow::Lagrangian::StepSize
vtkm::FloatDefault StepSize
Definition: Lagrangian.h:116
vtkm::cont::DataSet
Definition: DataSet.h:34
vtkm::filter::flow::Lagrangian::BasisParticlesOriginal
vtkm::cont::ArrayHandle< vtkm::Particle > BasisParticlesOriginal
Definition: Lagrangian.h:106
vtkm::filter::flow::Lagrangian::GetBasisParticles
VTKM_CONT vtkm::cont::ArrayHandle< vtkm::Particle > GetBasisParticles() const
Definition: Lagrangian.h:78
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::filter::flow::Lagrangian::GetBasisParticlesOriginal
VTKM_CONT vtkm::cont::ArrayHandle< vtkm::Particle > GetBasisParticlesOriginal() const
Definition: Lagrangian.h:86
vtkm::filter::flow::Lagrangian::SetCycle
VTKM_CONT void SetCycle(vtkm::Id cycle)
Definition: Lagrangian.h:68
FilterField.h
vtkm::filter::FilterField
Definition: FilterField.h:21
vtkm::filter::flow::Lagrangian::SetExtractFlows
VTKM_CONT void SetExtractFlows(bool val)
Definition: Lagrangian.h:35
vtkm::filter::flow::Lagrangian::SetSeedingResolution
VTKM_CONT void SetSeedingResolution(vtkm::Id3 val)
Definition: Lagrangian.h:59
vtkm::filter::flow::Lagrangian::SetBasisParticlesOriginal
VTKM_CONT void SetBasisParticlesOriginal(const vtkm::cont::ArrayHandle< vtkm::Particle > &basisParticles)
Definition: Lagrangian.h:81
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::filter::flow::Lagrangian::CanThread
VTKM_CONT bool CanThread() const override
Definition: Lagrangian.h:29
vtkm::filter::flow::Lagrangian
Definition: Lagrangian.h:25
vtkm::filter::flow::Lagrangian::GetBasisParticleValidity
VTKM_CONT vtkm::cont::ArrayHandle< vtkm::Id > GetBasisParticleValidity() const
Definition: Lagrangian.h:97
vtkm::Vec< vtkm::Id, 3 >
vtkm::FloatDefault
vtkm::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:198
vtkm::filter::flow::Lagrangian::GetCycle
VTKM_CONT vtkm::Id GetCycle() const
Definition: Lagrangian.h:70
vtkm::filter::flow::Lagrangian::SetStepSize
VTKM_CONT void SetStepSize(vtkm::Float32 val)
Definition: Lagrangian.h:41
vtkm::Float32
float Float32
Definition: Types.h:154
vtkm::filter::flow::Lagrangian::SetSeedResolutionInX
VTKM_CONT void SetSeedResolutionInX(vtkm::Id val)
Definition: Lagrangian.h:47
vtkm::filter::flow::Lagrangian::SetResetParticles
VTKM_CONT void SetResetParticles(bool val)
Definition: Lagrangian.h:38
vtkm::filter::flow::Lagrangian::SetBasisParticleValidity
VTKM_CONT void SetBasisParticleValidity(const vtkm::cont::ArrayHandle< vtkm::Id > &valid)
Definition: Lagrangian.h:92
vtkm::filter::flow::Lagrangian::SetSeedResolutionInY
VTKM_CONT void SetSeedResolutionInY(vtkm::Id val)
Definition: Lagrangian.h:50
vtkm::filter::flow::Lagrangian::SetSeedResolutionInZ
VTKM_CONT void SetSeedResolutionInZ(vtkm::Id val)
Definition: Lagrangian.h:53
Particle.h