VTK-m  2.0
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
vtkm::cont::PartitionedDataSet Class Reference

#include <PartitionedDataSet.h>

Public Types

using iterator = typename StorageVec::iterator
 
using const_iterator = typename StorageVec::const_iterator
 
using value_type = typename StorageVec::value_type
 
using reference = typename StorageVec::reference
 
using const_reference = typename StorageVec::const_reference
 

Public Member Functions

VTKM_CONT PartitionedDataSet (const vtkm::cont::DataSet &ds)
 Create a new PartitionedDataSet containng a single DataSet ds. More...
 
VTKM_CONT PartitionedDataSet (const std::vector< vtkm::cont::DataSet > &partitions)
 Create a new PartitionedDataSet with a DataSet vector partitions. More...
 
VTKM_CONT PartitionedDataSet (vtkm::Id size)
 Create a new PartitionedDataSet with the capacity set to be size. More...
 
VTKM_CONT PartitionedDataSet ()=default
 
VTKM_CONT vtkm::cont::Field GetFieldFromPartition (const std::string &field_name, int partition_index) const
 Get the field field_name from partition partition_index. More...
 
VTKM_CONT vtkm::Id GetNumberOfPartitions () const
 Get number of DataSet objects stored in this PartitionedDataSet. More...
 
VTKM_CONT vtkm::Id GetGlobalNumberOfPartitions () const
 Get number of partations across all MPI ranks. More...
 
const VTKM_CONT vtkm::cont::DataSetGetPartition (vtkm::Id partId) const
 Get the DataSet partId. More...
 
const VTKM_CONT std::vector< vtkm::cont::DataSet > & GetPartitions () const
 Get an STL vector of all DataSet objects stored in PartitionedDataSet. More...
 
VTKM_CONT void AppendPartition (const vtkm::cont::DataSet &ds)
 Add DataSet ds to the end of the contained DataSet vector. More...
 
VTKM_CONT void InsertPartition (vtkm::Id index, const vtkm::cont::DataSet &ds)
 Add DataSet ds to position index of the contained DataSet vector. More...
 
VTKM_CONT void ReplacePartition (vtkm::Id index, const vtkm::cont::DataSet &ds)
 Replace the index positioned element of the contained DataSet vector with ds. More...
 
VTKM_CONT void AppendPartitions (const std::vector< vtkm::cont::DataSet > &partitions)
 Append the DataSet vector partitions to the end of the contained one. More...
 
VTKM_CONT void CopyPartitions (const vtkm::cont::PartitionedDataSet &source)
 Copies the partitions from the source. The fields on the PartitionedDataSet are not copied. More...
 
VTKM_CONT void PrintSummary (std::ostream &stream) const
 
VTKM_CONT vtkm::IdComponent GetNumberOfFields () const
 
VTKM_CONT void AddField (const Field &field)
 
template<typename T , typename Storage >
VTKM_CONT void AddGlobalField (const std::string &fieldName, const vtkm::cont::ArrayHandle< T, Storage > &field)
 
template<typename T >
VTKM_CONT void AddGlobalField (const std::string &fieldName, const std::vector< T > &field)
 
template<typename T >
VTKM_CONT void AddGlobalField (const std::string &fieldName, const T *field, const vtkm::Id &n)
 
template<typename T , typename Storage >
VTKM_CONT void AddPartitionsField (const std::string &fieldName, const vtkm::cont::ArrayHandle< T, Storage > &field)
 
template<typename T >
VTKM_CONT void AddPartitionsField (const std::string &fieldName, const std::vector< T > &field)
 
template<typename T >
VTKM_CONT void AddPartitionsField (const std::string &fieldName, const T *field, const vtkm::Id &n)
 
const VTKM_CONT vtkm::cont::FieldGetField (vtkm::Id index) const
 
VTKM_CONT vtkm::cont::FieldGetField (vtkm::Id index)
 
const VTKM_CONT vtkm::cont::FieldGetField (const std::string &name, vtkm::cont::Field::Association assoc=vtkm::cont::Field::Association::Any) const
 
VTKM_CONT vtkm::cont::FieldGetField (const std::string &name, vtkm::cont::Field::Association assoc=vtkm::cont::Field::Association::Any)
 
const VTKM_CONT vtkm::cont::FieldGetGlobalField (const std::string &name) const
 
const VTKM_CONT vtkm::cont::FieldGetPartitionsField (const std::string &name) const
 
VTKM_CONT vtkm::cont::FieldGetGlobalField (const std::string &name)
 
VTKM_CONT vtkm::cont::FieldGetPartitionsField (const std::string &name)
 
VTKM_CONT bool HasField (const std::string &name, vtkm::cont::Field::Association assoc=vtkm::cont::Field::Association::Any) const
 
VTKM_CONT bool HasGlobalField (const std::string &name) const
 
VTKM_CONT bool HasPartitionsField (const std::string &name) const
 
VTKM_CONT iterator begin () noexcept
 
VTKM_CONT iterator end () noexcept
 
