Refactor topology mappings to clarify meaning.

The `From` and `To` nomenclature for topology mapping has been confusing for
both users and developers, especially at lower levels where the intention of
mapping attributes from one element to another is easily conflated with the
concept of mapping indices (which maps in the exact opposite direction).

These identifiers have been renamed to `VisitTopology` and `IncidentTopology`
to clarify the direction of the mapping. The order in which these template
parameters are specified for `WorkletMapTopology` have also been reversed,
since eventually there may be more than one `IncidentTopology`, and having
`IncidentTopology` at the end will allow us to replace it with a variadic
template parameter pack in the future.

Other implementation details supporting these worklets, include `Fetch` tags,
`Connectivity` classes, and methods on the various `CellSet` classes (such as
`PrepareForInput` have also reversed their template arguments. These will need
to be cautiously updated.

The convenience implementations of `WorkletMapTopology` have been renamed for
clarity as follows:

```
WorkletMapPointToCell --> WorkletVisitCellsWithPoints
WorkletMapCellToPoint --> WorkletVisitPointsWithCells
```

The `ControlSignature` tags have been renamed as follows:

```
FieldInTo --> FieldInVisit
FieldInFrom --> FieldInMap
FromCount --> IncidentElementCount
FromIndices --> IncidentElementIndices
```
This commit is contained in:
Allison Vacanti 2019-07-30 12:53:51 -04:00
parent 793702cf62
commit 5db762ee71
109 changed files with 891 additions and 816 deletions

@ -187,7 +187,7 @@ public:
}
};
class GenerateEdges : public vtkm::worklet::WorkletMapPointToCell
class GenerateEdges : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellset, WholeArrayOut edgeIds);

@ -655,14 +655,14 @@ class BenchmarkFilters
{ // Why does CastAndCall insist on making the cellset const?
using CellSetT = vtkm::cont::CellSetExplicit<T1, T2, T3, T4>;
CellSetT& mcellSet = const_cast<CellSetT&>(cellSet);
mcellSet.ResetConnectivity(vtkm::TopologyElementTagCell{},
vtkm::TopologyElementTagPoint{});
mcellSet.ResetConnectivity(vtkm::TopologyElementTagPoint{},
vtkm::TopologyElementTagCell{});
}
Timer timer{ DeviceAdapter() };
timer.Start();
cellSet.PrepareForInput(
DeviceAdapter(), vtkm::TopologyElementTagCell{}, vtkm::TopologyElementTagPoint{});
DeviceAdapter(), vtkm::TopologyElementTagPoint{}, vtkm::TopologyElementTagCell{});
this->Time = timer.GetElapsedTime();
}
};

@ -42,7 +42,7 @@ enum BenchmarkName
ALL = CELL_TO_POINT | POINT_TO_CELL | MC_CLASSIFY
};
class AveragePointToCell : public vtkm::worklet::WorkletMapPointToCell
class AveragePointToCell : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(FieldInPoint inPoints, CellSetIn cellset, FieldOutCell outCells);
@ -64,7 +64,7 @@ public:
}
};
class AverageCellToPoint : public vtkm::worklet::WorkletMapCellToPoint
class AverageCellToPoint : public vtkm::worklet::WorkletVisitPointsWithCells
{
public:
using ControlSignature = void(FieldInCell inCells, CellSetIn topology, FieldOut outPoints);
@ -91,7 +91,7 @@ public:
// -----------------------------------------------------------------------------
template <typename T>
class Classification : public vtkm::worklet::WorkletMapPointToCell
class Classification : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(FieldInPoint inNodes, CellSetIn cellset, FieldOutCell outCaseId);

@ -0,0 +1,35 @@
# Refactor topology mappings to clarify meaning.
The `From` and `To` nomenclature for topology mapping has been confusing for
both users and developers, especially at lower levels where the intention of
mapping attributes from one element to another is easily conflated with the
concept of mapping indices (which maps in the exact opposite direction).
These identifiers have been renamed to `VisitTopology` and `IncidentTopology`
to clarify the direction of the mapping. The order in which these template
parameters are specified for `WorkletMapTopology` have also been reversed,
since eventually there may be more than one `IncidentTopology`, and having
`IncidentTopology` at the end will allow us to replace it with a variadic
template parameter pack in the future.
Other implementation details supporting these worklets, include `Fetch` tags,
`Connectivity` classes, and methods on the various `CellSet` classes (such as
`PrepareForInput` have also reversed their template arguments. These will need
to be cautiously updated.
The convenience implementations of `WorkletMapTopology` have been renamed for
clarity as follows:
```
WorkletMapPointToCell --> WorkletVisitCellsWithPoints
WorkletMapCellToPoint --> WorkletVisitPointsWithCells
```
The `ControlSignature` tags have been renamed as follows:
```
FieldInTo --> FieldInVisit
FieldInFrom --> FieldInMap
FromCount --> IncidentElementCount
FromIndices --> IncidentElementIndices
```

@ -135,7 +135,7 @@ private:
bool DoneFlag;
};
class CountBinsL1 : public vtkm::worklet::WorkletMapPointToCell
class CountBinsL1 : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellset, FieldInPoint coords, FieldOutCell bincount);
@ -158,7 +158,7 @@ private:
Grid L1Grid;
};
class FindBinsL1 : public vtkm::worklet::WorkletMapPointToCell
class FindBinsL1 : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellset,
@ -218,7 +218,7 @@ private:
vtkm::FloatDefault Density;
};
class CountBinsL2 : public vtkm::worklet::WorkletMapPointToCell
class CountBinsL2 : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellset,
@ -253,7 +253,7 @@ private:
Grid L1Grid;
};
class FindBinsL2 : public vtkm::worklet::WorkletMapPointToCell
class FindBinsL2 : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellset,

@ -99,8 +99,8 @@ private:
using CellSetP2CExecType =
decltype(std::declval<CellSetType>().PrepareForInput(DeviceAdapter{},
vtkm::TopologyElementTagPoint{},
vtkm::TopologyElementTagCell{}));
vtkm::TopologyElementTagCell{},
vtkm::TopologyElementTagPoint{}));
// TODO: This function may return false positives for non 3D cells as the
// tests are done on the projection of the point on the cell. Extra checks
@ -140,8 +140,8 @@ public:
, CellCount(cellCount.PrepareForInput(DeviceAdapter{}))
, CellIds(cellIds.PrepareForInput(DeviceAdapter{}))
, CellSet(cellSet.PrepareForInput(DeviceAdapter{},
vtkm::TopologyElementTagPoint{},
vtkm::TopologyElementTagCell{}))
vtkm::TopologyElementTagCell{},
vtkm::TopologyElementTagPoint{}))
, Coords(coords.GetData().PrepareForInput(DeviceAdapter{}))
{
}

@ -28,7 +28,7 @@ namespace cont
namespace detail
{
template <typename CellSetType, typename FromTopology, typename ToTopology>
template <typename CellSetType, typename VisitTopology, typename IncidentTopology>
struct CellSetExplicitConnectivityChooser
{
using ConnectivityType = vtkm::cont::internal::ConnectivityExplicitInternals<>;
@ -63,13 +63,13 @@ class VTKM_ALWAYS_EXPORT CellSetExplicit : public CellSet
ConnectivityStorageTag,
OffsetsStorageTag>;
template <typename FromTopology, typename ToTopology>
template <typename VisitTopology, typename IncidentTopology>
struct ConnectivityChooser
{
using ConnectivityType =
typename detail::CellSetExplicitConnectivityChooser<Thisclass,
FromTopology,
ToTopology>::ConnectivityType;
VisitTopology,
IncidentTopology>::ConnectivityType;
using ShapeArrayType = typename ConnectivityType::ShapeArrayType;
using NumIndicesArrayType = typename ConnectivityType::NumIndicesArrayType;
@ -77,25 +77,26 @@ class VTKM_ALWAYS_EXPORT CellSetExplicit : public CellSet
using IndexOffsetArrayType = typename ConnectivityType::IndexOffsetArrayType;
};
using PointToCellInternalsType =
typename ConnectivityChooser<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell>::ConnectivityType;
using CellToPointInternalsType =
using VisitCellsWithPointsInternalsType =
typename ConnectivityChooser<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint>::ConnectivityType;
using VisitPointsWithCellsInternalsType =
typename ConnectivityChooser<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell>::ConnectivityType;
public:
using SchedulingRangeType = vtkm::Id;
//point to cell is used when iterating cells and asking for point properties
using PointToCellConnectivityType =
ConnectivityChooser<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell>;
using VisitCellsWithPointsConnectivityType =
ConnectivityChooser<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint>;
using ShapeArrayType = typename PointToCellConnectivityType::ShapeArrayType;
using NumIndicesArrayType = typename PointToCellConnectivityType::NumIndicesArrayType;
using ConnectivityArrayType = typename PointToCellConnectivityType::ConnectivityArrayType;
using IndexOffsetArrayType = typename PointToCellConnectivityType::IndexOffsetArrayType;
using ShapeArrayType = typename VisitCellsWithPointsConnectivityType::ShapeArrayType;
using NumIndicesArrayType = typename VisitCellsWithPointsConnectivityType::NumIndicesArrayType;
using ConnectivityArrayType =
typename VisitCellsWithPointsConnectivityType::ConnectivityArrayType;
using IndexOffsetArrayType = typename VisitCellsWithPointsConnectivityType::IndexOffsetArrayType;
VTKM_CONT CellSetExplicit(const std::string& name = std::string());
VTKM_CONT CellSetExplicit(const Thisclass& src);
@ -148,14 +149,14 @@ public:
const vtkm::cont::ArrayHandle<vtkm::Id, OffsetsStorageTag>& offsets =
vtkm::cont::ArrayHandle<vtkm::Id, OffsetsStorageTag>());
template <typename DeviceAdapter, typename FromTopology, typename ToTopology>
template <typename DeviceAdapter, typename VisitTopology, typename IncidentTopology>
struct ExecutionTypes
{
VTKM_IS_DEVICE_ADAPTER_TAG(DeviceAdapter);
VTKM_IS_TOPOLOGY_ELEMENT_TAG(FromTopology);
VTKM_IS_TOPOLOGY_ELEMENT_TAG(ToTopology);
VTKM_IS_TOPOLOGY_ELEMENT_TAG(VisitTopology);
VTKM_IS_TOPOLOGY_ELEMENT_TAG(IncidentTopology);
using ConnectivityTypes = ConnectivityChooser<FromTopology, ToTopology>;
using ConnectivityTypes = ConnectivityChooser<VisitTopology, IncidentTopology>;
using ShapePortalType = typename ConnectivityTypes::ShapeArrayType::template ExecutionTypes<
DeviceAdapter>::PortalConst;
@ -175,82 +176,85 @@ public:
IndexOffsetPortalType>;
};
template <typename Device, typename FromTopology, typename ToTopology>
typename ExecutionTypes<Device, FromTopology, ToTopology>::ExecObjectType
PrepareForInput(Device, FromTopology, ToTopology) const;
template <typename Device, typename VisitTopology, typename IncidentTopology>
typename ExecutionTypes<Device, VisitTopology, IncidentTopology>::ExecObjectType
PrepareForInput(Device, VisitTopology, IncidentTopology) const;
template <typename FromTopology, typename ToTopology>
VTKM_CONT const typename ConnectivityChooser<FromTopology, ToTopology>::ShapeArrayType&
GetShapesArray(FromTopology, ToTopology) const;
template <typename VisitTopology, typename IncidentTopology>
VTKM_CONT const typename ConnectivityChooser<VisitTopology, IncidentTopology>::ShapeArrayType&
GetShapesArray(VisitTopology, IncidentTopology) const;
template <typename FromTopology, typename ToTopology>
VTKM_CONT const typename ConnectivityChooser<FromTopology, ToTopology>::NumIndicesArrayType&
GetNumIndicesArray(FromTopology, ToTopology) const;
template <typename VisitTopology, typename IncidentTopology>
VTKM_CONT const typename ConnectivityChooser<VisitTopology,
IncidentTopology>::NumIndicesArrayType&
GetNumIndicesArray(VisitTopology, IncidentTopology) const;
template <typename FromTopology, typename ToTopology>
VTKM_CONT const typename ConnectivityChooser<FromTopology, ToTopology>::ConnectivityArrayType&
GetConnectivityArray(FromTopology, ToTopology) const;
template <typename VisitTopology, typename IncidentTopology>
VTKM_CONT const typename ConnectivityChooser<VisitTopology,
IncidentTopology>::ConnectivityArrayType&
GetConnectivityArray(VisitTopology, IncidentTopology) const;
template <typename FromTopology, typename ToTopology>
VTKM_CONT const typename ConnectivityChooser<FromTopology, ToTopology>::IndexOffsetArrayType&
GetIndexOffsetArray(FromTopology, ToTopology) const;
template <typename VisitTopology, typename IncidentTopology>
VTKM_CONT const typename ConnectivityChooser<VisitTopology,
IncidentTopology>::IndexOffsetArrayType&
GetIndexOffsetArray(VisitTopology, IncidentTopology) const;
// Can be used to check if e.g. CellToPoint table is built.
template <typename FromTopology, typename ToTopology>
VTKM_CONT bool HasConnectivity(FromTopology from, ToTopology to) const
template <typename VisitTopology, typename IncidentTopology>
VTKM_CONT bool HasConnectivity(VisitTopology from, IncidentTopology to) const
{
return this->HasConnectivityImpl(from, to);
}
// Can be used to reset a connectivity table, mostly useful for benchmarking.
template <typename FromTopology, typename ToTopology>
VTKM_CONT void ResetConnectivity(FromTopology from, ToTopology to)
template <typename VisitTopology, typename IncidentTopology>
VTKM_CONT void ResetConnectivity(VisitTopology from, IncidentTopology to)
{
this->ResetConnectivityImpl(from, to);
}
protected:
VTKM_CONT void BuildConnectivity(vtkm::cont::DeviceAdapterId,
vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell) const;
VTKM_CONT void BuildConnectivity(vtkm::cont::DeviceAdapterId,
vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint) const;
VTKM_CONT bool HasConnectivityImpl(vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell) const
{
return this->Data->PointToCell.ElementsValid;
}
VTKM_CONT void BuildConnectivity(vtkm::cont::DeviceAdapterId,
vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell) const;
VTKM_CONT bool HasConnectivityImpl(vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint) const
{
return this->Data->CellToPoint.ElementsValid;
return this->Data->VisitCellsWithPoints.ElementsValid;
}
VTKM_CONT void ResetConnectivityImpl(vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell)
VTKM_CONT bool HasConnectivityImpl(vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell) const
{
return this->Data->VisitPointsWithCells.ElementsValid;
}
VTKM_CONT void ResetConnectivityImpl(vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint)
{
// Reset entire cell set
this->Data->PointToCell = PointToCellInternalsType{};
this->Data->CellToPoint = CellToPointInternalsType{};
this->Data->VisitCellsWithPoints = VisitCellsWithPointsInternalsType{};
this->Data->VisitPointsWithCells = VisitPointsWithCellsInternalsType{};
this->Data->ConnectivityAdded = -1;
this->Data->NumberOfCellsAdded = -1;
this->Data->NumberOfPoints = 0;
}
VTKM_CONT void ResetConnectivityImpl(vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint)
VTKM_CONT void ResetConnectivityImpl(vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell)
{
this->Data->CellToPoint = CellToPointInternalsType{};
this->Data->VisitPointsWithCells = VisitPointsWithCellsInternalsType{};
}
// Store internals in a shared pointer so shallow copies stay consistent.
// See #2268.
struct Internals
{
PointToCellInternalsType PointToCell;
CellToPointInternalsType CellToPoint;
VisitCellsWithPointsInternalsType VisitCellsWithPoints;
VisitPointsWithCellsInternalsType VisitPointsWithCells;
// These are used in the AddCell and related methods to incrementally add
// cells. They need to be protected as subclasses of CellSetExplicit
@ -271,28 +275,28 @@ protected:
std::shared_ptr<Internals> Data;
private:
const PointToCellInternalsType& GetConnectivity(vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell) const
const VisitCellsWithPointsInternalsType& GetConnectivity(vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint) const
{
return this->Data->PointToCell;
return this->Data->VisitCellsWithPoints;
}
const PointToCellInternalsType& GetConnectivity(vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell)
const VisitCellsWithPointsInternalsType& GetConnectivity(vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint)
{
return this->Data->PointToCell;
return this->Data->VisitCellsWithPoints;
}
const CellToPointInternalsType& GetConnectivity(vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint) const
const VisitPointsWithCellsInternalsType& GetConnectivity(vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell) const
{
return this->Data->CellToPoint;
return this->Data->VisitPointsWithCells;
}
const CellToPointInternalsType& GetConnectivity(vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint)
const VisitPointsWithCellsInternalsType& GetConnectivity(vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell)
{
return this->Data->CellToPoint;
return this->Data->VisitPointsWithCells;
}
};
@ -302,8 +306,8 @@ namespace detail
template <typename Storage1, typename Storage2, typename Storage3, typename Storage4>
struct CellSetExplicitConnectivityChooser<
vtkm::cont::CellSetExplicit<Storage1, Storage2, Storage3, Storage4>,
vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell>
vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint>
{
using ConnectivityType =
vtkm::cont::internal::ConnectivityExplicitInternals<Storage1, Storage2, Storage3, Storage4>;
@ -311,8 +315,8 @@ struct CellSetExplicitConnectivityChooser<
template <typename CellSetType>
struct CellSetExplicitConnectivityChooser<CellSetType,
vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint>
vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell>
{
//only specify the shape type as it will be constant as everything
//is a vertex. otherwise use the defaults.
@ -376,13 +380,13 @@ public:
vtkmdiy::save(bb, cs.GetName());
vtkmdiy::save(bb, cs.GetNumberOfPoints());
vtkmdiy::save(
bb, cs.GetShapesArray(vtkm::TopologyElementTagPoint{}, vtkm::TopologyElementTagCell{}));
bb, cs.GetShapesArray(vtkm::TopologyElementTagCell{}, vtkm::TopologyElementTagPoint{}));
vtkmdiy::save(
bb, cs.GetNumIndicesArray(vtkm::TopologyElementTagPoint{}, vtkm::TopologyElementTagCell{}));
bb, cs.GetNumIndicesArray(vtkm::TopologyElementTagCell{}, vtkm::TopologyElementTagPoint{}));
vtkmdiy::save(
bb, cs.GetConnectivityArray(vtkm::TopologyElementTagPoint{}, vtkm::TopologyElementTagCell{}));
bb, cs.GetConnectivityArray(vtkm::TopologyElementTagCell{}, vtkm::TopologyElementTagPoint{}));
vtkmdiy::save(
bb, cs.GetIndexOffsetArray(vtkm::TopologyElementTagPoint{}, vtkm::TopologyElementTagCell{}));
bb, cs.GetIndexOffsetArray(vtkm::TopologyElementTagCell{}, vtkm::TopologyElementTagPoint{}));
}
static VTKM_CONT void load(BinaryBuffer& bb, Type& cs)

