//============================================================================ // Copyright (c) Kitware, Inc. // All rights reserved. // See LICENSE.txt for details. // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notice for more information. //============================================================================ #ifndef vtk_m_filter_ParticleAdvection_h #define vtk_m_filter_ParticleAdvection_h #include #include namespace vtkm { namespace filter { /// \brief advect particles in a vector field. /// Takes as input a vector field and seed locations and generates the /// end points for each seed through the vector field. class ParticleAdvection : public vtkm::filter::FilterDataSetWithField { public: using SupportedTypes = vtkm::TypeListFieldVec3; VTKM_CONT ParticleAdvection(); VTKM_CONT void SetStepSize(vtkm::FloatDefault s) { this->StepSize = s; } VTKM_CONT void SetNumberOfSteps(vtkm::Id n) { this->NumberOfSteps = n; } VTKM_CONT void SetSeeds(vtkm::cont::ArrayHandle& seeds); VTKM_CONT bool GetUseThreadedAlgorithm() { return this->UseThreadedAlgorithm; } VTKM_CONT void SetUseThreadedAlgorithm(bool val) { this->UseThreadedAlgorithm = val; } template vtkm::cont::PartitionedDataSet PrepareForExecution( const vtkm::cont::PartitionedDataSet& input, const vtkm::filter::PolicyBase& policy); template VTKM_CONT bool MapFieldOntoOutput(vtkm::cont::DataSet& result, const vtkm::cont::Field& field, vtkm::filter::PolicyBase policy); private: vtkm::Id NumberOfSteps; vtkm::FloatDefault StepSize; vtkm::cont::ArrayHandle Seeds; bool UseThreadedAlgorithm; }; } } // namespace vtkm::filter #ifndef vtk_m_filter_ParticleAdvection_hxx #include #endif #endif // vtk_m_filter_ParticleAdvection_h