VTK-m  2.2
FilterParticleAdvection.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_FilterParticleAdvection_h
12 #define vtk_m_filter_flow_FilterParticleAdvection_h
13 
14 #include <vtkm/Particle.h>
16 #include <vtkm/filter/Filter.h>
19 
20 namespace vtkm
21 {
22 namespace filter
23 {
24 namespace flow
25 {
26 
28 
31 
33 {
34 public:
35  VTKM_CONT
36  bool CanThread() const override { return false; }
37 
44  VTKM_CONT void SetStepSize(vtkm::FloatDefault s) { this->StepSize = s; }
45 
50  VTKM_CONT void SetNumberOfSteps(vtkm::Id n) { this->NumberOfSteps = n; }
51 
57  template <typename ParticleType>
59  {
60  this->Seeds = seeds;
61  }
62 
64  template <typename ParticleType>
65  VTKM_CONT void SetSeeds(const std::vector<ParticleType>& seeds,
67  {
68  this->Seeds = vtkm::cont::make_ArrayHandle(seeds, copyFlag);
69  }
70 
71  VTKM_CONT void SetBlockIDs(const std::vector<vtkm::Id>& blockIds)
72  {
73  this->BlockIds = blockIds;
74  this->BlockIdsSet = true;
75  }
76 
77  VTKM_CONT
79 
80  VTKM_CONT
82  {
84  }
85 
86  VTKM_CONT
87  bool GetUseThreadedAlgorithm() { return this->UseThreadedAlgorithm; }
88 
89  VTKM_CONT
90  void SetUseThreadedAlgorithm(bool val) { this->UseThreadedAlgorithm = val; }
91 
92  VTKM_CONT
93  void SetUseAsynchronousCommunication() { this->UseAsynchronousCommunication = true; }
94  VTKM_CONT
95  bool GetUseAsynchronousCommunication() { return this->UseAsynchronousCommunication; }
96 
97  VTKM_CONT
98  void SetUseSynchronousCommunication() { this->UseAsynchronousCommunication = false; }
99  VTKM_CONT
100  bool GetUseSynchronousCommunication() { return !this->GetUseAsynchronousCommunication(); }
101 
102 protected:
103  VTKM_CONT virtual void ValidateOptions() const;
104 
105  bool BlockIdsSet = false;
106  std::vector<vtkm::Id> BlockIds;
107 
108  vtkm::Id NumberOfSteps = 0;
112  vtkm::FloatDefault StepSize = 0;
113  bool UseAsynchronousCommunication = true;
114  bool UseThreadedAlgorithm = false;
117 
118 private:
119  VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& inData) override;
120 };
121 
122 }
123 }
124 } // namespace vtkm::filter::flow
125 
126 #endif // vtk_m_filter_flow_FilterParticleAdvection_h
vtkm::filter::flow::IntegrationSolverType::RK4_TYPE
@ RK4_TYPE
vtkm::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:300
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::filter::flow::IntegrationSolverType::EULER_TYPE
@ EULER_TYPE
vtkm::filter::flow::VectorFieldType::VELOCITY_FIELD_TYPE
@ VELOCITY_FIELD_TYPE
vtkm::filter::flow::FilterParticleAdvection::SetSeeds
void SetSeeds(const std::vector< ParticleType > &seeds, vtkm::CopyFlag copyFlag=vtkm::CopyFlag::On)
Specify the seed locations for the particle advection.
Definition: FilterParticleAdvection.h:65
vtkm::cont::UnknownArrayHandle
An ArrayHandle of an unknown value type and storage.
Definition: UnknownArrayHandle.h:430
vtkm::cont::DataSet
Contains and manages the geometric data structures that VTK-m operates on.
Definition: DataSet.h:57
vtkm::filter::flow::FilterParticleAdvection::CanThread
bool CanThread() const override
Returns whether the filter can execute on partitions in concurrent threads.
Definition: FilterParticleAdvection.h:36
vtkm::filter::flow::FilterParticleAdvection::Seeds
vtkm::cont::UnknownArrayHandle Seeds
Definition: FilterParticleAdvection.h:109
vtkm::filter::flow::FilterParticleAdvection::SetUseThreadedAlgorithm
void SetUseThreadedAlgorithm(bool val)
Definition: FilterParticleAdvection.h:90
ErrorFilterExecution.h
vtkm::filter::flow::FilterParticleAdvection::SetUseAsynchronousCommunication
void SetUseAsynchronousCommunication()
Definition: FilterParticleAdvection.h:93
vtkm::filter::flow::FilterParticleAdvection::GetUseAsynchronousCommunication
bool GetUseAsynchronousCommunication()
Definition: FilterParticleAdvection.h:95
vtkm::filter::flow::FilterParticleAdvection::BlockIds
std::vector< vtkm::Id > BlockIds
Definition: FilterParticleAdvection.h:106
vtkm::filter::flow::FilterParticleAdvection::SetSolverEuler
void SetSolverEuler()
Definition: FilterParticleAdvection.h:81
vtkm::filter::flow::FilterParticleAdvection::SetNumberOfSteps
void SetNumberOfSteps(vtkm::Id n)
Specifies the maximum number of integration steps for each particle.
Definition: FilterParticleAdvection.h:50
vtkm::filter::flow::FilterParticleAdvection::SetUseSynchronousCommunication
void SetUseSynchronousCommunication()
Definition: FilterParticleAdvection.h:98
vtkm::filter::flow::IntegrationSolverType
IntegrationSolverType
Definition: FlowTypes.h:19
vtkm::filter::Filter
Base class for all filters.
Definition: Filter.h:163
vtkm::filter::flow::VectorFieldType
VectorFieldType
Definition: FlowTypes.h:25
vtkm::filter::flow::FilterParticleAdvection::GetUseThreadedAlgorithm
bool GetUseThreadedAlgorithm()
Definition: FilterParticleAdvection.h:87
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Id
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
vtkm::filter::flow::FilterParticleAdvection::GetUseSynchronousCommunication
bool GetUseSynchronousCommunication()
Definition: FilterParticleAdvection.h:100
vtkm::filter::flow::FilterParticleAdvection
base class for advecting particles in a vector field.
Definition: FilterParticleAdvection.h:32
vtkm::CopyFlag::On
@ On
VTKM_FILTER_FLOW_EXPORT
#define VTKM_FILTER_FLOW_EXPORT
Definition: vtkm_filter_flow_export.h:44
vtkm::filter::flow::FilterParticleAdvection::SetSeeds
void SetSeeds(vtkm::cont::ArrayHandle< ParticleType > &seeds)
Specify the seed locations for the particle advection.
Definition: FilterParticleAdvection.h:58
vtkm::FloatDefault
vtkm::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:236
vtkm::filter::flow::FilterParticleAdvection::SetStepSize
void SetStepSize(vtkm::FloatDefault s)
Specifies the step size used for the numerical integrator.
Definition: FilterParticleAdvection.h:44
vtkm_filter_flow_export.h
vtkm::CopyFlag
CopyFlag
Identifier used to specify whether a function should deep copy data.
Definition: Flags.h:17
vtkm::cont::make_ArrayHandle
vtkm::cont::ArrayHandleBasic< T > make_ArrayHandle(const T *array, vtkm::Id numberOfValues, vtkm::CopyFlag copy)
A convenience function for creating an ArrayHandle from a standard C array.
Definition: ArrayHandleBasic.h:270
vtkm::filter::flow::FilterParticleAdvection::SetBlockIDs
void SetBlockIDs(const std::vector< vtkm::Id > &blockIds)
Definition: FilterParticleAdvection.h:71
vtkm::filter::flow::FilterParticleAdvection::SetSolverRK4
void SetSolverRK4()
Definition: FilterParticleAdvection.h:78
FlowTypes.h
Particle.h
Filter.h