@ -104,10 +104,10 @@ void CellSetExplicit<ShapeStorageTag,
OffsetsStorageTag>::PrintSummary(std::ostream& out) const
{
out << " ExplicitCellSet: " << this->Name << std::endl;
out << " PointToCell: " << std::endl;
this->Data->PointToCell.PrintSummary(out);
out << " CellToPoint: " << std::endl;
this->Data->CellToPoint.PrintSummary(out);
out << " VisitCellsWithPoints: " << std::endl;
this->Data->VisitCellsWithPoints.PrintSummary(out);
out << " VisitPointsWithCells: " << std::endl;
this->Data->VisitPointsWithCells.PrintSummary(out);
}
template <typename ShapeStorageTag,
@ -119,8 +119,8 @@ void CellSetExplicit<ShapeStorageTag,
ConnectivityStorageTag,
OffsetStorageTag>::ReleaseResourcesExecution()
{
this->Data->PointToCell.ReleaseResourcesExecution();
this->Data->CellToPoint.ReleaseResourcesExecution();
this->Data->VisitCellsWithPoints.ReleaseResourcesExecution();
this->Data->VisitPointsWithCells.ReleaseResourcesExecution();
}
//----------------------------------------------------------------------------
@ -134,7 +134,7 @@ vtkm::Id CellSetExplicit<ShapeStorageTag,
ConnectivityStorageTag,
OffsetsStorageTag>::GetNumberOfCells() const
{
return this->Data->PointToCell.GetNumberOfElements();
return this->Data->VisitCellsWithPoints.GetNumberOfElements();
}
template <typename ShapeStorageTag,
@ -224,7 +224,7 @@ VTKM_CONT vtkm::IdComponent
CellSetExplicit<ShapeStorageTag, NumIndicesStorageTag, ConnectivityStorageTag, OffsetsStorageTag>::
GetNumberOfPointsInCell(vtkm::Id cellIndex) const
{
return this->Data->PointToCell.NumIndices.GetPortalConstControl().Get(cellIndex);
return this->Data->VisitCellsWithPoints.NumIndices.GetPortalConstControl().Get(cellIndex);
}
template <typename ShapeStorageTag,
@ -236,7 +236,7 @@ VTKM_CONT vtkm::UInt8 CellSetExplicit<ShapeStorageTag,
ConnectivityStorageTag,
OffsetsStorageTag>::GetCellShape(vtkm::Id cellIndex) const
{
return this->Data->PointToCell.Shapes.GetPortalConstControl().Get(cellIndex);
return this->Data->VisitCellsWithPoints.Shapes.GetPortalConstControl().Get(cellIndex);
}
template <typename ShapeStorageTag,
@ -248,12 +248,12 @@ VTKM_CONT void
CellSetExplicit<ShapeStorageTag, NumIndicesStorageTag, ConnectivityStorageTag, OffsetsStorageTag>::
GetIndices(vtkm::Id index, vtkm::Vec<vtkm::Id, ItemTupleLength>& ids) const
{
this->Data->PointToCell.BuildIndexOffsets(vtkm::cont::DeviceAdapterTagAny{});
this->Data->VisitCellsWithPoints.BuildIndexOffsets(vtkm::cont::DeviceAdapterTagAny{});
vtkm::IdComponent numIndices = this->GetNumberOfPointsInCell(index);
vtkm::Id start = this->Data->PointToCell.IndexOffsets.GetPortalConstControl().Get(index);
vtkm::Id start = this->Data->VisitCellsWithPoints.IndexOffsets.GetPortalConstControl().Get(index);
for (vtkm::IdComponent i = 0; i < numIndices && i < ItemTupleLength; i++)
{
ids[i] = this->Data->PointToCell.Connectivity.GetPortalConstControl().Get(start + i);
ids[i] = this->Data->VisitCellsWithPoints.Connectivity.GetPortalConstControl().Get(start + i);
}
}
@ -265,15 +265,17 @@ VTKM_CONT void
CellSetExplicit<ShapeStorageTag, NumIndicesStorageTag, ConnectivityStorageTag, OffsetsStorageTag>::
GetIndices(vtkm::Id index, vtkm::cont::ArrayHandle<vtkm::Id>& ids) const
{
this->Data->PointToCell.BuildIndexOffsets(vtkm::cont::DeviceAdapterTagAny{});
this->Data->VisitCellsWithPoints.BuildIndexOffsets(vtkm::cont::DeviceAdapterTagAny{});
vtkm::IdComponent numIndices = this->GetNumberOfPointsInCell(index);
ids.Allocate(numIndices);
vtkm::Id start = this->Data->PointToCell.IndexOffsets.GetPortalConstControl().Get(index);
vtkm::Id start = this->Data->VisitCellsWithPoints.IndexOffsets.GetPortalConstControl().Get(index);
vtkm::cont::ArrayHandle<vtkm::Id>::PortalControl idPortal = ids.GetPortalControl();
auto PtCellPortal = this->Data->PointToCell.Connectivity.GetPortalConstControl();
auto PtCellPortal = this->Data->VisitCellsWithPoints.Connectivity.GetPortalConstControl();
for (vtkm::IdComponent i = 0; i < numIndices && i < numIndices; i++)
{
idPortal.Set(i, PtCellPortal.Get(start + i));
}
}
//----------------------------------------------------------------------------
@ -288,10 +290,10 @@ VTKM_CONT void CellSetExplicit<ShapeStorageTag,
OffsetsStorageTag>::PrepareToAddCells(vtkm::Id numCells,
vtkm::Id connectivityMaxLen)
{
this->Data->PointToCell.Shapes.Allocate(numCells);
this->Data->PointToCell.NumIndices.Allocate(numCells);
this->Data->PointToCell.Connectivity.Allocate(connectivityMaxLen);
this->Data->PointToCell.IndexOffsets.Allocate(numCells);
this->Data->VisitCellsWithPoints.Shapes.Allocate(numCells);
this->Data->VisitCellsWithPoints.NumIndices.Allocate(numCells);
this->Data->VisitCellsWithPoints.Connectivity.Allocate(connectivityMaxLen);
this->Data->VisitCellsWithPoints.IndexOffsets.Allocate(numCells);
this->Data->NumberOfCellsAdded = 0;
this->Data->ConnectivityAdded = 0;
}
@ -314,27 +316,28 @@ CellSetExplicit<ShapeStorageTag, NumIndicesStorageTag, ConnectivityStorageTag, O
throw vtkm::cont::ErrorBadValue("Not enough indices given to CellSetSingleType::AddCell.");
}
if (this->Data->NumberOfCellsAdded >= this->Data->PointToCell.Shapes.GetNumberOfValues())
if (this->Data->NumberOfCellsAdded >= this->Data->VisitCellsWithPoints.Shapes.GetNumberOfValues())
{
throw vtkm::cont::ErrorBadValue("Added more cells then expected.");
}
if (this->Data->ConnectivityAdded + numVertices >
this->Data->PointToCell.Connectivity.GetNumberOfValues())
this->Data->VisitCellsWithPoints.Connectivity.GetNumberOfValues())
{
throw vtkm::cont::ErrorBadValue(
"Connectivity increased passed estimated maximum connectivity.");
}
this->Data->PointToCell.Shapes.GetPortalControl().Set(this->Data->NumberOfCellsAdded, cellType);
this->Data->PointToCell.NumIndices.GetPortalControl().Set(this->Data->NumberOfCellsAdded,
numVertices);
this->Data->VisitCellsWithPoints.Shapes.GetPortalControl().Set(this->Data->NumberOfCellsAdded,
cellType);
this->Data->VisitCellsWithPoints.NumIndices.GetPortalControl().Set(this->Data->NumberOfCellsAdded,
numVertices);
for (vtkm::IdComponent iVec = 0; iVec < numVertices; ++iVec)
{
this->Data->PointToCell.Connectivity.GetPortalControl().Set(
this->Data->VisitCellsWithPoints.Connectivity.GetPortalControl().Set(
this->Data->ConnectivityAdded + iVec, Traits::GetComponent(ids, iVec));
}
this->Data->PointToCell.IndexOffsets.GetPortalControl().Set(this->Data->NumberOfCellsAdded,
this->Data->ConnectivityAdded);
this->Data->VisitCellsWithPoints.IndexOffsets.GetPortalControl().Set(
this->Data->NumberOfCellsAdded, this->Data->ConnectivityAdded);
this->Data->NumberOfCellsAdded++;
this->Data->ConnectivityAdded += numVertices;
}
@ -349,9 +352,9 @@ VTKM_CONT void CellSetExplicit<ShapeStorageTag,
OffsetsStorageTag>::CompleteAddingCells(vtkm::Id numPoints)
{
this->Data->NumberOfPoints = numPoints;
this->Data->PointToCell.Connectivity.Shrink(this->Data->ConnectivityAdded);
this->Data->PointToCell.ElementsValid = true;
this->Data->PointToCell.IndexOffsetsValid = true;
this->Data->VisitCellsWithPoints.Connectivity.Shrink(this->Data->ConnectivityAdded);
this->Data->VisitCellsWithPoints.ElementsValid = true;
this->Data->VisitCellsWithPoints.IndexOffsetsValid = true;
if (this->Data->NumberOfCellsAdded != this->GetNumberOfCells())
{
@ -377,20 +380,20 @@ CellSetExplicit<ShapeStorageTag, NumIndicesStorageTag, ConnectivityStorageTag, O
const vtkm::cont::ArrayHandle<vtkm::Id, OffsetsStorageTag>& offsets)
{
this->Data->NumberOfPoints = numPoints;
this->Data->PointToCell.Shapes = cellTypes;
this->Data->PointToCell.NumIndices = numIndices;
this->Data->PointToCell.Connectivity = connectivity;
this->Data->VisitCellsWithPoints.Shapes = cellTypes;
this->Data->VisitCellsWithPoints.NumIndices = numIndices;
this->Data->VisitCellsWithPoints.Connectivity = connectivity;
this->Data->PointToCell.ElementsValid = true;
this->Data->VisitCellsWithPoints.ElementsValid = true;
if (offsets.GetNumberOfValues() == cellTypes.GetNumberOfValues())
{
this->Data->PointToCell.IndexOffsets = offsets;
this->Data->PointToCell.IndexOffsetsValid = true;
this->Data->VisitCellsWithPoints.IndexOffsets = offsets;
this->Data->VisitCellsWithPoints.IndexOffsetsValid = true;
}
else
{
this->Data->PointToCell.IndexOffsetsValid = false;
this->Data->VisitCellsWithPoints.IndexOffsetsValid = false;
if (offsets.GetNumberOfValues() != 0)
{
throw vtkm::cont::ErrorBadValue("Explicit cell offsets array unexpected size. "
@ -398,7 +401,7 @@ CellSetExplicit<ShapeStorageTag, NumIndicesStorageTag, ConnectivityStorageTag, O
}
}
this->ResetConnectivity(TopologyElementTagCell{}, TopologyElementTagPoint{});
this->ResetConnectivity(TopologyElementTagPoint{}, TopologyElementTagCell{});
}
//----------------------------------------------------------------------------
@ -407,19 +410,22 @@ template <typename ShapeStorageTag,
typename NumIndicesStorageTag,
typename ConnectivityStorageTag,
typename OffsetsStorageTag>
template <typename Device, typename FromTopology, typename ToTopology>
template <typename Device, typename VisitTopology, typename IncidentTopology>
auto CellSetExplicit<ShapeStorageTag,
NumIndicesStorageTag,
ConnectivityStorageTag,
OffsetsStorageTag>::PrepareForInput(Device, FromTopology, ToTopology) const ->
typename ExecutionTypes<Device, FromTopology, ToTopology>::ExecObjectType
OffsetsStorageTag>::PrepareForInput(Device,
VisitTopology,
IncidentTopology) const ->
typename ExecutionTypes<Device, VisitTopology, IncidentTopology>::ExecObjectType
{
this->BuildConnectivity(Device{}, FromTopology(), ToTopology());
this->BuildConnectivity(Device{}, VisitTopology(), IncidentTopology());
const auto& connectivity = this->GetConnectivity(FromTopology(), ToTopology());
const auto& connectivity = this->GetConnectivity(VisitTopology(), IncidentTopology());
VTKM_ASSERT(connectivity.ElementsValid);
using ExecObjType = typename ExecutionTypes<Device, FromTopology, ToTopology>::ExecObjectType;
using ExecObjType =
typename ExecutionTypes<Device, VisitTopology, IncidentTopology>::ExecObjectType;
return ExecObjType(connectivity.Shapes.PrepareForInput(Device()),
connectivity.NumIndices.PrepareForInput(Device()),
connectivity.Connectivity.PrepareForInput(Device()),
@ -432,63 +438,64 @@ template <typename ShapeStorageTag,
typename NumIndicesStorageTag,
typename ConnectivityStorageTag,
typename OffsetsStorageTag>
template <typename FromTopology, typename ToTopology>
template <typename VisitTopology, typename IncidentTopology>
VTKM_CONT auto CellSetExplicit<ShapeStorageTag,
NumIndicesStorageTag,
ConnectivityStorageTag,
OffsetsStorageTag>::GetShapesArray(FromTopology, ToTopology) const
-> const typename ConnectivityChooser<FromTopology, ToTopology>::ShapeArrayType&
OffsetsStorageTag>::GetShapesArray(VisitTopology,
IncidentTopology) const -> const
typename ConnectivityChooser<VisitTopology, IncidentTopology>::ShapeArrayType&
{
this->BuildConnectivity(vtkm::cont::DeviceAdapterTagAny{}, FromTopology(), ToTopology());
return this->GetConnectivity(FromTopology(), ToTopology()).Shapes;
this->BuildConnectivity(vtkm::cont::DeviceAdapterTagAny{}, VisitTopology(), IncidentTopology());
return this->GetConnectivity(VisitTopology(), IncidentTopology()).Shapes;
}
template <typename ShapeStorageTag,
typename NumIndicesStorageTag,
typename ConnectivityStorageTag,
typename OffsetsStorageTag>
template <typename FromTopology, typename ToTopology>
template <typename VisitTopology, typename IncidentTopology>
VTKM_CONT auto CellSetExplicit<ShapeStorageTag,
NumIndicesStorageTag,
ConnectivityStorageTag,
OffsetsStorageTag>::GetNumIndicesArray(FromTopology,
ToTopology) const -> const
typename ConnectivityChooser<FromTopology, ToTopology>::NumIndicesArrayType&
OffsetsStorageTag>::GetNumIndicesArray(VisitTopology,
IncidentTopology) const
-> const typename ConnectivityChooser<VisitTopology, IncidentTopology>::NumIndicesArrayType&
{
this->BuildConnectivity(vtkm::cont::DeviceAdapterTagAny{}, FromTopology(), ToTopology());
return this->GetConnectivity(FromTopology(), ToTopology()).NumIndices;
this->BuildConnectivity(vtkm::cont::DeviceAdapterTagAny{}, VisitTopology(), IncidentTopology());
return this->GetConnectivity(VisitTopology(), IncidentTopology()).NumIndices;
}
template <typename ShapeStorageTag,
typename NumIndicesStorageTag,
typename ConnectivityStorageTag,
typename OffsetsStorageTag>
template <typename FromTopology, typename ToTopology>
template <typename VisitTopology, typename IncidentTopology>
VTKM_CONT auto CellSetExplicit<ShapeStorageTag,
NumIndicesStorageTag,
ConnectivityStorageTag,
OffsetsStorageTag>::GetConnectivityArray(FromTopology,
ToTopology) const -> const
typename ConnectivityChooser<FromTopology, ToTopology>::ConnectivityArrayType&
OffsetsStorageTag>::GetConnectivityArray(VisitTopology,
IncidentTopology) const
-> const typename ConnectivityChooser<VisitTopology, IncidentTopology>::ConnectivityArrayType&
{
this->BuildConnectivity(vtkm::cont::DeviceAdapterTagAny{}, FromTopology(), ToTopology());
return this->GetConnectivity(FromTopology(), ToTopology()).Connectivity;
this->BuildConnectivity(vtkm::cont::DeviceAdapterTagAny{}, VisitTopology(), IncidentTopology());
return this->GetConnectivity(VisitTopology(), IncidentTopology()).Connectivity;
}
template <typename ShapeStorageTag,
typename NumIndicesStorageTag,
typename ConnectivityStorageTag,
typename OffsetsStorageTag>
template <typename FromTopology, typename ToTopology>
template <typename VisitTopology, typename IncidentTopology>
VTKM_CONT auto CellSetExplicit<ShapeStorageTag,
NumIndicesStorageTag,
ConnectivityStorageTag,
OffsetsStorageTag>::GetIndexOffsetArray(FromTopology,
ToTopology) const -> const
typename ConnectivityChooser<FromTopology, ToTopology>::IndexOffsetArrayType&
OffsetsStorageTag>::GetIndexOffsetArray(VisitTopology,
IncidentTopology) const
-> const typename ConnectivityChooser<VisitTopology, IncidentTopology>::IndexOffsetArrayType&
{
this->BuildConnectivity(vtkm::cont::DeviceAdapterTagAny{}, FromTopology(), ToTopology());
return this->GetConnectivity(FromTopology(), ToTopology()).IndexOffsets;
this->BuildConnectivity(vtkm::cont::DeviceAdapterTagAny{}, VisitTopology(), IncidentTopology());
return this->GetConnectivity(VisitTopology(), IncidentTopology()).IndexOffsets;
}
//----------------------------------------------------------------------------
@ -521,13 +528,13 @@ void CellSetExplicit<ShapeStorageTag,
}
// TODO: implement actual deep-copy of the arrays
auto pt = vtkm::TopologyElementTagPoint{};
auto ct = vtkm::TopologyElementTagCell{};
auto pt = vtkm::TopologyElementTagPoint{};
this->Fill(other->GetNumberOfPoints(),
other->GetShapesArray(pt, ct),
other->GetNumIndicesArray(pt, ct),
other->GetConnectivityArray(pt, ct),
other->GetIndexOffsetArray(pt, ct));
other->GetShapesArray(ct, pt),
other->GetNumIndicesArray(ct, pt),
other->GetConnectivityArray(ct, pt),
other->GetIndexOffsetArray(ct, pt));
}
//----------------------------------------------------------------------------
@ -535,32 +542,33 @@ void CellSetExplicit<ShapeStorageTag,
namespace detail
{
template <typename PointToCellConnectivity>
struct BuildPointToCellConnectivityFunctor
template <typename VisitCellsWithPointsConnectivity>
struct BuildVisitCellsWithPointsConnectivityFunctor
{
explicit BuildPointToCellConnectivityFunctor(PointToCellConnectivity& pointToCell)
: PointToCell(&pointToCell)
explicit BuildVisitCellsWithPointsConnectivityFunctor(VisitCellsWithPointsConnectivity& obj)
: VisitCellsWithPoints(&obj)
{
}
template <typename Device>
bool operator()(Device) const
{
this->PointToCell->BuildIndexOffsets(Device());
this->VisitCellsWithPoints->BuildIndexOffsets(Device());
return true;
}
PointToCellConnectivity* PointToCell;
VisitCellsWithPointsConnectivity* VisitCellsWithPoints;
};
template <typename PointToCellConnectivity, typename CellToPointConnectivity>
struct BuildCellToPointConnectivityFunctor
template <typename VisitCellsWithPointsConnectivity, typename VisitPointsWithCellsConnectivity>
struct BuildVisitPointsWithCellsConnectivityFunctor
{
BuildCellToPointConnectivityFunctor(PointToCellConnectivity& pointToCell,
CellToPointConnectivity& cellToPoint,
vtkm::Id numberOfPoints)
: PointToCell(&pointToCell)
, CellToPoint(&cellToPoint)
BuildVisitPointsWithCellsConnectivityFunctor(
VisitCellsWithPointsConnectivity& visitCellsWithPoints,
VisitPointsWithCellsConnectivity& visitPointsWithCells,
vtkm::Id numberOfPoints)
: VisitCellsWithPoints(&visitCellsWithPoints)
, VisitPointsWithCells(&visitPointsWithCells)
, NumberOfPoints(numberOfPoints)
{
}
@ -568,15 +576,15 @@ struct BuildCellToPointConnectivityFunctor
template <typename Device>
bool operator()(Device) const
{
this->PointToCell->BuildIndexOffsets(Device());
internal::ComputeCellToPointConnectivity(
*this->CellToPoint, *this->PointToCell, this->NumberOfPoints, Device());
this->CellToPoint->BuildIndexOffsets(Device());
this->VisitCellsWithPoints->BuildIndexOffsets(Device());
internal::ComputeVisitPointsWithCellsConnectivity(
*this->VisitPointsWithCells, *this->VisitCellsWithPoints, this->NumberOfPoints, Device());
this->VisitPointsWithCells->BuildIndexOffsets(Device());
return true;
}
PointToCellConnectivity* PointToCell;
CellToPointConnectivity* CellToPoint;
VisitCellsWithPointsConnectivity* VisitCellsWithPoints;
VisitPointsWithCellsConnectivity* VisitPointsWithCells;
vtkm::Id NumberOfPoints;
};
@ -589,19 +597,20 @@ template <typename ShapeStorageTag,
VTKM_CONT void
CellSetExplicit<ShapeStorageTag, NumIndicesStorageTag, ConnectivityStorageTag, OffsetsStorageTag>::
BuildConnectivity(vtkm::cont::DeviceAdapterId device,
vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell) const
vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint) const
{
using PointToCellConnectivity =
typename ConnectivityChooser<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell>::ConnectivityType;
using VisitCellsWithPointsConnectivity =
typename ConnectivityChooser<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint>::ConnectivityType;
VTKM_ASSERT(this->Data->PointToCell.ElementsValid);
if (!this->Data->PointToCell.IndexOffsetsValid)
VTKM_ASSERT(this->Data->VisitCellsWithPoints.ElementsValid);
if (!this->Data->VisitCellsWithPoints.IndexOffsetsValid)
{
auto self = const_cast<Thisclass*>(this);
auto functor =
detail::BuildPointToCellConnectivityFunctor<PointToCellConnectivity>(self->Data->PointToCell);
detail::BuildVisitCellsWithPointsConnectivityFunctor<VisitCellsWithPointsConnectivity>(
self->Data->VisitCellsWithPoints);
if (!vtkm::cont::TryExecuteOnDevice(device, functor))
{
throw vtkm::cont::ErrorExecution("Failed to run BuildConnectivity.");
@ -616,22 +625,26 @@ template <typename ShapeStorageTag,
VTKM_CONT void
CellSetExplicit<ShapeStorageTag, NumIndicesStorageTag, ConnectivityStorageTag, OffsetsStorageTag>::
BuildConnectivity(vtkm::cont::DeviceAdapterId device,
vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint) const
vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell) const
{
using PointToCellConnectivity =
typename ConnectivityChooser<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell>::ConnectivityType;
using CellToPointConnectivity =
using VisitCellsWithPointsConnectivity =
typename ConnectivityChooser<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint>::ConnectivityType;
using VisitPointsWithCellsConnectivity =
typename ConnectivityChooser<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell>::ConnectivityType;
if (!this->Data->CellToPoint.ElementsValid || !this->Data->CellToPoint.IndexOffsetsValid)
if (!this->Data->VisitPointsWithCells.ElementsValid ||
!this->Data->VisitPointsWithCells.IndexOffsetsValid)
{
auto self = const_cast<Thisclass*>(this);
auto functor =
detail::BuildCellToPointConnectivityFunctor<PointToCellConnectivity, CellToPointConnectivity>(
self->Data->PointToCell, self->Data->CellToPoint, this->Data->NumberOfPoints);
detail::BuildVisitPointsWithCellsConnectivityFunctor<VisitCellsWithPointsConnectivity,
VisitPointsWithCellsConnectivity>(
self->Data->VisitCellsWithPoints,
self->Data->VisitPointsWithCells,
this->Data->NumberOfPoints);
if (!vtkm::cont::TryExecuteOnDevice(device, functor))
{
throw vtkm::cont::ErrorExecution("Failed to run BuildConnectivity.");

@ -95,8 +95,8 @@ vtkm::IdComponent CellSetExtrude::GetNumberOfPointsInCell(vtkm::Id) const
void CellSetExtrude::GetCellPointIds(vtkm::Id id, vtkm::Id* ptids) const
{
auto conn = this->PrepareForInput(vtkm::cont::DeviceAdapterTagSerial{},
vtkm::TopologyElementTagPoint{},
vtkm::TopologyElementTagCell{});
vtkm::TopologyElementTagCell{},
vtkm::TopologyElementTagPoint{});
auto indices = conn.GetIndices(id);
for (int i = 0; i < 6; ++i)
{

@ -68,30 +68,30 @@ public:
template <typename DeviceAdapter>
using ConnectivityC2P = vtkm::exec::ReverseConnectivityExtrude<DeviceAdapter>;
template <typename DeviceAdapter, typename FromTopology, typename ToTopology>
template <typename DeviceAdapter, typename VisitTopology, typename IncidentTopology>
struct ExecutionTypes;
template <typename DeviceAdapter>
struct ExecutionTypes<DeviceAdapter, vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell>
struct ExecutionTypes<DeviceAdapter, vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint>
{
using ExecObjectType = ConnectivityP2C<DeviceAdapter>;
};
template <typename DeviceAdapter>
struct ExecutionTypes<DeviceAdapter, vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint>
struct ExecutionTypes<DeviceAdapter, vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell>
{
using ExecObjectType = ConnectivityC2P<DeviceAdapter>;
};
template <typename Device>
ConnectivityP2C<Device> PrepareForInput(Device,
vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell) const;
vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint) const;
template <typename Device>
ConnectivityC2P<Device> PrepareForInput(Device,
vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint) const;
vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell) const;
private:
template <typename Device>

@ -87,8 +87,8 @@ VTKM_CONT void CellSetExtrude::BuildReverseConnectivity(Device)
template <typename Device>
CellSetExtrude::ConnectivityP2C<Device> CellSetExtrude::PrepareForInput(
Device,
vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell) const
vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint) const
{
return ConnectivityP2C<Device>(this->Connectivity.PrepareForInput(Device{}),
this->NextNode.PrepareForInput(Device{}),
@ -102,8 +102,8 @@ CellSetExtrude::ConnectivityP2C<Device> CellSetExtrude::PrepareForInput(
template <typename Device>
VTKM_CONT CellSetExtrude::ConnectivityC2P<Device> CellSetExtrude::PrepareForInput(
Device,
vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint) const
vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell) const
{
if (!this->ReverseConnectivityBuilt)
{

@ -35,10 +35,10 @@ namespace cont
namespace internal
{
class CellSetPermutationPointToCellHelpers
class CellSetPermutationVisitCellsWithPointsHelpers
{
public:
struct WriteNumIndices : public vtkm::worklet::WorkletMapPointToCell
struct WriteNumIndices : public vtkm::worklet::WorkletVisitCellsWithPoints
{
using ControlSignature = void(CellSetIn cellset, FieldOutCell numIndices);
using ExecutionSignature = void(PointCount, _2);
@ -50,7 +50,7 @@ public:
}
};
struct WriteConnectivity : public vtkm::worklet::WorkletMapPointToCell
struct WriteConnectivity : public vtkm::worklet::WorkletVisitCellsWithPoints
{
using ControlSignature = void(CellSetIn cellset, FieldOutCell connectivity);
using ExecutionSignature = void(PointCount, PointIndices, _2);
@ -112,7 +112,7 @@ public:
// default for CellSetPermutations of any cell type
template <typename CellSetPermutationType>
class CellSetPermutationPointToCell
class CellSetPermutationVisitCellsWithPoints
{
public:
using ConnectivityArrays = vtkm::cont::internal::ConnectivityExplicitInternals<>;
@ -123,10 +123,11 @@ public:
ConnectivityArrays conn;
vtkm::Id connectivityLength = 0;
conn.NumIndices = CellSetPermutationPointToCellHelpers::GetNumIndicesArray(cellset, Device{});
conn.IndexOffsets = CellSetPermutationPointToCellHelpers::GetIndexOffsetsArray(
conn.NumIndices =
CellSetPermutationVisitCellsWithPointsHelpers::GetNumIndicesArray(cellset, Device{});
conn.IndexOffsets = CellSetPermutationVisitCellsWithPointsHelpers::GetIndexOffsetsArray(
conn.NumIndices, connectivityLength, Device{});
conn.Connectivity = CellSetPermutationPointToCellHelpers::GetConnectivityArray(
conn.Connectivity = CellSetPermutationVisitCellsWithPointsHelpers::GetConnectivityArray(
cellset, conn.IndexOffsets, connectivityLength, Device{});
return conn;
@ -135,7 +136,7 @@ public:
// Specialization for CellSetExplicit/CellSetSingleType
template <typename S1, typename S2, typename S3, typename S4, typename PermutationArrayHandleType>
class CellSetPermutationPointToCell<
class CellSetPermutationVisitCellsWithPoints<
CellSetPermutation<CellSetExplicit<S1, S2, S3, S4>, PermutationArrayHandleType>>
{
private:
@ -160,10 +161,10 @@ public:
conn.NumIndices =
NumIndicesArrayType(cellset.GetValidCellIds(),
cellset.GetFullCellSet().GetNumIndicesArray(
vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()));
conn.IndexOffsets = CellSetPermutationPointToCellHelpers::GetIndexOffsetsArray(
vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()));
conn.IndexOffsets = CellSetPermutationVisitCellsWithPointsHelpers::GetIndexOffsetsArray(
conn.NumIndices, connectivityLength, Device{});
conn.Connectivity = CellSetPermutationPointToCellHelpers::GetConnectivityArray(
conn.Connectivity = CellSetPermutationVisitCellsWithPointsHelpers::GetConnectivityArray(
cellset, conn.IndexOffsets, connectivityLength, Device{});
return conn;
@ -172,7 +173,7 @@ public:
// Specialization for CellSetStructured
template <vtkm::IdComponent DIMENSION, typename PermutationArrayHandleType>
class CellSetPermutationPointToCell<
class CellSetPermutationVisitCellsWithPoints<
CellSetPermutation<CellSetStructured<DIMENSION>, PermutationArrayHandleType>>
{
private:
@ -197,7 +198,7 @@ public:
ConnectivityArrays conn;
conn.NumIndices = make_ArrayHandleConstant(numPointsInCell, numberOfCells);
conn.IndexOffsets = ArrayHandleCounting<vtkm::Id>(0, numPointsInCell, numberOfCells);
conn.Connectivity = CellSetPermutationPointToCellHelpers::GetConnectivityArray(
conn.Connectivity = CellSetPermutationVisitCellsWithPointsHelpers::GetConnectivityArray(
cellset, conn.IndexOffsets, connectivityLength, Device{});
return conn;
@ -281,7 +282,7 @@ public:
{
this->ValidCellIds.ReleaseResourcesExecution();
this->FullCellSet.ReleaseResourcesExecution();
this->CellToPoint.ReleaseResourcesExecution();
this->VisitPointsWithCells.ReleaseResourcesExecution();
}
VTKM_CONT
@ -337,11 +338,11 @@ public:
return this->FullCellSet.GetNumberOfPoints();
}
template <typename Device, typename FromTopology, typename ToTopology>
template <typename Device, typename VisitTopology, typename IncidentTopology>
struct ExecutionTypes;
template <typename Device>
struct ExecutionTypes<Device, vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell>
struct ExecutionTypes<Device, vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint>
{
VTKM_IS_DEVICE_ADAPTER_TAG(Device);
@ -349,15 +350,15 @@ public:
typename PermutationArrayHandleType::template ExecutionTypes<Device>::PortalConst;
using OrigExecObjectType = typename OriginalCellSetType::template ExecutionTypes<
Device,
vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell>::ExecObjectType;
vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint>::ExecObjectType;
using ExecObjectType =
vtkm::exec::ConnectivityPermutedPointToCell<ExecPortalType, OrigExecObjectType>;
vtkm::exec::ConnectivityPermutedVisitCellsWithPoints<ExecPortalType, OrigExecObjectType>;
};
template <typename Device>
struct ExecutionTypes<Device, vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint>
struct ExecutionTypes<Device, vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell>
{
VTKM_IS_DEVICE_ADAPTER_TAG(Device);
@ -368,47 +369,48 @@ public:
using IndexOffsetPortalType =
typename vtkm::cont::ArrayHandle<vtkm::Id>::template ExecutionTypes<Device>::PortalConst;
using ExecObjectType = vtkm::exec::ConnectivityPermutedCellToPoint<ConnectiviyPortalType,
NumIndicesPortalType,
IndexOffsetPortalType>;
using ExecObjectType =
vtkm::exec::ConnectivityPermutedVisitPointsWithCells<ConnectiviyPortalType,
NumIndicesPortalType,
IndexOffsetPortalType>;
};
template <typename Device>
VTKM_CONT typename ExecutionTypes<Device,
vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell>::ExecObjectType
vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint>::ExecObjectType
PrepareForInput(Device device,
vtkm::TopologyElementTagPoint from,
vtkm::TopologyElementTagCell to) const
vtkm::TopologyElementTagCell from,
vtkm::TopologyElementTagPoint to) const
{
using ConnectivityType = typename ExecutionTypes<Device,
vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell>::ExecObjectType;
vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint>::ExecObjectType;
return ConnectivityType(this->ValidCellIds.PrepareForInput(device),
this->FullCellSet.PrepareForInput(device, from, to));
}
template <typename Device>
VTKM_CONT typename ExecutionTypes<Device,
vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint>::ExecObjectType
PrepareForInput(Device device, vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint) const
vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell>::ExecObjectType
PrepareForInput(Device device, vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell) const
{
if (!this->CellToPoint.ElementsValid)
if (!this->VisitPointsWithCells.ElementsValid)
{
auto pointToCell =
internal::CellSetPermutationPointToCell<CellSetPermutation>::Get(*this, device);
internal::ComputeCellToPointConnectivity(
this->CellToPoint, pointToCell, this->GetNumberOfPoints(), device);
this->CellToPoint.BuildIndexOffsets(device);
internal::CellSetPermutationVisitCellsWithPoints<CellSetPermutation>::Get(*this, device);
internal::ComputeVisitPointsWithCellsConnectivity(
this->VisitPointsWithCells, pointToCell, this->GetNumberOfPoints(), device);
this->VisitPointsWithCells.BuildIndexOffsets(device);
}
using ConnectivityType = typename ExecutionTypes<Device,
vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint>::ExecObjectType;
return ConnectivityType(this->CellToPoint.Connectivity.PrepareForInput(device),
this->CellToPoint.NumIndices.PrepareForInput(device),
this->CellToPoint.IndexOffsets.PrepareForInput(device));
vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell>::ExecObjectType;
return ConnectivityType(this->VisitPointsWithCells.Connectivity.PrepareForInput(device),
this->VisitPointsWithCells.NumIndices.PrepareForInput(device),
this->VisitPointsWithCells.IndexOffsets.PrepareForInput(device));
}
VTKM_CONT
@ -421,12 +423,12 @@ public:
}
private:
using CellToPointConnectivity = vtkm::cont::internal::ConnectivityExplicitInternals<
using VisitPointsWithCellsConnectivity = vtkm::cont::internal::ConnectivityExplicitInternals<
typename ArrayHandleConstant<vtkm::UInt8>::StorageTag>;
PermutationArrayHandleType ValidCellIds;
OriginalCellSetType FullCellSet;
mutable CellToPointConnectivity CellToPoint;
mutable VisitPointsWithCellsConnectivity VisitPointsWithCells;
};
template <typename CellSetType,

@ -80,7 +80,7 @@ public:
{
this->CellShapeAsId = vtkm::CELL_SHAPE_EMPTY;
this->Data->PointToCell.Connectivity.Allocate(connectivityMaxLen);
this->Data->VisitCellsWithPoints.Connectivity.Allocate(connectivityMaxLen);
this->Data->NumberOfCellsAdded = 0;
this->Data->ConnectivityAdded = 0;
@ -101,7 +101,7 @@ public:
}
if (this->Data->ConnectivityAdded + numVertices >
this->Data->PointToCell.Connectivity.GetNumberOfValues())
this->Data->VisitCellsWithPoints.Connectivity.GetNumberOfValues())
{
throw vtkm::cont::ErrorBadValue(
"Connectivity increased passed estimated maximum connectivity.");
@ -131,7 +131,7 @@ public:
}
for (vtkm::IdComponent iVert = 0; iVert < numVertices; ++iVert)
{
this->Data->PointToCell.Connectivity.GetPortalControl().Set(
this->Data->VisitCellsWithPoints.Connectivity.GetPortalControl().Set(
this->Data->ConnectivityAdded + iVert, Traits::GetComponent(ids, iVert));
}
this->Data->NumberOfCellsAdded++;
@ -143,19 +143,19 @@ public:
void CompleteAddingCells(vtkm::Id numPoints)
{
this->Data->NumberOfPoints = numPoints;
this->PointToCell.Connectivity.Shrink(this->ConnectivityAdded);
this->VisitCellsWithPoints.Connectivity.Shrink(this->ConnectivityAdded);
vtkm::Id numCells = this->NumberOfCellsAdded;
this->PointToCell.Shapes =
this->VisitCellsWithPoints.Shapes =
vtkm::cont::make_ArrayHandleConstant(this->GetCellShape(0), numCells);
this->PointToCell.NumIndices =
this->VisitCellsWithPoints.NumIndices =
vtkm::cont::make_ArrayHandleConstant(this->NumberOfPointsPerCell, numCells);
this->PointToCell.IndexOffsets = vtkm::cont::make_ArrayHandleCounting(
this->VisitCellsWithPoints.IndexOffsets = vtkm::cont::make_ArrayHandleCounting(
vtkm::Id(0), static_cast<vtkm::Id>(this->NumberOfPointsPerCell), numCells);
this->PointToCell.ElementsValid = true;
this->PointToCell.IndexOffsetsValid = true;
this->VisitCellsWithPoints.ElementsValid = true;
this->VisitCellsWithPoints.IndexOffsetsValid = true;
if (this->ExpectedNumberOfCellsAdded != this->GetNumberOfCells())
{
@ -179,17 +179,18 @@ public:
this->CheckNumberOfPointsPerCell(numberOfPointsPerCell);
const vtkm::Id numCells = connectivity.GetNumberOfValues() / numberOfPointsPerCell;
VTKM_ASSERT((connectivity.GetNumberOfValues() % numberOfPointsPerCell) == 0);
this->Data->PointToCell.Shapes = vtkm::cont::make_ArrayHandleConstant(shapeId, numCells);
this->Data->PointToCell.NumIndices =
this->Data->VisitCellsWithPoints.Shapes =
vtkm::cont::make_ArrayHandleConstant(shapeId, numCells);
this->Data->VisitCellsWithPoints.NumIndices =
vtkm::cont::make_ArrayHandleConstant(numberOfPointsPerCell, numCells);
this->Data->PointToCell.IndexOffsets = vtkm::cont::make_ArrayHandleCounting(
this->Data->VisitCellsWithPoints.IndexOffsets = vtkm::cont::make_ArrayHandleCounting(
vtkm::Id(0), static_cast<vtkm::Id>(numberOfPointsPerCell), numCells);
this->Data->PointToCell.Connectivity = connectivity;
this->Data->VisitCellsWithPoints.Connectivity = connectivity;
this->Data->PointToCell.ElementsValid = true;
this->Data->PointToCell.IndexOffsetsValid = true;
this->Data->VisitCellsWithPoints.ElementsValid = true;
this->Data->VisitCellsWithPoints.IndexOffsetsValid = true;
this->ResetConnectivity(TopologyElementTagCell{}, TopologyElementTagPoint{});
this->ResetConnectivity(TopologyElementTagPoint{}, TopologyElementTagCell{});
}
VTKM_CONT
@ -224,10 +225,10 @@ public:
virtual void PrintSummary(std::ostream& out) const override
{
out << " CellSetSingleType: " << this->Name << " Type " << this->CellShapeAsId << std::endl;
out << " PointToCell: " << std::endl;
this->Data->PointToCell.PrintSummary(out);
out << " CellToPoint: " << std::endl;
this->Data->CellToPoint.PrintSummary(out);
out << " VisitCellsWithPoints: " << std::endl;
this->Data->VisitCellsWithPoints.PrintSummary(out);
out << " VisitPointsWithCells: " << std::endl;
this->Data->VisitPointsWithCells.PrintSummary(out);
}
private:
@ -308,7 +309,7 @@ public:
vtkmdiy::save(bb, cs.GetCellShape(0));
vtkmdiy::save(bb, cs.GetNumberOfPointsInCell(0));
vtkmdiy::save(
bb, cs.GetConnectivityArray(vtkm::TopologyElementTagPoint{}, vtkm::TopologyElementTagCell{}));
bb, cs.GetConnectivityArray(vtkm::TopologyElementTagCell{}, vtkm::TopologyElementTagPoint{}));
}
static VTKM_CONT void load(BinaryBuffer& bb, Type& cs)

@ -115,18 +115,19 @@ public:
template <typename TopologyElement>
SchedulingRangeType GetSchedulingRange(TopologyElement) const;
template <typename DeviceAdapter, typename FromTopology, typename ToTopology>
template <typename DeviceAdapter, typename VisitTopology, typename IncidentTopology>
struct ExecutionTypes
{
VTKM_IS_DEVICE_ADAPTER_TAG(DeviceAdapter);
VTKM_IS_TOPOLOGY_ELEMENT_TAG(FromTopology);
VTKM_IS_TOPOLOGY_ELEMENT_TAG(ToTopology);
using ExecObjectType = vtkm::exec::ConnectivityStructured<FromTopology, ToTopology, Dimension>;
VTKM_IS_TOPOLOGY_ELEMENT_TAG(VisitTopology);
VTKM_IS_TOPOLOGY_ELEMENT_TAG(IncidentTopology);
using ExecObjectType =
vtkm::exec::ConnectivityStructured<VisitTopology, IncidentTopology, Dimension>;
};
template <typename DeviceAdapter, typename FromTopology, typename ToTopology>
typename ExecutionTypes<DeviceAdapter, FromTopology, ToTopology>::ExecObjectType
PrepareForInput(DeviceAdapter, FromTopology, ToTopology) const;
template <typename DeviceAdapter, typename VisitTopology, typename IncidentTopology>
typename ExecutionTypes<DeviceAdapter, VisitTopology, IncidentTopology>::ExecObjectType
PrepareForInput(DeviceAdapter, VisitTopology, IncidentTopology) const;
void PrintSummary(std::ostream& out) const override;

@ -57,13 +57,16 @@ typename CellSetStructured<DIMENSION>::SchedulingRangeType
}
template <vtkm::IdComponent DIMENSION>
template <typename DeviceAdapter, typename FromTopology, typename ToTopology>
typename CellSetStructured<
DIMENSION>::template ExecutionTypes<DeviceAdapter, FromTopology, ToTopology>::ExecObjectType
CellSetStructured<DIMENSION>::PrepareForInput(DeviceAdapter, FromTopology, ToTopology) const
template <typename DeviceAdapter, typename VisitTopology, typename IncidentTopology>
typename CellSetStructured<DIMENSION>::template ExecutionTypes<DeviceAdapter,
VisitTopology,
IncidentTopology>::ExecObjectType
CellSetStructured<DIMENSION>::PrepareForInput(DeviceAdapter,
VisitTopology,
IncidentTopology) const
{
using ConnectivityType =
typename ExecutionTypes<DeviceAdapter, FromTopology, ToTopology>::ExecObjectType;
typename ExecutionTypes<DeviceAdapter, VisitTopology, IncidentTopology>::ExecObjectType;
return ConnectivityType(this->Structure);
}

@ -28,26 +28,29 @@ namespace arg
/// \c TransportTagCellSetIn is a tag used with the \c Transport class to
/// transport topology objects for input data.
///
template <typename FromTopology, typename ToTopology>
template <typename VisitTopology, typename IncidentTopology>
struct TransportTagCellSetIn
{
};
template <typename FromTopology, typename ToTopology, typename ContObjectType, typename Device>
struct Transport<vtkm::cont::arg::TransportTagCellSetIn<FromTopology, ToTopology>,
template <typename VisitTopology,
typename IncidentTopology,
typename ContObjectType,
typename Device>
struct Transport<vtkm::cont::arg::TransportTagCellSetIn<VisitTopology, IncidentTopology>,
ContObjectType,
Device>
{
VTKM_IS_CELL_SET(ContObjectType);
using ExecObjectType = decltype(
std::declval<ContObjectType>().PrepareForInput(Device(), FromTopology(), ToTopology()));
std::declval<ContObjectType>().PrepareForInput(Device(), VisitTopology(), IncidentTopology()));
template <typename InputDomainType>
VTKM_CONT ExecObjectType
operator()(const ContObjectType& object, const InputDomainType&, vtkm::Id, vtkm::Id) const
{
return object.PrepareForInput(Device(), FromTopology(), ToTopology());
return object.PrepareForInput(Device(), VisitTopology(), IncidentTopology());
}
};
}

@ -59,17 +59,16 @@ void TransportWholeCellSetIn(Device)
contObject.AddCell(vtkm::CELL_SHAPE_QUAD, 4, vtkm::make_Vec<vtkm::Id>(2, 1, 3, 4));
contObject.CompleteAddingCells(nVerts);
using FromType = vtkm::TopologyElementTagPoint;
using ToType = vtkm::TopologyElementTagCell;
using IncidentTopology = vtkm::TopologyElementTagPoint;
using VisitTopology = vtkm::TopologyElementTagCell;
using ExecObjectType =
typename vtkm::cont::CellSetExplicit<>::template ExecutionTypes<Device,
FromType,
ToType>::ExecObjectType;
using ExecObjectType = typename vtkm::cont::CellSetExplicit<>::
template ExecutionTypes<Device, VisitTopology, IncidentTopology>::ExecObjectType;
vtkm::cont::arg::Transport<vtkm::cont::arg::TransportTagCellSetIn<FromType, ToType>,
vtkm::cont::CellSetExplicit<>,
Device>
vtkm::cont::arg::Transport<
vtkm::cont::arg::TransportTagCellSetIn<VisitTopology, IncidentTopology>,
vtkm::cont::CellSetExplicit<>,
Device>
transport;
TestKernel<ExecObjectType> kernel;

@ -225,11 +225,11 @@ struct ConnIdxToCellIdCalcSingleType
vtkm::Id operator()(vtkm::Id inIdx) const { return inIdx / this->CellSize; }
};
template <typename PointToCell, typename CellToPoint, typename Device>
void ComputeCellToPointConnectivity(CellToPoint& cell2Point,
const PointToCell& point2Cell,
vtkm::Id numberOfPoints,
Device)
template <typename VisitCellsWithPoints, typename VisitPointsWithCells, typename Device>
void ComputeVisitPointsWithCellsConnectivity(VisitPointsWithCells& cell2Point,
const VisitCellsWithPoints& point2Cell,
vtkm::Id numberOfPoints,
Device)
{
if (cell2Point.ElementsValid)
{
@ -258,7 +258,7 @@ void ComputeCellToPointConnectivity(CellToPoint& cell2Point,
rConnSize,
Device());
// Set the CellToPoint information
// Set the VisitPointsWithCells information
cell2Point.Shapes = vtkm::cont::make_ArrayHandleConstant(
static_cast<vtkm::UInt8>(CELL_SHAPE_VERTEX), numberOfPoints);
cell2Point.ElementsValid = true;
@ -269,10 +269,10 @@ void ComputeCellToPointConnectivity(CellToPoint& cell2Point,
template <typename ShapeStorageTag,
typename ConnectivityStorageTag,
typename IndexOffsetStorageTag,
typename CellToPoint,
typename VisitPointsWithCells,
typename Device>
void ComputeCellToPointConnectivity(
CellToPoint& cell2Point,
void ComputeVisitPointsWithCellsConnectivity(
VisitPointsWithCells& cell2Point,
const ConnectivityExplicitInternals<
ShapeStorageTag,
vtkm::cont::ArrayHandleConstant<vtkm::IdComponent>::StorageTag, // nIndices
@ -309,7 +309,7 @@ void ComputeCellToPointConnectivity(
rConnSize,
Device());
// Set the CellToPoint information
// Set the VisitPointsWithCells information
cell2Point.Shapes = vtkm::cont::make_ArrayHandleConstant(
static_cast<vtkm::UInt8>(CELL_SHAPE_VERTEX), numberOfPoints);
cell2Point.ElementsValid = true;

@ -235,8 +235,8 @@ struct TestEqualCellSet
const vtkm::cont::CellSetExplicit<ShapeST, CountST, ConnectivityST, OffsetST>& cs2,
TestEqualResult& result) const
{
vtkm::TopologyElementTagPoint p2cFrom{};
vtkm::TopologyElementTagCell p2cTo{};
vtkm::TopologyElementTagCell visitTopo{};
vtkm::TopologyElementTagPoint incidentTopo{};
if (cs1.GetName() != cs2.GetName())
{
@ -249,30 +249,30 @@ struct TestEqualCellSet
return;
}
result = test_equal_ArrayHandles(cs1.GetShapesArray(p2cFrom, p2cTo),
cs2.GetShapesArray(p2cFrom, p2cTo));
result = test_equal_ArrayHandles(cs1.GetShapesArray(visitTopo, incidentTopo),
cs2.GetShapesArray(visitTopo, incidentTopo));
if (!result)
{
result.PushMessage("shapes arrays don't match");
return;
}
result = test_equal_ArrayHandles(cs1.GetNumIndicesArray(p2cFrom, p2cTo),
cs2.GetNumIndicesArray(p2cFrom, p2cTo));
result = test_equal_ArrayHandles(cs1.GetNumIndicesArray(visitTopo, incidentTopo),
cs2.GetNumIndicesArray(visitTopo, incidentTopo));
if (!result)
{
result.PushMessage("counts arrays don't match");
return;
}
result = test_equal_ArrayHandles(cs1.GetConnectivityArray(p2cFrom, p2cTo),
cs2.GetConnectivityArray(p2cFrom, p2cTo));
result = test_equal_ArrayHandles(cs1.GetConnectivityArray(visitTopo, incidentTopo),
cs2.GetConnectivityArray(visitTopo, incidentTopo));
if (!result)
{
result.PushMessage("connectivity arrays don't match");
return;
}
result = test_equal_ArrayHandles(cs1.GetIndexOffsetArray(p2cFrom, p2cTo),
cs2.GetIndexOffsetArray(p2cFrom, p2cTo));
result = test_equal_ArrayHandles(cs1.GetIndexOffsetArray(visitTopo, incidentTopo),
cs2.GetIndexOffsetArray(visitTopo, incidentTopo));
if (!result)
{
result.PushMessage("offsets arrays don't match");

@ -37,7 +37,7 @@ using PointType = vtkm::Vec3f;
std::default_random_engine RandomGenerator;
class ParametricToWorldCoordinates : public vtkm::worklet::WorkletMapPointToCell
class ParametricToWorldCoordinates : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellset,

@ -103,11 +103,11 @@ private:
vtkm::Id correctConnectivity[] = { 0, 0, 1, 0, 1, 1, 1 };
vtkm::cont::ArrayHandleConstant<vtkm::UInt8> shapes =
cellset.GetShapesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
cellset.GetShapesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
vtkm::cont::ArrayHandle<vtkm::IdComponent> numIndices =
cellset.GetNumIndicesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
cellset.GetNumIndicesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
vtkm::cont::ArrayHandle<vtkm::Id> conn =
cellset.GetConnectivityArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
cellset.GetConnectivityArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
VTKM_TEST_ASSERT(TestArrayHandle(shapes, correctShapes, numPoints), "Got incorrect shapes");
VTKM_TEST_ASSERT(TestArrayHandle(numIndices, correctNumIndices, numPoints),

@ -104,11 +104,11 @@ private:
//verify that the point to cell connectivity types are correct
vtkm::cont::ArrayHandleConstant<vtkm::UInt8> shapesPointToCell =
cellset.GetShapesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
cellset.GetShapesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
vtkm::cont::ArrayHandleConstant<vtkm::IdComponent> numIndicesPointToCell =
cellset.GetNumIndicesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
cellset.GetNumIndicesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
vtkm::cont::ArrayHandle<vtkm::Id> connPointToCell =
cellset.GetConnectivityArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
cellset.GetConnectivityArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
VTKM_TEST_ASSERT(shapesPointToCell.GetNumberOfValues() == 3, "Wrong number of shapes");
VTKM_TEST_ASSERT(numIndicesPointToCell.GetNumberOfValues() == 3, "Wrong number of indices");
@ -117,11 +117,11 @@ private:
//verify that the cell to point connectivity types are correct
//note the handle storage types differ compared to point to cell
vtkm::cont::ArrayHandleConstant<vtkm::UInt8> shapesCellToPoint =
cellset.GetShapesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
cellset.GetShapesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
vtkm::cont::ArrayHandle<vtkm::IdComponent> numIndicesCellToPoint =
cellset.GetNumIndicesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
cellset.GetNumIndicesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
vtkm::cont::ArrayHandle<vtkm::Id> connCellToPoint =
cellset.GetConnectivityArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
cellset.GetConnectivityArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
VTKM_TEST_ASSERT(shapesCellToPoint.GetNumberOfValues() == 5, "Wrong number of shapes");
VTKM_TEST_ASSERT(numIndicesCellToPoint.GetNumberOfValues() == 5, "Wrong number of indices");

@ -82,7 +82,7 @@ vtkm::cont::DataSet MakeTestDataSetCurvilinear()
}
//-----------------------------------------------------------------------------
class ParametricToWorldCoordinates : public vtkm::worklet::WorkletMapPointToCell
class ParametricToWorldCoordinates : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellset,

@ -65,7 +65,7 @@ vtkm::cont::CellSetExplicit<> MakeTestCellSet2()
return cs;
}
struct WorkletPointToCell : public vtkm::worklet::WorkletMapPointToCell
struct WorkletPointToCell : public vtkm::worklet::WorkletVisitCellsWithPoints
{
using ControlSignature = void(CellSetIn cellset, FieldOutCell numPoints);
using ExecutionSignature = void(PointIndices, _2);
@ -78,7 +78,7 @@ struct WorkletPointToCell : public vtkm::worklet::WorkletMapPointToCell
}
};
struct WorkletCellToPoint : public vtkm::worklet::WorkletMapCellToPoint
struct WorkletCellToPoint : public vtkm::worklet::WorkletVisitPointsWithCells
{
using ControlSignature = void(CellSetIn cellset, FieldOutPoint numCells);
using ExecutionSignature = void(CellIndices, _2);
@ -159,24 +159,24 @@ void TestCellSetExplicit()
std::cout << "\tTesting CellToPoint table caching\n";
cellset = MakeTestCellSet2();
VTKM_TEST_ASSERT(VTKM_PASS_COMMAS(cellset.HasConnectivity(PointTag{}, CellTag{})),
VTKM_TEST_ASSERT(VTKM_PASS_COMMAS(cellset.HasConnectivity(CellTag{}, PointTag{})),
"PointToCell table missing.");
VTKM_TEST_ASSERT(VTKM_PASS_COMMAS(!cellset.HasConnectivity(CellTag{}, PointTag{})),
VTKM_TEST_ASSERT(VTKM_PASS_COMMAS(!cellset.HasConnectivity(PointTag{}, CellTag{})),
"CellToPoint table exists before PrepareForInput.");
// Test a raw PrepareForInput call:
cellset.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial{}, CellTag{}, PointTag{});
cellset.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial{}, PointTag{}, CellTag{});
VTKM_TEST_ASSERT(VTKM_PASS_COMMAS(cellset.HasConnectivity(CellTag{}, PointTag{})),
VTKM_TEST_ASSERT(VTKM_PASS_COMMAS(cellset.HasConnectivity(PointTag{}, CellTag{})),
"CellToPoint table missing after PrepareForInput.");
cellset.ResetConnectivity(CellTag{}, PointTag{});
VTKM_TEST_ASSERT(VTKM_PASS_COMMAS(!cellset.HasConnectivity(CellTag{}, PointTag{})),
cellset.ResetConnectivity(PointTag{}, CellTag{});
VTKM_TEST_ASSERT(VTKM_PASS_COMMAS(!cellset.HasConnectivity(PointTag{}, CellTag{})),
"CellToPoint table exists after resetting.");
// Test a PrepareForInput wrapped inside a dispatch (See #268)
vtkm::worklet::DispatcherMapTopology<WorkletCellToPoint>().Invoke(cellset, result);
VTKM_TEST_ASSERT(VTKM_PASS_COMMAS(cellset.HasConnectivity(CellTag{}, PointTag{})),
VTKM_TEST_ASSERT(VTKM_PASS_COMMAS(cellset.HasConnectivity(PointTag{}, CellTag{})),
"CellToPoint table missing after CellToPoint worklet exec.");
}

@ -25,7 +25,7 @@ std::vector<int> topology = { 0, 2, 1 };
std::vector<int> nextNode = { 0, 1, 2 };
struct CopyTopo : public vtkm::worklet::WorkletMapPointToCell
struct CopyTopo : public vtkm::worklet::WorkletVisitCellsWithPoints
{
typedef void ControlSignature(CellSetIn, FieldOutCell);
typedef _2 ExecutionSignature(CellShape, PointIndices);
@ -36,7 +36,7 @@ struct CopyTopo : public vtkm::worklet::WorkletMapPointToCell
}
};
struct CopyReverseCellCount : public vtkm::worklet::WorkletMapCellToPoint
struct CopyReverseCellCount : public vtkm::worklet::WorkletVisitPointsWithCells
{
typedef void ControlSignature(CellSetIn, FieldOutPoint);
typedef _2 ExecutionSignature(CellShape, CellCount, CellIndices);

@ -20,7 +20,7 @@
namespace
{
struct WorkletPointToCell : public vtkm::worklet::WorkletMapPointToCell
struct WorkletPointToCell : public vtkm::worklet::WorkletVisitCellsWithPoints
{
using ControlSignature = void(CellSetIn cellset, FieldOutCell numPoints);
using ExecutionSignature = void(PointIndices, _2);
@ -33,7 +33,7 @@ struct WorkletPointToCell : public vtkm::worklet::WorkletMapPointToCell
}
};
struct WorkletCellToPoint : public vtkm::worklet::WorkletMapCellToPoint
struct WorkletCellToPoint : public vtkm::worklet::WorkletVisitPointsWithCells
{
using ControlSignature = void(CellSetIn cellset, FieldOutPoint numCells);
using ExecutionSignature = void(CellIndices, _2);
@ -46,7 +46,7 @@ struct WorkletCellToPoint : public vtkm::worklet::WorkletMapCellToPoint
}
};
struct CellsOfPoint : public vtkm::worklet::WorkletMapCellToPoint
struct CellsOfPoint : public vtkm::worklet::WorkletVisitPointsWithCells
{
using ControlSignature = void(CellSetIn cellset, FieldInPoint offset, WholeArrayOut cellIds);
using ExecutionSignature = void(CellIndices, _2, _3);

@ -105,13 +105,13 @@ void TestDataSet_Explicit()
subset.PrintSummary(std::cout);
using ExecObjectType = SubsetType::ExecutionTypes<vtkm::cont::DeviceAdapterTagSerial,
vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell>::ExecObjectType;
vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint>::ExecObjectType;
ExecObjectType execConnectivity;
execConnectivity = subset.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(),
vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell());
vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint());
//run a basic for-each topology algorithm on this
vtkm::cont::ArrayHandle<vtkm::Float32> result;
@ -154,7 +154,7 @@ void TestDataSet_Structured2D()
//verify that PrepareForInput exists
subset.PrepareForInput(
DeviceAdapterTag(), vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
DeviceAdapterTag(), vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
//run a basic for-each topology algorithm on this
vtkm::cont::ArrayHandle<vtkm::Float32> result;
@ -193,8 +193,8 @@ void TestDataSet_Structured3D()
//verify that PrepareForInput exists
subset.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(),
vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell());
vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint());
//run a basic for-each topology algorithm on this
vtkm::cont::ArrayHandle<vtkm::Float32> result;

@ -77,14 +77,14 @@ static void TwoDimRectilinearTest()
VTKM_TEST_ASSERT(shape == vtkm::CELL_SHAPE_QUAD, "Incorrect element type.");
}
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, 2>
pointToCell = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(),
vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell());
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint, 2>
cellToPoint = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(),
pointToCell = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(),
vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint());
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, 2>
cellToPoint = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(),
vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell());
vtkm::Id cells[2][4] = { { 0, 1, 4, 3 }, { 1, 2, 5, 4 } };
for (vtkm::Id cellIndex = 0; cellIndex < 2; cellIndex++)
@ -164,10 +164,10 @@ static void ThreeDimRectilinearTest()
}
//Test regular connectivity.
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, 3>
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint, 3>
pointToCell = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(),
vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell());
vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint());
vtkm::Id expectedPointIds[8] = { 0, 1, 4, 3, 6, 7, 10, 9 };
vtkm::Vec<vtkm::Id, 8> retrievedPointIds = pointToCell.GetIndices(vtkm::Id3(0));
for (vtkm::IdComponent localPointIndex = 0; localPointIndex < 8; localPointIndex++)
@ -176,10 +176,10 @@ static void ThreeDimRectilinearTest()
"Incorrect point ID for cell");
}
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint, 3>
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, 3>
cellToPoint = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(),
vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint());
vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell());
vtkm::Id retrievedCellIds[6] = { 0, -1, -1, -1, -1, -1 };
vtkm::VecVariable<vtkm::Id, 6> expectedCellIds = cellToPoint.GetIndices(vtkm::Id3(0));
VTKM_TEST_ASSERT(expectedCellIds.GetNumberOfComponents() <= 6,

@ -80,14 +80,14 @@ static void TwoDimUniformTest()
VTKM_TEST_ASSERT(shape == vtkm::CELL_SHAPE_QUAD, "Incorrect element type.");
}
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, 2>
pointToCell = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(),
vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell());
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint, 2>
cellToPoint = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(),
pointToCell = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(),
vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint());
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, 2>
cellToPoint = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(),
vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell());
vtkm::Id cells[2][4] = { { 0, 1, 4, 3 }, { 1, 2, 5, 4 } };
for (vtkm::Id cellIndex = 0; cellIndex < 2; cellIndex++)
@ -174,10 +174,10 @@ static void ThreeDimUniformTest()
}
//Test uniform connectivity.
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, 3>
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint, 3>
pointToCell = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(),
vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell());
vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint());
vtkm::Id expectedPointIds[8] = { 0, 1, 4, 3, 6, 7, 10, 9 };
vtkm::Vec<vtkm::Id, 8> retrievedPointIds = pointToCell.GetIndices(vtkm::Id3(0));
for (vtkm::IdComponent localPointIndex = 0; localPointIndex < 8; localPointIndex++)
@ -186,10 +186,10 @@ static void ThreeDimUniformTest()
"Incorrect point ID for cell");
}
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint, 3>
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, 3>
cellToPoint = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(),
vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint());
vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell());
vtkm::Id retrievedCellIds[6] = { 0, -1, -1, -1, -1, -1 };
vtkm::VecVariable<vtkm::Id, 6> expectedCellIds = cellToPoint.GetIndices(vtkm::Id3(0));
VTKM_TEST_ASSERT(expectedCellIds.GetNumberOfComponents() <= 6,

@ -71,7 +71,7 @@ public:
DeviceAdapter)
: Nodes(nodes.PrepareForInput(DeviceAdapter()))
, CellIds(cellIds.PrepareForInput(DeviceAdapter()))
, CellSet(cellSet.PrepareForInput(DeviceAdapter(), FromType(), ToType()))
, CellSet(cellSet.PrepareForInput(DeviceAdapter(), VisitType(), IncidentType()))
, Coords(coords.PrepareForInput(DeviceAdapter()))
{
}
@ -243,13 +243,14 @@ private:
return success && vtkm::exec::CellInside(parametric, cellShape);
}
using FromType = vtkm::TopologyElementTagPoint;
using ToType = vtkm::TopologyElementTagCell;
using VisitType = vtkm::TopologyElementTagCell;
using IncidentType = vtkm::TopologyElementTagPoint;
using NodePortal = typename NodeArrayHandle::template ExecutionTypes<DeviceAdapter>::PortalConst;
using CellIdPortal =
typename CellIdArrayHandle::template ExecutionTypes<DeviceAdapter>::PortalConst;
using CellSetPortal =
typename CellSetType::template ExecutionTypes<DeviceAdapter, FromType, ToType>::ExecObjectType;
using CellSetPortal = typename CellSetType::template ExecutionTypes<DeviceAdapter,
VisitType,
IncidentType>::ExecObjectType;
using CoordsPortal = typename vtkm::cont::ArrayHandleVirtualCoordinates::template ExecutionTypes<
DeviceAdapter>::PortalConst;

