vtk-m2/vtkm/filter/Pathline.hxx

59 lines
2.2 KiB
C++
Raw Normal View History

2019-03-25 20:10:58 +00:00
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
2019-04-15 23:24:21 +00:00
//
2019-03-25 20:10:58 +00:00
// 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_Pathline_hxx
#define vtk_m_filter_Pathline_hxx
2019-03-25 20:10:58 +00:00
#include <vtkm/cont/ErrorFilterExecution.h>
#include <vtkm/filter/Pathline.h>
2021-02-05 14:40:50 +00:00
#include <vtkm/filter/particleadvection/BoundsMap.h>
#include <vtkm/filter/particleadvection/DataSetIntegrator.h>
#include <vtkm/filter/particleadvection/ParticleAdvectionAlgorithm.h>
2019-03-25 20:10:58 +00:00
namespace vtkm
{
namespace filter
{
//-----------------------------------------------------------------------------
template <typename ParticleType>
inline VTKM_CONT PathlineBase<ParticleType>::PathlineBase()
: vtkm::filter::FilterTemporalParticleAdvection<PathlineBase<ParticleType>, ParticleType>()
2019-03-25 20:10:58 +00:00
{
}
//-----------------------------------------------------------------------------
template <typename ParticleType>
2021-02-05 14:40:50 +00:00
template <typename DerivedPolicy>
inline VTKM_CONT vtkm::cont::PartitionedDataSet PathlineBase<ParticleType>::PrepareForExecution(
2021-02-05 14:40:50 +00:00
const vtkm::cont::PartitionedDataSet& input,
2019-03-25 20:10:58 +00:00
const vtkm::filter::PolicyBase<DerivedPolicy>&)
{
2021-02-05 14:40:50 +00:00
using AlgorithmType = vtkm::filter::particleadvection::PathlineAlgorithm;
using ThreadedAlgorithmType = vtkm::filter::particleadvection::PathlineThreadedAlgorithm;
using TDSIType = vtkm::filter::particleadvection::TemporalDataSetIntegrator;
2019-03-25 20:10:58 +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<TDSIType, ThreadedAlgorithmType>(
2021-02-05 14:40:50 +00:00
boundsMap, dsi, this->NumberOfSteps, this->StepSize, this->Seeds);
else
return vtkm::filter::particleadvection::RunAlgo<TDSIType, AlgorithmType>(
2021-02-05 14:40:50 +00:00
boundsMap, dsi, this->NumberOfSteps, this->StepSize, this->Seeds);
2019-03-25 20:10:58 +00:00
}
}
} // namespace vtkm::filter
#endif