vtk-m2/vtkm/filter/Pathline.hxx

56 lines
2.0 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
{
//-----------------------------------------------------------------------------
inline VTKM_CONT Pathline::Pathline()
2021-11-22 18:56:08 +00:00
: vtkm::filter::FilterTemporalParticleAdvection<Pathline>()
2019-03-25 20:10:58 +00:00
{
}
//-----------------------------------------------------------------------------
2021-02-05 14:40:50 +00:00
template <typename DerivedPolicy>
inline VTKM_CONT vtkm::cont::PartitionedDataSet Pathline::PrepareForExecution(
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;
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<DSIType, ThreadedAlgorithmType>(
boundsMap, dsi, this->NumberOfSteps, this->StepSize, this->Seeds);
else
return vtkm::filter::particleadvection::RunAlgo<DSIType, AlgorithmType>(
boundsMap, dsi, this->NumberOfSteps, this->StepSize, this->Seeds);
2019-03-25 20:10:58 +00:00
}
}
} // namespace vtkm::filter
#endif