@ -32,11 +32,9 @@ template <typename DeviceAdapter>
class VTKM_ALWAYS_EXPORT CellLocatorRectilinearGrid final : public vtkm::exec::CellLocator
{
private:
using FromType = vtkm::TopologyElementTagPoint;
using ToType = vtkm::TopologyElementTagCell;
using CellSetPortal = vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
3>;
using VisitType = vtkm::TopologyElementTagCell;
using IncidentType = vtkm::TopologyElementTagPoint;
using CellSetPortal = vtkm::exec::ConnectivityStructured<VisitType, IncidentType, 3>;
using AxisHandle = vtkm::cont::ArrayHandle<vtkm::FloatDefault>;
using RectilinearType =
vtkm::cont::ArrayHandleCartesianProduct<AxisHandle, AxisHandle, AxisHandle>;
@ -53,7 +51,7 @@ public:
DeviceAdapter)
: PlaneSize(planeSize)
, RowSize(rowSize)
, CellSet(cellSet.PrepareForInput(DeviceAdapter(), FromType(), ToType()))
, CellSet(cellSet.PrepareForInput(DeviceAdapter(), VisitType(), IncidentType()))
, Coords(coords.PrepareForInput(DeviceAdapter()))
, PointDimensions(cellSet.GetPointDimensions())
{

@ -31,11 +31,9 @@ template <typename DeviceAdapter>
class VTKM_ALWAYS_EXPORT CellLocatorUniformGrid final : public vtkm::exec::CellLocator
{
private:
using FromType = vtkm::TopologyElementTagPoint;
using ToType = vtkm::TopologyElementTagCell;
using CellSetPortal = vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
3>;
using VisitType = vtkm::TopologyElementTagCell;
using IncidentType = vtkm::TopologyElementTagPoint;
using CellSetPortal = vtkm::exec::ConnectivityStructured<VisitType, IncidentType, 3>;
using CoordsPortal = typename vtkm::cont::ArrayHandleVirtualCoordinates::template ExecutionTypes<
DeviceAdapter>::PortalConst;
@ -52,7 +50,7 @@ public:
, CellDims(cellDims)
, PlaneSize(cellDims[0] * cellDims[1])
, RowSize(cellDims[0])
, CellSet(cellSet.PrepareForInput(DeviceAdapter(), FromType(), ToType()))
, CellSet(cellSet.PrepareForInput(DeviceAdapter(), VisitType(), IncidentType()))
, Coords(coords.PrepareForInput(DeviceAdapter()))
{
}

@ -22,28 +22,29 @@ namespace exec
{
template <typename PermutationPortal, typename OriginalConnectivity>
class ConnectivityPermutedPointToCell
class ConnectivityPermutedVisitCellsWithPoints
{
public:
using SchedulingRangeType = typename OriginalConnectivity::SchedulingRangeType;
VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT
ConnectivityPermutedPointToCell()
ConnectivityPermutedVisitCellsWithPoints()
: Portal()
, Connectivity()
{
}
VTKM_EXEC_CONT
ConnectivityPermutedPointToCell(const PermutationPortal& portal, const OriginalConnectivity& src)
ConnectivityPermutedVisitCellsWithPoints(const PermutationPortal& portal,
const OriginalConnectivity& src)
: Portal(portal)
, Connectivity(src)
{
}
VTKM_EXEC_CONT
ConnectivityPermutedPointToCell(const ConnectivityPermutedPointToCell& src)
ConnectivityPermutedVisitCellsWithPoints(const ConnectivityPermutedVisitCellsWithPoints& src)
: Portal(src.Portal)
, Connectivity(src.Connectivity)
{
@ -82,18 +83,18 @@ public:
template <typename ConnectivityPortalType,
typename NumIndicesPortalType,
typename IndexOffsetPortalType>
class ConnectivityPermutedCellToPoint
class ConnectivityPermutedVisitPointsWithCells
{
public:
using SchedulingRangeType = vtkm::Id;
using IndicesType = vtkm::VecFromPortal<ConnectivityPortalType>;
using CellShapeTag = vtkm::CellShapeTagVertex;
ConnectivityPermutedCellToPoint() = default;
ConnectivityPermutedVisitPointsWithCells() = default;
ConnectivityPermutedCellToPoint(const ConnectivityPortalType& connectivity,
const NumIndicesPortalType& numIndices,
const IndexOffsetPortalType& indexOffset)
ConnectivityPermutedVisitPointsWithCells(const ConnectivityPortalType& connectivity,
const NumIndicesPortalType& numIndices,
const IndexOffsetPortalType& indexOffset)
: Connectivity(connectivity)
, NumIndices(numIndices)
, IndexOffset(indexOffset)

@ -20,16 +20,16 @@ namespace vtkm
namespace exec
{
template <typename FromTopology, typename ToTopology, vtkm::IdComponent Dimension>
template <typename VisitTopology, typename IncidentTopology, vtkm::IdComponent Dimension>
class ConnectivityStructured
{
VTKM_IS_TOPOLOGY_ELEMENT_TAG(FromTopology);
VTKM_IS_TOPOLOGY_ELEMENT_TAG(ToTopology);
VTKM_IS_TOPOLOGY_ELEMENT_TAG(VisitTopology);
VTKM_IS_TOPOLOGY_ELEMENT_TAG(IncidentTopology);
using InternalsType = vtkm::internal::ConnectivityStructuredInternals<Dimension>;
using Helper =
vtkm::internal::ConnectivityStructuredIndexHelper<FromTopology, ToTopology, Dimension>;
vtkm::internal::ConnectivityStructuredIndexHelper<VisitTopology, IncidentTopology, Dimension>;
public:
using SchedulingRangeType = typename InternalsType::SchedulingRangeType;
@ -53,7 +53,8 @@ public:
}
VTKM_EXEC_CONT
ConnectivityStructured(const ConnectivityStructured<ToTopology, FromTopology, Dimension>& src)
ConnectivityStructured(
const ConnectivityStructured<IncidentTopology, VisitTopology, Dimension>& src)
: Internals(src.Internals)
{
}
@ -115,7 +116,7 @@ public:
return this->Internals.GetGlobalPointIndexStart();
}
friend class ConnectivityStructured<ToTopology, FromTopology, Dimension>;
friend class ConnectivityStructured<IncidentTopology, VisitTopology, Dimension>;
private:
InternalsType Internals;

@ -25,8 +25,8 @@ set(headers
FetchTagCellSetIn.h
FetchTagKeysIn.h
FetchTagWholeCellSetIn.h
FromCount.h
FromIndices.h
IncidentElementCount.h
IncidentElementIndices.h
InputIndex.h
OutputIndex.h
ThreadIndices.h

@ -13,7 +13,7 @@
#include <vtkm/exec/ConnectivityExtrude.h>
#include <vtkm/exec/arg/FetchTagArrayDirectIn.h>
#include <vtkm/exec/arg/FetchTagArrayTopologyMapIn.h>
#include <vtkm/exec/arg/FromIndices.h>
#include <vtkm/exec/arg/IncidentElementIndices.h>
//optimized fetches for ArrayPortalExtrude for
// - 3D Scheduling
@ -28,7 +28,7 @@ namespace arg
//Optimized fetch for point ids when iterating the cells ConnectivityExtrude
template <typename FetchType, typename Device, typename ExecObjectType>
struct Fetch<FetchType,
vtkm::exec::arg::AspectTagFromIndices,
vtkm::exec::arg::AspectTagIncidentElementIndices,
vtkm::exec::arg::ThreadIndicesTopologyMap<vtkm::exec::ConnectivityExtrude<Device>>,
ExecObjectType>
{
@ -42,7 +42,7 @@ struct Fetch<FetchType,
ValueType Load(const ThreadIndicesType& indices, const ExecObjectType&) const
{
// std::cout << "opimized fetch for point ids" << std::endl;
const auto& xgcidx = indices.GetIndicesFrom();
const auto& xgcidx = indices.GetIndicesIncident();
const vtkm::Id offset1 = (xgcidx.Planes[0] * xgcidx.NumberOfPointsPerPlane);
const vtkm::Id offset2 = (xgcidx.Planes[1] * xgcidx.NumberOfPointsPerPlane);
ValueType result;
@ -78,7 +78,7 @@ struct Fetch<vtkm::exec::arg::FetchTagArrayTopologyMapIn,
ValueType Load(const ThreadIndicesType& indices, const PortalType& portal)
{
// std::cout << "opimized fetch for point values" << std::endl;
const auto& xgcidx = indices.GetIndicesFrom();
const auto& xgcidx = indices.GetIndicesIncident();
const vtkm::Id offset1 = (xgcidx.Planes[0] * xgcidx.NumberOfPointsPerPlane);
const vtkm::Id offset2 = (xgcidx.Planes[1] * xgcidx.NumberOfPointsPerPlane);
ValueType result;
@ -115,7 +115,7 @@ struct Fetch<vtkm::exec::arg::FetchTagArrayTopologyMapIn,
ValueType Load(const ThreadIndicesType& indices, const vtkm::exec::ArrayPortalExtrude<T>& points)
{
// std::cout << "opimized fetch for point coordinates" << std::endl;
return points.GetWedge(indices.GetIndicesFrom());
return points.GetWedge(indices.GetIndicesIncident());
}
VTKM_EXEC
@ -144,7 +144,7 @@ struct Fetch<vtkm::exec::arg::FetchTagArrayTopologyMapIn,
const vtkm::exec::ArrayPortalExtrudePlane<T>& portal)
{
// std::cout << "opimized fetch for point coordinates" << std::endl;
return portal.GetWedge(indices.GetIndicesFrom());
return portal.GetWedge(indices.GetIndicesIncident());
}
VTKM_EXEC

@ -56,9 +56,9 @@ struct FetchArrayTopologyMapInImplementation
{
using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesTopologyMap<ConnectivityType>;
// ThreadIndicesTopologyMap has special "from" indices that are stored in a
// Vec-like object.
using IndexVecType = typename ThreadIndicesType::IndicesFromType;
// ThreadIndicesTopologyMap has special incident element indices that are
// stored in a Vec-like object.
using IndexVecType = typename ThreadIndicesType::IndicesIncidentType;
// The FieldExecObjectType is expected to behave like an ArrayPortal.
using PortalType = FieldExecObjectType;
@ -73,7 +73,7 @@ struct FetchArrayTopologyMapInImplementation
// pointer that will stay around during the time the Vec is valid. Thus, we
// should make sure that indices is a reference that goes up the stack at
// least as far as the returned VecFromPortalPermute is used.
return ValueType(indices.GetIndicesFromPointer(), field);
return ValueType(indices.GetIndicesIncidentPointer(), field);
}
VTKM_SUPPRESS_EXEC_WARNINGS
@ -84,7 +84,7 @@ struct FetchArrayTopologyMapInImplementation
// pointer that will stay around during the time the Vec is valid. Thus, we
// should make sure that indices is a reference that goes up the stack at
// least as far as the returned VecFromPortalPermute is used.
return ValueType(indices.GetIndicesFromPointer(), field);
return ValueType(indices.GetIndicesIncidentPointer(), field);
}
};
@ -130,14 +130,14 @@ static inline VTKM_EXEC vtkm::VecAxisAlignedPointCoordinates<3> make_VecAxisAlig
template <vtkm::IdComponent NumDimensions>
struct FetchArrayTopologyMapInImplementation<
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
NumDimensions>,
vtkm::internal::ArrayPortalUniformPointCoordinates>
{
using ConnectivityType = vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
using ConnectivityType = vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
NumDimensions>;
using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesTopologyMap<ConnectivityType>;
@ -157,18 +157,18 @@ struct FetchArrayTopologyMapInImplementation<
template <typename PermutationPortal, vtkm::IdComponent NumDimensions>
struct FetchArrayTopologyMapInImplementation<
vtkm::exec::ConnectivityPermutedPointToCell<
vtkm::exec::ConnectivityPermutedVisitCellsWithPoints<
PermutationPortal,
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
NumDimensions>>,
vtkm::internal::ArrayPortalUniformPointCoordinates>
{
using ConnectivityType = vtkm::exec::ConnectivityPermutedPointToCell<
using ConnectivityType = vtkm::exec::ConnectivityPermutedVisitCellsWithPoints<
PermutationPortal,
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
NumDimensions>>;
using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesTopologyMap<ConnectivityType>;

@ -7,8 +7,8 @@
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//============================================================================
#ifndef vtk_m_exec_arg_FromCount_h
#define vtk_m_exec_arg_FromCount_h
#ifndef vtk_m_exec_arg_IncidentElementCount_h
#define vtk_m_exec_arg_IncidentElementCount_h
#include <vtkm/exec/arg/ExecutionSignatureTagBase.h>
#include <vtkm/exec/arg/Fetch.h>
@ -21,32 +21,32 @@ namespace exec
namespace arg
{
/// \brief Aspect tag to use for getting the from count.
/// \brief Aspect tag to use for getting the incident element count.
///
/// The \c AspectTagFromCount aspect tag causes the \c Fetch class to obtain
/// the number of indices that map to the current topology element.
/// The \c AspectTagIncidentElementCount aspect tag causes the \c Fetch class to
/// obtain the number of indices that map to the current topology element.
///
struct AspectTagFromCount
struct AspectTagIncidentElementCount
{
};
/// \brief The \c ExecutionSignature tag to get the number of from elements.
/// \brief The \c ExecutionSignature tag to get the number of incident elements.
///
/// In a topology map, there are \em from and \em to topology elements
/// specified. The scheduling occurs on the \em to elements, and for each \em
/// to element there is some number of incident \em from elements that are
/// accessible. This \c ExecutionSignature tag provides the number of these \em
/// from elements that are accessible.
/// In a topology map, there are \em visited and \em incident topology elements
/// specified. The scheduling occurs on the \em visited elements, and for each
/// \em visited element there is some number of incident \em incident elements
/// that are accessible. This \c ExecutionSignature tag provides the number of
/// these \em incident elements that are accessible.
///
struct FromCount : vtkm::exec::arg::ExecutionSignatureTagBase
struct IncidentElementCount : vtkm::exec::arg::ExecutionSignatureTagBase
{
static constexpr vtkm::IdComponent INDEX = 1;
using AspectTag = vtkm::exec::arg::AspectTagFromCount;
using AspectTag = vtkm::exec::arg::AspectTagIncidentElementCount;
};
template <typename FetchTag, typename ConnectivityType, typename ExecObjectType>
struct Fetch<FetchTag,
vtkm::exec::arg::AspectTagFromCount,
vtkm::exec::arg::AspectTagIncidentElementCount,
vtkm::exec::arg::ThreadIndicesTopologyMap<ConnectivityType>,
ExecObjectType>
{
@ -58,7 +58,7 @@ struct Fetch<FetchTag,
VTKM_EXEC
ValueType Load(const ThreadIndicesType& indices, const ExecObjectType&) const
{
return indices.GetIndicesFrom().GetNumberOfComponents();
return indices.GetIndicesIncident().GetNumberOfComponents();
}
VTKM_EXEC
@ -71,4 +71,4 @@ struct Fetch<FetchTag,
}
} // namespace vtkm::exec::arg
#endif //vtk_m_exec_arg_FromCount_h
#endif //vtk_m_exec_arg_IncidentElementCount_h

@ -7,8 +7,8 @@
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//============================================================================
#ifndef vtk_m_exec_arg_FromIndices_h
#define vtk_m_exec_arg_FromIndices_h
#ifndef vtk_m_exec_arg_IncidentElementIndices_h
#define vtk_m_exec_arg_IncidentElementIndices_h
#include <vtkm/exec/arg/ExecutionSignatureTagBase.h>
#include <vtkm/exec/arg/Fetch.h>
@ -21,44 +21,45 @@ namespace exec
namespace arg
{
/// \brief Aspect tag to use for getting the from indices.
/// \brief Aspect tag to use for getting the visited indices.
///
/// The \c AspectTagFromIndices aspect tag causes the \c Fetch class to obtain
/// the indices that map to the current topology element.
/// The \c AspectTagIncidentElementIndices aspect tag causes the \c Fetch class
/// to obtain the indices that map to the current topology element.
///
struct AspectTagFromIndices
struct AspectTagIncidentElementIndices
{
};
/// \brief The \c ExecutionSignature tag to get the indices of from elements.
/// \brief The \c ExecutionSignature tag to get the indices of visited elements.
///
/// In a topology map, there are \em from and \em to topology elements
/// specified. The scheduling occurs on the \em to elements, and for each \em
/// to element there is some number of incident \em from elements that are
/// accessible. This \c ExecutionSignature tag provides the indices of these
/// \em from elements that are accessible.
/// In a topology map, there are \em visited and \em incident topology elements
/// specified. The scheduling occurs on the \em visited elements, and for each
/// \em visited element there is some number of incident \em incident elements
/// that are accessible. This \c ExecutionSignature tag provides the indices of
/// the \em incident elements that are incident to the current \em visited
/// element.
///
struct FromIndices : vtkm::exec::arg::ExecutionSignatureTagBase
struct IncidentElementIndices : vtkm::exec::arg::ExecutionSignatureTagBase
{
static constexpr vtkm::IdComponent INDEX = 1;
using AspectTag = vtkm::exec::arg::AspectTagFromIndices;
using AspectTag = vtkm::exec::arg::AspectTagIncidentElementIndices;
};
template <typename FetchTag, typename ConnectivityType, typename ExecObjectType>
struct Fetch<FetchTag,
vtkm::exec::arg::AspectTagFromIndices,
vtkm::exec::arg::AspectTagIncidentElementIndices,
vtkm::exec::arg::ThreadIndicesTopologyMap<ConnectivityType>,
ExecObjectType>
{
using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesTopologyMap<ConnectivityType>;
using ValueType = typename ThreadIndicesType::IndicesFromType;
using ValueType = typename ThreadIndicesType::IndicesIncidentType;
VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC
ValueType Load(const ThreadIndicesType& indices, const ExecObjectType&) const
{
return indices.GetIndicesFrom();
return indices.GetIndicesIncident();
}
VTKM_EXEC
@ -71,4 +72,4 @@ struct Fetch<FetchTag,
}
} // namespace vtkm::exec::arg
#endif //vtk_m_exec_arg_FromIndices_h
#endif //vtk_m_exec_arg_IncidentElementIndices_h

@ -29,7 +29,7 @@ class ThreadIndicesTopologyMap<vtkm::exec::ConnectivityExtrude<Device>>
public:
using CellShapeTag = typename ConnectivityType::CellShapeTag;
using IndicesFromType = typename ConnectivityType::IndicesType;
using IndicesIncidentType = typename ConnectivityType::IndicesType;
using LogicalIndexType = typename ConnectivityType::SchedulingRangeType;
@ -49,7 +49,7 @@ public:
this->OutputIndex = index;
this->VisitIndex = 0;
this->LogicalIndex = logicalIndex;
this->IndicesFrom = connectivity.GetIndices(logicalIndex);
this->IndicesIncident = connectivity.GetIndices(logicalIndex);
//this->CellShape = connectivity.GetCellShape(index);
this->GlobalThreadIndexOffset = globalThreadIndexOffset;
}
@ -70,7 +70,7 @@ public:
this->OutputIndex = index;
this->VisitIndex = 0;
this->LogicalIndex = logicalIndex;
this->IndicesFrom = connectivity.GetIndices(logicalIndex);
this->IndicesIncident = connectivity.GetIndices(logicalIndex);
//this->CellShape = connectivity.GetCellShape(index);
this->GlobalThreadIndexOffset = globalThreadIndexOffset;
}
@ -128,7 +128,7 @@ public:
/// containing the indices to the "from" elements.
///
VTKM_EXEC
const IndicesFromType& GetIndicesFrom() const { return this->IndicesFrom; }
const IndicesIncidentType& GetIndicesIncident() const { return this->IndicesIncident; }
/// \brief The input indices of the "from" elements in pointer form.
///
@ -140,7 +140,7 @@ public:
/// not go out of scope, at which time the returned pointer becomes invalid.
///
VTKM_EXEC
const IndicesFromType* GetIndicesFromPointer() const { return &this->IndicesFrom; }
const IndicesIncidentType* GetIndicesIncidentPointer() const { return &this->IndicesIncident; }
/// \brief The shape of the input cell.
///
@ -158,7 +158,7 @@ private:
vtkm::IdComponent VisitIndex;
vtkm::Id OutputIndex;
LogicalIndexType LogicalIndex;
IndicesFromType IndicesFrom;
IndicesIncidentType IndicesIncident;
//CellShapeTag CellShape;
vtkm::Id GlobalThreadIndexOffset;
};
@ -171,7 +171,7 @@ class ThreadIndicesTopologyMap<vtkm::exec::ReverseConnectivityExtrude<Device>>
public:
using CellShapeTag = typename ConnectivityType::CellShapeTag;
using IndicesFromType = typename ConnectivityType::IndicesType;
using IndicesIncidentType = typename ConnectivityType::IndicesType;
using LogicalIndexType = typename ConnectivityType::SchedulingRangeType;
VTKM_SUPPRESS_EXEC_WARNINGS
@ -191,7 +191,7 @@ public:
this->OutputIndex = index;
this->VisitIndex = 0;
this->LogicalIndex = logicalIndex;
this->IndicesFrom = connectivity.GetIndices(logicalIndex);
this->IndicesIncident = connectivity.GetIndices(logicalIndex);
//this->CellShape = connectivity.GetCellShape(index);
this->GlobalThreadIndexOffset = globalThreadIndexOffset;
}
@ -209,7 +209,7 @@ public:
this->OutputIndex = index;
this->VisitIndex = 0;
this->LogicalIndex = logicalIndex;
this->IndicesFrom = connectivity.GetIndices(logicalIndex);
this->IndicesIncident = connectivity.GetIndices(logicalIndex);
//this->CellShape = connectivity.GetCellShape(index);
this->GlobalThreadIndexOffset = globalThreadIndexOffset;
}
@ -266,7 +266,7 @@ public:
/// containing the indices to the "from" elements.
///
VTKM_EXEC
const IndicesFromType& GetIndicesFrom() const { return this->IndicesFrom; }
const IndicesIncidentType& GetIndicesIncident() const { return this->IndicesIncident; }
/// \brief The input indices of the "from" elements in pointer form.
///
@ -278,7 +278,7 @@ public:
/// not go out of scope, at which time the returned pointer becomes invalid.
///
VTKM_EXEC
const IndicesFromType* GetIndicesFromPointer() const { return &this->IndicesFrom; }
const IndicesIncidentType* GetIndicesIncidentPointer() const { return &this->IndicesIncident; }
/// \brief The shape of the input cell.
///
@ -296,7 +296,7 @@ private:
vtkm::IdComponent VisitIndex;
vtkm::Id OutputIndex;
LogicalIndexType LogicalIndex;
IndicesFromType IndicesFrom;
IndicesIncidentType IndicesIncident;
//CellShapeTag CellShape;
vtkm::Id GlobalThreadIndexOffset;
};

@ -58,15 +58,15 @@ public:
template <vtkm::IdComponent Dimension>
VTKM_EXEC ThreadIndicesPointNeighborhood(
const vtkm::Id3& outIndex,
const vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
const vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
Dimension>& connectivity,
vtkm::Id globalThreadIndexOffset = 0)
: State(outIndex, detail::To3D(connectivity.GetPointDimensions()))
, GlobalThreadIndexOffset(globalThreadIndexOffset)
{
using ConnectivityType = vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
using ConnectivityType = vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
Dimension>;
using ConnRangeType = typename ConnectivityType::SchedulingRangeType;
const ConnRangeType index = detail::Deflate(outIndex, ConnRangeType());
@ -82,8 +82,8 @@ public:
vtkm::Id inputIndex,
vtkm::IdComponent visitIndex,
vtkm::Id outputIndex,
const vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
const vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
Dimension>& connectivity,
vtkm::Id globalThreadIndexOffset = 0)
: State(detail::To3D(connectivity.FlatToLogicalToIndex(inputIndex)),

@ -73,9 +73,9 @@ static inline VTKM_EXEC vtkm::Id2 Deflate(const vtkm::Id3& index, vtkm::Id2)
/// \brief Container for thread indices in a topology map
///
/// This specialization of \c ThreadIndices adds extra indices that deal with
/// topology maps. In particular, it saves the indices used to map the "from"
/// elements in the map. The input and output indices from the superclass are
/// considered to be indexing the "to" elements.
/// topology maps. In particular, it saves the incident element indices. The
/// input and output indices from the superclass are considered to be indexing
/// the visited elements.
///
/// This class is templated on the type that stores the connectivity (such
/// as \c ConnectivityExplicit or \c ConnectivityStructured).
@ -86,7 +86,7 @@ class ThreadIndicesTopologyMap : public vtkm::exec::arg::ThreadIndicesBasic
using Superclass = vtkm::exec::arg::ThreadIndicesBasic;
public:
using IndicesFromType = typename ConnectivityType::IndicesType;
using IndicesIncidentType = typename ConnectivityType::IndicesType;
using CellShapeTag = typename ConnectivityType::CellShapeTag;
VTKM_SUPPRESS_EXEC_WARNINGS
@ -102,24 +102,24 @@ public:
// of the domain will match the connectivity type used here. If there is
// a compile error here about a type mismatch, chances are a worklet has
// set its input domain incorrectly.
, IndicesFrom(connectivity.GetIndices(inputIndex))
, IndicesIncident(connectivity.GetIndices(inputIndex))
, CellShape(connectivity.GetCellShape(inputIndex))
{
}
/// \brief The input indices of the "from" elements.
/// \brief The indices of the incident elements.
///
/// A topology map has "from" and "to" elements (for example from points to
/// cells). For each worklet invocation, there is exactly one "to" element,
/// but can be several "from" element. This method returns a Vec-like object
/// containing the indices to the "from" elements.
/// A topology map has "visited" and "incident" elements (e.g. points, cells,
/// etc). For each worklet invocation, there is exactly one visited element,
/// but there can be several incident elements. This method returns a Vec-like
/// object containing the indices to the incident elements.
///
VTKM_EXEC
const IndicesFromType& GetIndicesFrom() const { return this->IndicesFrom; }
const IndicesIncidentType& GetIndicesIncident() const { return this->IndicesIncident; }
/// \brief The input indices of the "from" elements in pointer form.
/// \brief The input indices of the incident elements in pointer form.
///
/// Returns the same object as GetIndicesFrom except that it returns a
/// Returns the same object as GetIndicesIncident except that it returns a
/// pointer to the internally held object rather than a reference or copy.
/// Since the from indices can be a sizeable Vec (8 entries is common), it is
/// best not to have a bunch a copies. Thus, you can pass around a pointer
@ -127,7 +127,7 @@ public:
/// not go out of scope, at which time the returned pointer becomes invalid.
///
VTKM_EXEC
const IndicesFromType* GetIndicesFromPointer() const { return &this->IndicesFrom; }
const IndicesIncidentType* GetIndicesIncidentPointer() const { return &this->IndicesIncident; }
/// \brief The shape of the input cell.
///
@ -140,19 +140,20 @@ public:
CellShapeTag GetCellShape() const { return this->CellShape; }
private:
IndicesFromType IndicesFrom;
IndicesIncidentType IndicesIncident;
CellShapeTag CellShape;
};
// Specialization for structured connectivity types.
template <typename FromTopology, typename ToTopology, vtkm::IdComponent Dimension>
template <typename VisitTopology, typename IncidentTopology, vtkm::IdComponent Dimension>
class ThreadIndicesTopologyMap<
vtkm::exec::ConnectivityStructured<FromTopology, ToTopology, Dimension>>
vtkm::exec::ConnectivityStructured<VisitTopology, IncidentTopology, Dimension>>
{
using ConnectivityType = vtkm::exec::ConnectivityStructured<FromTopology, ToTopology, Dimension>;
using ConnectivityType =
vtkm::exec::ConnectivityStructured<VisitTopology, IncidentTopology, Dimension>;
public:
using IndicesFromType = typename ConnectivityType::IndicesType;
using IndicesIncidentType = typename ConnectivityType::IndicesType;
using CellShapeTag = typename ConnectivityType::CellShapeTag;
using LogicalIndexType = typename ConnectivityType::SchedulingRangeType;
@ -168,7 +169,7 @@ public:
this->VisitIndex = visitIndex;
this->OutputIndex = outIndex;
this->LogicalIndex = connectivity.FlatToLogicalToIndex(this->InputIndex);
this->IndicesFrom = connectivity.GetIndices(this->LogicalIndex);
this->IndicesIncident = connectivity.GetIndices(this->LogicalIndex);
this->CellShape = connectivity.GetCellShape(this->InputIndex);
this->GlobalThreadIndexOffset = globalThreadIndexOffset;
}
@ -188,7 +189,7 @@ public:
this->OutputIndex = index;
this->VisitIndex = 0;
this->LogicalIndex = logicalIndex;
this->IndicesFrom = connectivity.GetIndices(logicalIndex);
this->IndicesIncident = connectivity.GetIndices(logicalIndex);
this->CellShape = connectivity.GetCellShape(index);
this->GlobalThreadIndexOffset = globalThreadIndexOffset;
}
@ -247,19 +248,19 @@ public:
VTKM_EXEC
vtkm::Id GetGlobalIndex() const { return (this->GlobalThreadIndexOffset + this->OutputIndex); }
/// \brief The input indices of the "from" elements.
/// \brief The indices of the incident elements.
///
/// A topology map has "from" and "to" elements (for example from points to
/// cells). For each worklet invocation, there is exactly one "to" element,
/// but can be several "from" element. This method returns a Vec-like object
/// containing the indices to the "from" elements.
/// A topology map has "visited" and "incident" elements (e.g. points, cells,
/// etc). For each worklet invocation, there is exactly one visited element,
/// but there can be several incident elements. This method returns a
/// Vec-like object containing the indices to the incident elements.
///
VTKM_EXEC
const IndicesFromType& GetIndicesFrom() const { return this->IndicesFrom; }
const IndicesIncidentType& GetIndicesIncident() const { return this->IndicesIncident; }
/// \brief The input indices of the "from" elements in pointer form.
/// \brief The input indices of the incident elements in pointer form.
///
/// Returns the same object as GetIndicesFrom except that it returns a
/// Returns the same object as GetIndicesIncident except that it returns a
/// pointer to the internally held object rather than a reference or copy.
/// Since the from indices can be a sizeable Vec (8 entries is common), it is
/// best not to have a bunch a copies. Thus, you can pass around a pointer
@ -267,7 +268,7 @@ public:
/// not go out of scope, at which time the returned pointer becomes invalid.
///
VTKM_EXEC
const IndicesFromType* GetIndicesFromPointer() const { return &this->IndicesFrom; }
const IndicesIncidentType* GetIndicesIncidentPointer() const { return &this->IndicesIncident; }
/// \brief The shape of the input cell.
///
@ -285,29 +286,29 @@ private:
vtkm::IdComponent VisitIndex;
vtkm::Id OutputIndex;
LogicalIndexType LogicalIndex;
IndicesFromType IndicesFrom;
IndicesIncidentType IndicesIncident;
CellShapeTag CellShape;
vtkm::Id GlobalThreadIndexOffset;
};
// Specialization for permuted structured connectivity types.
template <typename PermutationPortal, vtkm::IdComponent Dimension>
class ThreadIndicesTopologyMap<vtkm::exec::ConnectivityPermutedPointToCell<
class ThreadIndicesTopologyMap<vtkm::exec::ConnectivityPermutedVisitCellsWithPoints<
PermutationPortal,
vtkm::exec::
ConnectivityStructured<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, Dimension>>>
ConnectivityStructured<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint, Dimension>>>
{
using PermutedConnectivityType = vtkm::exec::ConnectivityPermutedPointToCell<
using PermutedConnectivityType = vtkm::exec::ConnectivityPermutedVisitCellsWithPoints<
PermutationPortal,
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
Dimension>>;
using ConnectivityType = vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
using ConnectivityType = vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
Dimension>;
public:
using IndicesFromType = typename ConnectivityType::IndicesType;
using IndicesIncidentType = typename ConnectivityType::IndicesType;
using CellShapeTag = typename ConnectivityType::CellShapeTag;
using LogicalIndexType = typename ConnectivityType::SchedulingRangeType;
@ -325,7 +326,7 @@ public:
const vtkm::Id permutedIndex = permutation.Portal.Get(this->InputIndex);
this->LogicalIndex = permutation.Connectivity.FlatToLogicalToIndex(permutedIndex);
this->IndicesFrom = permutation.Connectivity.GetIndices(this->LogicalIndex);
this->IndicesIncident = permutation.Connectivity.GetIndices(this->LogicalIndex);
this->CellShape = permutation.Connectivity.GetCellShape(permutedIndex);
this->GlobalThreadIndexOffset = globalThreadIndexOffset;
}
@ -384,19 +385,19 @@ public:
VTKM_EXEC
vtkm::Id GetGlobalIndex() const { return (this->GlobalThreadIndexOffset + this->OutputIndex); }
/// \brief The input indices of the "from" elements.
/// \brief The indices of the incident elements.
///
/// A topology map has "from" and "to" elements (for example from points to
/// cells). For each worklet invocation, there is exactly one "to" element,
/// but can be several "from" element. This method returns a Vec-like object
/// containing the indices to the "from" elements.
/// A topology map has "visited" and "incident" elements (e.g. points, cells,
/// etc). For each worklet invocation, there is exactly one visited element,
/// but there can be several incident elements. This method returns a
/// Vec-like object containing the indices to the incident elements.
///
VTKM_EXEC
const IndicesFromType& GetIndicesFrom() const { return this->IndicesFrom; }
const IndicesIncidentType& GetIndicesIncident() const { return this->IndicesIncident; }
/// \brief The input indices of the "from" elements in pointer form.
/// \brief The input indices of the incident elements in pointer form.
///
/// Returns the same object as GetIndicesFrom except that it returns a
/// Returns the same object as GetIndicesIncident except that it returns a
/// pointer to the internally held object rather than a reference or copy.
/// Since the from indices can be a sizeable Vec (8 entries is common), it is
/// best not to have a bunch a copies. Thus, you can pass around a pointer
@ -404,7 +405,7 @@ public:
/// not go out of scope, at which time the returned pointer becomes invalid.
///
VTKM_EXEC
const IndicesFromType* GetIndicesFromPointer() const { return &this->IndicesFrom; }
const IndicesIncidentType* GetIndicesIncidentPointer() const { return &this->IndicesIncident; }
/// \brief The shape of the input cell.
///
@ -422,7 +423,7 @@ private:
vtkm::IdComponent VisitIndex;
vtkm::Id OutputIndex;
LogicalIndexType LogicalIndex;
IndicesFromType IndicesFrom;
IndicesIncidentType IndicesIncident;
CellShapeTag CellShape;
vtkm::Id GlobalThreadIndexOffset;
};

