Go to the documentation of this file.
   10 #ifndef vtk_m_cont_CellSetExplicit_h 
   11 #define vtk_m_cont_CellSetExplicit_h 
   25 #include <vtkm/cont/vtkm_cont_export.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<
 
   48 VTKM_CONT_EXPORT 
void BuildReverseConnectivity(
 
   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 
   76   template <
typename VisitTopology, 
typename Inc
identTopology>
 
   80     using Chooser = 
typename detail::
 
   81       CellSetExplicitConnectivityChooser<Thisclass, VisitTopology, IncidentTopology>;
 
   93                                        typename ConnectivityArrayType::ReadPortalType,
 
   94                                        typename OffsetsArrayType::ReadPortalType>;
 
  126   VTKM_CONT void PrintSummary(std::ostream& out) 
const override;
 
  128   VTKM_CONT void ReleaseResourcesExecution() 
override;
 
  130   VTKM_CONT std::shared_ptr<CellSet> NewInstance() 
const override;
 
  140   ShapesReadPortal() 
const;
 
  144   template <vtkm::IdComponent NumIndices>
 
  152   template <
typename IdVecType>
 
  166   template <
typename VisitTopology, 
typename Inc
identTopology>
 
  170   template <
typename VisitTopology, 
typename Inc
identTopology>
 
  177   template <
typename VisitTopology, 
typename Inc
identTopology>
 
  179     GetShapesArray(VisitTopology, IncidentTopology) 
const;
 
  181   template <
typename VisitTopology, 
typename Inc
identTopology>
 
  184     GetConnectivityArray(VisitTopology, IncidentTopology) 
const;
 
  186   template <
typename VisitTopology, 
typename Inc
identTopology>
 
  188     GetOffsetsArray(VisitTopology, IncidentTopology) 
const;
 
  190   template <
typename VisitTopology, 
typename Inc
identTopology>
 
  192     GetNumIndicesArray(VisitTopology, IncidentTopology) 
const;
 
  194   template <
typename VisitTopology, 
typename Inc
identTopology>
 
  197     return this->HasConnectivityImpl(visit, incident);
 
  201   template <
typename VisitTopology, 
typename Inc
identTopology>
 
  204     this->ResetConnectivityImpl(visit, incident);
 
  212     VTKM_ASSERT(this->Data->CellPointIds.ElementsValid);
 
  220     detail::BuildReverseConnectivity(this->Data->CellPointIds.Connectivity,
 
  221                                      this->Data->CellPointIds.Offsets,
 
  222                                      this->Data->NumberOfPoints,
 
  223                                      this->Data->PointCellIds,
 
  230     return this->Data->CellPointIds.ElementsValid;
 
  236     return this->Data->PointCellIds.ElementsValid;
 
  244     this->Data->ConnectivityAdded = -1;
 
  245     this->Data->NumberOfCellsAdded = -1;
 
  246     this->Data->NumberOfPoints = 0;
 
  270       : ConnectivityAdded(-1)
 
  271       , NumberOfCellsAdded(-1)
 
  277   std::shared_ptr<Internals> 
Data;
 
  284     return this->Data->CellPointIds;
 
  291     return this->Data->CellPointIds;
 
  298     return this->Data->PointCellIds;
 
  305     return this->Data->PointCellIds;
 
  312 template <
typename Storage1, 
typename Storage2, 
typename Storage3>
 
  317   using ConnectivityType =
 
  318     vtkm::cont::internal::ConnectivityExplicitInternals<Storage1, Storage2, Storage3>;
 
  321 template <
typename CellSetType>
 
  322 struct CellSetExplicitConnectivityChooser<CellSetType,
 
  323                                           vtkm::TopologyElementTagPoint,
 
  328   using ConnectivityType = vtkm::cont::detail::DefaultVisitPointsWithCellsConnectivityExplicit;
 
  335 #ifndef vtk_m_cont_CellSetExplicit_cxx 
  336 extern template class VTKM_CONT_TEMPLATE_EXPORT CellSetExplicit<>; 
 
  337 extern template class VTKM_CONT_TEMPLATE_EXPORT CellSetExplicit<
 
  354 template <
typename SST, 
typename CST, 
typename OST>
 
  355 struct SerializableTypeString<
vtkm::cont::CellSetExplicit<SST, CST, OST>>
 
  359     static std::string name = 
"CS_Explicit<" +
 
  360       SerializableTypeString<vtkm::cont::ArrayHandle<vtkm::UInt8, SST>>
::Get() + 
"_ST," +
 
  361       SerializableTypeString<vtkm::cont::ArrayHandle<vtkm::Id, CST>>
::Get() + 
"_ST," +
 
  362       SerializableTypeString<vtkm::cont::ArrayHandle<vtkm::Id, OST>>
::Get() + 
"_ST>";
 
  373 template <
typename SST, 
typename CST, 
typename OST>
 
  374 struct Serialization<
vtkm::cont::CellSetExplicit<SST, CST, OST>>
 
  380   static VTKM_CONT void save(BinaryBuffer& bb, 
const Type& cs)
 
  382     vtkmdiy::save(bb, cs.GetNumberOfPoints());
 
  403     cs.Fill(numberOfPoints, shapes, connectivity, offsets);
 
  410 #ifndef vtk_m_cont_CellSetExplicit_hxx 
  411 #include <vtkm/cont/CellSetExplicit.hxx> 
  412 #endif //vtk_m_cont_CellSetExplicit_hxx 
  414 #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:66
 
const VTKM_CONT PointCellIdsType & GetConnectivity(vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell)
Definition: CellSetExplicit.h:302
 
vtkm::Id NumberOfPoints
Definition: CellSetExplicit.h:266
 
Definition: CellSetExplicit.h:77
 
typename CellPointIdsType::ShapesArrayType ShapesArrayType
Definition: CellSetExplicit.h:108
 
const VTKM_CONT PointCellIdsType & GetConnectivity(vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const
Definition: CellSetExplicit.h:295
 
Groups connected points that have the same field value.
Definition: Atomic.h:19
 
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
 
VTKM_CONT bool HasConnectivityImpl(vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const
Definition: CellSetExplicit.h:227
 
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:258
 
vtkm::Id SchedulingRangeType
Definition: CellSetExplicit.h:106
 
const VTKM_CONT CellPointIdsType & GetConnectivity(vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint)
Definition: CellSetExplicit.h:288
 
An ArrayHandle of an unknown value type and storage.
Definition: UnknownArrayHandle.h:406
 
typename CellPointIdsType::ConnectivityArrayType ConnectivityArrayType
Definition: CellSetExplicit.h:109
 
VTKM_CONT void BuildConnectivity(vtkm::cont::DeviceAdapterId device, vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const
Definition: CellSetExplicit.h:216
 
typename Chooser::ConnectivityType ConnectivityType
Definition: CellSetExplicit.h:84
 
typename ConnTypes::ConnectivityType CellPointIdsType
Definition: CellSetExplicit.h:102
 
VTKM_CONT Internals()
Definition: CellSetExplicit.h:269
 
typename StorageType::ReadPortalType ReadPortalType
Definition: ArrayHandle.h:294
 
VTKM_CONT void BuildConnectivity(vtkm::cont::DeviceAdapterId, vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const
Definition: CellSetExplicit.h:208
 
Definition: Particle.h:331
 
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
 
typename ConnectivityType::ShapesArrayType ShapesArrayType
Definition: CellSetExplicit.h:85
 
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:249
 
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:168
 
VTKM_CONT bool HasConnectivity(VisitTopology visit, IncidentTopology incident) const
Definition: CellSetExplicit.h:195
 
Definition: ArrayHandleCounting.h:23
 
typename ConnectivityType::ConnectivityArrayType ConnectivityArrayType
Definition: CellSetExplicit.h:86
 
typename ConnTypes::NumIndicesArrayType NumIndicesArrayType
Definition: CellSetExplicit.h:111
 
vtkm::Id NumberOfCellsAdded
Definition: CellSetExplicit.h:265
 
typename CellPointIdsType::OffsetsArrayType OffsetsArrayType
Definition: CellSetExplicit.h:110
 
VTKM_CONT void ResetConnectivity(VisitTopology visit, IncidentTopology incident)
Definition: CellSetExplicit.h:202
 
#define VTKM_CONT
Definition: ExportMacros.h:57
 
Definition: ConnectivityExplicit.h:24
 
std::shared_ptr< Internals > Data
Definition: CellSetExplicit.h:277
 
#define VTKM_DEFAULT_CONNECTIVITY_STORAGE_TAG
Definition: CellSetExplicit.h:62
 
uint8_t UInt8
Definition: Types.h:157
 
VTKM_CONT void ResetConnectivityImpl(vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint)
Definition: CellSetExplicit.h:239
 
Definition: DeviceAdapterTag.h:52
 
A short fixed-length array.
Definition: Types.h:767
 
PointCellIdsType PointCellIds
Definition: CellSetExplicit.h:259
 
vtkm::Id ConnectivityAdded
Definition: CellSetExplicit.h:264
 
typename ConnectivityType::OffsetsArrayType OffsetsArrayType
Definition: CellSetExplicit.h:87
 
Definition: CastAndCall.h:36
 
#define VTKM_DEFAULT_SHAPES_STORAGE_TAG
Definition: CellSetExplicit.h:58
 
typename RConnTypes::ConnectivityType PointCellIdsType
Definition: CellSetExplicit.h:103
 
An ArrayHandle that converts an array of offsets to an array of Vec sizes.
Definition: ArrayHandleOffsetsToNumComponents.h:129
 
vtkm::cont::StorageTagConstant StorageTag
Definition: ArrayHandle.h:291
 
A tag used to identify the cell elements in a topology.
Definition: TopologyElementTag.h:24
 
Definition: CellSetExplicit.h:256
 
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:92
 
typename detail::CellSetExplicitConnectivityChooser< Thisclass, VisitTopology, IncidentTopology > Chooser
Definition: CellSetExplicit.h:81
 
VTKM_CONT bool HasConnectivityImpl(vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const
Definition: CellSetExplicit.h:233
 
const VTKM_CONT CellPointIdsType & GetConnectivity(vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const
Definition: CellSetExplicit.h:281