2017-09-21 18:27:32 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
//
|
2017-09-21 18:27:32 +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.
|
|
|
|
//============================================================================
|
2019-10-07 19:39:02 +00:00
|
|
|
#ifndef vtk_m_filter_Streamline_hxx
|
|
|
|
#define vtk_m_filter_Streamline_hxx
|
2017-09-21 18:27:32 +00:00
|
|
|
|
2018-04-02 21:58:21 +00:00
|
|
|
#include <vtkm/cont/ErrorFilterExecution.h>
|
2021-06-11 12:00:25 +00:00
|
|
|
#include <vtkm/filter/Streamline.h>
|
2020-08-13 14:01:52 +00:00
|
|
|
#include <vtkm/filter/particleadvection/BoundsMap.h>
|
|
|
|
#include <vtkm/filter/particleadvection/DataSetIntegrator.h>
|
2021-06-11 12:00:25 +00:00
|
|
|
#include <vtkm/filter/particleadvection/ParticleAdvectionAlgorithm.h>
|
2020-08-13 14:01:52 +00:00
|
|
|
|
2017-09-21 18:27:32 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace filter
|
|
|
|
{
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
inline VTKM_CONT Streamline::Streamline()
|
2021-06-11 12:00:25 +00:00
|
|
|
: vtkm::filter::FilterParticleAdvection<Streamline>()
|
2017-09-21 18:27:32 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
2020-08-13 14:01:52 +00:00
|
|
|
template <typename DerivedPolicy>
|
|
|
|
inline VTKM_CONT vtkm::cont::PartitionedDataSet Streamline::PrepareForExecution(
|
|
|
|
const vtkm::cont::PartitionedDataSet& input,
|
2018-08-30 15:53:18 +00:00
|
|
|
const vtkm::filter::PolicyBase<DerivedPolicy>&)
|
2017-09-21 18:27:32 +00:00
|
|
|
{
|
2020-11-18 22:10:28 +00:00
|
|
|
using AlgorithmType = vtkm::filter::particleadvection::StreamlineAlgorithm;
|
|
|
|
using ThreadedAlgorithmType = vtkm::filter::particleadvection::StreamlineThreadedAlgorithm;
|
2017-09-22 17:03:36 +00:00
|
|
|
|
2021-06-23 17:53:56 +00:00
|
|
|
this->ValidateOptions();
|
2021-06-11 12:00:25 +00:00
|
|
|
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);
|
2017-09-21 18:27:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
} // namespace vtkm::filter
|
2019-10-07 19:39:02 +00:00
|
|
|
#endif
|