@ -105,8 +105,8 @@ struct FetchArrayNeighborhoodInTests
vtkm::internal::ConnectivityStructuredInternals<3> connectivityInternals;
connectivityInternals.SetPointDimensions(POINT_DIMS);
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
3>
connectivity(connectivityInternals);

@ -107,8 +107,8 @@ struct FetchArrayTopologyMapInTests
vtkm::internal::ConnectivityStructuredInternals<3> connectivityInternals;
connectivityInternals.SetPointDimensions(vtkm::Id3(2, 2, 2));
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
3>
connectivity(connectivityInternals);
@ -182,8 +182,8 @@ void TryStructuredPointCoordinatesInvocation(const Invocation& invocation)
template <vtkm::IdComponent NumDimensions>
void TryStructuredPointCoordinates(
const vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
const vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
NumDimensions>& connectivity,
const vtkm::internal::ArrayPortalUniformPointCoordinates& coordinates)
{
@ -221,21 +221,21 @@ void TryStructuredPointCoordinates()
std::cout << "3D" << std::endl;
vtkm::internal::ConnectivityStructuredInternals<3> connectivityInternals3d;
connectivityInternals3d.SetPointDimensions(vtkm::Id3(3, 2, 2));
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, 3>
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint, 3>
connectivity3d(connectivityInternals3d);
TryStructuredPointCoordinates(connectivity3d, coordinates);
std::cout << "2D" << std::endl;
vtkm::internal::ConnectivityStructuredInternals<2> connectivityInternals2d;
connectivityInternals2d.SetPointDimensions(vtkm::Id2(3, 2));
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, 2>
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint, 2>
connectivity2d(connectivityInternals2d);
TryStructuredPointCoordinates(connectivity2d, coordinates);
std::cout << "1D" << std::endl;
vtkm::internal::ConnectivityStructuredInternals<1> connectivityInternals1d;
connectivityInternals1d.SetPointDimensions(3);
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, 1>
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint, 1>
connectivity1d(connectivityInternals1d);
TryStructuredPointCoordinates(connectivity1d, coordinates);
}

