Go to the documentation of this file.
10 #ifndef vtk_m_cont_DataSet_h
11 #define vtk_m_cont_DataSet_h
108 return this->Fields.HasField(name, assoc);
118 bool HasGhostCellField()
const;
121 const std::string& GetGhostCellFieldName()
const;
140 const std::string& name,
143 return this->Fields.GetFieldIndex(name, assoc);
153 const std::string& name,
156 return this->Fields.GetField(name, assoc);
162 const std::string& name,
165 return this->Fields.GetField(name, assoc);
227 template <
typename T,
typename Storage>
234 template <
typename T>
241 template <
typename T>
262 template <
typename T,
typename Storage>
269 template <
typename T>
276 template <
typename T>
287 VTKM_CONT void SetGhostCellFieldName(
const std::string& name);
292 VTKM_CONT void SetGhostCellField(
const std::string& name);
305 VTKM_CONT void SetGhostCellField(
const std::string& fieldName,
324 this->SetGhostCellField(fieldName, field);
331 this->SetGhostCellField(field);
336 void AddGhostCellField(const
vtkm::cont::
Field& field) { this->SetGhostCellField(field); }
358 return this->GetCoordinateSystemIndex(name) >= 0;
377 template <
typename CellSetType>
381 this->SetCellSetImpl(cellSet);
421 void PrintSummary(std::ostream& out)
const;
454 template <
typename... CellSetTypes>
455 struct DataSetWithCellSetTypes
459 DataSetWithCellSetTypes() =
default;
467 template <
typename... CellSetTypes>
468 struct DataSetWithCellSetTypes<
vtkm::List<CellSetTypes...>>
469 : DataSetWithCellSetTypes<CellSetTypes...>
471 using DataSetWithCellSetTypes<CellSetTypes...>::DataSetWithCellSetTypes;
478 "Serialize DataSet directly or use DataSetWithCellSetTypes for weird CellSets.")
479 SerializableDataSet : DataSetWithCellSetTypes<CellSetTypesList>
481 using DataSetWithCellSetTypes<CellSetTypesList>::DataSetWithCellSetTypes;
498 template <
typename... CellSetTypes>
499 struct Serialization<
vtkm::cont::DataSetWithCellSetTypes<CellSetTypes...>>
502 using Type = vtkm::cont::DataSetWithCellSetTypes<CellSetTypes...>;
505 static VTKM_CONT void save(BinaryBuffer& bb,
const Type& serializable)
507 const auto& dataset = serializable.DataSet;
512 vtkmdiy::save(bb, numberOfFields);
515 vtkmdiy::save(bb, dataset.GetField(i));
518 vtkm::IdComponent numberOfCoordinateSystems = dataset.GetNumberOfCoordinateSystems();
519 vtkmdiy::save(bb, numberOfCoordinateSystems);
522 vtkmdiy::save(bb, dataset.GetCoordinateSystemName(i));
526 static VTKM_CONT void load(BinaryBuffer& bb, Type& serializable)
528 auto& dataset = serializable.DataSet;
533 dataset.SetCellSet(cells);
541 dataset.AddField(field);
548 std::string coordName;
550 dataset.AddCoordinateSystem(coordName);
555 template <
typename... CellSetTypes>
556 struct Serialization<
vtkm::cont::DataSetWithCellSetTypes<vtkm::List<CellSetTypes...>>>
557 : Serialization<vtkm::cont::DataSetWithCellSetTypes<CellSetTypes...>>
562 template <
typename FieldTypeList,
typename CellSetTypesList>
563 struct Serialization<
vtkm::cont::SerializableDataSet<FieldTypeList, CellSetTypesList>>
564 : Serialization<vtkm::cont::DataSetWithCellSetTypes<CellSetTypesList>>
572 #endif //vtk_m_cont_DataSet_h
const vtkm::cont::UnknownCellSet & GetCellSet() const
Definition: DataSet.h:385
Manages an array-worth of data.
Definition: ArrayHandle.h:300
vtkm::Id GetFieldIndex(const std::string &name, vtkm::cont::Field::Association assoc=vtkm::cont::Field::Association::Any) const
Returns the field that matches the provided name and association.
Definition: DataSet.h:139
T load(const U &u, vtkm::Id v)
Definition: FetchTagArrayDirectIn.h:36
Groups connected points that have the same field value.
Definition: Atomic.h:19
#define VTKM_IS_KNOWN_OR_UNKNOWN_CELL_SET(T)
Definition: UnknownCellSet.h:313
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
bool HasPointField(const std::string &name) const
Definition: DataSet.h:124
vtkm::cont::Field & GetPointField(const std::string &name)
Returns the first point field that matches the provided name.
Definition: DataSet.h:208
const vtkm::cont::Field & GetField(vtkm::Id index) const
Retrieves a field by index.
Definition: DataSet.h:98
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:236
void SetCellSet(const CellSetType &cellSet)
Definition: DataSet.h:378
An ArrayHandle of an unknown value type and storage.
Definition: UnknownArrayHandle.h:430
A CellSet of an uncertain type.
Definition: UncertainCellSet.h:38
Contains and manages the geometric data structures that VTK-m operates on.
Definition: DataSet.h:57
@ WholeDataSet
A "global" field that applies to the entirety of a vtkm::cont::DataSet.
const vtkm::cont::Field & GetPointField(const std::string &name) const
Returns the first point field that matches the provided name.
Definition: DataSet.h:202
A CellSet of an unknown type.
Definition: UnknownCellSet.h:48
vtkm::cont::Field & GetCellField(const std::string &name)
Returns the first cell field that matches the provided name.
Definition: DataSet.h:181
bool HasCellField(const std::string &name) const
Definition: DataSet.h:112
vtkm::IdComponent GetNumberOfCoordinateSystems() const
Definition: DataSet.h:394
Definition: Particle.h:351
void SetGlobalGhostCellFieldName(const std::string &name) noexcept
#define VTKM_DEPRECATED_SUPPRESS_END
Definition: Deprecated.h:123
Manages a coordinate system for a DataSet.
Definition: CoordinateSystem.h:30
void AddCellField(const std::string &fieldName, const vtkm::cont::ArrayHandle< T, Storage > &field)
Adds a cell field of a given name to the DataSet.
Definition: DataSet.h:263
void AddPointField(const std::string &fieldName, const std::vector< T > &field)
Adds a point field of a given name to the DataSet.
Definition: DataSet.h:235
vtkm::cont::Field make_FieldCell(std::string name, const vtkm::cont::ArrayHandle< T, S > &data)
Convenience function to build cell fields from vtkm::cont::ArrayHandle.
Definition: Field.h:297
void AddCellField(const std::string &fieldName, const std::vector< T > &field)
Adds a cell field of a given name to the DataSet.
Definition: DataSet.h:270
vtkm::cont::Field & GetField(const std::string &name, vtkm::cont::Field::Association assoc=vtkm::cont::Field::Association::Any)
Returns the field that matches the provided name and association.
Definition: DataSet.h:161
vtkm::cont::UnknownCellSet CellSet
Definition: DataSet.h:429
void AddPointField(const std::string &fieldName, const vtkm::cont::ArrayHandle< T, Storage > &field)
Adds a point field of a given name to the DataSet.
Definition: DataSet.h:228
#define VTKM_DEFAULT_CELL_SET_LIST
Definition: DefaultTypes.h:77
A Field encapsulates an array on some piece of the mesh, such as the points, a cell set,...
Definition: Field.h:31
void AddCellField(const std::string &fieldName, const T *field, const vtkm::Id &n)
Adds a cell field of a given name to the DataSet.
Definition: DataSet.h:277
#define VTKM_CONT_EXPORT
Definition: vtkm_cont_export.h:44
@ Any
Any field regardless of the association.
@ Points
A field that applies to points.
#define VTKM_CONT
Definition: ExportMacros.h:57
bool HasCoordinateSystem(const std::string &name) const
Definition: DataSet.h:356
bool HasField(const std::string &name, vtkm::cont::Field::Association assoc=vtkm::cont::Field::Association::Any) const
Definition: DataSet.h:105
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
Defines the topological structure of the data in a DataSet.
Definition: CellSet.h:28
const vtkm::cont::Field & GetField(const std::string &name, vtkm::cont::Field::Association assoc=vtkm::cont::Field::Association::Any) const
Returns the field that matches the provided name and association.
Definition: DataSet.h:152
#define VTKM_DEPRECATED_SUPPRESS_BEGIN
Definition: Deprecated.h:122
void AddCellField(const std::string &fieldName, const vtkm::cont::UnknownArrayHandle &field)
Adds a cell field of a given name to the DataSet.
Definition: DataSet.h:257
vtkm::cont::UnknownCellSet & GetCellSet()
Definition: DataSet.h:388
const std::string & GetGlobalGhostCellFieldName() noexcept
std::string & GlobalGhostCellFieldName() noexcept
#define VTKM_DEFAULT_TYPE_LIST
Definition: DefaultTypes.h:45
@ Cells
A field that applies to cells.
std::shared_ptr< std::string > GhostCellName
Definition: DataSet.h:430
A template used to hold a list of types.
Definition: List.h:39
void AddPointField(const std::string &fieldName, const vtkm::cont::UnknownArrayHandle &field)
Adds a point field of a given name to the DataSet.
Definition: DataSet.h:222
const vtkm::cont::Field & GetCellField(const std::string &name) const
Returns the first cell field that matches the provided name.
Definition: DataSet.h:175
std::vector< std::string > CoordSystemNames
Definition: DataSet.h:424
#define VTKM_DEPRECATED(...)
Definition: Deprecated.h:145
vtkm::cont::Field make_FieldPoint(std::string name, const vtkm::cont::ArrayHandle< T, S > &data)
Convenience function to build point fields from vtkm::cont::ArrayHandle.
Definition: Field.h:283
vtkm::cont::Field & GetField(vtkm::Id index)
Retrieves a field by index.
Definition: DataSet.h:101
vtkm::IdComponent GetNumberOfFields() const
Definition: DataSet.h:391
void AddPointField(const std::string &fieldName, const T *field, const vtkm::Id &n)
Adds a point field of a given name to the DataSet.
Definition: DataSet.h:242