53 #ifndef vtk_m_worklet_contourtree_distributed_tree_grafter_copy_new_supernodes_worklet_h
54 #define vtk_m_worklet_contourtree_distributed_tree_grafter_copy_new_supernodes_worklet_h
64 namespace contourtree_distributed
66 namespace tree_grafter
74 WholeArrayIn contourTreeSupernodes,
75 WholeArrayIn meshSorterOrder,
76 WholeArrayIn hierarchicalTreeId,
77 WholeArrayIn whenTransferred,
78 WholeArrayIn hierarchicalSuperparent,
79 WholeArrayIn hierarchicalHyperparent,
80 WholeArrayIn hierarchicalSuperId,
81 WholeArrayIn hierarchicalHyperId,
82 WholeArrayIn hierarchicalHyperarc,
83 WholeArrayOut hierarchicalTreeSupernodes,
84 WholeArrayOut hierarchicalTreeWhichRound,
85 WholeArrayOut hierarchicalTreeWhichIteration,
86 WholeArrayOut hierarchicalTreeSuperarcs,
87 WholeArrayInOut hierarchicalRegularId,
88 WholeArrayInOut hierarchicalTreeHyperparents,
89 WholeArrayInOut hierarchicalTreeSuperparents
93 void(
InputIndex, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17);
104 template <
typename InFieldPortalType,
105 typename SortOrderPortalType,
106 typename OutFieldPortalType,
107 typename InOutFieldPortalType>
110 const InFieldPortalType& newSupernodesPortal,
111 const InFieldPortalType& contourTreeSupernodesPortal,
112 const SortOrderPortalType&
114 const InFieldPortalType& hierarchicalTreeIdPortal,
115 const InFieldPortalType& whenTransferredPortal,
116 const InFieldPortalType& hierarchicalSuperparentPortal,
117 const InFieldPortalType& hierarchicalHyperparentPortal,
118 const InFieldPortalType& hierarchicalSuperIdPortal,
119 const InFieldPortalType& hierarchicalHyperIdPortal,
120 const InFieldPortalType& hierarchicalHyperarcPortal,
121 const OutFieldPortalType& hierarchicalTreeSupernodesPortal,
122 const OutFieldPortalType& hierarchicalTreeWhichRoundPortal,
123 const OutFieldPortalType& hierarchicalTreeWhichIterationPortal,
124 const OutFieldPortalType& hierarchicalTreeSuperarcsPortal,
125 const InOutFieldPortalType& hierarchicalRegularIdPortal,
126 const InOutFieldPortalType& hierarchicalTreeHyperparentsPortal,
127 const InOutFieldPortalType& hierarchicalTreeSuperparentsPortal
133 vtkm::Id oldSupernodeId = newSupernodesPortal.Get(newSupernode);
134 vtkm::Id oldSortId = contourTreeSupernodesPortal.Get(oldSupernodeId);
135 vtkm::Id oldRegularId = meshSortOrderPortal.Get(oldSortId);
138 vtkm::Id newRegularId = hierarchicalTreeIdPortal.Get(oldRegularId);
142 hierarchicalTreeSupernodesPortal.Set(newSupernodeId, newRegularId);
145 hierarchicalTreeWhichRoundPortal.Set(newSupernodeId, this->
TheRound);
146 hierarchicalTreeWhichIterationPortal.Set(newSupernodeId,
147 whenTransferredPortal.Get(oldSupernodeId));
155 vtkm::Id storedRegularId = hierarchicalRegularIdPortal.Get(oldSupernodeId);
158 hierarchicalRegularIdPortal.Set(oldSupernodeId, newRegularId);
168 hierarchicalTreeHyperparentsPortal.Set(
170 hierarchicalTreeHyperparentsPortal.Get(
171 hierarchicalTreeSuperparentsPortal.Get(storedRegularId)));
173 hierarchicalTreeSuperarcsPortal.Set(
181 hierarchicalSuperparentPortal.Get(oldSupernodeId)))
184 hierarchicalTreeSuperparentsPortal.Set(newRegularId,
185 hierarchicalSuperparentPortal.Get(oldSupernodeId));
186 hierarchicalTreeHyperparentsPortal.Set(newSupernodeId,
187 hierarchicalHyperparentPortal.Get(oldSupernodeId));
189 hierarchicalTreeSuperarcsPortal.Set(
198 vtkm::Id hierarchicalHyperparentOldSuperId =
199 hierarchicalHyperparentPortal.Get(oldSupernodeId);
200 vtkm::Id hierarchicalHyperparentNewHyperId =
201 hierarchicalHyperIdPortal.Get(hierarchicalHyperparentOldSuperId);
202 hierarchicalTreeHyperparentsPortal.Set(newSupernodeId, hierarchicalHyperparentNewHyperId);
204 hierarchicalTreeSuperparentsPortal.Set(newRegularId, newSupernodeId);
207 vtkm::Id hierarchicalHyperarcOldSuperId =
208 hierarchicalHyperarcPortal.Get(hierarchicalHyperparentOldSuperId);
213 hierarchicalHyperarcOldSuperId =
215 vtkm::Id hierarchicalHyperarcNewSuperId =
216 hierarchicalSuperIdPortal.Get(hierarchicalHyperarcOldSuperId);
235 vtkm::Id neighbour = newSupernode + 1;
238 if (neighbour >= newSupernodesPortal.GetNumberOfValues())
240 hierarchicalTreeSuperarcsPortal.Set(newSupernodeId,
241 hierarchicalHyperarcNewSuperId | isAscendingHyperarc);
245 vtkm::Id nbrSuperId = newSupernodesPortal.Get(neighbour);
250 hierarchicalSuperparentPortal.Get(nbrSuperId)))
252 hierarchicalTreeSuperarcsPortal.Set(
253 newSupernodeId, hierarchicalHyperarcNewSuperId | isAscendingHyperarc);
257 vtkm::Id nbrHyperparent = hierarchicalHyperparentPortal.Get(nbrSuperId);
260 if (nbrHyperparent == hierarchicalHyperparentOldSuperId)
262 hierarchicalTreeSuperarcsPortal.Set(
263 newSupernodeId, hierarchicalSuperIdPortal.Get(nbrSuperId) | isAscendingHyperarc);
268 hierarchicalTreeSuperarcsPortal.Set(
269 newSupernodeId, hierarchicalHyperarcNewSuperId | isAscendingHyperarc);