@ -87,7 +87,7 @@ inline VTKM_CONT vtkm::cont::DataSet MeshQuality::DoExecute(
input.GetCellSet(this->GetActiveCellSetIndex()).CopyTo(cellSet);
ShapeHandle cellShapes =
cellSet.GetShapesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
cellSet.GetShapesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
//Obtain the frequency counts of each cell type in the input dataset
IdHandle uniqueCellCounts;

@ -186,8 +186,8 @@ void TestSplitSharpEdgesFilterNoSplit(vtkm::cont::DataSet& simpleCubeWithSN,
"result value does not match expected value");
}
const auto& connectivityArray = newCellset.GetConnectivityArray(vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell());
const auto& connectivityArray = newCellset.GetConnectivityArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint());
auto connectivityArrayPortal = connectivityArray.GetPortalConstControl();
for (vtkm::IdComponent i = 0; i < connectivityArray.GetNumberOfValues(); i++)
{

@ -53,7 +53,7 @@ void TestVertexClustering()
CellSetType cellSet;
output.GetCellSet(0).CopyTo(cellSet);
auto cellArray =
cellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
cellSet.GetConnectivityArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
std::cerr << "output_pointIds = " << cellArray.GetNumberOfValues() << "\n";
std::cerr << "output_pointId[] = ";
vtkm::cont::printSummary_ArrayHandle(cellArray, std::cerr, true);

@ -517,20 +517,20 @@ private:
// We may want to generalize this class depending on how ConnectivityExplicit
// eventually handles retrieving cell to point connectivity.
template <typename From, typename To, vtkm::IdComponent Dimension>
template <typename VisitTopology, typename IncidentTopology, vtkm::IdComponent Dimension>
struct ConnectivityStructuredIndexHelper
{
// We want an unconditional failure if this unspecialized class ever gets
// instantiated, because it means someone missed a topology mapping type.
// We need to create a test which depends on the templated types so
// it doesn't get picked up without a concrete instantiation.
VTKM_STATIC_ASSERT_MSG(sizeof(To) == static_cast<size_t>(-1),
VTKM_STATIC_ASSERT_MSG(sizeof(VisitTopology) == static_cast<size_t>(-1),
"Missing Specialization for Topologies");
};
template <vtkm::IdComponent Dimension>
struct ConnectivityStructuredIndexHelper<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
struct ConnectivityStructuredIndexHelper<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
Dimension>
{
using ConnectivityType = vtkm::internal::ConnectivityStructuredInternals<Dimension>;
@ -590,8 +590,8 @@ struct ConnectivityStructuredIndexHelper<vtkm::TopologyElementTagPoint,
};
template <vtkm::IdComponent Dimension>
struct ConnectivityStructuredIndexHelper<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
struct ConnectivityStructuredIndexHelper<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
Dimension>
{
using ConnectivityType = vtkm::internal::ConnectivityStructuredInternals<Dimension>;

@ -32,7 +32,7 @@ namespace rendering
class Cylinderizer
{
public:
class CountSegments : public vtkm::worklet::WorkletMapPointToCell
class CountSegments : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
VTKM_CONT
@ -80,12 +80,12 @@ public:
}; //class CountSegments
template <int DIM>
class SegmentedStructured : public vtkm::worklet::WorkletMapPointToCell
class SegmentedStructured : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
typedef void ControlSignature(CellSetIn cellset, FieldInTo, WholeArrayOut);
typedef void ExecutionSignature(FromIndices, _2, _3);
typedef void ControlSignature(CellSetIn cellset, FieldInCell, WholeArrayOut);
typedef void ExecutionSignature(IncidentElementIndices, _2, _3);
//typedef _1 InputDomain;
VTKM_CONT
SegmentedStructured() {}
@ -196,7 +196,7 @@ public:
};
class Cylinderize : public vtkm::worklet::WorkletMapPointToCell
class Cylinderize : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:

@ -99,7 +99,7 @@ public:
#pragma warning(push)
#pragma warning(disable : 4127) //conditional expression is constant
#endif
struct EdgesCounter : public vtkm::worklet::WorkletMapPointToCell
struct EdgesCounter : public vtkm::worklet::WorkletVisitCellsWithPoints
{
using ControlSignature = void(CellSetIn cellSet, FieldOutCell numEdges);
using ExecutionSignature = _2(CellShape shape, PointCount numPoints);
@ -120,7 +120,7 @@ struct EdgesCounter : public vtkm::worklet::WorkletMapPointToCell
}
}; // struct EdgesCounter
struct EdgesExtracter : public vtkm::worklet::WorkletMapPointToCell
struct EdgesExtracter : public vtkm::worklet::WorkletVisitCellsWithPoints
{
using ControlSignature = void(CellSetIn cellSet, FieldOutCell edgeIndices);
using ExecutionSignature = void(CellShape, PointIndices, VisitIndex, _2);

@ -31,7 +31,7 @@ namespace rendering
class Quadralizer
{
public:
class CountQuads : public vtkm::worklet::WorkletMapPointToCell
class CountQuads : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
VTKM_CONT
@ -77,12 +77,12 @@ public:
}; //class CountQuads
template <int DIM>
class SegmentedStructured : public vtkm::worklet::WorkletMapPointToCell
class SegmentedStructured : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
typedef void ControlSignature(CellSetIn cellset, FieldInTo, WholeArrayOut);
typedef void ExecutionSignature(FromIndices, _2, _3);
typedef void ControlSignature(CellSetIn cellset, FieldInCell, WholeArrayOut);
typedef void ExecutionSignature(IncidentElementIndices, _2, _3);
//typedef _1 InputDomain;
VTKM_CONT
SegmentedStructured() {}
@ -168,7 +168,7 @@ public:
};
class Quadralize : public vtkm::worklet::WorkletMapPointToCell
class Quadralize : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:

@ -33,7 +33,7 @@ namespace rendering
class Triangulator
{
public:
class CountTriangles : public vtkm::worklet::WorkletMapPointToCell
class CountTriangles : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
VTKM_CONT
@ -79,12 +79,12 @@ public:
}; //class CountTriangles
template <int DIM>
class TrianglulateStructured : public vtkm::worklet::WorkletMapPointToCell
class TrianglulateStructured : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellset, FieldInTo, WholeArrayOut);
using ExecutionSignature = void(FromIndices, _2, _3);
using ControlSignature = void(CellSetIn cellset, FieldInCell, WholeArrayOut);
using ExecutionSignature = void(IncidentElementIndices, _2, _3);
VTKM_CONT
TrianglulateStructured() {}
@ -267,7 +267,7 @@ public:
}
}; //class UniqueTriangles
class Trianglulate : public vtkm::worklet::WorkletMapPointToCell
class Trianglulate : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:

