VTK-m  2.3
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/Deprecated.h>
15 #include <vtkm/Particle.h>
17 #include <vtkm/filter/Filter.h>
21 
22 namespace vtkm
23 {
24 namespace filter
25 {
26 namespace flow
27 {
28 
30 
33 
35 {
36 public:
37  VTKM_CONT
38  bool CanThread() const override { return false; }
39 
46  VTKM_CONT void SetStepSize(vtkm::FloatDefault s) { this->StepSize = s; }
47 
52  VTKM_CONT void SetNumberOfSteps(vtkm::Id n) { this->NumberOfSteps = n; }
53 
59  template <typename ParticleType>
61  {
62  this->Seeds = seeds;
63  }
64 
66  template <typename ParticleType>
67  VTKM_CONT void SetSeeds(const std::vector<ParticleType>& seeds,
69  {
70  this->Seeds = vtkm::cont::make_ArrayHandle(seeds, copyFlag);
71  }
72 
73  VTKM_CONT void SetBlockIDs(const std::vector<vtkm::Id>& blockIds)
74  {
75  this->BlockIds = blockIds;
76  this->BlockIdsSet = true;
77  }
78 
79  VTKM_CONT
81 
82  VTKM_CONT
84  {
86  }
87 
88  VTKM_CONT
89  bool GetUseThreadedAlgorithm() { return this->UseThreadedAlgorithm; }
90 
91  VTKM_CONT
92  void SetUseThreadedAlgorithm(bool val) { this->UseThreadedAlgorithm = val; }
93 
94  VTKM_DEPRECATED(2.2, "All communication is asynchronous now.")
95  VTKM_CONT
96  void SetUseAsynchronousCommunication() {}
97 
98  VTKM_DEPRECATED(2.2, "All communication is asynchronous now.")
99  VTKM_CONT
100  bool GetUseAsynchronousCommunication() { return true; }
101 
102  VTKM_DEPRECATED(2.2, "All communication is asynchronous now.")
103  VTKM_CONT
104  void SetUseSynchronousCommunication() {}
105 
106  VTKM_DEPRECATED(2.2, "All communication is asynchronous now.")
107  VTKM_CONT
108  bool GetUseSynchronousCommunication() { return false; }
109 
110 
111 protected:
112  VTKM_CONT virtual void ValidateOptions() const;
113 
114  bool BlockIdsSet = false;
115  std::vector<vtkm::Id> BlockIds;
116  vtkm::filter::flow::internal::BoundsMap BoundsMap;
117  vtkm::Id NumberOfSteps = 0;
121  vtkm::FloatDefault StepSize = 0;
122  bool UseThreadedAlgorithm = false;
125 
126 private:
127  VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& inData) override;
128 };
129 
130 }
131 }
132 } // namespace vtkm::filter::flow
133 
134 #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
BoundsMap.h
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:67
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:38
vtkm::filter::flow::FilterParticleAdvection::Seeds
vtkm::cont::UnknownArrayHandle Seeds
Definition: FilterParticleAdvection.h:118
vtkm::filter::flow::FilterParticleAdvection::SetUseThreadedAlgorithm
void SetUseThreadedAlgorithm(bool val)
Definition: FilterParticleAdvection.h:92
ErrorFilterExecution.h
vtkm::filter::flow::FilterParticleAdvection::BlockIds
std::vector< vtkm::Id > BlockIds
Definition: FilterParticleAdvection.h:115
vtkm::filter::flow::FilterParticleAdvection::SetSolverEuler
void SetSolverEuler()
Definition: FilterParticleAdvection.h:83
vtkm::filter::flow::FilterParticleAdvection::SetNumberOfSteps
void SetNumberOfSteps(vtkm::Id n)
Specifies the maximum number of integration steps for each particle.
Definition: FilterParticleAdvection.h:52
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:89
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
base class for advecting particles in a vector field.
Definition: FilterParticleAdvection.h:34
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:60
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:46
vtkm_filter_flow_export.h
vtkm::filter::flow::FilterParticleAdvection::BoundsMap
vtkm::filter::flow::internal::BoundsMap BoundsMap
Definition: FilterParticleAdvection.h:116
Deprecated.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:73
vtkm::filter::flow::FilterParticleAdvection::SetSolverRK4
void SetSolverRK4()
Definition: FilterParticleAdvection.h:80
FlowTypes.h
VTKM_DEPRECATED
#define VTKM_DEPRECATED(...)
Definition: Deprecated.h:145
Particle.h
Filter.h