53 #ifndef vtk_m_worklet_contourtree_distributed_tree_grafter_copy_new_nodes_set_superparents_worklet_h
54 #define vtk_m_worklet_contourtree_distributed_tree_grafter_copy_new_nodes_set_superparents_worklet_h
64 namespace contourtree_distributed
66 namespace tree_grafter
75 WholeArrayIn meshSortIndex,
76 WholeArrayIn meshSortOrder,
77 WholeArrayIn contourTreeSuperparents,
78 WholeArrayIn contourTreeSuperarcs,
79 WholeArrayIn contourTreeSupernodes,
80 WholeArrayIn hierarchicalRegularId,
81 WholeArrayIn hierarchicalTreeId,
82 WholeArrayIn hierarchicalTreeRegularNodeGlobalIds,
83 WholeArrayIn hierarchicalTreeDataValues,
84 ExecObject findSuperArcForUnknownNode,
85 WholeArrayOut hierarchicalTreeSuperparents
88 using ExecutionSignature = void(
InputIndex, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12);
98 template <
typename InFieldPortalType,
99 typename MeshSortIndexPortalType,
100 typename MeshSortOrderPortalType,
101 typename DataValuePortalType,
102 typename FindSuperExecType,
103 typename OutFieldPortalType>
108 const MeshSortIndexPortalType& meshSortIndexPortal,
109 const MeshSortOrderPortalType& meshSortOrderPortal,
110 const InFieldPortalType& contourTreeSuperparentsPortal,
111 const InFieldPortalType& contourTreeSuperarcsPortal,
112 const InFieldPortalType& contourTreeSupernodesPortal,
113 const InFieldPortalType& hierarchicalRegularIdPortal,
114 const InFieldPortalType& hierarchicalTreeIdPortal,
115 const InFieldPortalType& hierarchicalTreeRegularNodeGlobalIdsPortal,
116 const DataValuePortalType& hierarchicalTreeDataValuesPortal,
117 const FindSuperExecType& findSuperArcForUnknownNode,
118 const OutFieldPortalType& hierarchicalTreeSuperparentsPortal
126 vtkm::Id oldSortIndex = meshSortIndexPortal.Get(oldNodeId);
127 vtkm::Id oldSuperparent = contourTreeSuperparentsPortal.Get(oldSortIndex);
129 vtkm::Id oldSuperparentNewRegularId = hierarchicalRegularIdPortal.Get(oldSuperparent);
138 hierarchicalTreeSuperparentsPortal.Get(newNodeId)))
141 vtkm::Id oldSupertargetSuperId = contourTreeSuperarcsPortal.Get(oldSuperparent);
142 bool oldSuperarcAscends =
144 oldSupertargetSuperId =
146 vtkm::Id oldSupertargetOldSortId = contourTreeSupernodesPortal.Get(oldSupertargetSuperId);
147 vtkm::Id oldSupertargetOldRegularId = meshSortOrderPortal.Get(oldSupertargetOldSortId);
148 vtkm::Id oldSupertargetNewRegularId =
149 hierarchicalTreeIdPortal.Get(oldSupertargetOldRegularId);
154 oldSuperarcAscends ? oldSuperparentNewRegularId : oldSupertargetNewRegularId;
156 oldSuperarcAscends ? oldSupertargetNewRegularId : oldSuperparentNewRegularId;
159 vtkm::Id nodeGlobalId = hierarchicalTreeRegularNodeGlobalIdsPortal.Get(newNodeId);
160 auto nodeValue = hierarchicalTreeDataValuesPortal.Get(newNodeId);
163 hierarchicalTreeSuperparentsPortal.Set(
165 findSuperArcForUnknownNode.FindSuperArcForUnknownNode(
166 nodeGlobalId, nodeValue, highEndRegularId, lowEndRegularId));