@ -26,7 +26,7 @@ namespace raytracing
namespace detail
{
class CountSegments : public vtkm::worklet::WorkletMapPointToCell
class CountSegments : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
VTKM_CONT
@ -66,7 +66,7 @@ public:
}; // ClassCountSegments
class Pointify : public vtkm::worklet::WorkletMapPointToCell
class Pointify : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:

@ -343,8 +343,8 @@ public:
class StructuredExternalTriangles : public vtkm::worklet::WorkletMapField
{
protected:
using ConnType = vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
using ConnType = vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
3>;
ConnType Connectivity;
vtkm::Id Segments[7];
@ -680,14 +680,14 @@ void MeshConnectivityBuilder::BuildConnectivity(
BoundingBox[5] = vtkm::Float32(coordsBounds.Z.Max);
const vtkm::cont::ArrayHandleConstant<vtkm::UInt8> shapes = cellSetUnstructured.GetShapesArray(
vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
const vtkm::cont::ArrayHandle<vtkm::Id> conn = cellSetUnstructured.GetConnectivityArray(
vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
const vtkm::cont::ArrayHandleCounting<vtkm::Id> shapeOffsets =
cellSetUnstructured.GetIndexOffsetArray(vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell());
cellSetUnstructured.GetIndexOffsetArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint());
vtkm::cont::ArrayHandle<vtkm::Id> faceConnectivity;
vtkm::cont::ArrayHandle<vtkm::Id3> cellFaceId;
@ -741,13 +741,13 @@ void MeshConnectivityBuilder::BuildConnectivity(
BoundingBox[5] = vtkm::Float32(coordsBounds.Z.Max);
const vtkm::cont::ArrayHandle<vtkm::UInt8> shapes = cellSetUnstructured.GetShapesArray(
vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
const vtkm::cont::ArrayHandle<vtkm::Id> conn = cellSetUnstructured.GetConnectivityArray(
vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
const vtkm::cont::ArrayHandle<vtkm::Id> shapeOffsets = cellSetUnstructured.GetIndexOffsetArray(
vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
vtkm::cont::ArrayHandle<vtkm::Id> faceConnectivity;
vtkm::cont::ArrayHandle<vtkm::Id3> cellFaceId;
@ -791,7 +791,7 @@ struct StructuredTrianglesFunctor
VTKM_IS_DEVICE_ADAPTER_TAG(Device);
vtkm::worklet::DispatcherMapField<StructuredExternalTriangles> dispatch(
StructuredExternalTriangles(cellSet.PrepareForInput(
Device(), vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell())));
Device(), vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint())));
dispatch.SetDevice(Device());
dispatch.Invoke(counting, triangles);
@ -866,7 +866,7 @@ MeshConnContainer* MeshConnectivityBuilder::BuildConnectivity(
// Now we need to determine what type of cells this holds
//
vtkm::cont::ArrayHandleConstant<vtkm::UInt8> shapes =
singleType.GetShapesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
singleType.GetShapesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
vtkm::UInt8 shapeType = shapes.GetPortalConstControl().Get(0);
if (shapeType == CELL_SHAPE_HEXAHEDRON)
type = UnstructuredSingle;

@ -69,10 +69,10 @@ UnstructuredContainer::UnstructuredContainer(const vtkm::cont::CellSetExplicit<>
// Grab the cell arrays
//
CellConn =
Cellset.GetConnectivityArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
Cellset.GetConnectivityArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
CellOffsets =
Cellset.GetIndexOffsetArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
Shapes = Cellset.GetShapesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
Cellset.GetIndexOffsetArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
Shapes = Cellset.GetShapesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
Intersector.SetData(Coords, Triangles);
}
@ -160,9 +160,9 @@ UnstructuredSingleContainer::UnstructuredSingleContainer(
this->Intersector.SetUseWaterTight(true);
CellConnectivity =
Cellset.GetConnectivityArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
Cellset.GetConnectivityArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
vtkm::cont::ArrayHandleConstant<vtkm::UInt8> shapes =
Cellset.GetShapesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
Cellset.GetShapesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
ShapeId = shapes.GetPortalConstControl().Get(0);
CellTables tables;

@ -85,7 +85,7 @@ VTKM_EXEC inline vtkm::UInt64 Morton3D64(vtkm::Float32& x, vtkm::Float32& y, vtk
return (zz << 2 | yy << 1 | xx);
}
class MortonCodeFace : public vtkm::worklet::WorkletMapPointToCell
class MortonCodeFace : public vtkm::worklet::WorkletVisitCellsWithPoints
{
private:
// (1.f / dx),(1.f / dy), (1.f, / dz)
@ -140,9 +140,9 @@ public:
}
using ControlSignature =
void(CellSetIn cellset, WholeArrayIn, FieldInTo, WholeArrayOut, WholeArrayOut);
void(CellSetIn cellset, WholeArrayIn, FieldInCell, WholeArrayOut, WholeArrayOut);
using ExecutionSignature = void(CellShape, FromIndices, WorkIndex, _2, _3, _4, _5);
using ExecutionSignature = void(CellShape, IncidentElementIndices, WorkIndex, _2, _3, _4, _5);
template <typename CellShape,
typename CellNodeVecType,

@ -26,7 +26,7 @@ namespace raytracing
namespace detail
{
class CountQuads : public vtkm::worklet::WorkletMapPointToCell
class CountQuads : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
VTKM_CONT
@ -62,7 +62,7 @@ public:
}; // ClassCountquads
class Pointify : public vtkm::worklet::WorkletMapPointToCell
class Pointify : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:

@ -25,7 +25,7 @@ namespace raytracing
namespace detail
{
class CountPoints : public vtkm::worklet::WorkletMapPointToCell
class CountPoints : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
VTKM_CONT
@ -61,7 +61,7 @@ public:
}; // ClassCountPoints
class Pointify : public vtkm::worklet::WorkletMapPointToCell
class Pointify : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:

@ -49,7 +49,7 @@ protected:
DefaultConstHandle CoordPortals[3];
CartesianConstPortal Coordinates;
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, 3>
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint, 3>
Conn;
vtkm::Id3 PointDimensions;
vtkm::Vec3f_32 MinPoint;
@ -60,8 +60,8 @@ public:
vtkm::cont::CellSetStructured<3>& cellset)
: Coordinates(coordinates.PrepareForInput(Device()))
, Conn(cellset.PrepareForInput(Device(),
vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell()))
vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint()))
{
CoordPortals[0] = Coordinates.GetFirstPortal();
CoordPortals[1] = Coordinates.GetSecondPortal();
@ -195,15 +195,15 @@ protected:
vtkm::Vec3f_32 InvSpacing;
vtkm::Vec3f_32 MaxPoint;
UniformConstPortal Coordinates;
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell, 3>
vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint, 3>
Conn;
public:
UniformLocator(const UniformArrayHandle& coordinates, vtkm::cont::CellSetStructured<3>& cellset)
: Coordinates(coordinates.PrepareForInput(Device()))
, Conn(cellset.PrepareForInput(Device(),
vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell()))
vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint()))
{
Origin = Coordinates.GetOrigin();
PointDimensions = Conn.GetPointDimensions();

@ -21,7 +21,7 @@ namespace worklet
{
//simple functor that returns the average point value as a cell field
class CellAverage : public vtkm::worklet::WorkletMapPointToCell
class CellAverage : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellset, FieldInPoint inPoints, FieldOutCell outCells);

@ -28,7 +28,7 @@ namespace worklet
///
struct CellDeepCopy
{
struct CountCellPoints : vtkm::worklet::WorkletMapPointToCell
struct CountCellPoints : vtkm::worklet::WorkletVisitCellsWithPoints
{
using ControlSignature = void(CellSetIn inputTopology, FieldOut numPointsInCell);
using ExecutionSignature = _2(PointCount);
@ -37,7 +37,7 @@ struct CellDeepCopy
vtkm::IdComponent operator()(vtkm::IdComponent numPoints) const { return numPoints; }
};
struct PassCellStructure : vtkm::worklet::WorkletMapPointToCell
struct PassCellStructure : vtkm::worklet::WorkletVisitCellsWithPoints
{
using ControlSignature = void(CellSetIn inputTopology, FieldOut shapes, FieldOut pointIndices);
using ExecutionSignature = void(CellShape, PointIndices, _2, _3);

@ -60,7 +60,7 @@ namespace worklet
* Note that the integrals are signed; inverted cells will report negative values.
*/
template <typename IntegrationTypeList>
class CellMeasure : public vtkm::worklet::WorkletMapPointToCell
class CellMeasure : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellset,

@ -226,7 +226,7 @@ public:
{
};
class ComputeStats : public vtkm::worklet::WorkletMapPointToCell
class ComputeStats : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
VTKM_CONT
@ -315,7 +315,7 @@ public:
bool Invert;
};
class GenerateCellSet : public vtkm::worklet::WorkletMapPointToCell
class GenerateCellSet : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
VTKM_CONT
@ -341,7 +341,7 @@ public:
using ExecutionSignature = void(CellShape,
WorkIndex,
FromIndices,
PointIndices,
_2,
_3,
_4,

@ -46,7 +46,7 @@ public:
{
// This is the type for the input domain
using InputDomainType = typename Invocation::InputDomainType;
using SchedulingRangeType = typename WorkletType::ToTopologyType;
using SchedulingRangeType = typename WorkletType::VisitTopologyType;
// If you get a compile error on this line, then you have tried to use
// something that is not a vtkm::cont::CellSet as the input domain to a

@ -46,7 +46,7 @@ namespace worklet
struct ExternalFaces
{
//Worklet that returns the number of external faces for each structured cell
class NumExternalFacesPerStructuredCell : public vtkm::worklet::WorkletMapPointToCell
class NumExternalFacesPerStructuredCell : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn inCellSet,
@ -118,7 +118,7 @@ struct ExternalFaces
//Worklet that finds face connectivity for each structured cell
class BuildConnectivityStructured : public vtkm::worklet::WorkletMapPointToCell
class BuildConnectivityStructured : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn inCellSet,
@ -308,7 +308,7 @@ struct ExternalFaces
};
//Worklet that returns the number of faces for each cell/shape
class NumFacesPerCell : public vtkm::worklet::WorkletMapPointToCell
class NumFacesPerCell : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn inCellSet, FieldOut numFacesInCell);
@ -323,14 +323,14 @@ struct ExternalFaces
};
//Worklet that identifies a cell face by a hash value. Not necessarily completely unique.
class FaceHash : public vtkm::worklet::WorkletMapPointToCell
class FaceHash : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellset,
FieldOut faceHashes,
FieldOut originCells,
FieldOut originFaces);
using ExecutionSignature = void(_2, _3, _4, CellShape, FromIndices, InputIndex, VisitIndex);
using ExecutionSignature = void(_2, _3, _4, CellShape, PointIndices, InputIndex, VisitIndex);
using InputDomain = _1;
using ScatterType = vtkm::worklet::ScatterCounting;
@ -558,7 +558,7 @@ public:
}
};
class IsPolyDataCell : public vtkm::worklet::WorkletMapPointToCell
class IsPolyDataCell : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn inCellSet, FieldOut isPolyDataCell);
@ -572,7 +572,7 @@ public:
}
};
class CountPolyDataCellPoints : public vtkm::worklet::WorkletMapPointToCell
class CountPolyDataCellPoints : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ScatterType = vtkm::worklet::ScatterCounting;
@ -584,7 +584,7 @@ public:
VTKM_EXEC vtkm::Id operator()(vtkm::Id count) const { return count; }
};
class PassPolyDataCells : public vtkm::worklet::WorkletMapPointToCell
class PassPolyDataCells : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ScatterType = vtkm::worklet::ScatterCounting;

