20 #ifndef vtkmCellSetSingleType_h 21 #define vtkmCellSetSingleType_h 23 #ifndef VTK_WRAPPING_CXX 27 #include <vtkm/CellShape.h> 28 #include <vtkm/CellTraits.h> 29 #include <vtkm/TopologyElementTag.h> 30 #include <vtkm/cont/ArrayHandle.h> 31 #include <vtkm/cont/CellSet.h> 33 #include <vtkm/VecFromPortal.h> 35 #include <vtkm/cont/serial/DeviceAdapterSerial.h> 36 #include <vtkm/cont/cuda/DeviceAdapterCuda.h> 37 #include <vtkm/cont/tbb/DeviceAdapterTBB.h> 53 , CellTypeAsId(CellShapeTagEmpty::Id)
55 , ReverseConnectivityBuilt(false)
62 template <
typename CellShapeTag>
67 , CellTypeAsId(CellShapeTag::Id)
69 , ReverseConnectivityBuilt(false)
78 , NumberOfCells(src.NumberOfCells)
79 , NumberOfPoints(src.NumberOfPoints)
80 , CellTypeAsId(src.CellTypeAsId)
81 , Connectivity(src.Connectivity)
82 , ReverseConnectivityBuilt(src.ReverseConnectivityBuilt)
84 , RNumIndices(src.RNumIndices)
85 , RIndexOffsets(src.RIndexOffsets)
91 this->CellSet::operator=(src);
92 this->NumberOfCells = src.NumberOfCells;
93 this->NumberOfPoints = src.NumberOfPoints;
94 this->CellTypeAsId = src.CellTypeAsId;
95 this->ReverseConnectivityBuilt = src.ReverseConnectivityBuilt;
96 this->Connectivity = src.Connectivity;
97 this->RConn = src.RConn;
98 this->RNumIndices = src.RNumIndices;
99 this->RIndexOffsets = src.RIndexOffsets;
105 return this->NumberOfCells;
110 return this->NumberOfPoints;
119 return this->GetNumberOfCells();
124 return this->GetNumberOfPoints();
129 vtkm::Id numberOfPoints,
130 const vtkm::cont::ArrayHandle<vtkm::Id, tovtkm::vtkCellArrayContainerTag>&
133 template <
typename DeviceAdapter,
typename FromTopology,
typename ToTopology>
136 template <
typename DeviceAdapter>
138 vtkm::TopologyElementTagCell>
143 template <
typename DeviceAdapter>
145 vtkm::TopologyElementTagPoint>
150 template <
typename Device>
152 PrepareForInput(Device, vtkm::TopologyElementTagPoint,
153 vtkm::TopologyElementTagCell)
const;
155 template <
typename Device>
157 PrepareForInput(Device, vtkm::TopologyElementTagCell,
158 vtkm::TopologyElementTagPoint)
const;
161 const vtkm::cont::ArrayHandle<vtkm::Id, tovtkm::vtkCellArrayContainerTag>&
163 vtkm::TopologyElementTagCell)
const 165 return this->Connectivity;
168 void PrintSummary(std::ostream& out)
const override;
172 this->Connectivity.ReleaseResourcesExecution();
173 this->RConn.ReleaseResourcesExecution();
174 this->RNumIndices.ReleaseResourcesExecution();
175 this->RIndexOffsets.ReleaseResourcesExecution();
179 template <
typename CellShapeTag>
180 void DetermineNumberOfPoints(CellShapeTag, vtkm::CellTraitsTagSizeFixed,
181 vtkm::IdComponent& numberOfPoints)
const 183 numberOfPoints = vtkm::CellTraits<CellShapeTag>::NUM_POINTS;
186 template <
typename CellShapeTag>
187 void DetermineNumberOfPoints(CellShapeTag, vtkm::CellTraitsTagSizeVariable,
188 vtkm::IdComponent& numberOfPoints)
const 193 vtkm::IdComponent DetermineNumberOfPoints()
const;
195 vtkm::Id NumberOfCells;
196 mutable vtkm::Id NumberOfPoints;
197 vtkm::Id CellTypeAsId;
198 vtkm::cont::ArrayHandle<vtkm::Id, ConnectivityStorageTag> Connectivity;
200 mutable bool ReverseConnectivityBuilt;
201 mutable vtkm::cont::ArrayHandle<vtkm::Id> RConn;
202 mutable vtkm::cont::ArrayHandle<vtkm::IdComponent> RNumIndices;
203 mutable vtkm::cont::ArrayHandle<vtkm::Id> RIndexOffsets;
207 extern template VTKACCELERATORSVTKM_TEMPLATE_EXPORT
210 vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell)
const;
212 extern template VTKACCELERATORSVTKM_TEMPLATE_EXPORT
215 vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint)
const;
217 #ifdef VTKM_ENABLE_TBB 218 extern template VTKACCELERATORSVTKM_TEMPLATE_EXPORT
221 vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell)
const;
223 extern template VTKACCELERATORSVTKM_TEMPLATE_EXPORT
226 vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint)
const;
229 #ifdef VTKM_ENABLE_OPENMP 230 extern template VTKACCELERATORSVTKM_TEMPLATE_EXPORT
233 vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell)
const;
235 extern template VTKACCELERATORSVTKM_TEMPLATE_EXPORT
238 vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint)
const;
241 #if defined(VTKM_ENABLE_CUDA) && defined(VTKM_CUDA) 242 extern template VTKACCELERATORSVTKM_TEMPLATE_EXPORT
245 vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell)
const;
247 extern template VTKACCELERATORSVTKM_TEMPLATE_EXPORT
250 vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint)
const;
257 #endif // vtkmlib_vtkmCellSetSingleType_h vtkm::exec::ConnectivityVTKSingleType< Device > PrepareForInput(Device, vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const
vtkmCellSetSingleType(CellShapeTag, const std::string &name)
void ReleaseResourcesExecution() override
vtkm::Id GetSchedulingRange(vtkm::TopologyElementTagPoint) const
vtkm::exec::ReverseConnectivityVTK< DeviceAdapter > ExecObjectType
vtkm::Id GetNumberOfPoints() const override
vtkm::Id GetSchedulingRange(vtkm::TopologyElementTagCell) const
vtkm::Id GetNumberOfFaces() const override
vtkm::exec::ConnectivityVTKSingleType< DeviceAdapter > ExecObjectType
vtkm::Id GetNumberOfEdges() const override
vtkm::Id GetNumberOfCells() const override
vtkmCellSetSingleType & operator=(const vtkmCellSetSingleType &src)
vtkmCellSetSingleType(const vtkmCellSetSingleType &src)
const vtkm::cont::ArrayHandle< vtkm::Id, tovtkm::vtkCellArrayContainerTag > & GetConnectivityArray(vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const