2018-04-05 01:13:44 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
//
|
2018-04-05 01:13:44 +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_cont_FieldRangeGlobalCompute_h
|
|
|
|
#define vtk_m_cont_FieldRangeGlobalCompute_h
|
|
|
|
|
|
|
|
#include <vtkm/cont/FieldRangeCompute.h>
|
|
|
|
|
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace cont
|
|
|
|
{
|
2020-10-20 19:22:43 +00:00
|
|
|
|
|
|
|
namespace detail
|
|
|
|
{
|
|
|
|
|
|
|
|
VTKM_CONT_EXPORT VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> MergeRangesGlobal(
|
|
|
|
const vtkm::cont::ArrayHandle<vtkm::Range>& range);
|
|
|
|
|
|
|
|
} // namespace detail
|
|
|
|
|
2018-04-05 01:13:44 +00:00
|
|
|
/// \brief utility functions to compute global ranges for dataset fields.
|
|
|
|
///
|
2019-09-02 14:38:47 +00:00
|
|
|
/// These functions compute global ranges for fields in a single DataSet or a
|
|
|
|
/// PartitionedDataSet.
|
2018-04-05 01:13:44 +00:00
|
|
|
/// In non-distributed environments, this is exactly same as `FieldRangeCompute`. In
|
|
|
|
/// distributed environments, however, the range is computed locally on each rank
|
|
|
|
/// and then a reduce-all collective is performed to reduces the ranges on all ranks.
|
|
|
|
|
|
|
|
//{@
|
|
|
|
/// Returns the range for a field from a dataset. If the field is not present, an empty
|
|
|
|
/// ArrayHandle will be returned.
|
|
|
|
VTKM_CONT_EXPORT
|
|
|
|
VTKM_CONT
|
|
|
|
vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeGlobalCompute(
|
|
|
|
const vtkm::cont::DataSet& dataset,
|
|
|
|
const std::string& name,
|
2022-03-17 17:02:37 +00:00
|
|
|
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::Any);
|
2018-04-05 01:13:44 +00:00
|
|
|
//@}
|
|
|
|
|
|
|
|
//{@
|
2019-09-02 14:38:47 +00:00
|
|
|
/// Returns the range for a field from a PartitionedDataSet. If the field is
|
|
|
|
/// not present on any of the partitions, an empty ArrayHandle will be
|
|
|
|
/// returned. If the field is present on some partitions, but not all, those
|
|
|
|
/// partitions without the field are skipped.
|
2018-04-05 01:13:44 +00:00
|
|
|
///
|
2019-09-02 14:38:47 +00:00
|
|
|
/// The returned array handle will have as many values as the maximum number of
|
|
|
|
/// components for the selected field across all partitions.
|
2018-04-05 01:13:44 +00:00
|
|
|
VTKM_CONT_EXPORT
|
|
|
|
VTKM_CONT
|
|
|
|
vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeGlobalCompute(
|
2019-09-02 14:38:47 +00:00
|
|
|
const vtkm::cont::PartitionedDataSet& pds,
|
2018-04-05 01:13:44 +00:00
|
|
|
const std::string& name,
|
2022-03-17 17:02:37 +00:00
|
|
|
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::Any);
|
2018-04-05 01:13:44 +00:00
|
|
|
//@}
|
2022-11-11 21:34:13 +00:00
|
|
|
|
2018-04-05 01:13:44 +00:00
|
|
|
}
|
|
|
|
} // namespace vtkm::cont
|
|
|
|
|
|
|
|
#endif
|