@ -35,7 +35,7 @@ public:
////////////////////////////////////////////////////////////////////////////////////
// Worklet to identify cells within volume of interest
class ExtractCellsByVOI : public vtkm::worklet::WorkletMapPointToCell
class ExtractCellsByVOI : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellset,

@ -34,7 +34,7 @@ public:
////////////////////////////////////////////////////////////////////////////////////
// Worklet to identify points within volume of interest
class ExtractPointsByVOI : public vtkm::worklet::WorkletMapCellToPoint
class ExtractPointsByVOI : public vtkm::worklet::WorkletVisitPointsWithCells
{
public:
using ControlSignature = void(CellSetIn cellset,

@ -100,7 +100,7 @@ make_ScalarField(const vtkm::cont::ArrayHandle<vtkm::Int8, S>& ah)
// ---------------------------------------------------------------------------
template <typename T>
class ClassifyCell : public vtkm::worklet::WorkletMapPointToCell
class ClassifyCell : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
struct ClassifyCellTagType : vtkm::ListTagBase<T>
@ -272,7 +272,7 @@ private:
/// a point in the resulting iso-surface
// -----------------------------------------------------------------------------
template <typename T>
class EdgeWeightGenerate : public vtkm::worklet::WorkletMapPointToCell
class EdgeWeightGenerate : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
struct ClassifyCellTagType : vtkm::ListTagBase<T>
@ -293,7 +293,7 @@ public:
ExecObject metaData // Metadata for edge weight generation
);
using ExecutionSignature =
void(CellShape, _2, _3, _4, InputIndex, WorkIndex, VisitIndex, FromIndices);
void(CellShape, _2, _3, _4, InputIndex, WorkIndex, VisitIndex, PointIndices);
using InputDomain = _1;
@ -554,7 +554,7 @@ struct EdgeVertex
VTKM_EXEC vtkm::Id operator()(const vtkm::Id2& edge) const { return edge[Comp]; }
};
class NormalsWorkletPass1 : public vtkm::worklet::WorkletMapCellToPoint
class NormalsWorkletPass1 : public vtkm::worklet::WorkletVisitPointsWithCells
{
private:
using PointIdsArray =
@ -562,7 +562,7 @@ private:
public:
using ControlSignature = void(CellSetIn,
WholeCellSetIn<Point, Cell>,
WholeCellSetIn<Cell, Point>,
WholeArrayIn pointCoordinates,
WholeArrayIn inputField,
FieldOutPoint normals);
@ -603,7 +603,7 @@ public:
VTKM_EXEC void operator()(const vtkm::IdComponent& vtkmNotUsed(numCells),
const FromIndexType& vtkmNotUsed(cellIds),
vtkm::Id pointId,
vtkm::exec::ConnectivityStructured<Point, Cell, 3>& geometry,
vtkm::exec::ConnectivityStructured<Cell, Point, 3>& geometry,
const WholeCoordinatesIn& pointCoordinates,
const WholeFieldIn& inputField,
NormalType& normal) const
@ -612,7 +612,7 @@ public:
//Optimization for structured cellsets so we can call StructuredPointGradient
//and have way faster gradients
vtkm::exec::ConnectivityStructured<Cell, Point, 3> pointGeom(geometry);
vtkm::exec::ConnectivityStructured<Point, Cell, 3> pointGeom(geometry);
vtkm::exec::arg::ThreadIndicesPointNeighborhood tpn(pointId, pointId, 0, pointId, pointGeom, 0);
const auto& boundary = tpn.GetBoundaryState();
@ -626,7 +626,7 @@ public:
}
};
class NormalsWorkletPass2 : public vtkm::worklet::WorkletMapCellToPoint
class NormalsWorkletPass2 : public vtkm::worklet::WorkletVisitPointsWithCells
{
private:
using PointIdsArray =
@ -634,7 +634,7 @@ private:
public:
typedef void ControlSignature(CellSetIn,
WholeCellSetIn<Point, Cell>,
WholeCellSetIn<Cell, Point>,
WholeArrayIn pointCoordinates,
WholeArrayIn inputField,
WholeArrayIn weights,
@ -686,7 +686,7 @@ public:
VTKM_EXEC void operator()(const vtkm::IdComponent& vtkmNotUsed(numCells),
const FromIndexType& vtkmNotUsed(cellIds),
vtkm::Id pointId,
vtkm::exec::ConnectivityStructured<Point, Cell, 3>& geometry,
vtkm::exec::ConnectivityStructured<Cell, Point, 3>& geometry,
const WholeCoordinatesIn& pointCoordinates,
const WholeFieldIn& inputField,
vtkm::Id edgeId,
@ -696,7 +696,7 @@ public:
using T = typename WholeFieldIn::ValueType;
//Optimization for structured cellsets so we can call StructuredPointGradient
//and have way faster gradients
vtkm::exec::ConnectivityStructured<Cell, Point, 3> pointGeom(geometry);
vtkm::exec::ConnectivityStructured<Point, Cell, 3> pointGeom(geometry);
vtkm::exec::arg::ThreadIndicesPointNeighborhood tpn(pointId, pointId, 0, pointId, pointGeom, 0);
const auto& boundary = tpn.GetBoundaryState();

@ -38,7 +38,7 @@ namespace worklet
* the computed metric values (one per cell) is returned as output.
*/
template <typename MetricTagType>
class MeshQuality : public vtkm::worklet::WorkletMapPointToCell
class MeshQuality : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellset,

@ -105,7 +105,7 @@ public:
// each incident cell's normal to point out of the boundary, marking each cell
// as both visited and active.
// Clears the active flags for points, and marks the current point as visited.
class WorkletProcessSourceCells : public vtkm::worklet::WorkletMapCellToPoint
class WorkletProcessSourceCells : public vtkm::worklet::WorkletVisitPointsWithCells
{
public:
using ControlSignature = void(CellSetIn cells,
@ -203,7 +203,7 @@ public:
// Mark each incident point as active and visited.
// Marks the current cell as inactive.
class WorkletMarkActivePoints : public vtkm::worklet::WorkletMapPointToCell
class WorkletMarkActivePoints : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cell,
@ -237,7 +237,7 @@ public:
// Mark each incident cell as active, setting a visited neighbor
// cell as its reference for alignment.
// Marks the current point as inactive.
class WorkletMarkActiveCells : public vtkm::worklet::WorkletMapCellToPoint
class WorkletMarkActiveCells : public vtkm::worklet::WorkletVisitPointsWithCells
{
public:
using ControlSignature = void(CellSetIn cells,

@ -128,7 +128,7 @@ public:
// Mark each incident cell as active and visited.
// Marks the current point as inactive.
class WorkletMarkActiveCells : public vtkm::worklet::WorkletMapCellToPoint
class WorkletMarkActiveCells : public vtkm::worklet::WorkletVisitPointsWithCells
{
public:
using ControlSignature = void(CellSetIn cell,
@ -160,7 +160,7 @@ public:
};
// Align the current cell's normals to an adjacent visited point's normal.
class WorkletProcessCellNormals : public vtkm::worklet::WorkletMapPointToCell
class WorkletProcessCellNormals : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cells,
@ -213,7 +213,7 @@ public:
// Mark each incident point as active and visited.
// Marks the current cell as inactive.
class WorkletMarkActivePoints : public vtkm::worklet::WorkletMapPointToCell
class WorkletMarkActivePoints : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cell,
@ -245,7 +245,7 @@ public:
};
// Align the current point's normals to an adjacent visited cell's normal.
class WorkletProcessPointNormals : public vtkm::worklet::WorkletMapCellToPoint
class WorkletProcessPointNormals : public vtkm::worklet::WorkletVisitPointsWithCells
{
public:
using ControlSignature = void(CellSetIn cells,

@ -130,7 +130,7 @@ public:
// Traverses the active points (via mask) and marks the connected cells as
// active. Set the reference point for all adjacent cells to the current
// point.
class WorkletMarkActiveCells : public vtkm::worklet::WorkletMapCellToPoint
class WorkletMarkActiveCells : public vtkm::worklet::WorkletVisitPointsWithCells
{
public:
using ControlSignature = void(CellSetIn cellSet,
@ -166,7 +166,7 @@ public:
// Traverses the active cells and mark the connected points as active,
// propogating the reference pointId.
class WorkletMarkActivePoints : public vtkm::worklet::WorkletMapPointToCell
class WorkletMarkActivePoints : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellSet,

@ -22,7 +22,7 @@ namespace worklet
//simple functor that returns the average point value of a given
//cell based field.
class PointAverage : public vtkm::worklet::WorkletMapCellToPoint
class PointAverage : public vtkm::worklet::WorkletVisitPointsWithCells
{
public:
using ControlSignature = void(CellSetIn cellset,

@ -72,7 +72,7 @@ private:
//============================================================================
public:
class ProbeUniformPoints : public vtkm::worklet::WorkletMapPointToCell
class ProbeUniformPoints : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellset,
@ -278,7 +278,7 @@ public:
}
//============================================================================
struct HiddenCellsWorklet : public WorkletMapPointToCell
struct HiddenCellsWorklet : public WorkletVisitCellsWithPoints
{
using ControlSignature = void(CellSetIn cellset, FieldInPoint cellids, FieldOutCell);
using ExecutionSignature = _3(_2, PointCount);

@ -30,10 +30,10 @@ namespace worklet
struct RemoveDegenerateCells
{
struct IdentifyDegenerates : vtkm::worklet::WorkletMapPointToCell
struct IdentifyDegenerates : vtkm::worklet::WorkletVisitCellsWithPoints
{
using ControlSignature = void(CellSetIn, FieldOutCell);
using ExecutionSignature = _2(CellShape, FromIndices);
using ExecutionSignature = _2(CellShape, PointIndices);
using InputDomain = _1;
template <vtkm::IdComponent dimensionality, typename CellShapeTag, typename PointVecType>

@ -112,8 +112,8 @@ public:
VTKM_ASSERT(this->MaskArray.GetNumberOfValues() == inCellSet.GetNumberOfPoints());
vtkm::worklet::DispatcherMapField<GeneratePointMask> dispatcher;
dispatcher.Invoke(inCellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell()),
dispatcher.Invoke(inCellSet.GetConnectivityArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint()),
this->MaskArray);
}
@ -181,15 +181,15 @@ public:
const vtkm::cont::ArrayHandle<vtkm::Id, MapStorage>& inputToOutputPointMap,
vtkm::Id numberOfPoints)
{
using FromTopology = vtkm::TopologyElementTagPoint;
using ToTopology = vtkm::TopologyElementTagCell;
using VisitTopology = vtkm::TopologyElementTagCell;
using IncidentTopology = vtkm::TopologyElementTagPoint;
using NewConnectivityStorage = VTKM_DEFAULT_CONNECTIVITY_STORAGE_TAG;
vtkm::cont::ArrayHandle<vtkm::Id, NewConnectivityStorage> newConnectivityArray;
vtkm::worklet::DispatcherMapField<TransformPointIndices> dispatcher;
dispatcher.Invoke(inCellSet.GetConnectivityArray(FromTopology(), ToTopology()),
dispatcher.Invoke(inCellSet.GetConnectivityArray(VisitTopology(), IncidentTopology()),
inputToOutputPointMap,
newConnectivityArray);
@ -197,10 +197,10 @@ public:
CellSetExplicit<ShapeStorage, NumIndicesStorage, NewConnectivityStorage, OffsetsStorage>
outCellSet(inCellSet.GetName());
outCellSet.Fill(numberOfPoints,
inCellSet.GetShapesArray(FromTopology(), ToTopology()),
inCellSet.GetNumIndicesArray(FromTopology(), ToTopology()),
inCellSet.GetShapesArray(VisitTopology(), IncidentTopology()),
inCellSet.GetNumIndicesArray(VisitTopology(), IncidentTopology()),
newConnectivityArray,
inCellSet.GetIndexOffsetArray(FromTopology(), ToTopology()));
inCellSet.GetIndexOffsetArray(VisitTopology(), IncidentTopology()));
return outCellSet;
}

@ -246,7 +246,7 @@ public:
// as 89 degree, each point would be duplicated twice and there are two cells
// need connectivity update. There is no guarantee on which cell would get which
// new point.
class ClassifyPoint : public vtkm::worklet::WorkletMapCellToPoint
class ClassifyPoint : public vtkm::worklet::WorkletVisitPointsWithCells
{
public:
ClassifyPoint(vtkm::FloatDefault cosfeatureAngle)
@ -254,7 +254,7 @@ public:
{
}
using ControlSignature = void(CellSetIn intputCells,
WholeCellSetIn<Point, Cell>, // Query points from cell
WholeCellSetIn<Cell, Point>, // Query points from cell
FieldInCell faceNormals,
FieldOutPoint newPointNum,
FieldOutPoint cellNum);
@ -314,7 +314,7 @@ public:
// This worklet split the sharp edges and populate the
// cellTopologyUpdateTuples as (cellGlobalId, oldPointId, newPointId).
class SplitSharpEdge : public vtkm::worklet::WorkletMapCellToPoint
class SplitSharpEdge : public vtkm::worklet::WorkletVisitPointsWithCells
{
public:
SplitSharpEdge(vtkm::FloatDefault cosfeatureAngle, vtkm::Id numberOfOldPoints)
@ -323,7 +323,7 @@ public:
{
}
using ControlSignature = void(CellSetIn intputCells,
WholeCellSetIn<Point, Cell>, // Query points from cell
WholeCellSetIn<Cell, Point>, // Query points from cell
FieldInCell faceNormals,
FieldInPoint newPointStartingIndex,
FieldInPoint pointCellsStartingIndex,
@ -479,11 +479,11 @@ public:
CellDeepCopy::Run(oldCellset, newCellset);
// FIXME: Since the non const get array function is not in CellSetExplict.h,
// here I just get a non-const copy of the array handle.
auto connectivityArrayHandle = newCellset.GetConnectivityArray(vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell());
auto connectivityArrayHandle = newCellset.GetConnectivityArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint());
auto connectivityArrayHandleP = connectivityArrayHandle.GetPortalControl();
auto offsetArrayHandle = newCellset.GetIndexOffsetArray(vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell());
auto offsetArrayHandle = newCellset.GetIndexOffsetArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint());
auto offsetArrayHandleP = offsetArrayHandle.GetPortalControl();
for (vtkm::Id i = 0; i < cellTopologyUpdateTuples.GetNumberOfValues(); i++)
{

@ -29,7 +29,7 @@ class StreamSurface
{
public:
//Helper worklet to count various things in each polyline.
class CountPolylines : public vtkm::worklet::WorkletMapPointToCell
class CountPolylines : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
VTKM_CONT

@ -49,7 +49,7 @@ class FacetedSurfaceNormals
{
public:
template <typename NormalFnctr = detail::Normal>
class Worklet : public vtkm::worklet::WorkletMapPointToCell
class Worklet : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellset, FieldInPoint points, FieldOutCell normals);
@ -154,7 +154,7 @@ private:
class SmoothSurfaceNormals
{
public:
class Worklet : public vtkm::worklet::WorkletMapCellToPoint
class Worklet : public vtkm::worklet::WorkletVisitPointsWithCells
{
public:
using ControlSignature = void(CellSetIn cellset,

@ -41,7 +41,7 @@ public:
};
template <typename UnaryPredicate>
class ThresholdByPointField : public vtkm::worklet::WorkletMapPointToCell
class ThresholdByPointField : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellset, FieldInPoint scalars, FieldOutCell passFlags);
@ -76,10 +76,10 @@ public:
};
template <typename UnaryPredicate>
class ThresholdByCellField : public vtkm::worklet::WorkletMapPointToCell
class ThresholdByCellField : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellset, FieldInTo scalars, FieldOut passFlags);
using ControlSignature = void(CellSetIn cellset, FieldInCell scalars, FieldOut passFlags);
using ExecutionSignature = _3(_2);

@ -30,7 +30,7 @@ public:
};
template <typename UnaryPredicate>
class ThresholdPointField : public vtkm::worklet::WorkletMapCellToPoint
class ThresholdPointField : public vtkm::worklet::WorkletVisitPointsWithCells
{
public:
using ControlSignature = void(CellSetIn cellset, FieldInPoint scalars, FieldOutPoint passFlags);

@ -104,22 +104,22 @@ public:
vtkm::cont::ArrayHandle<vtkm::Id> conn;
{
const auto& connIn = cellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint{},
vtkm::TopologyElementTagCell{});
const auto& connIn = cellSet.GetConnectivityArray(vtkm::TopologyElementTagCell{},
vtkm::TopologyElementTagPoint{});
vtkm::cont::Algorithm::Copy(connIn, conn);
}
const auto& offsets = cellSet.GetIndexOffsetArray(vtkm::TopologyElementTagPoint{},
vtkm::TopologyElementTagCell{});
const auto& offsets = cellSet.GetIndexOffsetArray(vtkm::TopologyElementTagCell{},
vtkm::TopologyElementTagPoint{});
auto cells = vtkm::cont::make_ArrayHandleGroupVecVariable(conn, offsets);
WindToCellNormals dispatcher;
dispatcher.Invoke(cellNormals, cells, coords);
const auto& shapes =
cellSet.GetShapesArray(vtkm::TopologyElementTagPoint{}, vtkm::TopologyElementTagCell{});
cellSet.GetShapesArray(vtkm::TopologyElementTagCell{}, vtkm::TopologyElementTagPoint{});
const auto& numIndices =
cellSet.GetNumIndicesArray(vtkm::TopologyElementTagPoint{}, vtkm::TopologyElementTagCell{});
cellSet.GetNumIndicesArray(vtkm::TopologyElementTagCell{}, vtkm::TopologyElementTagPoint{});
vtkm::cont::CellSetExplicit<S, N, vtkm::cont::StorageTagBasic, O> newCells;
newCells.Fill(cellSet.GetNumberOfPoints(), shapes, numIndices, conn, offsets);
@ -141,13 +141,13 @@ public:
vtkm::cont::ArrayHandle<vtkm::Id> conn;
{
const auto& connIn = cellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint{},
vtkm::TopologyElementTagCell{});
const auto& connIn = cellSet.GetConnectivityArray(vtkm::TopologyElementTagCell{},
vtkm::TopologyElementTagPoint{});
vtkm::cont::Algorithm::Copy(connIn, conn);
}
const auto& offsets = cellSet.GetIndexOffsetArray(vtkm::TopologyElementTagPoint{},
vtkm::TopologyElementTagCell{});
const auto& offsets = cellSet.GetIndexOffsetArray(vtkm::TopologyElementTagCell{},
vtkm::TopologyElementTagPoint{});
auto cells = vtkm::cont::make_ArrayHandleGroupVecVariable(conn, offsets);
WindToCellNormals dispatcher;

@ -28,7 +28,7 @@ class Tube
{
public:
//Helper worklet to count various things in each polyline.
class CountSegments : public vtkm::worklet::WorkletMapPointToCell
class CountSegments : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
VTKM_CONT
@ -87,7 +87,7 @@ public:
};
//Helper worklet to generate normals at each point in the polyline.
class GenerateNormals : public vtkm::worklet::WorkletMapPointToCell
class GenerateNormals : public vtkm::worklet::WorkletVisitCellsWithPoints
{
static constexpr vtkm::FloatDefault vecMagnitudeEps = static_cast<vtkm::FloatDefault>(1e-3);
@ -100,7 +100,7 @@ public:
using ControlSignature = void(CellSetIn cellset,
WholeArrayIn pointCoords,
FieldInTo polylineOffset,
FieldInCell polylineOffset,
WholeArrayOut newNormals);
using ExecutionSignature = void(CellShape shapeType,
PointCount numPoints,
@ -249,7 +249,7 @@ public:
};
//Helper worklet to generate the tube points
class GeneratePoints : public vtkm::worklet::WorkletMapPointToCell
class GeneratePoints : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
VTKM_CONT
@ -264,8 +264,8 @@ public:
using ControlSignature = void(CellSetIn cellset,
WholeArrayIn pointCoords,
WholeArrayIn normals,
FieldInTo tubePointOffsets,
FieldInTo polylineOffset,
FieldInCell tubePointOffsets,
FieldInCell polylineOffset,
WholeArrayOut newPointCoords);
using ExecutionSignature = void(CellShape shapeType,
PointCount numPoints,
@ -378,7 +378,7 @@ public:
};
//Helper worklet to generate the tube cells
class GenerateCells : public vtkm::worklet::WorkletMapPointToCell
class GenerateCells : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
VTKM_CONT
@ -389,8 +389,8 @@ public:
}
using ControlSignature = void(CellSetIn cellset,
FieldInTo tubePointOffsets,
FieldInTo tubeConnOffsets,
FieldInCell tubePointOffsets,
FieldInCell tubeConnOffsets,
WholeArrayOut outConnectivity);
using ExecutionSignature = void(CellShape shapeType,
PointCount numPoints,

@ -175,7 +175,7 @@ struct VertexClustering
}
};
class MapCellsWorklet : public vtkm::worklet::WorkletMapPointToCell
class MapCellsWorklet : public vtkm::worklet::WorkletVisitCellsWithPoints
{
public:
using ControlSignature = void(CellSetIn cellset,

@ -29,8 +29,8 @@
#include <vtkm/exec/arg/FetchTagArrayDirectOut.h>
#include <vtkm/exec/arg/FetchTagArrayTopologyMapIn.h>
#include <vtkm/exec/arg/FetchTagCellSetIn.h>
#include <vtkm/exec/arg/FromCount.h>
#include <vtkm/exec/arg/FromIndices.h>
#include <vtkm/exec/arg/IncidentElementCount.h>
#include <vtkm/exec/arg/IncidentElementIndices.h>
#include <vtkm/exec/arg/ThreadIndicesTopologyMap.h>
namespace vtkm
@ -52,38 +52,42 @@ struct WorkletMapTopologyBase : vtkm::worklet::internal::WorkletBase
} // namespace detail
/// Base class for worklets that do a simple mapping of field arrays. All
/// inputs and outputs are on the same domain. That is, all the arrays are the
/// same size.
/// @brief Base class for worklets that map topology elements onto each other.
///
template <typename FromTopology, typename ToTopology>
/// The template parameters for this class must be members of the
/// TopologyElementTag group. The VisitTopology indicates the elements of a
/// cellset that will be visited, and the IncidentTopology will be mapped onto
/// the VisitTopology.
///
/// For instance,
/// `WorkletMapTopology<TopologyElementTagPoint, TopologyElementCell>` will
/// execute one instance per point, and provides convenience methods for
/// gathering information about the cells incident to the current point.
///
template <typename VisitTopology, typename IncidentTopology>
class WorkletMapTopology : public detail::WorkletMapTopologyBase
{
public:
using FromTopologyType = FromTopology;
using ToTopologyType = ToTopology;
using VisitTopologyType = VisitTopology;
using IncidentTopologyType = IncidentTopology;
/// \brief A control signature tag for input fields.
/// \brief A control signature tag for input fields from the \em visited
/// topology.
///
/// This tag takes a template argument that is a type list tag that limits
/// the possible value types in the array.
///
struct FieldInTo : vtkm::cont::arg::ControlSignatureTagBase
struct FieldInVisit : vtkm::cont::arg::ControlSignatureTagBase
{
using TypeCheckTag = vtkm::cont::arg::TypeCheckTagArray;
using TransportTag = vtkm::cont::arg::TransportTagTopologyFieldIn<ToTopologyType>;
using TransportTag = vtkm::cont::arg::TransportTagTopologyFieldIn<VisitTopologyType>;
using FetchTag = vtkm::exec::arg::FetchTagArrayDirectIn;
};
/// \brief A control signature tag for input connectivity.
/// \brief A control signature tag for input fields from the \em incident
/// topology.
///
/// This tag takes a template argument that is a type list tag that limits
/// the possible value types in the array.
///
struct FieldInFrom : vtkm::cont::arg::ControlSignatureTagBase
struct FieldInIncident : vtkm::cont::arg::ControlSignatureTagBase
{
using TypeCheckTag = vtkm::cont::arg::TypeCheckTagArray;
using TransportTag = vtkm::cont::arg::TransportTagTopologyFieldIn<FromTopologyType>;
using TransportTag = vtkm::cont::arg::TransportTagTopologyFieldIn<IncidentTopologyType>;
using FetchTag = vtkm::exec::arg::FetchTagArrayTopologyMapIn;
};
@ -99,10 +103,8 @@ public:
using FetchTag = vtkm::exec::arg::FetchTagArrayDirectOut;
};
/// \brief A control signature tag for input-output (in-place) fields.
///
/// This tag takes a template argument that is a type list tag that limits
/// the possible value types in the array.
/// \brief A control signature tag for input-output (in-place) fields from
/// the visited topology.
///
struct FieldInOut : vtkm::cont::arg::ControlSignatureTagBase
{
@ -116,37 +118,41 @@ public:
struct CellSetIn : vtkm::cont::arg::ControlSignatureTagBase
{
using TypeCheckTag = vtkm::cont::arg::TypeCheckTagCellSet;
using TransportTag = vtkm::cont::arg::TransportTagCellSetIn<FromTopologyType, ToTopologyType>;
using TransportTag =
vtkm::cont::arg::TransportTagCellSetIn<VisitTopologyType, IncidentTopologyType>;
using FetchTag = vtkm::exec::arg::FetchTagCellSetIn;
};
/// \brief An execution signature tag for getting the cell shape.
/// \brief An execution signature tag for getting the cell shape. This only
/// makes sense when visiting cell topologies.
///
struct CellShape : vtkm::exec::arg::CellShape
{
};
/// \brief An execution signature tag to get the number of from elements.
/// \brief An execution signature tag to get the number of \em incident
/// elements.
///
/// In a topology map, there are \em from and \em to topology elements
/// specified. The scheduling occurs on the \em to elements, and for each \em
/// to element there is some number of incident \em from elements that are
/// accessible. This \c ExecutionSignature tag provides the number of these
/// \em from elements that are accessible.
/// In a topology map, there are \em visited and \em incident topology
/// elements specified. The scheduling occurs on the \em visited elements,
/// and for each \em visited element there is some number of incident \em
/// mapped elements that are accessible. This \c ExecutionSignature tag
/// provides the number of these \em mapped elements that are accessible.
///
struct FromCount : vtkm::exec::arg::FromCount
struct IncidentElementCount : vtkm::exec::arg::IncidentElementCount
{
};
/// \brief An execution signature tag to get the indices of from elements.
///
/// In a topology map, there are \em from and \em to topology elements
/// specified. The scheduling occurs on the \em to elements, and for each \em
/// to element there is some number of incident \em from elements that are
/// accessible. This \c ExecutionSignature tag provides the indices of these
/// \em from elements that are accessible.
/// In a topology map, there are \em visited and \em incident topology
/// elements specified. The scheduling occurs on the \em visited elements,
/// and for each \em visited element there is some number of incident \em
/// mapped elements that are accessible. This \c ExecutionSignature tag
/// provides the indices of the \em mapped elements that are incident to the
/// current \em visited element.
///
struct FromIndices : vtkm::exec::arg::FromIndices
struct IncidentElementIndices : vtkm::exec::arg::IncidentElementIndices
{
};
@ -201,41 +207,46 @@ public:
/// Base class for worklets that map from Points to Cells.
///
class WorkletMapPointToCell
: public WorkletMapTopology<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell>
class WorkletVisitCellsWithPoints
: public WorkletMapTopology<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint>
{
public:
using FieldInPoint = FieldInFrom;
using FieldInPoint = FieldInIncident;
using FieldInCell = FieldInTo;
using FieldInCell = FieldInVisit;
using FieldOutCell = FieldOut;
using FieldInOutCell = FieldInOut;
using PointCount = FromCount;
using PointCount = IncidentElementCount;
using PointIndices = FromIndices;
using PointIndices = IncidentElementIndices;
};
/// Base class for worklets that map from Cells to Points.
///
class WorkletMapCellToPoint
: public WorkletMapTopology<vtkm::TopologyElementTagCell, vtkm::TopologyElementTagPoint>
class WorkletVisitPointsWithCells
: public WorkletMapTopology<vtkm::TopologyElementTagPoint, vtkm::TopologyElementTagCell>
{
public:
using FieldInCell = FieldInFrom;
using FieldInCell = FieldInIncident;
using FieldInPoint = FieldInTo;
using FieldInPoint = FieldInVisit;
using FieldOutPoint = FieldOut;
using FieldInOutPoint = FieldInOut;
using CellCount = FromCount;
using CellCount = IncidentElementCount;
using CellIndices = FromIndices;
using CellIndices = IncidentElementIndices;
};
// Deprecated signatures for legacy support. These will be removed at some
// point.
using WorkletMapCellsToPoint = WorkletVisitPointsWithCells;
using WorkletMapPointToCell = WorkletVisitCellsWithPoints;
}
} // namespace vtkm::worklet

@ -145,8 +145,8 @@ public:
struct CellSetIn : vtkm::cont::arg::ControlSignatureTagBase
{
using TypeCheckTag = vtkm::cont::arg::TypeCheckTagCellSetStructured;
using TransportTag = vtkm::cont::arg::TransportTagCellSetIn<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint>;
using TransportTag = vtkm::cont::arg::TransportTagCellSetIn<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell>;
using FetchTag = vtkm::exec::arg::FetchTagCellSetIn;
};
};
@ -184,8 +184,8 @@ public:
const OutToInArrayType& outToIn,
const VisitArrayType& visit,
const ThreadToOutArrayType& threadToOut,
const vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagCell,
vtkm::TopologyElementTagPoint,
const vtkm::exec::ConnectivityStructured<vtkm::TopologyElementTagPoint,
vtkm::TopologyElementTagCell,
Dimension>& inputDomain, //this should be explicitly
vtkm::Id globalThreadIndexOffset = 0) const
{

@ -26,7 +26,7 @@ namespace connectivity
{
namespace detail
{
struct EdgeCount : public vtkm::worklet::WorkletMapPointToCell
struct EdgeCount : public vtkm::worklet::WorkletVisitCellsWithPoints
{
using ControlSignature = void(CellSetIn, FieldOutCell numEdgesInCell);
@ -41,7 +41,7 @@ struct EdgeCount : public vtkm::worklet::WorkletMapPointToCell
}
};
struct EdgeExtract : public vtkm::worklet::WorkletMapPointToCell
struct EdgeExtract : public vtkm::worklet::WorkletVisitCellsWithPoints
{
using ControlSignature = void(CellSetIn, FieldOutCell cellIndices, FieldOutCell edgeIndices);

@ -30,7 +30,7 @@ struct CellGradientInType : vtkm::ListTagBase<T>
};
template <typename T>
struct CellGradient : vtkm::worklet::WorkletMapPointToCell
struct CellGradient : vtkm::worklet::WorkletVisitCellsWithPoints
{
using ControlSignature = void(CellSetIn,
FieldInPoint pointCoordinates,

@ -31,10 +31,10 @@ struct PointGradientInType : vtkm::ListTagBase<T>
};
template <typename T>
struct PointGradient : public vtkm::worklet::WorkletMapCellToPoint
struct PointGradient : public vtkm::worklet::WorkletVisitPointsWithCells
{
using ControlSignature = void(CellSetIn,
WholeCellSetIn<Point, Cell>,
WholeCellSetIn<Cell, Point>,
WholeArrayIn pointCoordinates,
WholeArrayIn inputField,
GradientOutputs outputFields);
@ -114,7 +114,7 @@ private:
vtkm::Id pointId) const
{
vtkm::IdComponent result = 0;
const auto& topo = indices.GetIndicesFrom();
const auto& topo = indices.GetIndicesIncident();
for (vtkm::IdComponent i = 0; i < topo.GetNumberOfComponents(); ++i)
{
if (topo[i] == pointId)

@ -247,13 +247,15 @@ public:
/// operator argument with one of the default args. This can be used to
/// global lookup for arbitrary topology information
using Cell = vtkm::TopologyElementTagCell;
using Point = vtkm::TopologyElementTagPoint;
template <typename FromType = Point, typename ToType = Cell>
using Cell = vtkm::TopologyElementTagCell;
using Edge = vtkm::TopologyElementTagEdge;
using Face = vtkm::TopologyElementTagFace;
template <typename VisitTopology = Cell, typename IncidentTopology = Point>
struct WholeCellSetIn : vtkm::cont::arg::ControlSignatureTagBase
{
using TypeCheckTag = vtkm::cont::arg::TypeCheckTagCellSet;
using TransportTag = vtkm::cont::arg::TransportTagCellSetIn<FromType, ToType>;
using TransportTag = vtkm::cont::arg::TransportTagCellSetIn<VisitTopology, IncidentTopology>;
using FetchTag = vtkm::exec::arg::FetchTagWholeCellSetIn;
};

@ -251,15 +251,15 @@ public:
{
SingleExplicitType CellSet = cellSet.Cast<SingleExplicitType>();
CellShape =
CellSet.GetShapesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell())
CellSet.GetShapesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint())
.GetPortalConstControl()
.Get(0);
PointsPerCell =
CellSet.GetNumIndicesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell())
CellSet.GetNumIndicesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint())
.GetPortalConstControl()
.Get(0);
Connectivity = CellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell());
Connectivity = CellSet.GetConnectivityArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint());
}
else
throw vtkm::cont::ErrorBadType("Cell set is not CellSetSingleType");
@ -313,13 +313,13 @@ public:
{
vtkm::cont::CellSetExplicit<> CellSet = cellSet.Cast<vtkm::cont::CellSetExplicit<>>();
Shape =
CellSet.GetShapesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
CellSet.GetShapesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
NumIdx =
CellSet.GetNumIndicesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell());
Offset = CellSet.GetIndexOffsetArray(vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell());
Connectivity = CellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell());
CellSet.GetNumIndicesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint());
Offset = CellSet.GetIndexOffsetArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint());
Connectivity = CellSet.GetConnectivityArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint());
}
else
throw vtkm::cont::ErrorBadType("Cell set is not CellSetSingleType");

@ -72,7 +72,7 @@ struct SplitProperties
}
}; // struct SplitProperties
struct CellRangesExtracter : public vtkm::worklet::WorkletMapPointToCell
struct CellRangesExtracter : public vtkm::worklet::WorkletVisitCellsWithPoints
{
typedef void ControlSignature(CellSetIn,
WholeArrayIn,

@ -21,7 +21,7 @@
namespace
{
struct CellCentroidCalculator : public vtkm::worklet::WorkletMapPointToCell
struct CellCentroidCalculator : public vtkm::worklet::WorkletVisitCellsWithPoints
{
typedef void ControlSignature(CellSetIn, FieldInPoint, FieldOut);
typedef _3 ExecutionSignature(_1, PointCount, _2);

@ -149,8 +149,8 @@ void TestClippingExplicit()
"Wrong number of points in cell set.");
VTKM_TEST_ASSERT(
TestArrayHandle(outputCellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell()),
TestArrayHandle(outputCellSet.GetConnectivityArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint()),
expectedConnectivity,
connectivitySize),
"Got incorrect conectivity");
@ -211,8 +211,8 @@ void TestClippingStructured()
"Wrong number of points in cell set.");
VTKM_TEST_ASSERT(
TestArrayHandle(outputCellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell()),
TestArrayHandle(outputCellSet.GetConnectivityArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint()),
expectedConnectivity,
connectivitySize),
"Got incorrect conectivity");
@ -270,8 +270,8 @@ void TestClippingWithImplicitFunction()
30.f, 30.f, -30.f, -30.f };
VTKM_TEST_ASSERT(
TestArrayHandle(outputCellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell()),
TestArrayHandle(outputCellSet.GetConnectivityArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint()),
expectedConnectivity,
connectivitySize),
"Got incorrect conectivity");
@ -325,8 +325,8 @@ void TestClippingWithImplicitFunctionInverted()
std::vector<vtkm::Float32> expectedCellvar = { -100.f, 100.f, 30.f, -30.f };
VTKM_TEST_ASSERT(
TestArrayHandle(outputCellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell()),
TestArrayHandle(outputCellSet.GetConnectivityArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint()),
expectedConnectivity,
connectivitySize),
"Got incorrect conectivity");

