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;
144 ShapesReadPortal()
const;
148 template <vtkm::IdComponent NumIndices>
162 template <
typename IdVecType>
178 template <
typename VisitTopology,
typename Inc
identTopology>
182 template <
typename VisitTopology,
typename Inc
identTopology>
189 template <
typename VisitTopology,
typename Inc
identTopology>
191 GetShapesArray(VisitTopology, IncidentTopology)
const;
193 template <
typename VisitTopology,
typename Inc
identTopology>
196 GetConnectivityArray(VisitTopology, IncidentTopology)
const;
198 template <
typename VisitTopology,
typename Inc
identTopology>
200 GetOffsetsArray(VisitTopology, IncidentTopology)
const;
202 template <
typename VisitTopology,
typename Inc
identTopology>
204 GetNumIndicesArray(VisitTopology, IncidentTopology)
const;
206 template <
typename VisitTopology,
typename Inc
identTopology>
209 return this->HasConnectivityImpl(visit, incident);
213 template <
typename VisitTopology,
typename Inc
identTopology>
216 this->ResetConnectivityImpl(visit, incident);
224 VTKM_ASSERT(this->Data->CellPointIds.ElementsValid);
232 detail::BuildReverseConnectivity(this->Data->CellPointIds.Connectivity,
233 this->Data->CellPointIds.Offsets,
234 this->Data->NumberOfPoints,
235 this->Data->PointCellIds,
242 return this->Data->CellPointIds.ElementsValid;
248 return this->Data->PointCellIds.ElementsValid;
256 this->Data->ConnectivityAdded = -1;
257 this->Data->NumberOfCellsAdded = -1;
258 this->Data->NumberOfPoints = 0;
282 : ConnectivityAdded(-1)
283 , NumberOfCellsAdded(-1)
289 std::shared_ptr<Internals>
Data;
296 return this->Data->CellPointIds;
303 return this->Data->CellPointIds;
310 return this->Data->PointCellIds;
317 return this->Data->PointCellIds;
324 template <
typename Storage1,
typename Storage2,
typename Storage3>
329 using ConnectivityType =
330 vtkm::cont::internal::ConnectivityExplicitInternals<Storage1, Storage2, Storage3>;
333 template <
typename CellSetType>
334 struct CellSetExplicitConnectivityChooser<CellSetType,
335 vtkm::TopologyElementTagPoint,
340 using ConnectivityType = vtkm::cont::detail::DefaultVisitPointsWithCellsConnectivityExplicit;
347 #ifndef vtk_m_cont_CellSetExplicit_cxx
366 template <
typename SST,
typename CST,
typename OST>
367 struct SerializableTypeString<
vtkm::cont::CellSetExplicit<SST, CST, OST>>
371 static std::string name =
"CS_Explicit<" +
372 SerializableTypeString<vtkm::cont::ArrayHandle<vtkm::UInt8, SST>>
::Get() +
"_ST," +
373 SerializableTypeString<vtkm::cont::ArrayHandle<vtkm::Id, CST>>
::Get() +
"_ST," +
374 SerializableTypeString<vtkm::cont::ArrayHandle<vtkm::Id, OST>>
::Get() +
"_ST>";
385 template <
typename SST,
typename CST,
typename OST>
386 struct Serialization<
vtkm::cont::CellSetExplicit<SST, CST, OST>>
392 static VTKM_CONT void save(BinaryBuffer& bb,
const Type& cs)
394 vtkmdiy::save(bb, cs.GetNumberOfPoints());
415 cs.Fill(numberOfPoints, shapes, connectivity, offsets);
422 #ifndef vtk_m_cont_CellSetExplicit_hxx
423 #include <vtkm/cont/CellSetExplicit.hxx>
424 #endif //vtk_m_cont_CellSetExplicit_hxx
426 #endif //vtk_m_cont_CellSetExplicit_h
const PointCellIdsType & GetConnectivity(vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const
Definition: CellSetExplicit.h:307
const CellPointIdsType & GetConnectivity(vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const
Definition: CellSetExplicit.h:293
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:278
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:270
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:300
typename Superclass::StorageTag StorageTag
Definition: ArrayHandleConstant.h:75
void ResetConnectivity(VisitTopology visit, IncidentTopology incident)
Definition: CellSetExplicit.h:214
void BuildConnectivity(vtkm::cont::DeviceAdapterId, vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const
Definition: CellSetExplicit.h:220
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:314
typename StorageType::ReadPortalType ReadPortalType
Definition: ArrayHandle.h:311
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:180
typename ConnectivityType::ConnectivityArrayType ConnectivityArrayType
Definition: CellSetExplicit.h:90
bool HasConnectivityImpl(vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const
Definition: CellSetExplicit.h:245
typename ConnTypes::NumIndicesArrayType NumIndicesArrayType
Definition: CellSetExplicit.h:115
vtkm::Id NumberOfCellsAdded
Definition: CellSetExplicit.h:277
void BuildConnectivity(vtkm::cont::DeviceAdapterId device, vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const
Definition: CellSetExplicit.h:228
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
Definition: ConnectivityExplicit.h:24
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:289
#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:261
bool HasConnectivity(VisitTopology visit, IncidentTopology incident) const
Definition: CellSetExplicit.h:207
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:271
Internals()
Definition: CellSetExplicit.h:281
vtkm::Id ConnectivityAdded
Definition: CellSetExplicit.h:276
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:239
A tag used to identify the cell elements in a topology.
Definition: TopologyElementTag.h:24
Definition: CellSetExplicit.h:268
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:89
void ResetConnectivityImpl(vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint)
Definition: CellSetExplicit.h:251
typename detail::CellSetExplicitConnectivityChooser< Thisclass, VisitTopology, IncidentTopology > Chooser
Definition: CellSetExplicit.h:85
typename Superclass::StorageTag StorageTag
Definition: ArrayHandleCounting.h:127