Go to the documentation of this file.
10 #ifndef vtk_m_cont_CellSetExplicit_h
11 #define vtk_m_cont_CellSetExplicit_h
26 #include <vtkm/cont/vtkm_cont_export.h>
36 template <
typename CellSetType,
typename VisitTopology,
typename Inc
identTopology>
37 struct CellSetExplicitConnectivityChooser
39 using ConnectivityType = vtkm::cont::internal::ConnectivityExplicitInternals<>;
45 using DefaultVisitPointsWithCellsConnectivityExplicit =
46 vtkm::cont::internal::ConnectivityExplicitInternals<
49 VTKM_CONT_EXPORT
void BuildReverseConnectivity(
53 vtkm::cont::detail::DefaultVisitPointsWithCellsConnectivityExplicit& visitPointsWithCells,
58 #ifndef VTKM_DEFAULT_SHAPES_STORAGE_TAG
59 #define VTKM_DEFAULT_SHAPES_STORAGE_TAG VTKM_DEFAULT_STORAGE_TAG
62 #ifndef VTKM_DEFAULT_CONNECTIVITY_STORAGE_TAG
63 #define VTKM_DEFAULT_CONNECTIVITY_STORAGE_TAG VTKM_DEFAULT_STORAGE_TAG
66 #ifndef VTKM_DEFAULT_OFFSETS_STORAGE_TAG
67 #define VTKM_DEFAULT_OFFSETS_STORAGE_TAG VTKM_DEFAULT_STORAGE_TAG
77 template <
typename VisitTopology,
typename Inc
identTopology>
81 using Chooser =
typename detail::
82 CellSetExplicitConnectivityChooser<Thisclass, VisitTopology, IncidentTopology>;
94 typename ConnectivityArrayType::ReadPortalType,
95 typename OffsetsArrayType::ReadPortalType>;
127 VTKM_CONT void PrintSummary(std::ostream& out)
const override;
129 VTKM_CONT void ReleaseResourcesExecution()
override;
131 VTKM_CONT std::shared_ptr<CellSet> NewInstance()
const override;
141 ShapesReadPortal()
const;
145 template <vtkm::IdComponent NumIndices>
153 template <
typename IdVecType>
167 template <
typename Device,
typename VisitTopology,
typename Inc
identTopology>
180 using ShapesAT =
typename Chooser::ShapesArrayType;
181 using ConnAT =
typename Chooser::ConnectivityArrayType;
182 using OffsetsAT =
typename Chooser::OffsetsArrayType;
185 using ShapesPortalType =
typename ShapesAT::ReadPortalType;
186 using ConnectivityPortalType =
typename ConnAT::ReadPortalType;
187 using OffsetsPortalType =
typename OffsetsAT::ReadPortalType;
189 using ExecObjectType =
193 template <
typename VisitTopology,
typename Inc
identTopology>
194 using ExecConnectivityType =
197 template <
typename VisitTopology,
typename Inc
identTopology>
204 template <
typename VisitTopology,
typename Inc
identTopology>
205 VTKM_DEPRECATED(1.6,
"Provide a vtkm::cont::Token object when calling PrepareForInput.")
208 VisitTopology visitTopology,
209 IncidentTopology incidentTopology)
const
212 return this->PrepareForInput(device, visitTopology, incidentTopology, token);
215 template <
typename VisitTopology,
typename Inc
identTopology>
216 VTKM_CONT const typename ConnectivityChooser<VisitTopology, IncidentTopology>::ShapesArrayType&
217 GetShapesArray(VisitTopology, IncidentTopology)
const;
219 template <
typename VisitTopology,
typename Inc
identTopology>
220 VTKM_CONT const typename ConnectivityChooser<VisitTopology,
221 IncidentTopology>::ConnectivityArrayType&
222 GetConnectivityArray(VisitTopology, IncidentTopology)
const;
224 template <
typename VisitTopology,
typename Inc
identTopology>
225 VTKM_CONT const typename ConnectivityChooser<VisitTopology, IncidentTopology>::OffsetsArrayType&
226 GetOffsetsArray(VisitTopology, IncidentTopology)
const;
228 template <
typename VisitTopology,
typename Inc
identTopology>
229 VTKM_CONT typename ConnectivityChooser<VisitTopology, IncidentTopology>::NumIndicesArrayType
230 GetNumIndicesArray(VisitTopology, IncidentTopology)
const;
232 template <
typename VisitTopology,
typename Inc
identTopology>
235 return this->HasConnectivityImpl(visit, incident);
239 template <
typename VisitTopology,
typename Inc
identTopology>
242 this->ResetConnectivityImpl(visit, incident);
250 VTKM_ASSERT(this->Data->CellPointIds.ElementsValid);
258 detail::BuildReverseConnectivity(this->Data->CellPointIds.Connectivity,
259 this->Data->CellPointIds.Offsets,
260 this->Data->NumberOfPoints,
261 this->Data->PointCellIds,
268 return this->Data->CellPointIds.ElementsValid;
274 return this->Data->PointCellIds.ElementsValid;
282 this->Data->ConnectivityAdded = -1;
283 this->Data->NumberOfCellsAdded = -1;
284 this->Data->NumberOfPoints = 0;
308 : ConnectivityAdded(-1)
309 , NumberOfCellsAdded(-1)
315 std::shared_ptr<Internals>
Data;
322 return this->Data->CellPointIds;
329 return this->Data->CellPointIds;
336 return this->Data->PointCellIds;
343 return this->Data->PointCellIds;
350 template <
typename Storage1,
typename Storage2,
typename Storage3>
355 using ConnectivityType =
356 vtkm::cont::internal::ConnectivityExplicitInternals<Storage1, Storage2, Storage3>;
359 template <
typename CellSetType>
360 struct CellSetExplicitConnectivityChooser<CellSetType,
361 vtkm::TopologyElementTagPoint,
366 using ConnectivityType = vtkm::cont::detail::DefaultVisitPointsWithCellsConnectivityExplicit;
373 #ifndef vtk_m_cont_CellSetExplicit_cxx
374 extern template class VTKM_CONT_TEMPLATE_EXPORT CellSetExplicit<>;
375 extern template class VTKM_CONT_TEMPLATE_EXPORT CellSetExplicit<
392 template <
typename SST,
typename CST,
typename OST>
393 struct SerializableTypeString<
vtkm::cont::CellSetExplicit<SST, CST, OST>>
397 static std::string name =
"CS_Explicit<" +
398 SerializableTypeString<vtkm::cont::ArrayHandle<vtkm::UInt8, SST>>
::Get() +
"_ST," +
399 SerializableTypeString<vtkm::cont::ArrayHandle<vtkm::Id, CST>>
::Get() +
"_ST," +
400 SerializableTypeString<vtkm::cont::ArrayHandle<vtkm::Id, OST>>
::Get() +
"_ST>";
411 template <
typename SST,
typename CST,
typename OST>
412 struct Serialization<
vtkm::cont::CellSetExplicit<SST, CST, OST>>
418 static VTKM_CONT void save(BinaryBuffer& bb,
const Type& cs)
420 vtkmdiy::save(bb, cs.GetNumberOfPoints());
441 cs.Fill(numberOfPoints, shapes, connectivity, offsets);
448 #ifndef vtk_m_cont_CellSetExplicit_hxx
449 #include <vtkm/cont/CellSetExplicit.hxx>
450 #endif //vtk_m_cont_CellSetExplicit_hxx
452 #endif //vtk_m_cont_CellSetExplicit_h
A tag used to identify the point elements in a topology.
Definition: TopologyElementTag.h:34
#define VTKM_DEFAULT_OFFSETS_STORAGE_TAG
Definition: CellSetExplicit.h:67
const VTKM_CONT PointCellIdsType & GetConnectivity(vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell)
Definition: CellSetExplicit.h:340
vtkm::Id NumberOfPoints
Definition: CellSetExplicit.h:304
struct VTKM_DEPRECATED(1.6, "Use vtkm::ColorSpace.") ColorSpace
Definition: cont/ColorTable.h:36
Definition: CellSetExplicit.h:78
typename CellPointIdsType::ShapesArrayType ShapesArrayType
Definition: CellSetExplicit.h:109
const VTKM_CONT PointCellIdsType & GetConnectivity(vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const
Definition: CellSetExplicit.h:333
VTKM_NO_DEPRECATED_VIRTUAL.
Definition: Algorithms.h:18
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
VTKM_CONT bool HasConnectivityImpl(vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const
Definition: CellSetExplicit.h:265
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC_CONT auto Get(const vtkm::Tuple< Ts... > &tuple) -> decltype(tuple.template Get< Index >())
Retrieve the object from a vtkm::Tuple at the given index.
Definition: Tuple.h:83
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
CellPointIdsType CellPointIds
Definition: CellSetExplicit.h:296
vtkm::Id SchedulingRangeType
Definition: CellSetExplicit.h:107
const VTKM_CONT CellPointIdsType & GetConnectivity(vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint)
Definition: CellSetExplicit.h:326
An ArrayHandle of an unknown value type and storage.
Definition: UnknownArrayHandle.h:397
typename CellPointIdsType::ConnectivityArrayType ConnectivityArrayType
Definition: CellSetExplicit.h:110
VTKM_CONT void BuildConnectivity(vtkm::cont::DeviceAdapterId device, vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const
Definition: CellSetExplicit.h:254
typename Chooser::ConnectivityType ConnectivityType
Definition: CellSetExplicit.h:85
typename ConnTypes::ConnectivityType CellPointIdsType
Definition: CellSetExplicit.h:103
VTKM_CONT Internals()
Definition: CellSetExplicit.h:307
#define VTKM_IS_TOPOLOGY_ELEMENT_TAG(type)
Definition: TopologyElementTag.h:92
typename StorageType::ReadPortalType ReadPortalType
Definition: ArrayHandle.h:298
VTKM_CONT void BuildConnectivity(vtkm::cont::DeviceAdapterId, vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const
Definition: CellSetExplicit.h:246
Definition: Particle.h:251
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
typename ConnectivityType::ShapesArrayType ShapesArrayType
Definition: CellSetExplicit.h:86
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC T load(const U &u, vtkm::Id v)
Definition: FetchTagArrayDirectIn.h:36
Definition: ArrayHandleConstant.h:20
VTKM_CONT void ResetConnectivityImpl(vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell)
Definition: CellSetExplicit.h:287
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:195
VTKM_CONT bool HasConnectivity(VisitTopology visit, IncidentTopology incident) const
Definition: CellSetExplicit.h:233
Definition: ArrayHandleCounting.h:23
typename ConnectivityType::ConnectivityArrayType ConnectivityArrayType
Definition: CellSetExplicit.h:87
typename ConnTypes::NumIndicesArrayType NumIndicesArrayType
Definition: CellSetExplicit.h:112
vtkm::Id NumberOfCellsAdded
Definition: CellSetExplicit.h:303
typename CellPointIdsType::OffsetsArrayType OffsetsArrayType
Definition: CellSetExplicit.h:111
VTKM_CONT void ResetConnectivity(VisitTopology visit, IncidentTopology incident)
Definition: CellSetExplicit.h:240
#define VTKM_CONT
Definition: ExportMacros.h:57
Definition: ConnectivityExplicit.h:24
std::shared_ptr< Internals > Data
Definition: CellSetExplicit.h:315
#define VTKM_DEFAULT_CONNECTIVITY_STORAGE_TAG
Definition: CellSetExplicit.h:63
uint8_t UInt8
Definition: Types.h:157
VTKM_CONT void ResetConnectivityImpl(vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint)
Definition: CellSetExplicit.h:277
Definition: DeviceAdapterTag.h:52
A short fixed-length array.
Definition: Types.h:767
PointCellIdsType PointCellIds
Definition: CellSetExplicit.h:297
vtkm::Id ConnectivityAdded
Definition: CellSetExplicit.h:302
typename ConnectivityType::OffsetsArrayType OffsetsArrayType
Definition: CellSetExplicit.h:88
Definition: CastAndCall.h:36
#define VTKM_DEFAULT_SHAPES_STORAGE_TAG
Definition: CellSetExplicit.h:59
typename RConnTypes::ConnectivityType PointCellIdsType
Definition: CellSetExplicit.h:104
An ArrayHandle that converts an array of offsets to an array of Vec sizes.
Definition: ArrayHandleOffsetsToNumComponents.h:127
vtkm::cont::StorageTagConstant StorageTag
Definition: ArrayHandle.h:295
A tag used to identify the cell elements in a topology.
Definition: TopologyElementTag.h:24
Definition: CellSetExplicit.h:294
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:92
typename detail::CellSetExplicitConnectivityChooser< Thisclass, VisitTopology, IncidentTopology > Chooser
Definition: CellSetExplicit.h:82
VTKM_CONT bool HasConnectivityImpl(vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const
Definition: CellSetExplicit.h:271
const VTKM_CONT CellPointIdsType & GetConnectivity(vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const
Definition: CellSetExplicit.h:319
#define VTKM_IS_DEVICE_ADAPTER_TAG(tag)
Checks that the argument is a proper device adapter tag.
Definition: DeviceAdapterTag.h:164