@ -150,8 +150,8 @@ void TestClippingExplicit()
"Wrong number of points in cell set.");
VTKM_TEST_ASSERT(
TestArrayHandle(outputCellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell()),
TestArrayHandle(outputCellSet.GetConnectivityArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint()),
expectedConnectivity,
connectivitySize),
"Got incorrect conectivity");
@ -212,8 +212,8 @@ void TestClippingStructured()
"Wrong number of points in cell set.");
VTKM_TEST_ASSERT(
TestArrayHandle(outputCellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell()),
TestArrayHandle(outputCellSet.GetConnectivityArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint()),
expectedConnectivity,
connectivitySize),
"Got incorrect conectivity");
@ -271,8 +271,8 @@ void TestClippingWithImplicitFunction()
30.f, 30.f, -30.f, -30.f };
VTKM_TEST_ASSERT(
TestArrayHandle(outputCellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell()),
TestArrayHandle(outputCellSet.GetConnectivityArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint()),
expectedConnectivity,
connectivitySize),
"Got incorrect conectivity");
@ -326,8 +326,8 @@ void TestClippingWithImplicitFunctionInverted()
std::vector<vtkm::Float32> expectedCellvar = { -100.f, 100.f, 30.f, -30.f };
VTKM_TEST_ASSERT(
TestArrayHandle(outputCellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell()),
TestArrayHandle(outputCellSet.GetConnectivityArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint()),
expectedConnectivity,
connectivitySize),
"Got incorrect conectivity");

@ -23,7 +23,7 @@
namespace
{
class Worklet : public vtkm::worklet::WorkletMapCellToPoint
class Worklet : public vtkm::worklet::WorkletVisitPointsWithCells
{
public:
using ControlSignature = void(CellSetIn cellset, FieldInOutPoint outPointId);

@ -92,13 +92,13 @@ struct ValidateNormals
using NormalsArrayType = vtkm::cont::ArrayHandleVirtual<NormalType>;
using NormalsPortalType = decltype(std::declval<NormalsArrayType>().GetPortalConstControl());
using ConnType =
decltype(std::declval<CellSetType>().PrepareForInput(vtkm::cont::DeviceAdapterTagSerial{},
vtkm::TopologyElementTagPoint{},
vtkm::TopologyElementTagCell{}));
using RConnType =
decltype(std::declval<CellSetType>().PrepareForInput(vtkm::cont::DeviceAdapterTagSerial{},
vtkm::TopologyElementTagCell{},
vtkm::TopologyElementTagPoint{}));
using RConnType =
decltype(std::declval<CellSetType>().PrepareForInput(vtkm::cont::DeviceAdapterTagSerial{},
vtkm::TopologyElementTagPoint{},
vtkm::TopologyElementTagCell{}));
using PointsType =
decltype(std::declval<vtkm::cont::CoordinateSystem>().GetData().GetPortalConstControl());
@ -160,16 +160,16 @@ struct ValidateNormals
// cell sets....
// Build the connectivity table on any device, then get a portal for serial
// so we can do lookups on the CPU.
this->Cells.GetConnectivityArray(vtkm::TopologyElementTagPoint{},
vtkm::TopologyElementTagCell{});
this->Cells.GetConnectivityArray(vtkm::TopologyElementTagCell{},
vtkm::TopologyElementTagPoint{});
this->Cells.GetConnectivityArray(vtkm::TopologyElementTagCell{},
vtkm::TopologyElementTagPoint{});
this->Conn = this->Cells.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial{},
vtkm::TopologyElementTagPoint{},
vtkm::TopologyElementTagCell{});
vtkm::TopologyElementTagCell{},
vtkm::TopologyElementTagPoint{});
this->RConn = this->Cells.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial{},
vtkm::TopologyElementTagCell{},
vtkm::TopologyElementTagPoint{});
vtkm::TopologyElementTagPoint{},
vtkm::TopologyElementTagCell{});
if (this->CheckPoints)
{

@ -52,7 +52,7 @@ struct FieldWorklet : vtkm::worklet::WorkletMapField
}
};
struct TopologyWorklet : vtkm::worklet::WorkletMapCellToPoint
struct TopologyWorklet : vtkm::worklet::WorkletVisitPointsWithCells
{
using ControlSignature = void(CellSetIn,
FieldInPoint inputField,

@ -21,7 +21,7 @@
namespace
{
class Worklet : public vtkm::worklet::WorkletMapCellToPoint
class Worklet : public vtkm::worklet::WorkletVisitPointsWithCells
{
public:
using ControlSignature = void(CellSetIn cellset,

@ -190,8 +190,8 @@ void TestSplitSharpEdgesNoSplit(vtkm::cont::DataSet& simpleCube,
"result value does not match expected value");
}
const auto& connectivityArray = newCellset.GetConnectivityArray(vtkm::TopologyElementTagPoint(),
vtkm::TopologyElementTagCell());
const auto& connectivityArray = newCellset.GetConnectivityArray(vtkm::TopologyElementTagCell(),
vtkm::TopologyElementTagPoint());
auto connectivityArrayPortal = connectivityArray.GetPortalConstControl();
for (int i = 0; i < connectivityArray.GetNumberOfValues(); i++)
{

Some files were not shown because too many files have changed in this diff Show More