Go to the documentation of this file.
10 #ifndef vtk_m_cont_CellSetExplicit_h
11 #define vtk_m_cont_CellSetExplicit_h
35 template <
typename CellSetType,
typename VisitTopology,
typename Inc
identTopology>
36 struct CellSetExplicitConnectivityChooser
38 using ConnectivityType = vtkm::cont::internal::ConnectivityExplicitInternals<>;
44 using DefaultVisitPointsWithCellsConnectivityExplicit =
45 vtkm::cont::internal::ConnectivityExplicitInternals<
52 vtkm::cont::detail::DefaultVisitPointsWithCellsConnectivityExplicit& visitPointsWithCells,
57 #ifndef VTKM_DEFAULT_SHAPES_STORAGE_TAG
58 #define VTKM_DEFAULT_SHAPES_STORAGE_TAG VTKM_DEFAULT_STORAGE_TAG
61 #ifndef VTKM_DEFAULT_CONNECTIVITY_STORAGE_TAG
62 #define VTKM_DEFAULT_CONNECTIVITY_STORAGE_TAG VTKM_DEFAULT_STORAGE_TAG
65 #ifndef VTKM_DEFAULT_OFFSETS_STORAGE_TAG
66 #define VTKM_DEFAULT_OFFSETS_STORAGE_TAG VTKM_DEFAULT_STORAGE_TAG
80 template <
typename VisitTopology,
typename Inc
identTopology>
84 using Chooser =
typename detail::
85 CellSetExplicitConnectivityChooser<Thisclass, VisitTopology, IncidentTopology>;
97 typename ConnectivityArrayType::ReadPortalType,
98 typename OffsetsArrayType::ReadPortalType>;
130 VTKM_CONT void PrintSummary(std::ostream& out)
const override;
132 VTKM_CONT void ReleaseResourcesExecution()
override;
134 VTKM_CONT std::shared_ptr<CellSet> NewInstance()
const override;
147 ShapesReadPortal()
const;
153 template <vtkm::IdComponent NumIndices>
168 template <
typename IdVecType>
184 template <
typename VisitTopology,
typename Inc
identTopology>
202 template <
typename VisitTopology,
typename Inc
identTopology>
205 VisitTopology visitTopology,
206 IncidentTopology incidentTopology,
215 template <
typename VisitTopology,
typename Inc
identTopology>
217 GetShapesArray(VisitTopology, IncidentTopology)
const;
226 template <
typename VisitTopology,
typename Inc
identTopology>
229 GetConnectivityArray(VisitTopology, IncidentTopology)
const;
238 template <
typename VisitTopology,
typename Inc
identTopology>
240 GetOffsetsArray(VisitTopology, IncidentTopology)
const;
242 template <
typename VisitTopology,
typename Inc
identTopology>
244 GetNumIndicesArray(VisitTopology, IncidentTopology)
const;
249 template <
typename VisitTopology,
typename Inc
identTopology>
252 return this->HasConnectivityImpl(visit, incident);
256 template <
typename VisitTopology,
typename Inc
identTopology>
259 this->ResetConnectivityImpl(visit, incident);
267 VTKM_ASSERT(this->Data->CellPointIds.ElementsValid);
275 detail::BuildReverseConnectivity(this->Data->CellPointIds.Connectivity,
276 this->Data->CellPointIds.Offsets,
277 this->Data->NumberOfPoints,
278 this->Data->PointCellIds,
285 return this->Data->CellPointIds.ElementsValid;
291 return this->Data->PointCellIds.ElementsValid;
299 this->Data->ConnectivityAdded = -1;
300 this->Data->NumberOfCellsAdded = -1;
301 this->Data->NumberOfPoints = 0;
325 : ConnectivityAdded(-1)
326 , NumberOfCellsAdded(-1)
332 std::shared_ptr<Internals>
Data;
339 return this->Data->CellPointIds;
346 return this->Data->CellPointIds;
353 return this->Data->PointCellIds;
360 return this->Data->PointCellIds;
367 template <
typename Storage1,
typename Storage2,
typename Storage3>
372 using ConnectivityType =
373 vtkm::cont::internal::ConnectivityExplicitInternals<Storage1, Storage2, Storage3>;
376 template <
typename CellSetType>
377 struct CellSetExplicitConnectivityChooser<CellSetType,
378 vtkm::TopologyElementTagPoint,
383 using ConnectivityType = vtkm::cont::detail::DefaultVisitPointsWithCellsConnectivityExplicit;
390 #ifndef vtk_m_cont_CellSetExplicit_cxx
409 template <
typename SST,
typename CST,
typename OST>
410 struct SerializableTypeString<
vtkm::cont::CellSetExplicit<SST, CST, OST>>
414 static std::string name =
"CS_Explicit<" +
415 SerializableTypeString<vtkm::cont::ArrayHandle<vtkm::UInt8, SST>>
::Get() +
"_ST," +
416 SerializableTypeString<vtkm::cont::ArrayHandle<vtkm::Id, CST>>
::Get() +
"_ST," +
417 SerializableTypeString<vtkm::cont::ArrayHandle<vtkm::Id, OST>>
::Get() +
"_ST>";
428 template <
typename SST,
typename CST,
typename OST>
429 struct Serialization<
vtkm::cont::CellSetExplicit<SST, CST, OST>>
435 static VTKM_CONT void save(BinaryBuffer& bb,
const Type& cs)
437 vtkmdiy::save(bb, cs.GetNumberOfPoints());
458 cs.Fill(numberOfPoints, shapes, connectivity, offsets);
465 #ifndef vtk_m_cont_CellSetExplicit_hxx
466 #include <vtkm/cont/CellSetExplicit.hxx>
467 #endif //vtk_m_cont_CellSetExplicit_hxx
469 #endif //vtk_m_cont_CellSetExplicit_h
const PointCellIdsType & GetConnectivity(vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const
Definition: CellSetExplicit.h:350
const CellPointIdsType & GetConnectivity(vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const
Definition: CellSetExplicit.h:336
A tag used to identify the point elements in a topology.
Definition: TopologyElementTag.h:34
#define VTKM_DEFAULT_OFFSETS_STORAGE_TAG
Definition: CellSetExplicit.h:66
vtkm::Id NumberOfPoints
Definition: CellSetExplicit.h:321
Definition: CellSetExplicit.h:81
typename CellPointIdsType::ShapesArrayType ShapesArrayType
Definition: CellSetExplicit.h:112
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
auto Get(const vtkm::Tuple< Ts... > &tuple)
Retrieve the object from a vtkm::Tuple at the given index.
Definition: Tuple.h:81
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
CellPointIdsType CellPointIds
Definition: CellSetExplicit.h:313
vtkm::Id SchedulingRangeType
Definition: CellSetExplicit.h:110
An ArrayHandle of an unknown value type and storage.
Definition: UnknownArrayHandle.h:430
typename CellPointIdsType::ConnectivityArrayType ConnectivityArrayType
Definition: CellSetExplicit.h:113
const CellPointIdsType & GetConnectivity(vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint)
Definition: CellSetExplicit.h:343
typename Superclass::StorageTag StorageTag
Definition: ArrayHandleConstant.h:75
void ResetConnectivity(VisitTopology visit, IncidentTopology incident)
Definition: CellSetExplicit.h:257
void BuildConnectivity(vtkm::cont::DeviceAdapterId, vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const
Definition: CellSetExplicit.h:263
typename Chooser::ConnectivityType ConnectivityType
Definition: CellSetExplicit.h:88
typename ConnTypes::ConnectivityType CellPointIdsType
Definition: CellSetExplicit.h:106
const PointCellIdsType & GetConnectivity(vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell)
Definition: CellSetExplicit.h:357
typename StorageType::ReadPortalType ReadPortalType
The type of portal used when accessing data in a read-only mode.
Definition: ArrayHandle.h:312
Definition: Particle.h:351
typename ConnectivityType::ShapesArrayType ShapesArrayType
Definition: CellSetExplicit.h:89
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
typename ConnectivityChooser< VisitTopology, IncidentTopology >::ExecConnectivityType ExecConnectivityType
Definition: CellSetExplicit.h:186
typename ConnectivityType::ConnectivityArrayType ConnectivityArrayType
Definition: CellSetExplicit.h:90
bool HasConnectivityImpl(vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const
Definition: CellSetExplicit.h:288
typename ConnTypes::NumIndicesArrayType NumIndicesArrayType
Definition: CellSetExplicit.h:115
vtkm::Id NumberOfCellsAdded
Definition: CellSetExplicit.h:320
void BuildConnectivity(vtkm::cont::DeviceAdapterId device, vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const
Definition: CellSetExplicit.h:271
typename CellPointIdsType::OffsetsArrayType OffsetsArrayType
Definition: CellSetExplicit.h:114
#define VTKM_CONT_EXPORT
Definition: vtkm_cont_export.h:44
#define VTKM_CONT
Definition: ExportMacros.h:57
A class holding information about topology connections.
Definition: ConnectivityExplicit.h:29
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
std::shared_ptr< Internals > Data
Definition: CellSetExplicit.h:332
#define VTKM_DEFAULT_CONNECTIVITY_STORAGE_TAG
Definition: CellSetExplicit.h:62
uint8_t UInt8
Base type to use for 8-bit unsigned integer numbers.
Definition: Types.h:169
void ResetConnectivityImpl(vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell)
Definition: CellSetExplicit.h:304
bool HasConnectivity(VisitTopology visit, IncidentTopology incident) const
Returns whether the CellSetExplicit has information for the given visit and incident topology element...
Definition: CellSetExplicit.h:250
An object used to specify a device.
Definition: DeviceAdapterTag.h:58
#define VTKM_CONT_TEMPLATE_EXPORT
Definition: vtkm_cont_export.h:62
A short fixed-length array.
Definition: Types.h:357
PointCellIdsType PointCellIds
Definition: CellSetExplicit.h:314
Internals()
Definition: CellSetExplicit.h:324
vtkm::Id ConnectivityAdded
Definition: CellSetExplicit.h:319
typename ConnectivityType::OffsetsArrayType OffsetsArrayType
Definition: CellSetExplicit.h:91
Defines an irregular collection of cells.
Definition: CastAndCall.h:36
#define VTKM_DEFAULT_SHAPES_STORAGE_TAG
Definition: CellSetExplicit.h:58
typename RConnTypes::ConnectivityType PointCellIdsType
Definition: CellSetExplicit.h:107
An ArrayHandle that converts an array of offsets to an array of Vec sizes.
Definition: ArrayHandleOffsetsToNumComponents.h:135
bool HasConnectivityImpl(vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const
Definition: CellSetExplicit.h:282
A tag used to identify the cell elements in a topology.
Definition: TopologyElementTag.h:24
Definition: CellSetExplicit.h:311
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:89
void ResetConnectivityImpl(vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint)
Definition: CellSetExplicit.h:294
typename detail::CellSetExplicitConnectivityChooser< Thisclass, VisitTopology, IncidentTopology > Chooser
Definition: CellSetExplicit.h:85
typename Superclass::StorageTag StorageTag
Definition: ArrayHandleCounting.h:136