46 #ifndef vtk_m_worklet_contourtree_distributed_hierarchical_augmenter_create_superarcs_worklet_h
47 #define vtk_m_worklet_contourtree_distributed_hierarchical_augmenter_create_superarcs_worklet_h
56 namespace contourtree_distributed
58 namespace hierarchical_augmenter
100 WholeArrayIn supernodeSorter,
101 WholeArrayIn superparentSet,
102 WholeArrayIn baseTreeSuperarcs,
103 WholeArrayIn newSupernodeIds,
104 WholeArrayIn baseTreeSupernodes,
105 WholeArrayIn baseTreeRegularNodeGlobalIds,
107 WholeArrayIn baseTreeSuper2Hypernode,
108 WholeArrayIn baseTreeWhichIteration,
109 FieldOut augmentedTreeSuperarcsView,
110 WholeArrayInOut augmentedTreeFirstSupernodePerIteration,
111 FieldOut augmentedTreeSuper2hypernode
113 using ExecutionSignature = void(
InputIndex, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12);
125 const vtkm::Id& augmentedTreeNumIterations,
127 const vtkm::Id& numAugmentedTreeSupernodes)
137 template <
typename InFieldPortalType,
typename InOutFieldPortalType>
140 const InFieldPortalType& supernodeSorterPortal,
141 const InFieldPortalType& superparentSetPortal,
142 const InFieldPortalType& baseTreeSuperarcsPortal,
143 const InFieldPortalType& newSupernodeIdsPortal,
144 const InFieldPortalType& baseTreeSupernodesPortal,
145 const InFieldPortalType& baseTreeRegularNodeGlobalIdsPortal,
146 const vtkm::Id& globalRegularIdSetValue,
147 const InFieldPortalType& baseTreeSuper2HypernodePortal,
148 const InFieldPortalType& baseTreeWhichIterationPortal,
149 vtkm::Id& augmentedTreeSuperarcsValue,
150 const InOutFieldPortalType&
151 augmentedTreeFirstSupernodePerIterationPortal,
152 vtkm::Id& augmentedTreeSuper2hypernodeValue)
const
156 vtkm::Id supernodeSetIndex = supernodeSorterPortal.Get(supernode);
172 vtkm::Id superparentSetVal = superparentSetPortal.Get(supernodeSetIndex);
185 if (supernode == supernodeSorterPortal.GetNumberOfValues() - 1)
196 baseTreeSuperarcsPortal.Get(superparentOldSuperId));
198 vtkm::Id newTargetSuperId = newSupernodeIdsPortal.Get(oldTargetSuperId);
200 augmentedTreeSuperarcsValue = newTargetSuperId |
207 else if (superparentOldSuperId !=
209 superparentSetPortal.Get(supernodeSorterPortal.Get(supernode + 1))))
213 baseTreeSuperarcsPortal.Get(superparentOldSuperId));
215 vtkm::Id newTargetSuperId = newSupernodeIdsPortal.Get(oldTargetSuperId);
217 augmentedTreeSuperarcsValue = newTargetSuperId |
222 baseTreeWhichIterationPortal.Get(superparentOldSuperId));
224 baseTreeWhichIterationPortal.Get(superparentOldSuperId + 1));
226 if (iterationNumber != iterationNumberOfNext)
229 augmentedTreeFirstSupernodePerIterationPortal.Set(iterationNumberOfNext,
236 augmentedTreeSuperarcsValue = (newSupernodeId + 1) |
254 vtkm::Id superparentOldRegularId = baseTreeSupernodesPortal.Get(superparentOldSuperId);
255 vtkm::Id superparentGlobalId = baseTreeRegularNodeGlobalIdsPortal.Get(superparentOldRegularId);
257 if (superparentGlobalId == globalRegularIdSetValue)
260 augmentedTreeSuper2hypernodeValue = baseTreeSuper2HypernodePortal.Get(superparentOldSuperId);