Go to the documentation of this file.
18 #ifndef viskores_cont_PartitionedDataSet_h
19 #define viskores_cont_PartitionedDataSet_h
39 using iterator =
typename StorageVec::iterator;
62 int partition_index)
const;
78 VISKORES_CONT const std::vector<viskores::cont::DataSet>& GetPartitions()
const;
96 VISKORES_CONT void AppendPartitions(
const std::vector<viskores::cont::DataSet>& partitions);
101 return this->Fields.GetNumberOfFields();
116 this->AddField({ name, association, data });
120 template <
typename T,
typename Storage>
127 template <
typename T>
134 template <
typename T>
144 template <
typename T,
typename Storage>
151 template <
typename T>
158 template <
typename T>
170 return this->Fields.GetField(index);
178 const std::string& name,
181 return this->Fields.GetField(name, assoc);
189 const std::string& name,
192 return this->Fields.GetField(name, assoc);
224 const std::string& name,
227 return this->Fields.HasField(name, assoc);
247 void PrintSummary(std::ostream& stream)
const;
const_iterator cbegin() const noexcept
Definition: PartitionedDataSet.h:263
void AddPartitionsField(const std::string &fieldName, const T *field, const viskores::Id &n)
Definition: PartitionedDataSet.h:159
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
const_iterator end() const noexcept
Definition: PartitionedDataSet.h:261
iterator end() noexcept
Definition: PartitionedDataSet.h:257
Association
Identifies what elements of a data set a field is associated with.
Definition: Field.h:46
void AddGlobalField(const std::string &fieldName, const viskores::cont::ArrayHandle< T, Storage > &field)
Add a field with a global association.
Definition: PartitionedDataSet.h:121
@ Any
Any field regardless of the association.
const viskores::cont::Field & GetField(const std::string &name, viskores::cont::Field::Association assoc=viskores::cont::Field::Association::Any) const
Definition: PartitionedDataSet.h:177
void AddGlobalField(const std::string &fieldName, const T *field, const viskores::Id &n)
Definition: PartitionedDataSet.h:135
const viskores::cont::Field & GetGlobalField(const std::string &name) const
Get a global field.
Definition: PartitionedDataSet.h:197
Manages an array-worth of data.
Definition: ArrayHandle.h:313
typename StorageVec::const_iterator const_iterator
Definition: PartitionedDataSet.h:40
@ Global
A field that applies to all partitions.
std::vector< viskores::cont::DataSet > Partitions
Definition: PartitionedDataSet.h:269
viskores::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:202
bool HasGlobalField(const std::string &name) const
Query whether the partitioned data set has the named global field.
Definition: PartitionedDataSet.h:231
const viskores::cont::Field & GetField(viskores::Id index) const
Definition: PartitionedDataSet.h:168
viskores::cont::Field & GetPartitionsField(const std::string &name)
Definition: PartitionedDataSet.h:216
@ Partitions
A field that applies to partitions.
void AddPartitionsField(const std::string &fieldName, const viskores::cont::ArrayHandle< T, Storage > &field)
Add a field where each entry is associated with a whole partition.
Definition: PartitionedDataSet.h:145
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores::cont::Field & GetField(viskores::Id index)
Definition: PartitionedDataSet.h:174
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::cont::Field make_Field(std::string name, Field::Association association, const T *data, viskores::Id size, viskores::CopyFlag copy)
Convenience functions to build fields from C style arrays and std::vector.
Definition: Field.h:266
const_iterator begin() const noexcept
Definition: PartitionedDataSet.h:259
Comprises a set of viskores::cont::DataSet objects.
Definition: PartitionedDataSet.h:34
viskores::cont::Field & GetField(const std::string &name, viskores::cont::Field::Association assoc=viskores::cont::Field::Association::Any)
Get a field associated with the partitioned data structure.
Definition: PartitionedDataSet.h:188
void AddField(const std::string &name, viskores::cont::Field::Association association, const viskores::cont::UnknownArrayHandle &data)
Adds a field that is applied to the meta-partition structure.
Definition: PartitionedDataSet.h:112
viskores::cont::Field & GetGlobalField(const std::string &name)
Definition: PartitionedDataSet.h:210
iterator begin() noexcept
Definition: PartitionedDataSet.h:255
bool HasPartitionsField(const std::string &name) const
Query whether the partitioned data set has the named partition field.
Definition: PartitionedDataSet.h:237
viskores::IdComponent GetNumberOfFields() const
Methods to Add and Get fields on a PartitionedDataSet.
Definition: PartitionedDataSet.h:99
void AddPartitionsField(const std::string &fieldName, const std::vector< T > &field)
Definition: PartitionedDataSet.h:152
std::vector< viskores::cont::DataSet > StorageVec
Definition: PartitionedDataSet.h:36
typename StorageVec::const_reference const_reference
Definition: PartitionedDataSet.h:43
const_iterator cend() const noexcept
Definition: PartitionedDataSet.h:265
void AddField(const Field &field)
Adds a field that is applied to the meta-partition structure.
Definition: PartitionedDataSet.h:107
typename StorageVec::value_type value_type
Definition: PartitionedDataSet.h:41
typename StorageVec::reference reference
Definition: PartitionedDataSet.h:42
An ArrayHandle of an unknown value type and storage.
Definition: UnknownArrayHandle.h:451
bool HasField(const std::string &name, viskores::cont::Field::Association assoc=viskores::cont::Field::Association::Any) const
Query whether the partitioned data set has the named field.
Definition: PartitionedDataSet.h:223
typename StorageVec::iterator iterator
Definition: PartitionedDataSet.h:39
void AddGlobalField(const std::string &fieldName, const std::vector< T > &field)
Definition: PartitionedDataSet.h:128
A Field encapsulates an array on some piece of the mesh, such as the points, a cell set,...
Definition: Field.h:39
const viskores::cont::Field & GetPartitionsField(const std::string &name) const
Get a field associated with the partitions.
Definition: PartitionedDataSet.h:204