VTKM_CONT const_iterator begin () const noexcept
 
VTKM_CONT const_iterator end () const noexcept
 
VTKM_CONT const_iterator cbegin () const noexcept
 
VTKM_CONT const_iterator cend () const noexcept
 

Private Types

using StorageVec = std::vector< vtkm::cont::DataSet >
 

Private Attributes

std::vector< vtkm::cont::DataSetPartitions
 
vtkm::cont::internal::FieldCollection Fields
 

Member Typedef Documentation

◆ const_iterator

using vtkm::cont::PartitionedDataSet::const_iterator = typename StorageVec::const_iterator

◆ const_reference

using vtkm::cont::PartitionedDataSet::const_reference = typename StorageVec::const_reference

◆ iterator

using vtkm::cont::PartitionedDataSet::iterator = typename StorageVec::iterator

◆ reference

using vtkm::cont::PartitionedDataSet::reference = typename StorageVec::reference

◆ StorageVec

◆ value_type

using vtkm::cont::PartitionedDataSet::value_type = typename StorageVec::value_type

Constructor & Destructor Documentation

◆ PartitionedDataSet() [1/4]

VTKM_CONT vtkm::cont::PartitionedDataSet::PartitionedDataSet ( const vtkm::cont::DataSet ds)

Create a new PartitionedDataSet containng a single DataSet ds.

◆ PartitionedDataSet() [2/4]

VTKM_CONT vtkm::cont::PartitionedDataSet::PartitionedDataSet ( const std::vector< vtkm::cont::DataSet > &  partitions)
explicit

Create a new PartitionedDataSet with a DataSet vector partitions.

◆ PartitionedDataSet() [3/4]

VTKM_CONT vtkm::cont::PartitionedDataSet::PartitionedDataSet ( vtkm::Id  size)
explicit

Create a new PartitionedDataSet with the capacity set to be size.

◆ PartitionedDataSet() [4/4]

VTKM_CONT vtkm::cont::PartitionedDataSet::PartitionedDataSet ( )
default

Member Function Documentation

◆ AddField()

VTKM_CONT void vtkm::cont::PartitionedDataSet::AddField ( const Field field)
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ AddGlobalField() [1/3]

template<typename T >
VTKM_CONT void vtkm::cont::PartitionedDataSet::AddGlobalField ( const std::string &  fieldName,
const std::vector< T > &  field 
)
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ AddGlobalField() [2/3]

template<typename T >
VTKM_CONT void vtkm::cont::PartitionedDataSet::AddGlobalField ( const std::string &  fieldName,
const T *  field,
const vtkm::Id n 
)
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ AddGlobalField() [3/3]

template<typename T , typename Storage >
VTKM_CONT void vtkm::cont::PartitionedDataSet::AddGlobalField ( const std::string &  fieldName,
const vtkm::cont::ArrayHandle< T, Storage > &  field 
)
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ AddPartitionsField() [1/3]

template<typename T >
VTKM_CONT void vtkm::cont::PartitionedDataSet::AddPartitionsField ( const std::string &  fieldName,
const std::vector< T > &  field 
)
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ AddPartitionsField() [2/3]

template<typename T >
VTKM_CONT void vtkm::cont::PartitionedDataSet::AddPartitionsField ( const std::string &  fieldName,
const T *  field,
const vtkm::Id n 
)
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ AddPartitionsField() [3/3]

template<typename T , typename Storage >
VTKM_CONT void vtkm::cont::PartitionedDataSet::AddPartitionsField ( const std::string &  fieldName,
const vtkm::cont::ArrayHandle< T, Storage > &  field 
)
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ AppendPartition()

VTKM_CONT void vtkm::cont::PartitionedDataSet::AppendPartition ( const vtkm::cont::DataSet ds)

Add DataSet ds to the end of the contained DataSet vector.

◆ AppendPartitions()

VTKM_CONT void vtkm::cont::PartitionedDataSet::AppendPartitions ( const std::vector< vtkm::cont::DataSet > &  partitions)

Append the DataSet vector partitions to the end of the contained one.

◆ begin() [1/2]

VTKM_CONT const_iterator vtkm::cont::PartitionedDataSet::begin ( ) const
inlinenoexcept

API to support range-based for loops on partitions.

◆ begin() [2/2]

VTKM_CONT iterator vtkm::cont::PartitionedDataSet::begin ( )
inlinenoexcept

API to support range-based for loops on partitions.

◆ cbegin()

VTKM_CONT const_iterator vtkm::cont::PartitionedDataSet::cbegin ( ) const
inlinenoexcept

API to support range-based for loops on partitions.

◆ cend()

VTKM_CONT const_iterator vtkm::cont::PartitionedDataSet::cend ( ) const
inlinenoexcept

API to support range-based for loops on partitions.

◆ CopyPartitions()

VTKM_CONT void vtkm::cont::PartitionedDataSet::CopyPartitions ( const vtkm::cont::PartitionedDataSet source)

Copies the partitions from the source. The fields on the PartitionedDataSet are not copied.

