2020-06-18 15:52:16 +00:00
|
|
|
//============================================================================
|
|
|
|
// 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_hxx
|
|
|
|
#define vtk_m_filter_ParticleAdvection_hxx
|
|
|
|
|
|
|
|
#include <vtkm/cont/ErrorFilterExecution.h>
|
2021-06-11 12:00:25 +00:00
|
|
|
#include <vtkm/filter/ParticleAdvection.h>
|
2020-08-13 14:01:52 +00:00
|
|
|
#include <vtkm/filter/particleadvection/BoundsMap.h>
|
|
|
|
#include <vtkm/filter/particleadvection/DataSetIntegrator.h>
|
2020-11-19 18:52:01 +00:00
|
|
|
#include <vtkm/filter/particleadvection/ParticleAdvectionAlgorithm.h>
|
2020-08-13 14:01:52 +00:00
|
|
|
|
2020-06-18 15:52:16 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace filter
|
|
|
|
{
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
inline VTKM_CONT ParticleAdvection::ParticleAdvection()
|
2021-06-11 12:00:25 +00:00
|
|
|
: vtkm::filter::FilterParticleAdvection<ParticleAdvection>()
|
2020-06-18 15:52:16 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
2020-08-13 14:01:52 +00:00
|
|
|
template <typename DerivedPolicy>
|
|
|
|
inline VTKM_CONT vtkm::cont::PartitionedDataSet ParticleAdvection::PrepareForExecution(
|
|
|
|
const vtkm::cont::PartitionedDataSet& input,
|
2020-06-18 15:52:16 +00:00
|
|
|
const vtkm::filter::PolicyBase<DerivedPolicy>&)
|
|
|
|
{
|
2020-11-18 22:10:28 +00:00
|
|
|
using AlgorithmType = vtkm::filter::particleadvection::ParticleAdvectionAlgorithm;
|
|
|
|
using ThreadedAlgorithmType = vtkm::filter::particleadvection::ParticleAdvectionThreadedAlgorithm;
|
|
|
|
|
2021-06-11 12:00:25 +00:00
|
|
|
this->ValidateOptions(input);
|
|
|
|
vtkm::filter::particleadvection::BoundsMap boundsMap(input);
|
|
|
|
auto dsi = this->CreateDataSetIntegrators(input, boundsMap);
|
|
|
|
|
2021-02-05 14:40:50 +00:00
|
|
|
if (this->GetUseThreadedAlgorithm())
|
|
|
|
return vtkm::filter::particleadvection::RunAlgo<DSIType, ThreadedAlgorithmType>(
|
2020-11-18 22:10:28 +00:00
|
|
|
boundsMap, dsi, this->NumberOfSteps, this->StepSize, this->Seeds);
|
|
|
|
else
|
2021-02-05 14:40:50 +00:00
|
|
|
return vtkm::filter::particleadvection::RunAlgo<DSIType, AlgorithmType>(
|
2020-11-18 22:10:28 +00:00
|
|
|
boundsMap, dsi, this->NumberOfSteps, this->StepSize, this->Seeds);
|
2020-06-18 15:52:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} // namespace vtkm::filter
|
|
|
|
#endif
|