VTK-m  2.3
ParticleAdvector.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_internal_ParticleAdvector_h
12 #define vtk_m_filter_flow_internal_ParticleAdvector_h
13 
18 
19 namespace vtkm
20 {
21 namespace filter
22 {
23 namespace flow
24 {
25 namespace internal
26 {
27 
28 template <typename DSIType>
29 class ParticleAdvector
30 {
31 public:
32  using ParticleType = typename DSIType::PType;
33 
34  ParticleAdvector(const vtkm::filter::flow::internal::BoundsMap& bm,
35  const std::vector<DSIType>& blocks,
36  const bool& useThreaded)
37  : Blocks(blocks)
38  , BoundsMap(bm)
39  , UseThreadedAlgorithm(useThreaded)
40  {
41  }
42 
44  vtkm::FloatDefault stepSize)
45  {
46  if (!this->UseThreadedAlgorithm)
47  {
48  using AlgorithmType = vtkm::filter::flow::internal::AdvectAlgorithm<DSIType>;
49  return this->RunAlgo<AlgorithmType>(seeds, stepSize);
50  }
51  else
52  {
53  using AlgorithmType = vtkm::filter::flow::internal::AdvectAlgorithmThreaded<DSIType>;
54  return this->RunAlgo<AlgorithmType>(seeds, stepSize);
55  }
56  }
57 
58 private:
59  template <typename AlgorithmType>
61  vtkm::FloatDefault stepSize)
62  {
63  AlgorithmType algo(this->BoundsMap, this->Blocks);
64  algo.Execute(seeds, stepSize);
65  return algo.GetOutput();
66  }
67 
68  std::vector<DSIType> Blocks;
69  vtkm::filter::flow::internal::BoundsMap BoundsMap;
70  bool UseThreadedAlgorithm;
71 };
72 
73 }
74 }
75 }
76 } //vtkm::filter::flow::internal
77 
78 
79 #endif //vtk_m_filter_flow_internal_ParticleAdvector_h
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
DataSetIntegrator.h
AdvectAlgorithm.h
vtkm::FloatDefault
vtkm::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:236
AdvectAlgorithmThreaded.h
vtkm::cont::PartitionedDataSet
Comprises a set of vtkm::cont::DataSet objects.
Definition: PartitionedDataSet.h:26