◆ end() [1/2]

VTKM_CONT const_iterator vtkm::cont::PartitionedDataSet::end ( ) const
inlinenoexcept

API to support range-based for loops on partitions.

◆ end() [2/2]

VTKM_CONT iterator vtkm::cont::PartitionedDataSet::end ( )
inlinenoexcept

API to support range-based for loops on partitions.

◆ GetField() [1/4]

VTKM_CONT vtkm::cont::Field& vtkm::cont::PartitionedDataSet::GetField ( const std::string &  name,
vtkm::cont::Field::Association  assoc = vtkm::cont::Field::Association::Any 
)
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ GetField() [2/4]

const VTKM_CONT vtkm::cont::Field& vtkm::cont::PartitionedDataSet::GetField ( const std::string &  name,
vtkm::cont::Field::Association  assoc = vtkm::cont::Field::Association::Any 
) const
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ GetField() [3/4]

VTKM_CONT vtkm::cont::Field& vtkm::cont::PartitionedDataSet::GetField ( vtkm::Id  index)
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ GetField() [4/4]

const VTKM_CONT vtkm::cont::Field& vtkm::cont::PartitionedDataSet::GetField ( vtkm::Id  index) const
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ GetFieldFromPartition()

VTKM_CONT vtkm::cont::Field vtkm::cont::PartitionedDataSet::GetFieldFromPartition ( const std::string &  field_name,
int  partition_index 
) const

Get the field field_name from partition partition_index.

◆ GetGlobalField() [1/2]

VTKM_CONT vtkm::cont::Field& vtkm::cont::PartitionedDataSet::GetGlobalField ( const std::string &  name)
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ GetGlobalField() [2/2]

const VTKM_CONT vtkm::cont::Field& vtkm::cont::PartitionedDataSet::GetGlobalField ( const std::string &  name) const
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ GetGlobalNumberOfPartitions()

VTKM_CONT vtkm::Id vtkm::cont::PartitionedDataSet::GetGlobalNumberOfPartitions ( ) const

Get number of partations across all MPI ranks.

Warning
This method requires global communication (MPI_Allreduce) if MPI is enabled.

◆ GetNumberOfFields()

VTKM_CONT vtkm::IdComponent vtkm::cont::PartitionedDataSet::GetNumberOfFields ( ) const
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ GetNumberOfPartitions()

VTKM_CONT vtkm::Id vtkm::cont::PartitionedDataSet::GetNumberOfPartitions ( ) const

Get number of DataSet objects stored in this PartitionedDataSet.

◆ GetPartition()

const VTKM_CONT vtkm::cont::DataSet& vtkm::cont::PartitionedDataSet::GetPartition ( vtkm::Id  partId) const

Get the DataSet partId.

◆ GetPartitions()

const VTKM_CONT std::vector<vtkm::cont::DataSet>& vtkm::cont::PartitionedDataSet::GetPartitions ( ) const

Get an STL vector of all DataSet objects stored in PartitionedDataSet.

◆ GetPartitionsField() [1/2]

VTKM_CONT vtkm::cont::Field& vtkm::cont::PartitionedDataSet::GetPartitionsField ( const std::string &  name)
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ GetPartitionsField() [2/2]

const VTKM_CONT vtkm::cont::Field& vtkm::cont::PartitionedDataSet::GetPartitionsField ( const std::string &  name) const
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ HasField()

VTKM_CONT bool vtkm::cont::PartitionedDataSet::HasField ( const std::string &  name,
vtkm::cont::Field::Association  assoc = vtkm::cont::Field::Association::Any 
) const
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ HasGlobalField()

VTKM_CONT bool vtkm::cont::PartitionedDataSet::HasGlobalField ( const std::string &  name) const
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ HasPartitionsField()

VTKM_CONT bool vtkm::cont::PartitionedDataSet::HasPartitionsField ( const std::string &  name) const
inline

Methods to Add and Get fields on a PartitionedDataSet

◆ InsertPartition()

VTKM_CONT void vtkm::cont::PartitionedDataSet::InsertPartition ( vtkm::Id  index,
const vtkm::cont::DataSet ds 
)

Add DataSet ds to position index of the contained DataSet vector.

◆ PrintSummary()

VTKM_CONT void vtkm::cont::PartitionedDataSet::PrintSummary ( std::ostream &  stream) const

◆ ReplacePartition()

VTKM_CONT void vtkm::cont::PartitionedDataSet::ReplacePartition ( vtkm::Id  index,
const vtkm::cont::DataSet ds 
)

Replace the index positioned element of the contained DataSet vector with ds.

Member Data Documentation

◆ Fields

vtkm::cont::internal::FieldCollection vtkm::cont::PartitionedDataSet::Fields
private

◆ Partitions

std::vector<vtkm::cont::DataSet> vtkm::cont::PartitionedDataSet::Partitions
private

The documentation for this class was generated from the following file:
vtkm::cont::Field::Association::Global
@ Global
vtkm::cont::Field::Association::Partitions
@ Partitions