Viskores
1.0
|
Defines an irregular collection of cells. More...
#include <CastAndCall.h>
Classes | |
struct | ConnectivityChooser |
struct | Internals |
Public Types | |
using | SchedulingRangeType = viskores::Id |
using | ShapesArrayType = typename CellPointIdsType::ShapesArrayType |
using | ConnectivityArrayType = typename CellPointIdsType::ConnectivityArrayType |
using | OffsetsArrayType = typename CellPointIdsType::OffsetsArrayType |
using | NumIndicesArrayType = typename ConnTypes::NumIndicesArrayType |
template<typename VisitTopology , typename IncidentTopology > | |
using | ExecConnectivityType = typename ConnectivityChooser< VisitTopology, IncidentTopology >::ExecConnectivityType |
Public Member Functions | |
CellSetExplicit () | |
CellSetExplicit (const Thisclass &src) | |
CellSetExplicit (Thisclass &&src) noexcept | |
Thisclass & | operator= (const Thisclass &src) |
Thisclass & | operator= (Thisclass &&src) noexcept |
~CellSetExplicit () override | |
viskores::Id | GetNumberOfCells () const override |
viskores::Id | GetNumberOfPoints () const override |
viskores::Id | GetNumberOfFaces () const override |
viskores::Id | GetNumberOfEdges () const override |
void | PrintSummary (std::ostream &out) const override |
void | ReleaseResourcesExecution () override |
std::shared_ptr< CellSet > | NewInstance () const override |
void | DeepCopy (const CellSet *src) override |
viskores::Id | GetSchedulingRange (viskores::TopologyElementTagCell) const |
viskores::Id | GetSchedulingRange (viskores::TopologyElementTagPoint) const |
viskores::IdComponent | GetNumberOfPointsInCell (viskores::Id cellid) const override |
void | GetCellPointIds (viskores::Id id, viskores::Id *ptids) const override |
viskores::cont::ArrayHandle< viskores::UInt8, ShapesStorageTag >::ReadPortalType | ShapesReadPortal () const |
Returns an array portal that can be used to get the shape id of each cell. More... | |
viskores::UInt8 | GetCellShape (viskores::Id cellid) const override |
template<viskores::IdComponent NumIndices> | |
void | GetIndices (viskores::Id index, viskores::Vec< viskores::Id, NumIndices > &ids) const |
Retrieves the indices of the points incident to the given cell. More... | |
void | GetIndices (viskores::Id index, viskores::cont::ArrayHandle< viskores::Id > &ids) const |
Retrieves the indices of the points incident to the given cell. More... | |
void | PrepareToAddCells (viskores::Id numCells, viskores::Id connectivityMaxLen) |
Start adding cells one at a time. More... | |
template<typename IdVecType > | |
void | AddCell (viskores::UInt8 cellType, viskores::IdComponent numVertices, const IdVecType &ids) |
Add a cell. More... | |
void | CompleteAddingCells (viskores::Id numPoints) |
Finish adding cells one at a time. More... | |
void | Fill (viskores::Id numPoints, const viskores::cont::ArrayHandle< viskores::UInt8, ShapesStorageTag > &cellTypes, const viskores::cont::ArrayHandle< viskores::Id, ConnectivityStorageTag > &connectivity, const viskores::cont::ArrayHandle< viskores::Id, OffsetsStorageTag > &offsets) |
Set all the cells of the mesh. More... | |
template<typename VisitTopology , typename IncidentTopology > | |
ExecConnectivityType< VisitTopology, IncidentTopology > | PrepareForInput (viskores::cont::DeviceAdapterId device, VisitTopology visitTopology, IncidentTopology incidentTopology, viskores::cont::Token &token) const |
Prepares the data for a particular device and returns the execution object for it. More... | |
template<typename VisitTopology , typename IncidentTopology > | |
const ConnectivityChooser< VisitTopology, IncidentTopology >::ShapesArrayType & | GetShapesArray (VisitTopology, IncidentTopology) const |
Returns the viskores::cont::ArrayHandle holding the shape information. More... | |
template<typename VisitTopology , typename IncidentTopology > | |
const ConnectivityChooser< VisitTopology, IncidentTopology >::ConnectivityArrayType & | GetConnectivityArray (VisitTopology, IncidentTopology) const |
Returns the viskores::cont::ArrayHandle containing the connectivity information. More... | |
template<typename VisitTopology , typename IncidentTopology > | |
const ConnectivityChooser< VisitTopology, IncidentTopology >::OffsetsArrayType & | GetOffsetsArray (VisitTopology, IncidentTopology) const |
Returns the viskores::cont::ArrayHandle containing the offsets into theconnectivity information. More... | |
template<typename VisitTopology , typename IncidentTopology > | |
ConnectivityChooser< VisitTopology, IncidentTopology >::NumIndicesArrayType | GetNumIndicesArray (VisitTopology, IncidentTopology) const |
template<typename VisitTopology , typename IncidentTopology > | |
bool | HasConnectivity (VisitTopology visit, IncidentTopology incident) const |
Returns whether the CellSetExplicit has information for the given visit and incident topology elements. More... | |
template<typename VisitTopology , typename IncidentTopology > | |
void | ResetConnectivity (VisitTopology visit, IncidentTopology incident) |
Protected Attributes | |
std::shared_ptr< Internals > | Data |
Private Types | |
using | Thisclass = CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag > |
using | ConnTypes = ConnectivityChooser< viskores::TopologyElementTagCell, viskores::TopologyElementTagPoint > |
using | RConnTypes = ConnectivityChooser< viskores::TopologyElementTagPoint, viskores::TopologyElementTagCell > |
using | CellPointIdsType = typename ConnTypes::ConnectivityType |
using | PointCellIdsType = typename RConnTypes::ConnectivityType |
Private Member Functions | |
const CellPointIdsType & | GetConnectivity (viskores::TopologyElementTagCell, viskores::TopologyElementTagPoint) const |
const CellPointIdsType & | GetConnectivity (viskores::TopologyElementTagCell, viskores::TopologyElementTagPoint) |
const PointCellIdsType & | GetConnectivity (viskores::TopologyElementTagPoint, viskores::TopologyElementTagCell) const |
const PointCellIdsType & | GetConnectivity (viskores::TopologyElementTagPoint, viskores::TopologyElementTagCell) |
Defines an irregular collection of cells.
The cells can be of different types and connected in arbitrary ways. This is done by explicitly providing for each cell a sequence of points that defines the cell.
|
private |
using viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::ConnectivityArrayType = typename CellPointIdsType::ConnectivityArrayType |
|
private |
using viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::ExecConnectivityType = typename ConnectivityChooser<VisitTopology, IncidentTopology>::ExecConnectivityType |
using viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::NumIndicesArrayType = typename ConnTypes::NumIndicesArrayType |
using viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::OffsetsArrayType = typename CellPointIdsType::OffsetsArrayType |
|
private |
|
private |
using viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::SchedulingRangeType = viskores::Id |
using viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::ShapesArrayType = typename CellPointIdsType::ShapesArrayType |
|
private |
viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::CellSetExplicit | ( | ) |
viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::CellSetExplicit | ( | const Thisclass & | src | ) |
|
noexcept |
|
override |
void viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::AddCell | ( | viskores::UInt8 | cellType, |
viskores::IdComponent | numVertices, | ||
const IdVecType & | ids | ||
) |
Add a cell.
This can only be called after AddCell
.
|
inlineprotected |
|
inlineprotected |
void viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::CompleteAddingCells | ( | viskores::Id | numPoints | ) |
Finish adding cells one at a time.
|
override |
void viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::Fill | ( | viskores::Id | numPoints, |
const viskores::cont::ArrayHandle< viskores::UInt8, ShapesStorageTag > & | cellTypes, | ||
const viskores::cont::ArrayHandle< viskores::Id, ConnectivityStorageTag > & | connectivity, | ||
const viskores::cont::ArrayHandle< viskores::Id, OffsetsStorageTag > & | offsets | ||
) |
Set all the cells of the mesh.
This method can be used to fill the memory from another system without copying data.
|
override |
|
override |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
const ConnectivityChooser<VisitTopology, IncidentTopology>::ConnectivityArrayType& viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::GetConnectivityArray | ( | VisitTopology | , |
IncidentTopology | |||
) | const |
Returns the viskores::cont::ArrayHandle
containing the connectivity information.
Returns the viskores::cont::ArrayHandle
holding the shape information. The incident array corresponding to viskores::TopologyElementTagCell
for the VisitTopology
and viskores::TopologyElementTagPoint
for the IncidentTopology
is the same as that provided when filling the explicit cell set. ExplicitCellSet
is capable of providing the inverse connections (cells incident on each point) on request.
void viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::GetIndices | ( | viskores::Id | index, |
viskores::cont::ArrayHandle< viskores::Id > & | ids | ||
) | const |
Retrieves the indices of the points incident to the given cell.
void viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::GetIndices | ( | viskores::Id | index, |
viskores::Vec< viskores::Id, NumIndices > & | ids | ||
) | const |
Retrieves the indices of the points incident to the given cell.
If the provided viskores::Vec
does not have enough components, the result will be truncated.
|
override |
|
override |
|
override |
|
override |
|
override |
ConnectivityChooser<VisitTopology, IncidentTopology>::NumIndicesArrayType viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::GetNumIndicesArray | ( | VisitTopology | , |
IncidentTopology | |||
) | const |
const ConnectivityChooser<VisitTopology, IncidentTopology>::OffsetsArrayType& viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::GetOffsetsArray | ( | VisitTopology | , |
IncidentTopology | |||
) | const |
Returns the viskores::cont::ArrayHandle
containing the offsets into theconnectivity information.
Returns the viskores::cont::ArrayHandle
holding the offset information. The offset array corresponding to viskores::TopologyElementTagCell
for the VisitTopology
and viskores::TopologyElementTagPoint
for the IncidentTopology
is the same as that provided when filling the explicit cell set. ExplicitCellSet
is capable of providing the inverse connections (cells incident on each point) on request.
viskores::Id viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::GetSchedulingRange | ( | viskores::TopologyElementTagCell | ) | const |
viskores::Id viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::GetSchedulingRange | ( | viskores::TopologyElementTagPoint | ) | const |
const ConnectivityChooser<VisitTopology, IncidentTopology>::ShapesArrayType& viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::GetShapesArray | ( | VisitTopology | , |
IncidentTopology | |||
) | const |
Returns the viskores::cont::ArrayHandle
holding the shape information.
The shapes array corresponding to viskores::TopologyElementTagCell
for the VisitTopology
and viskores::TopologyElementTagPoint
for the IncidentTopology
is the same as that provided when filling the explicit cell set. ExplicitCellSet
is capable of providing the inverse connections (cells incident on each point) on request.
|
inline |
Returns whether the CellSetExplicit
has information for the given visit and incident topology elements.
If the connectivity is not available, it will be automatically created if requested, but that will take time.
|
inlineprotected |
|
inlineprotected |
|
override |
Thisclass& viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::operator= | ( | const Thisclass & | src | ) |
|
noexcept |
ExecConnectivityType<VisitTopology, IncidentTopology> viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::PrepareForInput | ( | viskores::cont::DeviceAdapterId | device, |
VisitTopology | visitTopology, | ||
IncidentTopology | incidentTopology, | ||
viskores::cont::Token & | token | ||
) | const |
Prepares the data for a particular device and returns the execution object for it.
device | Specifies the device on which the cell set will ve available. |
visitTopology | Specifies the "visit" topology element. This is the element that will be indexed in the resulting connectivity object. This is typically viskores::TopologyElementTagPoint or viskores::TopologyElementTagCell . |
incidentTopology | Specifies the "incident" topology element. This is the element that will incident to the elements that are visited. This is typically viskores::TopologyElementTagPoint or viskores::TopologyElementTagCell . |
token | Provides a viskores::cont::Token object that will define the span which the return execution object must be valid. |
void viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::PrepareToAddCells | ( | viskores::Id | numCells, |
viskores::Id | connectivityMaxLen | ||
) |
Start adding cells one at a time.
After this method is called, AddCell
is called repeatedly to add each cell. Once all cells are added, call CompleteAddingCells
.
|
override |
|
override |
|
inline |
|
inlineprotected |
|
inlineprotected |
viskores::cont::ArrayHandle<viskores::UInt8, ShapesStorageTag>::ReadPortalType viskores::cont::CellSetExplicit< ShapesStorageTag, ConnectivityStorageTag, OffsetsStorageTag >::ShapesReadPortal | ( | ) | const |
Returns an array portal that can be used to get the shape id of each cell.
Using the array portal returned from this method to get many shape ids is likely significantly faster than calling GetCellShape()
for each cell.
|
protected |