Go to the documentation of this file.
18 #ifndef viskores_cont_CellSetExplicit_h
19 #define viskores_cont_CellSetExplicit_h
43 template <
typename CellSetType,
typename VisitTopology,
typename Inc
identTopology>
44 struct CellSetExplicitConnectivityChooser
46 using ConnectivityType = viskores::cont::internal::ConnectivityExplicitInternals<>;
52 using DefaultVisitPointsWithCellsConnectivityExplicit =
53 viskores::cont::internal::ConnectivityExplicitInternals<
56 VISKORES_CONT_EXPORT
void BuildReverseConnectivity(
60 viskores::cont::detail::DefaultVisitPointsWithCellsConnectivityExplicit& visitPointsWithCells,
65 #ifndef VISKORES_DEFAULT_SHAPES_STORAGE_TAG
66 #define VISKORES_DEFAULT_SHAPES_STORAGE_TAG VISKORES_DEFAULT_STORAGE_TAG
69 #ifndef VISKORES_DEFAULT_CONNECTIVITY_STORAGE_TAG
70 #define VISKORES_DEFAULT_CONNECTIVITY_STORAGE_TAG VISKORES_DEFAULT_STORAGE_TAG
73 #ifndef VISKORES_DEFAULT_OFFSETS_STORAGE_TAG
74 #define VISKORES_DEFAULT_OFFSETS_STORAGE_TAG VISKORES_DEFAULT_STORAGE_TAG
84 class VISKORES_ALWAYS_EXPORT CellSetExplicit :
public CellSet
88 template <
typename VisitTopology,
typename Inc
identTopology>
92 using Chooser =
typename detail::
93 CellSetExplicitConnectivityChooser<Thisclass, VisitTopology, IncidentTopology>;
105 typename ConnectivityArrayType::ReadPortalType,
106 typename OffsetsArrayType::ReadPortalType>;
138 VISKORES_CONT void PrintSummary(std::ostream& out)
const override;
142 VISKORES_CONT std::shared_ptr<CellSet> NewInstance()
const override;
156 ShapesReadPortal()
const;
162 template <viskores::IdComponent NumIndices>
179 template <
typename IdVecType>
182 const IdVecType& ids);
197 template <
typename VisitTopology,
typename Inc
identTopology>
215 template <
typename VisitTopology,
typename Inc
identTopology>
218 VisitTopology visitTopology,
219 IncidentTopology incidentTopology,
228 template <
typename VisitTopology,
typename Inc
identTopology>
231 GetShapesArray(VisitTopology, IncidentTopology)
const;
240 template <
typename VisitTopology,
typename Inc
identTopology>
243 GetConnectivityArray(VisitTopology, IncidentTopology)
const;
252 template <
typename VisitTopology,
typename Inc
identTopology>
255 GetOffsetsArray(VisitTopology, IncidentTopology)
const;
257 template <
typename VisitTopology,
typename Inc
identTopology>
259 GetNumIndicesArray(VisitTopology, IncidentTopology)
const;
264 template <
typename VisitTopology,
typename Inc
identTopology>
267 return this->HasConnectivityImpl(visit, incident);
271 template <
typename VisitTopology,
typename Inc
identTopology>
274 this->ResetConnectivityImpl(visit, incident);
290 detail::BuildReverseConnectivity(this->Data->CellPointIds.Connectivity,
291 this->Data->CellPointIds.Offsets,
292 this->Data->NumberOfPoints,
293 this->Data->PointCellIds,
300 return this->Data->CellPointIds.ElementsValid;
306 return this->Data->PointCellIds.ElementsValid;
315 this->Data->ConnectivityAdded = -1;
316 this->Data->NumberOfCellsAdded = -1;
317 this->Data->NumberOfPoints = 0;
342 : ConnectivityAdded(-1)
343 , NumberOfCellsAdded(-1)
349 std::shared_ptr<Internals>
Data;
356 return this->Data->CellPointIds;
363 return this->Data->CellPointIds;
370 return this->Data->PointCellIds;
377 return this->Data->PointCellIds;
384 template <
typename Storage1,
typename Storage2,
typename Storage3>
385 struct CellSetExplicitConnectivityChooser<
390 using ConnectivityType =
391 viskores::cont::internal::ConnectivityExplicitInternals<Storage1, Storage2, Storage3>;
394 template <
typename CellSetType>
395 struct CellSetExplicitConnectivityChooser<CellSetType,
401 using ConnectivityType = viskores::cont::detail::DefaultVisitPointsWithCellsConnectivityExplicit;
408 #ifndef viskores_cont_CellSetExplicit_cxx
409 extern template class VISKORES_CONT_TEMPLATE_EXPORT CellSetExplicit<>;
410 extern template class VISKORES_CONT_TEMPLATE_EXPORT CellSetExplicit<
427 template <
typename SST,
typename CST,
typename OST>
428 struct SerializableTypeString<
viskores::cont::CellSetExplicit<SST, CST, OST>>
432 static std::string name =
"CS_Explicit<" +
433 SerializableTypeString<viskores::cont::ArrayHandle<viskores::UInt8, SST>>
::Get() +
"_ST," +
434 SerializableTypeString<viskores::cont::ArrayHandle<viskores::Id, CST>>
::Get() +
"_ST," +
435 SerializableTypeString<viskores::cont::ArrayHandle<viskores::Id, OST>>
::Get() +
"_ST>";
446 template <
typename SST,
typename CST,
typename OST>
447 struct Serialization<
viskores::cont::CellSetExplicit<SST, CST, OST>>
453 static VISKORES_CONT void save(BinaryBuffer& bb,
const Type& cs)
455 viskoresdiy::save(bb, cs.GetNumberOfPoints());
459 viskoresdiy::save(bb,
479 cs.Fill(numberOfPoints, shapes, connectivity, offsets);
486 #ifndef viskores_cont_CellSetExplicit_hxx
487 #include <viskores/cont/CellSetExplicit.hxx>
488 #endif //viskores_cont_CellSetExplicit_hxx
490 #endif //viskores_cont_CellSetExplicit_h
T load(const U &u, viskores::Id v)
Definition: FetchTagArrayDirectIn.h:44
bool HasConnectivity(VisitTopology visit, IncidentTopology incident) const
Returns whether the CellSetExplicit has information for the given visit and incident topology element...
Definition: CellSetExplicit.h:265
A tag used to identify the cell elements in a topology.
Definition: TopologyElementTag.h:32
typename ConnectivityType::ConnectivityArrayType ConnectivityArrayType
Definition: CellSetExplicit.h:98
A class holding information about topology connections.
Definition: ConnectivityExplicit.h:37
void ResetConnectivity(VisitTopology visit, IncidentTopology incident)
Definition: CellSetExplicit.h:272
typename ConnTypes::ConnectivityType CellPointIdsType
Definition: CellSetExplicit.h:114
void BuildConnectivity(viskores::cont::DeviceAdapterId device, viskores::TopologyElementTagPoint, viskores::TopologyElementTagCell) const
Definition: CellSetExplicit.h:286
typename ConnectivityType::ShapesArrayType ShapesArrayType
Definition: CellSetExplicit.h:97
viskores::Id SchedulingRangeType
Definition: CellSetExplicit.h:118
#define VISKORES_DEFAULT_SHAPES_STORAGE_TAG
Definition: CellSetExplicit.h:66
typename StorageType::ReadPortalType ReadPortalType
The type of portal used when accessing data in a read-only mode.
Definition: ArrayHandle.h:325
viskores::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:202
typename CellPointIdsType::ShapesArrayType ShapesArrayType
Definition: CellSetExplicit.h:120
Definition: Particle.h:373
Internals()
Definition: CellSetExplicit.h:341
typename ConnectivityType::OffsetsArrayType OffsetsArrayType
Definition: CellSetExplicit.h:99
typename Superclass::StorageTag StorageTag
Definition: ArrayHandleConstant.h:85
A tag used to identify the point elements in a topology.
Definition: TopologyElementTag.h:42
void ResetConnectivityImpl(viskores::TopologyElementTagPoint, viskores::TopologyElementTagCell)
Definition: CellSetExplicit.h:320
typename ConnectivityChooser< VisitTopology, IncidentTopology >::ExecConnectivityType ExecConnectivityType
Definition: CellSetExplicit.h:199
typename RConnTypes::ConnectivityType PointCellIdsType
Definition: CellSetExplicit.h:115
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
#define VISKORES_CONT
Definition: ExportMacros.h:65
Groups connected points that have the same field value.
Definition: Atomic.h:27
#define VISKORES_DEFAULT_OFFSETS_STORAGE_TAG
Definition: CellSetExplicit.h:74
PointCellIdsType PointCellIds
Definition: CellSetExplicit.h:331
viskores::Id NumberOfPoints
Definition: CellSetExplicit.h:338
std::shared_ptr< Internals > Data
Definition: CellSetExplicit.h:349
An ArrayHandle that converts an array of offsets to an array of Vec sizes.
Definition: ArrayHandleOffsetsToNumComponents.h:148
Defines an irregular collection of cells.
Definition: CastAndCall.h:44
const PointCellIdsType & GetConnectivity(viskores::TopologyElementTagPoint, viskores::TopologyElementTagCell) const
Definition: CellSetExplicit.h:367
Definition: CellSetExplicit.h:328
#define VISKORES_ASSERT(condition)
Definition: Assert.h:51
viskores::Id ConnectivityAdded
Definition: CellSetExplicit.h:336
uint8_t UInt8
Base type to use for 8-bit unsigned integer numbers.
Definition: Types.h:177
An object used to specify a device.
Definition: DeviceAdapterTag.h:66
CellPointIdsType CellPointIds
Definition: CellSetExplicit.h:330
typename ConnTypes::NumIndicesArrayType NumIndicesArrayType
Definition: CellSetExplicit.h:123
Definition: CellSetExplicit.h:89
typename Superclass::StorageTag StorageTag
Definition: ArrayHandleCounting.h:147
typename CellPointIdsType::OffsetsArrayType OffsetsArrayType
Definition: CellSetExplicit.h:122
void ResetConnectivityImpl(viskores::TopologyElementTagCell, viskores::TopologyElementTagPoint)
Definition: CellSetExplicit.h:309
auto Get(const viskores::Tuple< Ts... > &tuple)
Retrieve the object from a viskores::Tuple at the given index.
Definition: Tuple.h:89
viskores::Id NumberOfCellsAdded
Definition: CellSetExplicit.h:337
An ArrayHandle of an unknown value type and storage.
Definition: UnknownArrayHandle.h:451
typename CellPointIdsType::ConnectivityArrayType ConnectivityArrayType
Definition: CellSetExplicit.h:121
const CellPointIdsType & GetConnectivity(viskores::TopologyElementTagCell, viskores::TopologyElementTagPoint) const
Definition: CellSetExplicit.h:353
A short fixed-length array.
Definition: Types.h:365
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:43
bool HasConnectivityImpl(viskores::TopologyElementTagCell, viskores::TopologyElementTagPoint) const
Definition: CellSetExplicit.h:297
Defines the topological structure of the data in a DataSet.
Definition: CellSet.h:36
void BuildConnectivity(viskores::cont::DeviceAdapterId, viskores::TopologyElementTagCell, viskores::TopologyElementTagPoint) const
Definition: CellSetExplicit.h:278
typename Chooser::ConnectivityType ConnectivityType
Definition: CellSetExplicit.h:96
bool HasConnectivityImpl(viskores::TopologyElementTagPoint, viskores::TopologyElementTagCell) const
Definition: CellSetExplicit.h:303
const CellPointIdsType & GetConnectivity(viskores::TopologyElementTagCell, viskores::TopologyElementTagPoint)
Definition: CellSetExplicit.h:360
const PointCellIdsType & GetConnectivity(viskores::TopologyElementTagPoint, viskores::TopologyElementTagCell)
Definition: CellSetExplicit.h:374
typename detail::CellSetExplicitConnectivityChooser< Thisclass, VisitTopology, IncidentTopology > Chooser
Definition: CellSetExplicit.h:93
#define VISKORES_DEFAULT_CONNECTIVITY_STORAGE_TAG
Definition: CellSetExplicit.h:70