Go to the documentation of this file.
10 #ifndef vtk_m_cont_DataSet_h
11 #define vtk_m_cont_DataSet_h
13 #include <vtkm/cont/vtkm_cont_export.h>
85 return this->Fields.HasField(name, assoc);
95 bool HasGhostCellField()
const;
98 const std::string& GetGhostCellFieldName()
const;
117 const std::string& name,
120 return this->Fields.GetFieldIndex(name, assoc);
130 const std::string& name,
133 return this->Fields.GetField(name, assoc);
139 const std::string& name,
142 return this->Fields.GetField(name, assoc);
204 template <
typename T,
typename Storage>
211 template <
typename T>
218 template <
typename T>
239 template <
typename T,
typename Storage>
246 template <
typename T>
253 template <
typename T>
264 VTKM_CONT void SetGhostCellFieldName(
const std::string& name);
269 VTKM_CONT void SetGhostCellField(
const std::string& name);
282 VTKM_CONT void SetGhostCellField(
const std::string& fieldName,
301 this->SetGhostCellField(fieldName, field);
308 this->SetGhostCellField(field);
313 void AddGhostCellField(const
vtkm::cont::
Field& field) { this->SetGhostCellField(field); }
335 return this->GetCoordinateSystemIndex(name) >= 0;
354 template <
typename CellSetType>
358 this->SetCellSetImpl(cellSet);
398 void PrintSummary(std::ostream& out)
const;
423 template <
typename FieldTypeList = VTKM_DEFAULT_TYPE_LIST,
424 typename CellSetTypesList = VTKM_DEFAULT_CELL_SET_LIST>
425 struct SerializableDataSet
427 SerializableDataSet() =
default;
442 template <
typename FieldTypeList,
typename CellSetTypesList>
443 struct Serialization<
vtkm::cont::SerializableDataSet<FieldTypeList, CellSetTypesList>>
446 using Type = vtkm::cont::SerializableDataSet<FieldTypeList, CellSetTypesList>;
449 static VTKM_CONT void save(BinaryBuffer& bb,
const Type& serializable)
451 const auto& dataset = serializable.DataSet;
453 vtkmdiy::save(bb, dataset.GetCellSet().ResetCellSetList(CellSetTypesList{}));
456 vtkmdiy::save(bb, numberOfFields);
459 vtkmdiy::save(bb, dataset.GetField(i));
462 vtkm::IdComponent numberOfCoordinateSystems = dataset.GetNumberOfCoordinateSystems();
463 vtkmdiy::save(bb, numberOfCoordinateSystems);
466 vtkmdiy::save(bb, dataset.GetCoordinateSystemName(i));
470 static VTKM_CONT void load(BinaryBuffer& bb, Type& serializable)
472 auto& dataset = serializable.DataSet;
477 dataset.SetCellSet(cells);
485 dataset.AddField(field);
492 std::string coordName;
494 dataset.AddCoordinateSystem(coordName);
502 #endif //vtk_m_cont_DataSet_h
VTKM_CONT_EXPORT const VTKM_CONT std::string & GetGlobalGhostCellFieldName() noexcept
VTKM_CONT vtkm::cont::UnknownCellSet & GetCellSet()
Definition: DataSet.h:365
Manages an array-worth of data.
Definition: ArrayHandle.h:283
VTKM_CONT bool HasPointField(const std::string &name) const
Definition: DataSet.h:101
VTKM_CONT 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:247
Groups connected points that have the same field value.
Definition: Atomic.h:19
VTKM_CONT 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:205
VTKM_CONT_EXPORT VTKM_CONT void SetGlobalGhostCellFieldName(const std::string &name) noexcept
#define VTKM_IS_KNOWN_OR_UNKNOWN_CELL_SET(T)
Definition: UnknownCellSet.h:313
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
VTKM_CONT 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:116
Association
Definition: cont/Field.h:34
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: cont/Field.h:180
An ArrayHandle of an unknown value type and storage.
Definition: UnknownArrayHandle.h:406
A CellSet of an uncertain type.
Definition: UncertainCellSet.h:38
A CellSet of an unknown type.
Definition: UnknownCellSet.h:48
VTKM_CONT 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:234
Definition: Particle.h:331
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC T load(const U &u, vtkm::Id v)
Definition: FetchTagArrayDirectIn.h:36
Definition: CoordinateSystem.h:25
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: cont/Field.h:241
VTKM_CONT 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:219
VTKM_CONT bool HasCellField(const std::string &name) const
Definition: DataSet.h:89
vtkm::cont::UnknownCellSet CellSet
Definition: DataSet.h:406
A Field encapsulates an array on some piece of the mesh, such as the points, a cell set,...
Definition: cont/Field.h:31
VTKM_CONT vtkm::IdComponent GetNumberOfCoordinateSystems() const
Definition: DataSet.h:371
#define VTKM_CONT
Definition: ExportMacros.h:57
VTKM_CONT 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:254
VTKM_CONT_EXPORT VTKM_CONT std::string & GlobalGhostCellFieldName() noexcept
const VTKM_CONT vtkm::cont::Field & GetPointField(const std::string &name) const
Returns the first point field that matches the provided name.
Definition: DataSet.h:179
VTKM_CONT bool HasCoordinateSystem(const std::string &name) const
Definition: DataSet.h:333
VTKM_CONT 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:212
VTKM_CONT vtkm::cont::Field & GetField(vtkm::Id index)
Retrieves a field by index.
Definition: DataSet.h:78
std::shared_ptr< std::string > GhostCellName
Definition: DataSet.h:407
const VTKM_CONT vtkm::cont::Field & GetField(vtkm::Id index) const
Retrieves a field by index.
Definition: DataSet.h:75
VTKM_CONT vtkm::cont::Field & GetCellField(const std::string &name)
Returns the first cell field that matches the provided name.
Definition: DataSet.h:158
VTKM_CONT void SetCellSet(const CellSetType &cellSet)
Definition: DataSet.h:355
VTKM_CONT vtkm::IdComponent GetNumberOfFields() const
Definition: DataSet.h:368
VTKM_CONT 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:240
const VTKM_CONT 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:129
VTKM_CONT bool HasField(const std::string &name, vtkm::cont::Field::Association assoc=vtkm::cont::Field::Association::Any) const
Definition: DataSet.h:82
std::vector< std::string > CoordSystemNames
Definition: DataSet.h:401
VTKM_CONT 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:138
#define VTKM_DEPRECATED(...)
Definition: Deprecated.h:145
const VTKM_CONT vtkm::cont::UnknownCellSet & GetCellSet() const
Definition: DataSet.h:362
VTKM_CONT vtkm::cont::Field & GetPointField(const std::string &name)
Returns the first point field that matches the provided name.
Definition: DataSet.h:185
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: cont/Field.h:227
const VTKM_CONT vtkm::cont::Field & GetCellField(const std::string &name) const
Returns the first cell field that matches the provided name.
Definition: DataSet.h:152
VTKM_CONT 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:199