From 5db762ee71cf1f07b803b5c2533be1add0bfe71a Mon Sep 17 00:00:00 2001 From: Allison Vacanti Date: Tue, 30 Jul 2019 12:53:51 -0400 Subject: [PATCH] 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 ``` --- benchmarking/BenchmarkFieldAlgorithms.cxx | 2 +- benchmarking/BenchmarkFilters.cxx | 6 +- benchmarking/BenchmarkTopologyAlgorithms.cxx | 6 +- docs/changelog/refactor-topo-mapping.md | 35 +++ vtkm/cont/CellLocatorUniformBins.cxx | 8 +- vtkm/cont/CellLocatorUniformBins.h | 8 +- vtkm/cont/CellSetExplicit.h | 154 ++++++------ vtkm/cont/CellSetExplicit.hxx | 229 +++++++++--------- vtkm/cont/CellSetExtrude.cxx | 4 +- vtkm/cont/CellSetExtrude.h | 14 +- vtkm/cont/CellSetExtrude.hxx | 8 +- vtkm/cont/CellSetPermutation.h | 90 +++---- vtkm/cont/CellSetSingleType.h | 43 ++-- vtkm/cont/CellSetStructured.h | 15 +- vtkm/cont/CellSetStructured.hxx | 13 +- vtkm/cont/arg/TransportTagCellSetIn.h | 13 +- .../testing/UnitTestTransportCellSetIn.cxx | 17 +- .../internal/ConnectivityExplicitInternals.h | 20 +- vtkm/cont/testing/Testing.h | 20 +- .../testing/TestingCellLocatorUniformBins.h | 2 +- vtkm/cont/testing/TestingDataSetExplicit.h | 6 +- vtkm/cont/testing/TestingDataSetSingleType.h | 12 +- .../testing/UnitTestCellLocatorGeneral.cxx | 2 +- vtkm/cont/testing/UnitTestCellSetExplicit.cxx | 18 +- vtkm/cont/testing/UnitTestCellSetExtrude.cxx | 4 +- .../testing/UnitTestCellSetPermutation.cxx | 6 +- .../testing/UnitTestDataSetPermutation.cxx | 14 +- .../testing/UnitTestDataSetRectilinear.cxx | 22 +- vtkm/cont/testing/UnitTestDataSetUniform.cxx | 22 +- ...CellLocatorBoundingIntervalHierarchyExec.h | 11 +- vtkm/exec/CellLocatorRectilinearGrid.h | 10 +- vtkm/exec/CellLocatorUniformGrid.h | 10 +- vtkm/exec/ConnectivityPermuted.h | 19 +- vtkm/exec/ConnectivityStructured.h | 13 +- vtkm/exec/arg/CMakeLists.txt | 4 +- vtkm/exec/arg/FetchExtrude.h | 12 +- vtkm/exec/arg/FetchTagArrayTopologyMapIn.h | 30 +-- .../{FromCount.h => IncidentElementCount.h} | 34 +-- ...FromIndices.h => IncidentElementIndices.h} | 37 +-- vtkm/exec/arg/ThreadIndicesExtrude.h | 24 +- .../exec/arg/ThreadIndicesPointNeighborhood.h | 12 +- vtkm/exec/arg/ThreadIndicesTopologyMap.h | 101 ++++---- .../UnitTestFetchArrayNeighborhoodIn.cxx | 4 +- .../UnitTestFetchArrayTopologyMapIn.cxx | 14 +- vtkm/filter/MeshQuality.hxx | 2 +- .../testing/UnitTestSplitSharpEdgesFilter.cxx | 4 +- .../UnitTestVertexClusteringFilter.cxx | 2 +- .../ConnectivityStructuredInternals.h | 12 +- vtkm/rendering/Cylinderizer.h | 10 +- vtkm/rendering/MapperWireframer.cxx | 4 +- vtkm/rendering/Quadralizer.h | 10 +- vtkm/rendering/Triangulator.h | 10 +- .../raytracing/CylinderExtractor.cxx | 4 +- .../raytracing/MeshConnectivityBuilder.cxx | 22 +- .../raytracing/MeshConnectivityContainers.cxx | 10 +- vtkm/rendering/raytracing/MortonCodes.h | 6 +- vtkm/rendering/raytracing/QuadExtractor.cxx | 4 +- vtkm/rendering/raytracing/SphereExtractor.cxx | 4 +- .../raytracing/VolumeRendererStructured.cxx | 12 +- vtkm/worklet/CellAverage.h | 2 +- vtkm/worklet/CellDeepCopy.h | 4 +- vtkm/worklet/CellMeasure.h | 2 +- vtkm/worklet/Clip.h | 6 +- vtkm/worklet/DispatcherMapTopology.h | 2 +- vtkm/worklet/ExternalFaces.h | 16 +- vtkm/worklet/ExtractGeometry.h | 2 +- vtkm/worklet/ExtractPoints.h | 2 +- vtkm/worklet/MarchingCubes.h | 22 +- vtkm/worklet/MeshQuality.h | 2 +- vtkm/worklet/OrientCellNormals.h | 6 +- vtkm/worklet/OrientPointAndCellNormals.h | 8 +- vtkm/worklet/OrientPointNormals.h | 4 +- vtkm/worklet/PointAverage.h | 2 +- vtkm/worklet/Probe.h | 4 +- vtkm/worklet/RemoveDegenerateCells.h | 4 +- vtkm/worklet/RemoveUnusedPoints.h | 16 +- vtkm/worklet/SplitSharpEdges.h | 16 +- vtkm/worklet/StreamSurface.h | 2 +- vtkm/worklet/SurfaceNormals.h | 4 +- vtkm/worklet/Threshold.h | 6 +- vtkm/worklet/ThresholdPoints.h | 2 +- vtkm/worklet/TriangleWinding.h | 20 +- vtkm/worklet/Tube.h | 18 +- vtkm/worklet/VertexClustering.h | 2 +- vtkm/worklet/WorkletMapTopology.h | 113 +++++---- vtkm/worklet/WorkletPointNeighborhood.h | 8 +- .../worklet/connectivities/CellSetDualGraph.h | 4 +- vtkm/worklet/gradient/CellGradient.h | 2 +- vtkm/worklet/gradient/PointGradient.h | 6 +- vtkm/worklet/internal/WorkletBase.h | 8 +- .../CellInterpolationHelper.h | 20 +- .../BoundingIntervalHierarchy.h | 2 +- .../UnitTestBoundingIntervalHierarchy.cxx | 2 +- vtkm/worklet/testing/UnitTestClipping.cxx | 16 +- .../testing/UnitTestClippingWithFunction.cxx | 16 +- vtkm/worklet/testing/UnitTestMaskIndices.cxx | 2 +- .../worklet/testing/UnitTestOrientNormals.cxx | 20 +- .../testing/UnitTestScatterAndMask.cxx | 2 +- .../testing/UnitTestScatterPermutation.cxx | 2 +- .../testing/UnitTestSplitSharpEdges.cxx | 4 +- .../testing/UnitTestTriangleWinding.cxx | 4 +- .../testing/UnitTestVertexClustering.cxx | 8 +- .../testing/UnitTestWholeCellSetIn.cxx | 8 +- .../UnitTestWorkletMapTopologyExplicit.cxx | 2 +- .../UnitTestWorkletMapTopologyUniform.cxx | 4 +- .../tetrahedralize/TetrahedralizeExplicit.h | 6 +- .../tetrahedralize/TetrahedralizeStructured.h | 2 +- .../worklet/triangulate/TriangulateExplicit.h | 6 +- .../triangulate/TriangulateStructured.h | 2 +- 109 files changed, 891 insertions(+), 816 deletions(-) create mode 100644 docs/changelog/refactor-topo-mapping.md rename vtkm/exec/arg/{FromCount.h => IncidentElementCount.h} (54%) rename vtkm/exec/arg/{FromIndices.h => IncidentElementIndices.h} (52%) diff --git a/benchmarking/BenchmarkFieldAlgorithms.cxx b/benchmarking/BenchmarkFieldAlgorithms.cxx index 68a4ca77a..2492365bf 100644 --- a/benchmarking/BenchmarkFieldAlgorithms.cxx +++ b/benchmarking/BenchmarkFieldAlgorithms.cxx @@ -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); diff --git a/benchmarking/BenchmarkFilters.cxx b/benchmarking/BenchmarkFilters.cxx index 58b429d8d..57f4e5084 100644 --- a/benchmarking/BenchmarkFilters.cxx +++ b/benchmarking/BenchmarkFilters.cxx @@ -655,14 +655,14 @@ class BenchmarkFilters { // Why does CastAndCall insist on making the cellset const? using CellSetT = vtkm::cont::CellSetExplicit; CellSetT& mcellSet = const_cast(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(); } }; diff --git a/benchmarking/BenchmarkTopologyAlgorithms.cxx b/benchmarking/BenchmarkTopologyAlgorithms.cxx index 7367b6f0a..e592fbdc0 100644 --- a/benchmarking/BenchmarkTopologyAlgorithms.cxx +++ b/benchmarking/BenchmarkTopologyAlgorithms.cxx @@ -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 -class Classification : public vtkm::worklet::WorkletMapPointToCell +class Classification : public vtkm::worklet::WorkletVisitCellsWithPoints { public: using ControlSignature = void(FieldInPoint inNodes, CellSetIn cellset, FieldOutCell outCaseId); diff --git a/docs/changelog/refactor-topo-mapping.md b/docs/changelog/refactor-topo-mapping.md new file mode 100644 index 000000000..9dce06aad --- /dev/null +++ b/docs/changelog/refactor-topo-mapping.md @@ -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 +``` diff --git a/vtkm/cont/CellLocatorUniformBins.cxx b/vtkm/cont/CellLocatorUniformBins.cxx index 99b42a1e8..e0fd7d5bc 100644 --- a/vtkm/cont/CellLocatorUniformBins.cxx +++ b/vtkm/cont/CellLocatorUniformBins.cxx @@ -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, diff --git a/vtkm/cont/CellLocatorUniformBins.h b/vtkm/cont/CellLocatorUniformBins.h index 04c7359cd..2c696a859 100644 --- a/vtkm/cont/CellLocatorUniformBins.h +++ b/vtkm/cont/CellLocatorUniformBins.h @@ -99,8 +99,8 @@ private: using CellSetP2CExecType = decltype(std::declval().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{})) { } diff --git a/vtkm/cont/CellSetExplicit.h b/vtkm/cont/CellSetExplicit.h index e1d39449c..ecffb6672 100644 --- a/vtkm/cont/CellSetExplicit.h +++ b/vtkm/cont/CellSetExplicit.h @@ -28,7 +28,7 @@ namespace cont namespace detail { -template +template struct CellSetExplicitConnectivityChooser { using ConnectivityType = vtkm::cont::internal::ConnectivityExplicitInternals<>; @@ -63,13 +63,13 @@ class VTKM_ALWAYS_EXPORT CellSetExplicit : public CellSet ConnectivityStorageTag, OffsetsStorageTag>; - template + template struct ConnectivityChooser { using ConnectivityType = typename detail::CellSetExplicitConnectivityChooser::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::ConnectivityType; - - using CellToPointInternalsType = + using VisitCellsWithPointsInternalsType = typename ConnectivityChooser::ConnectivityType; + using VisitPointsWithCellsInternalsType = + typename ConnectivityChooser::ConnectivityType; + public: using SchedulingRangeType = vtkm::Id; //point to cell is used when iterating cells and asking for point properties - using PointToCellConnectivityType = - ConnectivityChooser; + using VisitCellsWithPointsConnectivityType = + ConnectivityChooser; - 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& offsets = vtkm::cont::ArrayHandle()); - template + template 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; + using ConnectivityTypes = ConnectivityChooser; using ShapePortalType = typename ConnectivityTypes::ShapeArrayType::template ExecutionTypes< DeviceAdapter>::PortalConst; @@ -175,82 +176,85 @@ public: IndexOffsetPortalType>; }; - template - typename ExecutionTypes::ExecObjectType - PrepareForInput(Device, FromTopology, ToTopology) const; + template + typename ExecutionTypes::ExecObjectType + PrepareForInput(Device, VisitTopology, IncidentTopology) const; - template - VTKM_CONT const typename ConnectivityChooser::ShapeArrayType& - GetShapesArray(FromTopology, ToTopology) const; + template + VTKM_CONT const typename ConnectivityChooser::ShapeArrayType& + GetShapesArray(VisitTopology, IncidentTopology) const; - template - VTKM_CONT const typename ConnectivityChooser::NumIndicesArrayType& - GetNumIndicesArray(FromTopology, ToTopology) const; + template + VTKM_CONT const typename ConnectivityChooser::NumIndicesArrayType& + GetNumIndicesArray(VisitTopology, IncidentTopology) const; - template - VTKM_CONT const typename ConnectivityChooser::ConnectivityArrayType& - GetConnectivityArray(FromTopology, ToTopology) const; + template + VTKM_CONT const typename ConnectivityChooser::ConnectivityArrayType& + GetConnectivityArray(VisitTopology, IncidentTopology) const; - template - VTKM_CONT const typename ConnectivityChooser::IndexOffsetArrayType& - GetIndexOffsetArray(FromTopology, ToTopology) const; + template + VTKM_CONT const typename ConnectivityChooser::IndexOffsetArrayType& + GetIndexOffsetArray(VisitTopology, IncidentTopology) const; // Can be used to check if e.g. CellToPoint table is built. - template - VTKM_CONT bool HasConnectivity(FromTopology from, ToTopology to) const + template + 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 - VTKM_CONT void ResetConnectivity(FromTopology from, ToTopology to) + template + 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 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 struct CellSetExplicitConnectivityChooser< vtkm::cont::CellSetExplicit, - vtkm::TopologyElementTagPoint, - vtkm::TopologyElementTagCell> + vtkm::TopologyElementTagCell, + vtkm::TopologyElementTagPoint> { using ConnectivityType = vtkm::cont::internal::ConnectivityExplicitInternals; @@ -311,8 +315,8 @@ struct CellSetExplicitConnectivityChooser< template struct CellSetExplicitConnectivityChooser + 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) diff --git a/vtkm/cont/CellSetExplicit.hxx b/vtkm/cont/CellSetExplicit.hxx index 3f6b5f937..c2cf0e6d5 100644 --- a/vtkm/cont/CellSetExplicit.hxx +++ b/vtkm/cont/CellSetExplicit.hxx @@ -104,10 +104,10 @@ void CellSetExplicit::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 ::ReleaseResourcesExecution() { - this->Data->PointToCell.ReleaseResourcesExecution(); - this->Data->CellToPoint.ReleaseResourcesExecution(); + this->Data->VisitCellsWithPoints.ReleaseResourcesExecution(); + this->Data->VisitPointsWithCells.ReleaseResourcesExecution(); } //---------------------------------------------------------------------------- @@ -134,7 +134,7 @@ vtkm::Id CellSetExplicit::GetNumberOfCells() const { - return this->Data->PointToCell.GetNumberOfElements(); + return this->Data->VisitCellsWithPoints.GetNumberOfElements(); } template :: GetNumberOfPointsInCell(vtkm::Id cellIndex) const { - return this->Data->PointToCell.NumIndices.GetPortalConstControl().Get(cellIndex); + return this->Data->VisitCellsWithPoints.NumIndices.GetPortalConstControl().Get(cellIndex); } template ::GetCellShape(vtkm::Id cellIndex) const { - return this->Data->PointToCell.Shapes.GetPortalConstControl().Get(cellIndex); + return this->Data->VisitCellsWithPoints.Shapes.GetPortalConstControl().Get(cellIndex); } template :: GetIndices(vtkm::Id index, vtkm::Vec& 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:: GetIndices(vtkm::Id index, vtkm::cont::ArrayHandle& 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::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::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 @@ CellSetExplicitData->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::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& 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 @@ CellSetExplicitResetConnectivity(TopologyElementTagCell{}, TopologyElementTagPoint{}); + this->ResetConnectivity(TopologyElementTagPoint{}, TopologyElementTagCell{}); } //---------------------------------------------------------------------------- @@ -407,19 +410,22 @@ template -template +template auto CellSetExplicit::PrepareForInput(Device, FromTopology, ToTopology) const -> - typename ExecutionTypes::ExecObjectType + OffsetsStorageTag>::PrepareForInput(Device, + VisitTopology, + IncidentTopology) const -> + typename ExecutionTypes::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::ExecObjectType; + using ExecObjType = + typename ExecutionTypes::ExecObjectType; return ExecObjType(connectivity.Shapes.PrepareForInput(Device()), connectivity.NumIndices.PrepareForInput(Device()), connectivity.Connectivity.PrepareForInput(Device()), @@ -432,63 +438,64 @@ template -template +template VTKM_CONT auto CellSetExplicit::GetShapesArray(FromTopology, ToTopology) const - -> const typename ConnectivityChooser::ShapeArrayType& + OffsetsStorageTag>::GetShapesArray(VisitTopology, + IncidentTopology) const -> const + typename ConnectivityChooser::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 -template +template VTKM_CONT auto CellSetExplicit::GetNumIndicesArray(FromTopology, - ToTopology) const -> const - typename ConnectivityChooser::NumIndicesArrayType& + OffsetsStorageTag>::GetNumIndicesArray(VisitTopology, + IncidentTopology) const + -> const typename ConnectivityChooser::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 -template +template VTKM_CONT auto CellSetExplicit::GetConnectivityArray(FromTopology, - ToTopology) const -> const - typename ConnectivityChooser::ConnectivityArrayType& + OffsetsStorageTag>::GetConnectivityArray(VisitTopology, + IncidentTopology) const + -> const typename ConnectivityChooser::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 -template +template VTKM_CONT auto CellSetExplicit::GetIndexOffsetArray(FromTopology, - ToTopology) const -> const - typename ConnectivityChooser::IndexOffsetArrayType& + OffsetsStorageTag>::GetIndexOffsetArray(VisitTopology, + IncidentTopology) const + -> const typename ConnectivityChooser::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 CellSetExplicitFill(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 -struct BuildPointToCellConnectivityFunctor +template +struct BuildVisitCellsWithPointsConnectivityFunctor { - explicit BuildPointToCellConnectivityFunctor(PointToCellConnectivity& pointToCell) - : PointToCell(&pointToCell) + explicit BuildVisitCellsWithPointsConnectivityFunctor(VisitCellsWithPointsConnectivity& obj) + : VisitCellsWithPoints(&obj) { } template bool operator()(Device) const { - this->PointToCell->BuildIndexOffsets(Device()); + this->VisitCellsWithPoints->BuildIndexOffsets(Device()); return true; } - PointToCellConnectivity* PointToCell; + VisitCellsWithPointsConnectivity* VisitCellsWithPoints; }; -template -struct BuildCellToPointConnectivityFunctor +template +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 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 :: BuildConnectivity(vtkm::cont::DeviceAdapterId device, - vtkm::TopologyElementTagPoint, - vtkm::TopologyElementTagCell) const + vtkm::TopologyElementTagCell, + vtkm::TopologyElementTagPoint) const { - using PointToCellConnectivity = - typename ConnectivityChooser::ConnectivityType; + using VisitCellsWithPointsConnectivity = + typename ConnectivityChooser::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(this); auto functor = - detail::BuildPointToCellConnectivityFunctor(self->Data->PointToCell); + detail::BuildVisitCellsWithPointsConnectivityFunctor( + self->Data->VisitCellsWithPoints); if (!vtkm::cont::TryExecuteOnDevice(device, functor)) { throw vtkm::cont::ErrorExecution("Failed to run BuildConnectivity."); @@ -616,22 +625,26 @@ template :: BuildConnectivity(vtkm::cont::DeviceAdapterId device, - vtkm::TopologyElementTagCell, - vtkm::TopologyElementTagPoint) const + vtkm::TopologyElementTagPoint, + vtkm::TopologyElementTagCell) const { - using PointToCellConnectivity = - typename ConnectivityChooser::ConnectivityType; - using CellToPointConnectivity = + using VisitCellsWithPointsConnectivity = typename ConnectivityChooser::ConnectivityType; + using VisitPointsWithCellsConnectivity = + typename ConnectivityChooser::ConnectivityType; - if (!this->Data->CellToPoint.ElementsValid || !this->Data->CellToPoint.IndexOffsetsValid) + if (!this->Data->VisitPointsWithCells.ElementsValid || + !this->Data->VisitPointsWithCells.IndexOffsetsValid) { auto self = const_cast(this); auto functor = - detail::BuildCellToPointConnectivityFunctor( - self->Data->PointToCell, self->Data->CellToPoint, this->Data->NumberOfPoints); + detail::BuildVisitPointsWithCellsConnectivityFunctor( + self->Data->VisitCellsWithPoints, + self->Data->VisitPointsWithCells, + this->Data->NumberOfPoints); if (!vtkm::cont::TryExecuteOnDevice(device, functor)) { throw vtkm::cont::ErrorExecution("Failed to run BuildConnectivity."); diff --git a/vtkm/cont/CellSetExtrude.cxx b/vtkm/cont/CellSetExtrude.cxx index ae65496fa..ef883df58 100644 --- a/vtkm/cont/CellSetExtrude.cxx +++ b/vtkm/cont/CellSetExtrude.cxx @@ -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) { diff --git a/vtkm/cont/CellSetExtrude.h b/vtkm/cont/CellSetExtrude.h index 15966aaeb..87567571e 100644 --- a/vtkm/cont/CellSetExtrude.h +++ b/vtkm/cont/CellSetExtrude.h @@ -68,30 +68,30 @@ public: template using ConnectivityC2P = vtkm::exec::ReverseConnectivityExtrude; - template + template struct ExecutionTypes; template - struct ExecutionTypes + struct ExecutionTypes { using ExecObjectType = ConnectivityP2C; }; template - struct ExecutionTypes + struct ExecutionTypes { using ExecObjectType = ConnectivityC2P; }; template ConnectivityP2C PrepareForInput(Device, - vtkm::TopologyElementTagPoint, - vtkm::TopologyElementTagCell) const; + vtkm::TopologyElementTagCell, + vtkm::TopologyElementTagPoint) const; template ConnectivityC2P PrepareForInput(Device, - vtkm::TopologyElementTagCell, - vtkm::TopologyElementTagPoint) const; + vtkm::TopologyElementTagPoint, + vtkm::TopologyElementTagCell) const; private: template diff --git a/vtkm/cont/CellSetExtrude.hxx b/vtkm/cont/CellSetExtrude.hxx index 0558e0d1c..9ad2f140e 100644 --- a/vtkm/cont/CellSetExtrude.hxx +++ b/vtkm/cont/CellSetExtrude.hxx @@ -87,8 +87,8 @@ VTKM_CONT void CellSetExtrude::BuildReverseConnectivity(Device) template CellSetExtrude::ConnectivityP2C CellSetExtrude::PrepareForInput( Device, - vtkm::TopologyElementTagPoint, - vtkm::TopologyElementTagCell) const + vtkm::TopologyElementTagCell, + vtkm::TopologyElementTagPoint) const { return ConnectivityP2C(this->Connectivity.PrepareForInput(Device{}), this->NextNode.PrepareForInput(Device{}), @@ -102,8 +102,8 @@ CellSetExtrude::ConnectivityP2C CellSetExtrude::PrepareForInput( template VTKM_CONT CellSetExtrude::ConnectivityC2P CellSetExtrude::PrepareForInput( Device, - vtkm::TopologyElementTagCell, - vtkm::TopologyElementTagPoint) const + vtkm::TopologyElementTagPoint, + vtkm::TopologyElementTagCell) const { if (!this->ReverseConnectivityBuilt) { diff --git a/vtkm/cont/CellSetPermutation.h b/vtkm/cont/CellSetPermutation.h index ad787bbef..384ed1143 100644 --- a/vtkm/cont/CellSetPermutation.h +++ b/vtkm/cont/CellSetPermutation.h @@ -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 -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 -class CellSetPermutationPointToCell< +class CellSetPermutationVisitCellsWithPoints< CellSetPermutation, 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 -class CellSetPermutationPointToCell< +class CellSetPermutationVisitCellsWithPoints< CellSetPermutation, PermutationArrayHandleType>> { private: @@ -197,7 +198,7 @@ public: ConnectivityArrays conn; conn.NumIndices = make_ArrayHandleConstant(numPointsInCell, numberOfCells); conn.IndexOffsets = ArrayHandleCounting(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 + template struct ExecutionTypes; template - struct ExecutionTypes + struct ExecutionTypes { VTKM_IS_DEVICE_ADAPTER_TAG(Device); @@ -349,15 +350,15 @@ public: typename PermutationArrayHandleType::template ExecutionTypes::PortalConst; using OrigExecObjectType = typename OriginalCellSetType::template ExecutionTypes< Device, - vtkm::TopologyElementTagPoint, - vtkm::TopologyElementTagCell>::ExecObjectType; + vtkm::TopologyElementTagCell, + vtkm::TopologyElementTagPoint>::ExecObjectType; using ExecObjectType = - vtkm::exec::ConnectivityPermutedPointToCell; + vtkm::exec::ConnectivityPermutedVisitCellsWithPoints; }; template - struct ExecutionTypes + struct ExecutionTypes { VTKM_IS_DEVICE_ADAPTER_TAG(Device); @@ -368,47 +369,48 @@ public: using IndexOffsetPortalType = typename vtkm::cont::ArrayHandle::template ExecutionTypes::PortalConst; - using ExecObjectType = vtkm::exec::ConnectivityPermutedCellToPoint; + using ExecObjectType = + vtkm::exec::ConnectivityPermutedVisitPointsWithCells; }; template VTKM_CONT typename ExecutionTypes::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::ExecObjectType; + vtkm::TopologyElementTagCell, + vtkm::TopologyElementTagPoint>::ExecObjectType; return ConnectivityType(this->ValidCellIds.PrepareForInput(device), this->FullCellSet.PrepareForInput(device, from, to)); } template VTKM_CONT typename ExecutionTypes::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::Get(*this, device); - internal::ComputeCellToPointConnectivity( - this->CellToPoint, pointToCell, this->GetNumberOfPoints(), device); - this->CellToPoint.BuildIndexOffsets(device); + internal::CellSetPermutationVisitCellsWithPoints::Get(*this, device); + internal::ComputeVisitPointsWithCellsConnectivity( + this->VisitPointsWithCells, pointToCell, this->GetNumberOfPoints(), device); + this->VisitPointsWithCells.BuildIndexOffsets(device); } using ConnectivityType = typename ExecutionTypes::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::StorageTag>; PermutationArrayHandleType ValidCellIds; OriginalCellSetType FullCellSet; - mutable CellToPointConnectivity CellToPoint; + mutable VisitPointsWithCellsConnectivity VisitPointsWithCells; }; template 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(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(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) diff --git a/vtkm/cont/CellSetStructured.h b/vtkm/cont/CellSetStructured.h index a810445f3..e6cd63a1c 100644 --- a/vtkm/cont/CellSetStructured.h +++ b/vtkm/cont/CellSetStructured.h @@ -115,18 +115,19 @@ public: template SchedulingRangeType GetSchedulingRange(TopologyElement) const; - template + template 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; + VTKM_IS_TOPOLOGY_ELEMENT_TAG(VisitTopology); + VTKM_IS_TOPOLOGY_ELEMENT_TAG(IncidentTopology); + using ExecObjectType = + vtkm::exec::ConnectivityStructured; }; - template - typename ExecutionTypes::ExecObjectType - PrepareForInput(DeviceAdapter, FromTopology, ToTopology) const; + template + typename ExecutionTypes::ExecObjectType + PrepareForInput(DeviceAdapter, VisitTopology, IncidentTopology) const; void PrintSummary(std::ostream& out) const override; diff --git a/vtkm/cont/CellSetStructured.hxx b/vtkm/cont/CellSetStructured.hxx index 0269e5445..e1a47e4e3 100644 --- a/vtkm/cont/CellSetStructured.hxx +++ b/vtkm/cont/CellSetStructured.hxx @@ -57,13 +57,16 @@ typename CellSetStructured::SchedulingRangeType } template -template -typename CellSetStructured< - DIMENSION>::template ExecutionTypes::ExecObjectType - CellSetStructured::PrepareForInput(DeviceAdapter, FromTopology, ToTopology) const +template +typename CellSetStructured::template ExecutionTypes::ExecObjectType + CellSetStructured::PrepareForInput(DeviceAdapter, + VisitTopology, + IncidentTopology) const { using ConnectivityType = - typename ExecutionTypes::ExecObjectType; + typename ExecutionTypes::ExecObjectType; return ConnectivityType(this->Structure); } diff --git a/vtkm/cont/arg/TransportTagCellSetIn.h b/vtkm/cont/arg/TransportTagCellSetIn.h index 3e1a0e2c5..19103e419 100644 --- a/vtkm/cont/arg/TransportTagCellSetIn.h +++ b/vtkm/cont/arg/TransportTagCellSetIn.h @@ -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 +template struct TransportTagCellSetIn { }; -template -struct Transport, +template +struct Transport, ContObjectType, Device> { VTKM_IS_CELL_SET(ContObjectType); using ExecObjectType = decltype( - std::declval().PrepareForInput(Device(), FromTopology(), ToTopology())); + std::declval().PrepareForInput(Device(), VisitTopology(), IncidentTopology())); template 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()); } }; } diff --git a/vtkm/cont/arg/testing/UnitTestTransportCellSetIn.cxx b/vtkm/cont/arg/testing/UnitTestTransportCellSetIn.cxx index 0d30c75e5..9feb1f138 100644 --- a/vtkm/cont/arg/testing/UnitTestTransportCellSetIn.cxx +++ b/vtkm/cont/arg/testing/UnitTestTransportCellSetIn.cxx @@ -59,17 +59,16 @@ void TransportWholeCellSetIn(Device) contObject.AddCell(vtkm::CELL_SHAPE_QUAD, 4, vtkm::make_Vec(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::ExecObjectType; + using ExecObjectType = typename vtkm::cont::CellSetExplicit<>:: + template ExecutionTypes::ExecObjectType; - vtkm::cont::arg::Transport, - vtkm::cont::CellSetExplicit<>, - Device> + vtkm::cont::arg::Transport< + vtkm::cont::arg::TransportTagCellSetIn, + vtkm::cont::CellSetExplicit<>, + Device> transport; TestKernel kernel; diff --git a/vtkm/cont/internal/ConnectivityExplicitInternals.h b/vtkm/cont/internal/ConnectivityExplicitInternals.h index 3c7c960c9..f6af9a4ad 100644 --- a/vtkm/cont/internal/ConnectivityExplicitInternals.h +++ b/vtkm/cont/internal/ConnectivityExplicitInternals.h @@ -225,11 +225,11 @@ struct ConnIdxToCellIdCalcSingleType vtkm::Id operator()(vtkm::Id inIdx) const { return inIdx / this->CellSize; } }; -template -void ComputeCellToPointConnectivity(CellToPoint& cell2Point, - const PointToCell& point2Cell, - vtkm::Id numberOfPoints, - Device) +template +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(CELL_SHAPE_VERTEX), numberOfPoints); cell2Point.ElementsValid = true; @@ -269,10 +269,10 @@ void ComputeCellToPointConnectivity(CellToPoint& cell2Point, template -void ComputeCellToPointConnectivity( - CellToPoint& cell2Point, +void ComputeVisitPointsWithCellsConnectivity( + VisitPointsWithCells& cell2Point, const ConnectivityExplicitInternals< ShapeStorageTag, vtkm::cont::ArrayHandleConstant::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(CELL_SHAPE_VERTEX), numberOfPoints); cell2Point.ElementsValid = true; diff --git a/vtkm/cont/testing/Testing.h b/vtkm/cont/testing/Testing.h index 66e21c3e0..9e48f7d20 100644 --- a/vtkm/cont/testing/Testing.h +++ b/vtkm/cont/testing/Testing.h @@ -235,8 +235,8 @@ struct TestEqualCellSet const vtkm::cont::CellSetExplicit& 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"); diff --git a/vtkm/cont/testing/TestingCellLocatorUniformBins.h b/vtkm/cont/testing/TestingCellLocatorUniformBins.h index 9c64668d6..94e89123c 100644 --- a/vtkm/cont/testing/TestingCellLocatorUniformBins.h +++ b/vtkm/cont/testing/TestingCellLocatorUniformBins.h @@ -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, diff --git a/vtkm/cont/testing/TestingDataSetExplicit.h b/vtkm/cont/testing/TestingDataSetExplicit.h index 11cf59f87..fb53bb4b8 100644 --- a/vtkm/cont/testing/TestingDataSetExplicit.h +++ b/vtkm/cont/testing/TestingDataSetExplicit.h @@ -103,11 +103,11 @@ private: vtkm::Id correctConnectivity[] = { 0, 0, 1, 0, 1, 1, 1 }; vtkm::cont::ArrayHandleConstant shapes = - cellset.GetShapesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); + cellset.GetShapesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); vtkm::cont::ArrayHandle numIndices = - cellset.GetNumIndicesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); + cellset.GetNumIndicesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); vtkm::cont::ArrayHandle 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), diff --git a/vtkm/cont/testing/TestingDataSetSingleType.h b/vtkm/cont/testing/TestingDataSetSingleType.h index 99a72b12b..2b22e1b01 100644 --- a/vtkm/cont/testing/TestingDataSetSingleType.h +++ b/vtkm/cont/testing/TestingDataSetSingleType.h @@ -104,11 +104,11 @@ private: //verify that the point to cell connectivity types are correct vtkm::cont::ArrayHandleConstant shapesPointToCell = - cellset.GetShapesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); + cellset.GetShapesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); vtkm::cont::ArrayHandleConstant numIndicesPointToCell = - cellset.GetNumIndicesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); + cellset.GetNumIndicesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); vtkm::cont::ArrayHandle 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 shapesCellToPoint = - cellset.GetShapesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); + cellset.GetShapesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); vtkm::cont::ArrayHandle numIndicesCellToPoint = - cellset.GetNumIndicesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); + cellset.GetNumIndicesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); vtkm::cont::ArrayHandle 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"); diff --git a/vtkm/cont/testing/UnitTestCellLocatorGeneral.cxx b/vtkm/cont/testing/UnitTestCellLocatorGeneral.cxx index fa3d8a896..f187a69d1 100644 --- a/vtkm/cont/testing/UnitTestCellLocatorGeneral.cxx +++ b/vtkm/cont/testing/UnitTestCellLocatorGeneral.cxx @@ -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, diff --git a/vtkm/cont/testing/UnitTestCellSetExplicit.cxx b/vtkm/cont/testing/UnitTestCellSetExplicit.cxx index 6906d1bb8..f1db30a50 100644 --- a/vtkm/cont/testing/UnitTestCellSetExplicit.cxx +++ b/vtkm/cont/testing/UnitTestCellSetExplicit.cxx @@ -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().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."); } diff --git a/vtkm/cont/testing/UnitTestCellSetExtrude.cxx b/vtkm/cont/testing/UnitTestCellSetExtrude.cxx index 3e0282457..5ea9e79b4 100644 --- a/vtkm/cont/testing/UnitTestCellSetExtrude.cxx +++ b/vtkm/cont/testing/UnitTestCellSetExtrude.cxx @@ -25,7 +25,7 @@ std::vector topology = { 0, 2, 1 }; std::vector 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); diff --git a/vtkm/cont/testing/UnitTestCellSetPermutation.cxx b/vtkm/cont/testing/UnitTestCellSetPermutation.cxx index d2892b29e..836051f83 100644 --- a/vtkm/cont/testing/UnitTestCellSetPermutation.cxx +++ b/vtkm/cont/testing/UnitTestCellSetPermutation.cxx @@ -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); diff --git a/vtkm/cont/testing/UnitTestDataSetPermutation.cxx b/vtkm/cont/testing/UnitTestDataSetPermutation.cxx index 14b73973f..1e46b8f87 100644 --- a/vtkm/cont/testing/UnitTestDataSetPermutation.cxx +++ b/vtkm/cont/testing/UnitTestDataSetPermutation.cxx @@ -105,13 +105,13 @@ void TestDataSet_Explicit() subset.PrintSummary(std::cout); using ExecObjectType = SubsetType::ExecutionTypes::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 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 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 result; diff --git a/vtkm/cont/testing/UnitTestDataSetRectilinear.cxx b/vtkm/cont/testing/UnitTestDataSetRectilinear.cxx index 8bafd262f..c17dabd5c 100644 --- a/vtkm/cont/testing/UnitTestDataSetRectilinear.cxx +++ b/vtkm/cont/testing/UnitTestDataSetRectilinear.cxx @@ -77,14 +77,14 @@ static void TwoDimRectilinearTest() VTKM_TEST_ASSERT(shape == vtkm::CELL_SHAPE_QUAD, "Incorrect element type."); } - vtkm::exec::ConnectivityStructured - pointToCell = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), - vtkm::TopologyElementTagPoint(), - vtkm::TopologyElementTagCell()); vtkm::exec::ConnectivityStructured - cellToPoint = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), + pointToCell = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); + vtkm::exec::ConnectivityStructured + 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::exec::ConnectivityStructured 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 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::exec::ConnectivityStructured 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 expectedCellIds = cellToPoint.GetIndices(vtkm::Id3(0)); VTKM_TEST_ASSERT(expectedCellIds.GetNumberOfComponents() <= 6, diff --git a/vtkm/cont/testing/UnitTestDataSetUniform.cxx b/vtkm/cont/testing/UnitTestDataSetUniform.cxx index 96dfd437c..4cd804a03 100644 --- a/vtkm/cont/testing/UnitTestDataSetUniform.cxx +++ b/vtkm/cont/testing/UnitTestDataSetUniform.cxx @@ -80,14 +80,14 @@ static void TwoDimUniformTest() VTKM_TEST_ASSERT(shape == vtkm::CELL_SHAPE_QUAD, "Incorrect element type."); } - vtkm::exec::ConnectivityStructured - pointToCell = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), - vtkm::TopologyElementTagPoint(), - vtkm::TopologyElementTagCell()); vtkm::exec::ConnectivityStructured - cellToPoint = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), + pointToCell = cellSet.PrepareForInput(vtkm::cont::DeviceAdapterTagSerial(), vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); + vtkm::exec::ConnectivityStructured + 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::exec::ConnectivityStructured 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 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::exec::ConnectivityStructured 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 expectedCellIds = cellToPoint.GetIndices(vtkm::Id3(0)); VTKM_TEST_ASSERT(expectedCellIds.GetNumberOfComponents() <= 6, diff --git a/vtkm/exec/CellLocatorBoundingIntervalHierarchyExec.h b/vtkm/exec/CellLocatorBoundingIntervalHierarchyExec.h index 8597d080a..8ceee67c5 100644 --- a/vtkm/exec/CellLocatorBoundingIntervalHierarchyExec.h +++ b/vtkm/exec/CellLocatorBoundingIntervalHierarchyExec.h @@ -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::PortalConst; using CellIdPortal = typename CellIdArrayHandle::template ExecutionTypes::PortalConst; - using CellSetPortal = - typename CellSetType::template ExecutionTypes::ExecObjectType; + using CellSetPortal = typename CellSetType::template ExecutionTypes::ExecObjectType; using CoordsPortal = typename vtkm::cont::ArrayHandleVirtualCoordinates::template ExecutionTypes< DeviceAdapter>::PortalConst; diff --git a/vtkm/exec/CellLocatorRectilinearGrid.h b/vtkm/exec/CellLocatorRectilinearGrid.h index d14146d5d..66bddd738 100644 --- a/vtkm/exec/CellLocatorRectilinearGrid.h +++ b/vtkm/exec/CellLocatorRectilinearGrid.h @@ -32,11 +32,9 @@ template class VTKM_ALWAYS_EXPORT CellLocatorRectilinearGrid final : public vtkm::exec::CellLocator { private: - using FromType = vtkm::TopologyElementTagPoint; - using ToType = vtkm::TopologyElementTagCell; - using CellSetPortal = vtkm::exec::ConnectivityStructured; + using VisitType = vtkm::TopologyElementTagCell; + using IncidentType = vtkm::TopologyElementTagPoint; + using CellSetPortal = vtkm::exec::ConnectivityStructured; using AxisHandle = vtkm::cont::ArrayHandle; using RectilinearType = vtkm::cont::ArrayHandleCartesianProduct; @@ -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()) { diff --git a/vtkm/exec/CellLocatorUniformGrid.h b/vtkm/exec/CellLocatorUniformGrid.h index 5fda04d39..17567e620 100644 --- a/vtkm/exec/CellLocatorUniformGrid.h +++ b/vtkm/exec/CellLocatorUniformGrid.h @@ -31,11 +31,9 @@ template class VTKM_ALWAYS_EXPORT CellLocatorUniformGrid final : public vtkm::exec::CellLocator { private: - using FromType = vtkm::TopologyElementTagPoint; - using ToType = vtkm::TopologyElementTagCell; - using CellSetPortal = vtkm::exec::ConnectivityStructured; + using VisitType = vtkm::TopologyElementTagCell; + using IncidentType = vtkm::TopologyElementTagPoint; + using CellSetPortal = vtkm::exec::ConnectivityStructured; 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())) { } diff --git a/vtkm/exec/ConnectivityPermuted.h b/vtkm/exec/ConnectivityPermuted.h index e62f616ea..cd5996aa2 100644 --- a/vtkm/exec/ConnectivityPermuted.h +++ b/vtkm/exec/ConnectivityPermuted.h @@ -22,28 +22,29 @@ namespace exec { template -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 -class ConnectivityPermutedCellToPoint +class ConnectivityPermutedVisitPointsWithCells { public: using SchedulingRangeType = vtkm::Id; using IndicesType = vtkm::VecFromPortal; 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) diff --git a/vtkm/exec/ConnectivityStructured.h b/vtkm/exec/ConnectivityStructured.h index 5942cfe10..e702f4ec6 100644 --- a/vtkm/exec/ConnectivityStructured.h +++ b/vtkm/exec/ConnectivityStructured.h @@ -20,16 +20,16 @@ namespace vtkm namespace exec { -template +template 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; using Helper = - vtkm::internal::ConnectivityStructuredIndexHelper; + vtkm::internal::ConnectivityStructuredIndexHelper; public: using SchedulingRangeType = typename InternalsType::SchedulingRangeType; @@ -53,7 +53,8 @@ public: } VTKM_EXEC_CONT - ConnectivityStructured(const ConnectivityStructured& src) + ConnectivityStructured( + const ConnectivityStructured& src) : Internals(src.Internals) { } @@ -115,7 +116,7 @@ public: return this->Internals.GetGlobalPointIndexStart(); } - friend class ConnectivityStructured; + friend class ConnectivityStructured; private: InternalsType Internals; diff --git a/vtkm/exec/arg/CMakeLists.txt b/vtkm/exec/arg/CMakeLists.txt index a7c00c457..3b472cbc2 100644 --- a/vtkm/exec/arg/CMakeLists.txt +++ b/vtkm/exec/arg/CMakeLists.txt @@ -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 diff --git a/vtkm/exec/arg/FetchExtrude.h b/vtkm/exec/arg/FetchExtrude.h index afa55fbf2..ecc6cd9fa 100644 --- a/vtkm/exec/arg/FetchExtrude.h +++ b/vtkm/exec/arg/FetchExtrude.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include //optimized fetches for ArrayPortalExtrude for // - 3D Scheduling @@ -28,7 +28,7 @@ namespace arg //Optimized fetch for point ids when iterating the cells ConnectivityExtrude template struct Fetch>, ExecObjectType> { @@ -42,7 +42,7 @@ struct Fetch& 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& portal) { // std::cout << "opimized fetch for point coordinates" << std::endl; - return portal.GetWedge(indices.GetIndicesFrom()); + return portal.GetWedge(indices.GetIndicesIncident()); } VTKM_EXEC diff --git a/vtkm/exec/arg/FetchTagArrayTopologyMapIn.h b/vtkm/exec/arg/FetchTagArrayTopologyMapIn.h index ad456e83a..b99664af2 100644 --- a/vtkm/exec/arg/FetchTagArrayTopologyMapIn.h +++ b/vtkm/exec/arg/FetchTagArrayTopologyMapIn.h @@ -56,9 +56,9 @@ struct FetchArrayTopologyMapInImplementation { using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesTopologyMap; - // 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 struct FetchArrayTopologyMapInImplementation< - vtkm::exec::ConnectivityStructured, vtkm::internal::ArrayPortalUniformPointCoordinates> { - using ConnectivityType = vtkm::exec::ConnectivityStructured; using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesTopologyMap; @@ -157,18 +157,18 @@ struct FetchArrayTopologyMapInImplementation< template struct FetchArrayTopologyMapInImplementation< - vtkm::exec::ConnectivityPermutedPointToCell< + vtkm::exec::ConnectivityPermutedVisitCellsWithPoints< PermutationPortal, - vtkm::exec::ConnectivityStructured>, vtkm::internal::ArrayPortalUniformPointCoordinates> { - using ConnectivityType = vtkm::exec::ConnectivityPermutedPointToCell< + using ConnectivityType = vtkm::exec::ConnectivityPermutedVisitCellsWithPoints< PermutationPortal, - vtkm::exec::ConnectivityStructured>; using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesTopologyMap; diff --git a/vtkm/exec/arg/FromCount.h b/vtkm/exec/arg/IncidentElementCount.h similarity index 54% rename from vtkm/exec/arg/FromCount.h rename to vtkm/exec/arg/IncidentElementCount.h index 95cdebf81..251467bf9 100644 --- a/vtkm/exec/arg/FromCount.h +++ b/vtkm/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_FromCount_h -#define vtk_m_exec_arg_FromCount_h +#ifndef vtk_m_exec_arg_IncidentElementCount_h +#define vtk_m_exec_arg_IncidentElementCount_h #include #include @@ -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 struct Fetch, ExecObjectType> { @@ -58,7 +58,7 @@ struct Fetch #include @@ -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 struct Fetch, ExecObjectType> { using ThreadIndicesType = vtkm::exec::arg::ThreadIndicesTopologyMap; - 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> 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> 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; }; diff --git a/vtkm/exec/arg/ThreadIndicesPointNeighborhood.h b/vtkm/exec/arg/ThreadIndicesPointNeighborhood.h index 063b7ac49..a34150383 100644 --- a/vtkm/exec/arg/ThreadIndicesPointNeighborhood.h +++ b/vtkm/exec/arg/ThreadIndicesPointNeighborhood.h @@ -58,15 +58,15 @@ public: template VTKM_EXEC ThreadIndicesPointNeighborhood( const vtkm::Id3& outIndex, - const vtkm::exec::ConnectivityStructured& connectivity, vtkm::Id globalThreadIndexOffset = 0) : State(outIndex, detail::To3D(connectivity.GetPointDimensions())) , GlobalThreadIndexOffset(globalThreadIndexOffset) { - using ConnectivityType = vtkm::exec::ConnectivityStructured; 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& connectivity, vtkm::Id globalThreadIndexOffset = 0) : State(detail::To3D(connectivity.FlatToLogicalToIndex(inputIndex)), diff --git a/vtkm/exec/arg/ThreadIndicesTopologyMap.h b/vtkm/exec/arg/ThreadIndicesTopologyMap.h index 8e0466116..fb7a0aed2 100644 --- a/vtkm/exec/arg/ThreadIndicesTopologyMap.h +++ b/vtkm/exec/arg/ThreadIndicesTopologyMap.h @@ -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 +template class ThreadIndicesTopologyMap< - vtkm::exec::ConnectivityStructured> + vtkm::exec::ConnectivityStructured> { - using ConnectivityType = vtkm::exec::ConnectivityStructured; + using ConnectivityType = + vtkm::exec::ConnectivityStructured; 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 -class ThreadIndicesTopologyMap>> + ConnectivityStructured>> { - using PermutedConnectivityType = vtkm::exec::ConnectivityPermutedPointToCell< + using PermutedConnectivityType = vtkm::exec::ConnectivityPermutedVisitCellsWithPoints< PermutationPortal, - vtkm::exec::ConnectivityStructured>; - using ConnectivityType = vtkm::exec::ConnectivityStructured; 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; }; diff --git a/vtkm/exec/arg/testing/UnitTestFetchArrayNeighborhoodIn.cxx b/vtkm/exec/arg/testing/UnitTestFetchArrayNeighborhoodIn.cxx index 98981e288..7aa02f978 100644 --- a/vtkm/exec/arg/testing/UnitTestFetchArrayNeighborhoodIn.cxx +++ b/vtkm/exec/arg/testing/UnitTestFetchArrayNeighborhoodIn.cxx @@ -105,8 +105,8 @@ struct FetchArrayNeighborhoodInTests vtkm::internal::ConnectivityStructuredInternals<3> connectivityInternals; connectivityInternals.SetPointDimensions(POINT_DIMS); - vtkm::exec::ConnectivityStructured connectivity(connectivityInternals); diff --git a/vtkm/exec/arg/testing/UnitTestFetchArrayTopologyMapIn.cxx b/vtkm/exec/arg/testing/UnitTestFetchArrayTopologyMapIn.cxx index 89435d060..0e4ecd8de 100644 --- a/vtkm/exec/arg/testing/UnitTestFetchArrayTopologyMapIn.cxx +++ b/vtkm/exec/arg/testing/UnitTestFetchArrayTopologyMapIn.cxx @@ -107,8 +107,8 @@ struct FetchArrayTopologyMapInTests vtkm::internal::ConnectivityStructuredInternals<3> connectivityInternals; connectivityInternals.SetPointDimensions(vtkm::Id3(2, 2, 2)); - vtkm::exec::ConnectivityStructured connectivity(connectivityInternals); @@ -182,8 +182,8 @@ void TryStructuredPointCoordinatesInvocation(const Invocation& invocation) template void TryStructuredPointCoordinates( - const vtkm::exec::ConnectivityStructured& 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::exec::ConnectivityStructured 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::exec::ConnectivityStructured connectivity2d(connectivityInternals2d); TryStructuredPointCoordinates(connectivity2d, coordinates); std::cout << "1D" << std::endl; vtkm::internal::ConnectivityStructuredInternals<1> connectivityInternals1d; connectivityInternals1d.SetPointDimensions(3); - vtkm::exec::ConnectivityStructured + vtkm::exec::ConnectivityStructured connectivity1d(connectivityInternals1d); TryStructuredPointCoordinates(connectivity1d, coordinates); } diff --git a/vtkm/filter/MeshQuality.hxx b/vtkm/filter/MeshQuality.hxx index 62ed61918..9f222fed9 100644 --- a/vtkm/filter/MeshQuality.hxx +++ b/vtkm/filter/MeshQuality.hxx @@ -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; diff --git a/vtkm/filter/testing/UnitTestSplitSharpEdgesFilter.cxx b/vtkm/filter/testing/UnitTestSplitSharpEdgesFilter.cxx index ae821128c..88d9421dd 100644 --- a/vtkm/filter/testing/UnitTestSplitSharpEdgesFilter.cxx +++ b/vtkm/filter/testing/UnitTestSplitSharpEdgesFilter.cxx @@ -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++) { diff --git a/vtkm/filter/testing/UnitTestVertexClusteringFilter.cxx b/vtkm/filter/testing/UnitTestVertexClusteringFilter.cxx index 5b4a915a9..cec733e0c 100644 --- a/vtkm/filter/testing/UnitTestVertexClusteringFilter.cxx +++ b/vtkm/filter/testing/UnitTestVertexClusteringFilter.cxx @@ -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); diff --git a/vtkm/internal/ConnectivityStructuredInternals.h b/vtkm/internal/ConnectivityStructuredInternals.h index 98ec739d6..5240850ae 100644 --- a/vtkm/internal/ConnectivityStructuredInternals.h +++ b/vtkm/internal/ConnectivityStructuredInternals.h @@ -517,20 +517,20 @@ private: // We may want to generalize this class depending on how ConnectivityExplicit // eventually handles retrieving cell to point connectivity. -template +template 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(-1), + VTKM_STATIC_ASSERT_MSG(sizeof(VisitTopology) == static_cast(-1), "Missing Specialization for Topologies"); }; template -struct ConnectivityStructuredIndexHelper { using ConnectivityType = vtkm::internal::ConnectivityStructuredInternals; @@ -590,8 +590,8 @@ struct ConnectivityStructuredIndexHelper -struct ConnectivityStructuredIndexHelper { using ConnectivityType = vtkm::internal::ConnectivityStructuredInternals; diff --git a/vtkm/rendering/Cylinderizer.h b/vtkm/rendering/Cylinderizer.h index c78652de3..ead7a1624 100644 --- a/vtkm/rendering/Cylinderizer.h +++ b/vtkm/rendering/Cylinderizer.h @@ -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 - 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: diff --git a/vtkm/rendering/MapperWireframer.cxx b/vtkm/rendering/MapperWireframer.cxx index 520925ac6..a9bd45d6d 100644 --- a/vtkm/rendering/MapperWireframer.cxx +++ b/vtkm/rendering/MapperWireframer.cxx @@ -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); diff --git a/vtkm/rendering/Quadralizer.h b/vtkm/rendering/Quadralizer.h index ab058f5f1..b4f12655d 100644 --- a/vtkm/rendering/Quadralizer.h +++ b/vtkm/rendering/Quadralizer.h @@ -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 - 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: diff --git a/vtkm/rendering/Triangulator.h b/vtkm/rendering/Triangulator.h index fad4c41cf..96c19fe8d 100644 --- a/vtkm/rendering/Triangulator.h +++ b/vtkm/rendering/Triangulator.h @@ -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 - 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: diff --git a/vtkm/rendering/raytracing/CylinderExtractor.cxx b/vtkm/rendering/raytracing/CylinderExtractor.cxx index 3a059cd5c..faf1f12e0 100644 --- a/vtkm/rendering/raytracing/CylinderExtractor.cxx +++ b/vtkm/rendering/raytracing/CylinderExtractor.cxx @@ -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: diff --git a/vtkm/rendering/raytracing/MeshConnectivityBuilder.cxx b/vtkm/rendering/raytracing/MeshConnectivityBuilder.cxx index 22ab5296e..d7a41d714 100644 --- a/vtkm/rendering/raytracing/MeshConnectivityBuilder.cxx +++ b/vtkm/rendering/raytracing/MeshConnectivityBuilder.cxx @@ -343,8 +343,8 @@ public: class StructuredExternalTriangles : public vtkm::worklet::WorkletMapField { protected: - using ConnType = vtkm::exec::ConnectivityStructured; ConnType Connectivity; vtkm::Id Segments[7]; @@ -680,14 +680,14 @@ void MeshConnectivityBuilder::BuildConnectivity( BoundingBox[5] = vtkm::Float32(coordsBounds.Z.Max); const vtkm::cont::ArrayHandleConstant shapes = cellSetUnstructured.GetShapesArray( - vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); + vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); const vtkm::cont::ArrayHandle conn = cellSetUnstructured.GetConnectivityArray( - vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); + vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); const vtkm::cont::ArrayHandleCounting shapeOffsets = - cellSetUnstructured.GetIndexOffsetArray(vtkm::TopologyElementTagPoint(), - vtkm::TopologyElementTagCell()); + cellSetUnstructured.GetIndexOffsetArray(vtkm::TopologyElementTagCell(), + vtkm::TopologyElementTagPoint()); vtkm::cont::ArrayHandle faceConnectivity; vtkm::cont::ArrayHandle cellFaceId; @@ -741,13 +741,13 @@ void MeshConnectivityBuilder::BuildConnectivity( BoundingBox[5] = vtkm::Float32(coordsBounds.Z.Max); const vtkm::cont::ArrayHandle shapes = cellSetUnstructured.GetShapesArray( - vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); + vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); const vtkm::cont::ArrayHandle conn = cellSetUnstructured.GetConnectivityArray( - vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); + vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); const vtkm::cont::ArrayHandle shapeOffsets = cellSetUnstructured.GetIndexOffsetArray( - vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); + vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); vtkm::cont::ArrayHandle faceConnectivity; vtkm::cont::ArrayHandle cellFaceId; @@ -791,7 +791,7 @@ struct StructuredTrianglesFunctor VTKM_IS_DEVICE_ADAPTER_TAG(Device); vtkm::worklet::DispatcherMapField 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 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; diff --git a/vtkm/rendering/raytracing/MeshConnectivityContainers.cxx b/vtkm/rendering/raytracing/MeshConnectivityContainers.cxx index 774e180fc..adc253e76 100644 --- a/vtkm/rendering/raytracing/MeshConnectivityContainers.cxx +++ b/vtkm/rendering/raytracing/MeshConnectivityContainers.cxx @@ -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 shapes = - Cellset.GetShapesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); + Cellset.GetShapesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); ShapeId = shapes.GetPortalConstControl().Get(0); CellTables tables; diff --git a/vtkm/rendering/raytracing/MortonCodes.h b/vtkm/rendering/raytracing/MortonCodes.h index 771c8fb8c..b35374b2f 100644 --- a/vtkm/rendering/raytracing/MortonCodes.h +++ b/vtkm/rendering/raytracing/MortonCodes.h @@ -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 + vtkm::exec::ConnectivityStructured 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::exec::ConnectivityStructured 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(); diff --git a/vtkm/worklet/CellAverage.h b/vtkm/worklet/CellAverage.h index 32b854a7b..fe7a632bb 100644 --- a/vtkm/worklet/CellAverage.h +++ b/vtkm/worklet/CellAverage.h @@ -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); diff --git a/vtkm/worklet/CellDeepCopy.h b/vtkm/worklet/CellDeepCopy.h index 9c8927787..326e73cfa 100644 --- a/vtkm/worklet/CellDeepCopy.h +++ b/vtkm/worklet/CellDeepCopy.h @@ -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); diff --git a/vtkm/worklet/CellMeasure.h b/vtkm/worklet/CellMeasure.h index f9d49ab05..483133373 100644 --- a/vtkm/worklet/CellMeasure.h +++ b/vtkm/worklet/CellMeasure.h @@ -60,7 +60,7 @@ namespace worklet * Note that the integrals are signed; inverted cells will report negative values. */ template -class CellMeasure : public vtkm::worklet::WorkletMapPointToCell +class CellMeasure : public vtkm::worklet::WorkletVisitCellsWithPoints { public: using ControlSignature = void(CellSetIn cellset, diff --git a/vtkm/worklet/Clip.h b/vtkm/worklet/Clip.h index f86779da2..d61b44807 100644 --- a/vtkm/worklet/Clip.h +++ b/vtkm/worklet/Clip.h @@ -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, diff --git a/vtkm/worklet/DispatcherMapTopology.h b/vtkm/worklet/DispatcherMapTopology.h index 41a44c3c9..d558d7d52 100644 --- a/vtkm/worklet/DispatcherMapTopology.h +++ b/vtkm/worklet/DispatcherMapTopology.h @@ -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 diff --git a/vtkm/worklet/ExternalFaces.h b/vtkm/worklet/ExternalFaces.h index 1aea6a77a..4d377e91f 100644 --- a/vtkm/worklet/ExternalFaces.h +++ b/vtkm/worklet/ExternalFaces.h @@ -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; diff --git a/vtkm/worklet/ExtractGeometry.h b/vtkm/worklet/ExtractGeometry.h index ebb18d425..af43c139d 100644 --- a/vtkm/worklet/ExtractGeometry.h +++ b/vtkm/worklet/ExtractGeometry.h @@ -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, diff --git a/vtkm/worklet/ExtractPoints.h b/vtkm/worklet/ExtractPoints.h index ec3a1dca4..eb1519f90 100644 --- a/vtkm/worklet/ExtractPoints.h +++ b/vtkm/worklet/ExtractPoints.h @@ -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, diff --git a/vtkm/worklet/MarchingCubes.h b/vtkm/worklet/MarchingCubes.h index 7661f478b..7249bfc2d 100644 --- a/vtkm/worklet/MarchingCubes.h +++ b/vtkm/worklet/MarchingCubes.h @@ -100,7 +100,7 @@ make_ScalarField(const vtkm::cont::ArrayHandle& ah) // --------------------------------------------------------------------------- template -class ClassifyCell : public vtkm::worklet::WorkletMapPointToCell +class ClassifyCell : public vtkm::worklet::WorkletVisitCellsWithPoints { public: struct ClassifyCellTagType : vtkm::ListTagBase @@ -272,7 +272,7 @@ private: /// a point in the resulting iso-surface // ----------------------------------------------------------------------------- template -class EdgeWeightGenerate : public vtkm::worklet::WorkletMapPointToCell +class EdgeWeightGenerate : public vtkm::worklet::WorkletVisitCellsWithPoints { public: struct ClassifyCellTagType : vtkm::ListTagBase @@ -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, + WholeCellSetIn, 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& geometry, + vtkm::exec::ConnectivityStructured& 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 pointGeom(geometry); + vtkm::exec::ConnectivityStructured 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, + WholeCellSetIn, 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& geometry, + vtkm::exec::ConnectivityStructured& 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 pointGeom(geometry); + vtkm::exec::ConnectivityStructured pointGeom(geometry); vtkm::exec::arg::ThreadIndicesPointNeighborhood tpn(pointId, pointId, 0, pointId, pointGeom, 0); const auto& boundary = tpn.GetBoundaryState(); diff --git a/vtkm/worklet/MeshQuality.h b/vtkm/worklet/MeshQuality.h index 54cf45d79..99a072433 100644 --- a/vtkm/worklet/MeshQuality.h +++ b/vtkm/worklet/MeshQuality.h @@ -38,7 +38,7 @@ namespace worklet * the computed metric values (one per cell) is returned as output. */ template -class MeshQuality : public vtkm::worklet::WorkletMapPointToCell +class MeshQuality : public vtkm::worklet::WorkletVisitCellsWithPoints { public: using ControlSignature = void(CellSetIn cellset, diff --git a/vtkm/worklet/OrientCellNormals.h b/vtkm/worklet/OrientCellNormals.h index deac6f10b..981f5c603 100644 --- a/vtkm/worklet/OrientCellNormals.h +++ b/vtkm/worklet/OrientCellNormals.h @@ -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, diff --git a/vtkm/worklet/OrientPointAndCellNormals.h b/vtkm/worklet/OrientPointAndCellNormals.h index 613166a2f..c73fc153d 100644 --- a/vtkm/worklet/OrientPointAndCellNormals.h +++ b/vtkm/worklet/OrientPointAndCellNormals.h @@ -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, diff --git a/vtkm/worklet/OrientPointNormals.h b/vtkm/worklet/OrientPointNormals.h index 3704f4f79..d875d8765 100644 --- a/vtkm/worklet/OrientPointNormals.h +++ b/vtkm/worklet/OrientPointNormals.h @@ -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, diff --git a/vtkm/worklet/PointAverage.h b/vtkm/worklet/PointAverage.h index bae62b6f8..3eaca5274 100644 --- a/vtkm/worklet/PointAverage.h +++ b/vtkm/worklet/PointAverage.h @@ -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, diff --git a/vtkm/worklet/Probe.h b/vtkm/worklet/Probe.h index e89339ba6..cd1e73e14 100644 --- a/vtkm/worklet/Probe.h +++ b/vtkm/worklet/Probe.h @@ -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); diff --git a/vtkm/worklet/RemoveDegenerateCells.h b/vtkm/worklet/RemoveDegenerateCells.h index 2be76c8b9..2409764dc 100644 --- a/vtkm/worklet/RemoveDegenerateCells.h +++ b/vtkm/worklet/RemoveDegenerateCells.h @@ -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 diff --git a/vtkm/worklet/RemoveUnusedPoints.h b/vtkm/worklet/RemoveUnusedPoints.h index d25e1005b..03e08a4a9 100644 --- a/vtkm/worklet/RemoveUnusedPoints.h +++ b/vtkm/worklet/RemoveUnusedPoints.h @@ -112,8 +112,8 @@ public: VTKM_ASSERT(this->MaskArray.GetNumberOfValues() == inCellSet.GetNumberOfPoints()); vtkm::worklet::DispatcherMapField 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& 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 newConnectivityArray; vtkm::worklet::DispatcherMapField dispatcher; - dispatcher.Invoke(inCellSet.GetConnectivityArray(FromTopology(), ToTopology()), + dispatcher.Invoke(inCellSet.GetConnectivityArray(VisitTopology(), IncidentTopology()), inputToOutputPointMap, newConnectivityArray); @@ -197,10 +197,10 @@ public: CellSetExplicit 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; } diff --git a/vtkm/worklet/SplitSharpEdges.h b/vtkm/worklet/SplitSharpEdges.h index 045ba554b..e38881d23 100644 --- a/vtkm/worklet/SplitSharpEdges.h +++ b/vtkm/worklet/SplitSharpEdges.h @@ -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, // Query points from cell + WholeCellSetIn, // 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, // Query points from cell + WholeCellSetIn, // 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++) { diff --git a/vtkm/worklet/StreamSurface.h b/vtkm/worklet/StreamSurface.h index 1be9bad28..29f099cf3 100644 --- a/vtkm/worklet/StreamSurface.h +++ b/vtkm/worklet/StreamSurface.h @@ -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 diff --git a/vtkm/worklet/SurfaceNormals.h b/vtkm/worklet/SurfaceNormals.h index d2aabc6ad..3b2906643 100644 --- a/vtkm/worklet/SurfaceNormals.h +++ b/vtkm/worklet/SurfaceNormals.h @@ -49,7 +49,7 @@ class FacetedSurfaceNormals { public: template - 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, diff --git a/vtkm/worklet/Threshold.h b/vtkm/worklet/Threshold.h index 957080d83..dd0d14e6b 100644 --- a/vtkm/worklet/Threshold.h +++ b/vtkm/worklet/Threshold.h @@ -41,7 +41,7 @@ public: }; template - 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 - 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); diff --git a/vtkm/worklet/ThresholdPoints.h b/vtkm/worklet/ThresholdPoints.h index 77b35681b..1e3cb5c70 100644 --- a/vtkm/worklet/ThresholdPoints.h +++ b/vtkm/worklet/ThresholdPoints.h @@ -30,7 +30,7 @@ public: }; template - class ThresholdPointField : public vtkm::worklet::WorkletMapCellToPoint + class ThresholdPointField : public vtkm::worklet::WorkletVisitPointsWithCells { public: using ControlSignature = void(CellSetIn cellset, FieldInPoint scalars, FieldOutPoint passFlags); diff --git a/vtkm/worklet/TriangleWinding.h b/vtkm/worklet/TriangleWinding.h index 28e444c02..7ca9a942d 100644 --- a/vtkm/worklet/TriangleWinding.h +++ b/vtkm/worklet/TriangleWinding.h @@ -104,22 +104,22 @@ public: vtkm::cont::ArrayHandle 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 newCells; newCells.Fill(cellSet.GetNumberOfPoints(), shapes, numIndices, conn, offsets); @@ -141,13 +141,13 @@ public: vtkm::cont::ArrayHandle 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; diff --git a/vtkm/worklet/Tube.h b/vtkm/worklet/Tube.h index 0c7288124..cc9961793 100644 --- a/vtkm/worklet/Tube.h +++ b/vtkm/worklet/Tube.h @@ -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(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, diff --git a/vtkm/worklet/VertexClustering.h b/vtkm/worklet/VertexClustering.h index 4575aff5b..76bc4bc22 100644 --- a/vtkm/worklet/VertexClustering.h +++ b/vtkm/worklet/VertexClustering.h @@ -175,7 +175,7 @@ struct VertexClustering } }; - class MapCellsWorklet : public vtkm::worklet::WorkletMapPointToCell + class MapCellsWorklet : public vtkm::worklet::WorkletVisitCellsWithPoints { public: using ControlSignature = void(CellSetIn cellset, diff --git a/vtkm/worklet/WorkletMapTopology.h b/vtkm/worklet/WorkletMapTopology.h index 06f3b433e..0e21d0f1e 100644 --- a/vtkm/worklet/WorkletMapTopology.h +++ b/vtkm/worklet/WorkletMapTopology.h @@ -29,8 +29,8 @@ #include #include #include -#include -#include +#include +#include #include 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 +/// 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` will +/// execute one instance per point, and provides convenience methods for +/// gathering information about the cells incident to the current point. +/// +template 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; + using TransportTag = vtkm::cont::arg::TransportTagTopologyFieldIn; 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; + using TransportTag = vtkm::cont::arg::TransportTagTopologyFieldIn; 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; + using TransportTag = + vtkm::cont::arg::TransportTagCellSetIn; 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 +class WorkletVisitCellsWithPoints + : public WorkletMapTopology { 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 +class WorkletVisitPointsWithCells + : public WorkletMapTopology { 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 diff --git a/vtkm/worklet/WorkletPointNeighborhood.h b/vtkm/worklet/WorkletPointNeighborhood.h index b41aaac02..e5bbce166 100644 --- a/vtkm/worklet/WorkletPointNeighborhood.h +++ b/vtkm/worklet/WorkletPointNeighborhood.h @@ -145,8 +145,8 @@ public: struct CellSetIn : vtkm::cont::arg::ControlSignatureTagBase { using TypeCheckTag = vtkm::cont::arg::TypeCheckTagCellSetStructured; - using TransportTag = vtkm::cont::arg::TransportTagCellSetIn; + using TransportTag = vtkm::cont::arg::TransportTagCellSetIn; using FetchTag = vtkm::exec::arg::FetchTagCellSetIn; }; }; @@ -184,8 +184,8 @@ public: const OutToInArrayType& outToIn, const VisitArrayType& visit, const ThreadToOutArrayType& threadToOut, - const vtkm::exec::ConnectivityStructured& inputDomain, //this should be explicitly vtkm::Id globalThreadIndexOffset = 0) const { diff --git a/vtkm/worklet/connectivities/CellSetDualGraph.h b/vtkm/worklet/connectivities/CellSetDualGraph.h index 62b684e7d..e57fac893 100644 --- a/vtkm/worklet/connectivities/CellSetDualGraph.h +++ b/vtkm/worklet/connectivities/CellSetDualGraph.h @@ -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); diff --git a/vtkm/worklet/gradient/CellGradient.h b/vtkm/worklet/gradient/CellGradient.h index 7a3bd8165..6157d4b53 100644 --- a/vtkm/worklet/gradient/CellGradient.h +++ b/vtkm/worklet/gradient/CellGradient.h @@ -30,7 +30,7 @@ struct CellGradientInType : vtkm::ListTagBase }; template -struct CellGradient : vtkm::worklet::WorkletMapPointToCell +struct CellGradient : vtkm::worklet::WorkletVisitCellsWithPoints { using ControlSignature = void(CellSetIn, FieldInPoint pointCoordinates, diff --git a/vtkm/worklet/gradient/PointGradient.h b/vtkm/worklet/gradient/PointGradient.h index 0c80d30c6..540165a23 100644 --- a/vtkm/worklet/gradient/PointGradient.h +++ b/vtkm/worklet/gradient/PointGradient.h @@ -31,10 +31,10 @@ struct PointGradientInType : vtkm::ListTagBase }; template -struct PointGradient : public vtkm::worklet::WorkletMapCellToPoint +struct PointGradient : public vtkm::worklet::WorkletVisitPointsWithCells { using ControlSignature = void(CellSetIn, - WholeCellSetIn, + WholeCellSetIn, 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) diff --git a/vtkm/worklet/internal/WorkletBase.h b/vtkm/worklet/internal/WorkletBase.h index 51f856e6f..cc627e918 100644 --- a/vtkm/worklet/internal/WorkletBase.h +++ b/vtkm/worklet/internal/WorkletBase.h @@ -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 + using Cell = vtkm::TopologyElementTagCell; + using Edge = vtkm::TopologyElementTagEdge; + using Face = vtkm::TopologyElementTagFace; + template struct WholeCellSetIn : vtkm::cont::arg::ControlSignatureTagBase { using TypeCheckTag = vtkm::cont::arg::TypeCheckTagCellSet; - using TransportTag = vtkm::cont::arg::TransportTagCellSetIn; + using TransportTag = vtkm::cont::arg::TransportTagCellSetIn; using FetchTag = vtkm::exec::arg::FetchTagWholeCellSetIn; }; diff --git a/vtkm/worklet/particleadvection/CellInterpolationHelper.h b/vtkm/worklet/particleadvection/CellInterpolationHelper.h index ef16656ea..6b60e25fa 100644 --- a/vtkm/worklet/particleadvection/CellInterpolationHelper.h +++ b/vtkm/worklet/particleadvection/CellInterpolationHelper.h @@ -251,15 +251,15 @@ public: { SingleExplicitType CellSet = cellSet.Cast(); 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>(); 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"); diff --git a/vtkm/worklet/spatialstructure/BoundingIntervalHierarchy.h b/vtkm/worklet/spatialstructure/BoundingIntervalHierarchy.h index 1c5907c48..f2c5702be 100644 --- a/vtkm/worklet/spatialstructure/BoundingIntervalHierarchy.h +++ b/vtkm/worklet/spatialstructure/BoundingIntervalHierarchy.h @@ -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, diff --git a/vtkm/worklet/testing/UnitTestBoundingIntervalHierarchy.cxx b/vtkm/worklet/testing/UnitTestBoundingIntervalHierarchy.cxx index f0d16f36b..7c2af999c 100644 --- a/vtkm/worklet/testing/UnitTestBoundingIntervalHierarchy.cxx +++ b/vtkm/worklet/testing/UnitTestBoundingIntervalHierarchy.cxx @@ -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); diff --git a/vtkm/worklet/testing/UnitTestClipping.cxx b/vtkm/worklet/testing/UnitTestClipping.cxx index cc56702ec..16fd5e19b 100644 --- a/vtkm/worklet/testing/UnitTestClipping.cxx +++ b/vtkm/worklet/testing/UnitTestClipping.cxx @@ -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 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"); diff --git a/vtkm/worklet/testing/UnitTestClippingWithFunction.cxx b/vtkm/worklet/testing/UnitTestClippingWithFunction.cxx index f5da28000..35a2ad548 100644 --- a/vtkm/worklet/testing/UnitTestClippingWithFunction.cxx +++ b/vtkm/worklet/testing/UnitTestClippingWithFunction.cxx @@ -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 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"); diff --git a/vtkm/worklet/testing/UnitTestMaskIndices.cxx b/vtkm/worklet/testing/UnitTestMaskIndices.cxx index 9d488df80..1f0a4a341 100644 --- a/vtkm/worklet/testing/UnitTestMaskIndices.cxx +++ b/vtkm/worklet/testing/UnitTestMaskIndices.cxx @@ -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); diff --git a/vtkm/worklet/testing/UnitTestOrientNormals.cxx b/vtkm/worklet/testing/UnitTestOrientNormals.cxx index b77ebbaa7..d9e29b754 100644 --- a/vtkm/worklet/testing/UnitTestOrientNormals.cxx +++ b/vtkm/worklet/testing/UnitTestOrientNormals.cxx @@ -92,13 +92,13 @@ struct ValidateNormals using NormalsArrayType = vtkm::cont::ArrayHandleVirtual; using NormalsPortalType = decltype(std::declval().GetPortalConstControl()); using ConnType = - decltype(std::declval().PrepareForInput(vtkm::cont::DeviceAdapterTagSerial{}, - vtkm::TopologyElementTagPoint{}, - vtkm::TopologyElementTagCell{})); - using RConnType = decltype(std::declval().PrepareForInput(vtkm::cont::DeviceAdapterTagSerial{}, vtkm::TopologyElementTagCell{}, vtkm::TopologyElementTagPoint{})); + using RConnType = + decltype(std::declval().PrepareForInput(vtkm::cont::DeviceAdapterTagSerial{}, + vtkm::TopologyElementTagPoint{}, + vtkm::TopologyElementTagCell{})); using PointsType = decltype(std::declval().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) { diff --git a/vtkm/worklet/testing/UnitTestScatterAndMask.cxx b/vtkm/worklet/testing/UnitTestScatterAndMask.cxx index 3f9f77fe5..97e47d834 100644 --- a/vtkm/worklet/testing/UnitTestScatterAndMask.cxx +++ b/vtkm/worklet/testing/UnitTestScatterAndMask.cxx @@ -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, diff --git a/vtkm/worklet/testing/UnitTestScatterPermutation.cxx b/vtkm/worklet/testing/UnitTestScatterPermutation.cxx index f01010b39..ebe298816 100644 --- a/vtkm/worklet/testing/UnitTestScatterPermutation.cxx +++ b/vtkm/worklet/testing/UnitTestScatterPermutation.cxx @@ -21,7 +21,7 @@ namespace { -class Worklet : public vtkm::worklet::WorkletMapCellToPoint +class Worklet : public vtkm::worklet::WorkletVisitPointsWithCells { public: using ControlSignature = void(CellSetIn cellset, diff --git a/vtkm/worklet/testing/UnitTestSplitSharpEdges.cxx b/vtkm/worklet/testing/UnitTestSplitSharpEdges.cxx index 46cee6859..0a671051c 100644 --- a/vtkm/worklet/testing/UnitTestSplitSharpEdges.cxx +++ b/vtkm/worklet/testing/UnitTestSplitSharpEdges.cxx @@ -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++) { diff --git a/vtkm/worklet/testing/UnitTestTriangleWinding.cxx b/vtkm/worklet/testing/UnitTestTriangleWinding.cxx index 86222a2cb..579781868 100644 --- a/vtkm/worklet/testing/UnitTestTriangleWinding.cxx +++ b/vtkm/worklet/testing/UnitTestTriangleWinding.cxx @@ -56,9 +56,9 @@ void Validate(vtkm::cont::DataSet dataSet) const auto cellSet = dataSet.GetCellSet().Cast>(); const auto coordsArray = dataSet.GetCoordinateSystem().GetData(); const auto conn = - cellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint{}, vtkm::TopologyElementTagCell{}); + cellSet.GetConnectivityArray(vtkm::TopologyElementTagCell{}, vtkm::TopologyElementTagPoint{}); const auto offsets = - cellSet.GetIndexOffsetArray(vtkm::TopologyElementTagPoint{}, vtkm::TopologyElementTagCell{}); + cellSet.GetIndexOffsetArray(vtkm::TopologyElementTagCell{}, vtkm::TopologyElementTagPoint{}); const auto cellArray = vtkm::cont::make_ArrayHandleGroupVecVariable(conn, offsets); const auto cellNormalsVar = dataSet.GetField("normals", vtkm::cont::Field::Association::CELL_SET).GetData(); diff --git a/vtkm/worklet/testing/UnitTestVertexClustering.cxx b/vtkm/worklet/testing/UnitTestVertexClustering.cxx index 8cc06e4fb..cd51ec51f 100644 --- a/vtkm/worklet/testing/UnitTestVertexClustering.cxx +++ b/vtkm/worklet/testing/UnitTestVertexClustering.cxx @@ -59,7 +59,7 @@ void TestVertexClustering() CellSetType cellSet; outDataSet.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); @@ -93,16 +93,16 @@ void TestVertexClustering() CellSetType cellSet; outDataSet.GetCellSet(0).CopyTo(cellSet); VTKM_TEST_ASSERT( - cellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()) + cellSet.GetConnectivityArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()) .GetNumberOfValues() == output_pointIds, "Number of connectivity array elements mismatch"); for (vtkm::Id i = 0; i < - cellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()) + cellSet.GetConnectivityArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()) .GetNumberOfValues(); i++) { vtkm::Id id1 = - cellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()) + cellSet.GetConnectivityArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()) .GetPortalConstControl() .Get(i); vtkm::Id id2 = output_pointId[i]; diff --git a/vtkm/worklet/testing/UnitTestWholeCellSetIn.cxx b/vtkm/worklet/testing/UnitTestWholeCellSetIn.cxx index fd980ae91..390f0280a 100644 --- a/vtkm/worklet/testing/UnitTestWholeCellSetIn.cxx +++ b/vtkm/worklet/testing/UnitTestWholeCellSetIn.cxx @@ -23,11 +23,11 @@ struct TestWholeCellSetIn { - template + template struct WholeCellSetWorklet : public vtkm::worklet::WorkletMapField { using ControlSignature = void(FieldIn indices, - WholeCellSetIn, + WholeCellSetIn, FieldOut numberOfElements, FieldOut shapes, FieldOut numberOfindices, @@ -70,7 +70,7 @@ struct TestWholeCellSetIn vtkm::cont::ArrayHandle connectionSum) { using WorkletType = - WholeCellSetWorklet; + WholeCellSetWorklet; vtkm::worklet::DispatcherMapField dispatcher; dispatcher.Invoke(vtkm::cont::ArrayHandleIndex(cellSet.GetNumberOfCells()), cellSet, @@ -88,7 +88,7 @@ struct TestWholeCellSetIn vtkm::cont::ArrayHandle connectionSum) { using WorkletType = - WholeCellSetWorklet; + WholeCellSetWorklet; vtkm::worklet::DispatcherMapField dispatcher; dispatcher.Invoke(vtkm::cont::ArrayHandleIndex(cellSet->GetNumberOfPoints()), cellSet, diff --git a/vtkm/worklet/testing/UnitTestWorkletMapTopologyExplicit.cxx b/vtkm/worklet/testing/UnitTestWorkletMapTopologyExplicit.cxx index 6f0dcb23e..e5a81286c 100644 --- a/vtkm/worklet/testing/UnitTestWorkletMapTopologyExplicit.cxx +++ b/vtkm/worklet/testing/UnitTestWorkletMapTopologyExplicit.cxx @@ -25,7 +25,7 @@ namespace test_explicit { -class MaxPointOrCellValue : public vtkm::worklet::WorkletMapPointToCell +class MaxPointOrCellValue : public vtkm::worklet::WorkletVisitCellsWithPoints { public: using ControlSignature = void(FieldInCell inCells, diff --git a/vtkm/worklet/testing/UnitTestWorkletMapTopologyUniform.cxx b/vtkm/worklet/testing/UnitTestWorkletMapTopologyUniform.cxx index 930b3de66..e8fe7dc7e 100644 --- a/vtkm/worklet/testing/UnitTestWorkletMapTopologyUniform.cxx +++ b/vtkm/worklet/testing/UnitTestWorkletMapTopologyUniform.cxx @@ -25,7 +25,7 @@ namespace test_uniform { -class MaxPointOrCellValue : public vtkm::worklet::WorkletMapPointToCell +class MaxPointOrCellValue : public vtkm::worklet::WorkletVisitCellsWithPoints { public: using ControlSignature = void(FieldInCell inCells, @@ -59,7 +59,7 @@ public: } }; -struct CheckStructuredUniformPointCoords : public vtkm::worklet::WorkletMapPointToCell +struct CheckStructuredUniformPointCoords : public vtkm::worklet::WorkletVisitCellsWithPoints { using ControlSignature = void(CellSetIn topology, FieldInPoint pointCoords); using ExecutionSignature = void(_2); diff --git a/vtkm/worklet/tetrahedralize/TetrahedralizeExplicit.h b/vtkm/worklet/tetrahedralize/TetrahedralizeExplicit.h index 35448a29a..ac5e5f447 100644 --- a/vtkm/worklet/tetrahedralize/TetrahedralizeExplicit.h +++ b/vtkm/worklet/tetrahedralize/TetrahedralizeExplicit.h @@ -64,7 +64,7 @@ public: // Worklet to turn cells into tetrahedra // Vertices remain the same and each cell is processed with needing topology // - class TetrahedralizeCell : public vtkm::worklet::WorkletMapPointToCell + class TetrahedralizeCell : public vtkm::worklet::WorkletVisitCellsWithPoints { public: using ControlSignature = void(CellSetIn cellset, @@ -120,9 +120,9 @@ vtkm::cont::CellSetSingleType<> TetrahedralizeExplicit::Run( // Input topology auto inShapes = - cellSet.GetShapesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); + cellSet.GetShapesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); auto inNumIndices = - cellSet.GetNumIndicesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); + cellSet.GetNumIndicesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); // Output topology vtkm::cont::ArrayHandle outConnectivity; diff --git a/vtkm/worklet/tetrahedralize/TetrahedralizeStructured.h b/vtkm/worklet/tetrahedralize/TetrahedralizeStructured.h index 35a816735..647a45122 100644 --- a/vtkm/worklet/tetrahedralize/TetrahedralizeStructured.h +++ b/vtkm/worklet/tetrahedralize/TetrahedralizeStructured.h @@ -36,7 +36,7 @@ namespace tetrahedralize // Worklet to turn hexahedra into tetrahedra // Vertices remain the same and each cell is processed with needing topology // -class TetrahedralizeCell : public vtkm::worklet::WorkletMapPointToCell +class TetrahedralizeCell : public vtkm::worklet::WorkletVisitCellsWithPoints { public: using ControlSignature = void(CellSetIn cellset, FieldOutCell connectivityOut); diff --git a/vtkm/worklet/triangulate/TriangulateExplicit.h b/vtkm/worklet/triangulate/TriangulateExplicit.h index 253e18e75..2d4c325a3 100644 --- a/vtkm/worklet/triangulate/TriangulateExplicit.h +++ b/vtkm/worklet/triangulate/TriangulateExplicit.h @@ -66,7 +66,7 @@ public: // Worklet to turn cells into triangles // Vertices remain the same and each cell is processed with needing topology // - class TriangulateCell : public vtkm::worklet::WorkletMapPointToCell + class TriangulateCell : public vtkm::worklet::WorkletVisitCellsWithPoints { public: using ControlSignature = void(CellSetIn cellset, @@ -119,9 +119,9 @@ vtkm::cont::CellSetSingleType<> TriangulateExplicit::Run( // Input topology auto inShapes = - cellSet.GetShapesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); + cellSet.GetShapesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); auto inNumIndices = - cellSet.GetNumIndicesArray(vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); + cellSet.GetNumIndicesArray(vtkm::TopologyElementTagCell(), vtkm::TopologyElementTagPoint()); // Output topology vtkm::cont::ArrayHandle outConnectivity; diff --git a/vtkm/worklet/triangulate/TriangulateStructured.h b/vtkm/worklet/triangulate/TriangulateStructured.h index b17953688..f6a16ae44 100644 --- a/vtkm/worklet/triangulate/TriangulateStructured.h +++ b/vtkm/worklet/triangulate/TriangulateStructured.h @@ -34,7 +34,7 @@ namespace triangulate // Worklet to turn quads into triangles // Vertices remain the same and each cell is processed with needing topology // -class TriangulateCell : public vtkm::worklet::WorkletMapPointToCell +class TriangulateCell : public vtkm::worklet::WorkletVisitCellsWithPoints { public: using ControlSignature = void(CellSetIn cellset, FieldOutCell connectivityOut);