Go to the documentation of this file.
10 #ifndef vtk_m_cont_PartitionedDataSet_h
11 #define vtk_m_cont_PartitionedDataSet_h
31 using iterator =
typename StorageVec::iterator;
53 vtkm::cont::Field GetFieldFromPartition(
const std::string& field_name,
int partition_index)
const;
57 vtkm::Id GetNumberOfPartitions()
const;
62 vtkm::Id GetGlobalNumberOfPartitions()
const;
69 VTKM_CONT const std::vector<vtkm::cont::DataSet>& GetPartitions()
const;
87 VTKM_CONT void AppendPartitions(
const std::vector<vtkm::cont::DataSet>& partitions);
104 this->AddField({ name, association, data });
108 template <
typename T,
typename Storage>
115 template <
typename T>
122 template <
typename T>
130 template <
typename T,
typename Storage>
137 template <
typename T>
144 template <
typename T>
159 const std::string& name,
162 return this->Fields.GetField(name, assoc);
170 const std::string& name,
173 return this->Fields.GetField(name, assoc);
207 return this->Fields.HasField(name, assoc);
227 void PrintSummary(std::ostream& stream)
const;
const_iterator cbegin() const noexcept
Definition: PartitionedDataSet.h:243
Manages an array-worth of data.
Definition: ArrayHandle.h:300
vtkm::cont::Field & GetGlobalField(const std::string &name)
Definition: PartitionedDataSet.h:191
Groups connected points that have the same field value.
Definition: Atomic.h:19
iterator begin() noexcept
Definition: PartitionedDataSet.h:235
vtkm::IdComponent GetNumberOfFields() const
Methods to Add and Get fields on a PartitionedDataSet.
Definition: PartitionedDataSet.h:90
void AddGlobalField(const std::string &fieldName, const std::vector< T > &field)
Definition: PartitionedDataSet.h:116
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
@ Global
A field that applies to all partitions.
Association
Identifies what elements of a data set a field is associated with.
Definition: Field.h:38
vtkm::cont::Field make_Field(std::string name, Field::Association association, const T *data, vtkm::Id size, vtkm::CopyFlag copy)
Convenience functions to build fields from C style arrays and std::vector.
Definition: Field.h:257
An ArrayHandle of an unknown value type and storage.
Definition: UnknownArrayHandle.h:430
Contains and manages the geometric data structures that VTK-m operates on.
Definition: DataSet.h:57
const_iterator cend() const noexcept
Definition: PartitionedDataSet.h:245
void AddGlobalField(const std::string &fieldName, const vtkm::cont::ArrayHandle< T, Storage > &field)
Add a field with a global association.
Definition: PartitionedDataSet.h:109
const vtkm::cont::Field & GetGlobalField(const std::string &name) const
Get a global field.
Definition: PartitionedDataSet.h:178
vtkm::cont::Field & GetField(vtkm::Id index)
Definition: PartitionedDataSet.h:155
const vtkm::cont::Field & GetField(const std::string &name, vtkm::cont::Field::Association assoc=vtkm::cont::Field::Association::Any) const
Definition: PartitionedDataSet.h:158
void AddField(const Field &field)
Adds a field that is applied to the meta-partition structure.
Definition: PartitionedDataSet.h:95
void AddPartitionsField(const std::string &fieldName, const vtkm::cont::ArrayHandle< T, Storage > &field)
Add a field where each entry is associated with a whole partition.
Definition: PartitionedDataSet.h:131
A Field encapsulates an array on some piece of the mesh, such as the points, a cell set,...
Definition: Field.h:31
#define VTKM_CONT_EXPORT
Definition: vtkm_cont_export.h:44
bool HasGlobalField(const std::string &name) const
Query whether the partitioned data set has the named global field.
Definition: PartitionedDataSet.h:211
@ Any
Any field regardless of the association.
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
void AddField(const std::string &name, vtkm::cont::Field::Association association, const vtkm::cont::UnknownArrayHandle &data)
Adds a field that is applied to the meta-partition structure.
Definition: PartitionedDataSet.h:100
void AddPartitionsField(const std::string &fieldName, const std::vector< T > &field)
Definition: PartitionedDataSet.h:138
bool HasPartitionsField(const std::string &name) const
Query whether the partitioned data set has the named partition field.
Definition: PartitionedDataSet.h:217
vtkm::cont::Field & GetField(const std::string &name, vtkm::cont::Field::Association assoc=vtkm::cont::Field::Association::Any)
Get a field associated with the partitioned data structure.
Definition: PartitionedDataSet.h:169
vtkm::cont::Field & GetPartitionsField(const std::string &name)
Definition: PartitionedDataSet.h:197
const_iterator begin() const noexcept
Definition: PartitionedDataSet.h:239
bool HasField(const std::string &name, vtkm::cont::Field::Association assoc=vtkm::cont::Field::Association::Any) const
Query whether the partitioned data set has the named field.
Definition: PartitionedDataSet.h:204
std::vector< vtkm::cont::DataSet > Partitions
Definition: PartitionedDataSet.h:249
void AddPartitionsField(const std::string &fieldName, const T *field, const vtkm::Id &n)
Definition: PartitionedDataSet.h:145
@ Partitions
A field that applies to partitions.
iterator end() noexcept
Definition: PartitionedDataSet.h:237
typename StorageVec::iterator iterator
Definition: PartitionedDataSet.h:31
typename StorageVec::value_type value_type
Definition: PartitionedDataSet.h:33
const_iterator end() const noexcept
Definition: PartitionedDataSet.h:241
typename StorageVec::const_reference const_reference
Definition: PartitionedDataSet.h:35
const vtkm::cont::Field & GetPartitionsField(const std::string &name) const
Get a field associated with the partitions.
Definition: PartitionedDataSet.h:185
typename StorageVec::const_iterator const_iterator
Definition: PartitionedDataSet.h:32
std::vector< vtkm::cont::DataSet > StorageVec
Definition: PartitionedDataSet.h:28
const vtkm::cont::Field & GetField(vtkm::Id index) const
Definition: PartitionedDataSet.h:152
Comprises a set of vtkm::cont::DataSet objects.
Definition: PartitionedDataSet.h:26
typename StorageVec::reference reference
Definition: PartitionedDataSet.h:34
void AddGlobalField(const std::string &fieldName, const T *field, const vtkm::Id &n)
Definition: PartitionedDataSet.h:123