Go to the documentation of this file.
53 #ifndef vtk_m_worklet_contourtree_distributed_find_superarc_for_unknown_node_h
54 #define vtk_m_worklet_contourtree_distributed_find_superarc_for_unknown_node_h
64 namespace contourtree_distributed
69 template <
typename FieldType>
126 if (aboveSuperparent == belowSuperparent)
128 return aboveSuperparent;
162 if (aboveHyperparent == belowHyperparent)
164 hyperparent = aboveHyperparent;
168 while (aboveHyperparent != belowHyperparent)
174 this->
WhichIteration.Get(this->Hypernodes.Get(belowHyperparent)));
178 this->
WhichIteration.Get(this->Hypernodes.Get(aboveHyperparent)));
188 if (belowRound < aboveRound)
192 else if (belowRound > aboveRound)
197 else if (belowIteration < aboveIteration)
201 else if (belowIteration > aboveIteration)
206 else if (aboveHyperparent == belowHyperparent)
222 hyperparent = aboveHyperparent;
233 FieldType hyperTargetValue = this->
DataValues.Get(hyperTargetRegularId);
237 if ((hyperTargetValue > nodeValue) ||
238 ((hyperTargetValue == nodeValue) && (hyperTargetGlobalId > nodeGlobalId)))
240 hyperparent = belowHyperparent;
249 belowSuperparent = this->
Hypernodes.Get(belowHyperparent);
250 belowRound = this->
WhichRound.Get(belowSuperparent);
265 FieldType hyperTargetValue = this->
DataValues.Get(hyperTargetRegularId);
269 if ((hyperTargetValue < nodeValue) ||
270 ((hyperTargetValue == nodeValue) && (hyperTargetGlobalId < nodeGlobalId)))
272 hyperparent = aboveHyperparent;
282 aboveSuperparent = this->
Hypernodes.Get(aboveHyperparent);
283 aboveRound = this->
WhichRound.Get(aboveSuperparent);
314 FieldType highValue = this->
DataValues.Get(highSupernodeRegularId);
316 if ((highValue < nodeValue) ||
317 ((highValue == nodeValue) && (highSupernodeGlobalId < nodeGlobalId)))
319 return highSupernode;
325 while (highSupernode - lowSupernode > 1)
328 vtkm::Id midSupernode = (lowSupernode + highSupernode) / 2;
331 FieldType midValue = this->
DataValues.Get(midSupernodeRegularId);
334 if ((midValue > nodeValue) ||
335 ((midValue == nodeValue) && (midSupernodeGlobalId > nodeGlobalId)))
337 highSupernode = midSupernode;
342 lowSupernode = midSupernode;
362 FieldType lowValue = this->
DataValues.Get(lowSupernodeRegularId);
364 if ((lowValue > nodeValue) ||
365 ((lowValue == nodeValue) && (lowSupernodeGlobalId >= nodeGlobalId)))
373 while (lowSupernode - highSupernode > 1)
376 vtkm::Id midSupernode = (highSupernode + lowSupernode) / 2;
379 FieldType midValue = this->
DataValues.Get(midSupernodeRegularId);
381 if ((midValue > nodeValue) ||
382 ((midValue == nodeValue) && (midSupernodeGlobalId > nodeGlobalId)))
384 highSupernode = midSupernode;
389 lowSupernode = midSupernode;
394 return highSupernode;
427 template <
typename FieldType>
IndicesPortalType Hyperarcs
Definition: FindSuperArcForUnknownNode.h:415
VTKM_EXEC_CONT bool IsAscending(vtkm::Id flaggedIndex)
Definition: filter/scalar_topology/worklet/contourtree_augmented/Types.h:121
DataPortalType DataValues
Definition: FindSuperArcForUnknownNode.h:417
vtkm::worklet::contourtree_augmented::IdArrayType Supernodes
Definition: FindSuperArcForUnknownNode.h:482
#define VTKM_EXEC
Definition: ExportMacros.h:51
Groups connected points that have the same field value.
Definition: Atomic.h:19
Device implementation of FindSuperArcForUnknownNode for the HierarchicalContourTree.
Definition: FindSuperArcForUnknownNode.h:70
vtkm::cont::ArrayHandle< FieldType > DataValues
Definition: FindSuperArcForUnknownNode.h:491
IndicesPortalType WhichRound
Definition: FindSuperArcForUnknownNode.h:411
VTKM_CONT ReadPortalType PrepareForInput(vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const
Prepares this array to be used as an input to an operation in the execution environment.
Definition: ArrayHandle.h:574
VTKM_CONT FindSuperArcForUnknownNodeDeviceData(vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token, const vtkm::worklet::contourtree_augmented::IdArrayType &superparents, const vtkm::worklet::contourtree_augmented::IdArrayType &supernodes, const vtkm::worklet::contourtree_augmented::IdArrayType &superarcs, const vtkm::worklet::contourtree_augmented::IdArrayType &superchildren, const vtkm::worklet::contourtree_augmented::IdArrayType &whichRound, const vtkm::worklet::contourtree_augmented::IdArrayType &whichIteration, const vtkm::worklet::contourtree_augmented::IdArrayType &hyperparents, const vtkm::worklet::contourtree_augmented::IdArrayType &hypernodes, const vtkm::worklet::contourtree_augmented::IdArrayType &hyperarcs, const vtkm::worklet::contourtree_augmented::IdArrayType ®ularNodeGlobalIds, const vtkm::cont::ArrayHandle< FieldType > &dataValues)
Definition: FindSuperArcForUnknownNode.h:78
IndicesPortalType WhichIteration
Definition: FindSuperArcForUnknownNode.h:412
VTKM_EXEC vtkm::Id FindSuperArcForUnknownNode(vtkm::Id nodeGlobalId, FieldType nodeValue, vtkm::Id above, vtkm::Id below) const
routine to find the superarc to which a given global Id/value pair maps given a known pair of vertice...
Definition: FindSuperArcForUnknownNode.h:113
static constexpr vtkm::Id PRUNE_FINAL
Definition: FindSuperArcForUnknownNode.h:403
vtkm::worklet::contourtree_augmented::IdArrayType WhichIteration
Definition: FindSuperArcForUnknownNode.h:486
VTKM_EXEC_CONT vtkm::Id MaskedIndex(vtkm::Id flaggedIndex)
Definition: filter/scalar_topology/worklet/contourtree_augmented/Types.h:127
typename StorageType::ReadPortalType ReadPortalType
Definition: ArrayHandle.h:294
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::worklet::contourtree_augmented::IdArrayType Superparents
Definition: FindSuperArcForUnknownNode.h:481
vtkm::worklet::contourtree_augmented::IdArrayType Hyperarcs
Definition: FindSuperArcForUnknownNode.h:489
vtkm::worklet::contourtree_augmented::IdArrayType Hypernodes
Definition: FindSuperArcForUnknownNode.h:488
vtkm::worklet::contourtree_augmented::IdArrayType RegularNodeGlobalIds
Definition: FindSuperArcForUnknownNode.h:490
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
vtkm::worklet::contourtree_augmented::IdArrayType WhichRound
Definition: FindSuperArcForUnknownNode.h:485
VTKM_EXEC_CONT bool NoSuchElement(vtkm::Id flaggedIndex)
Definition: filter/scalar_topology/worklet/contourtree_augmented/Types.h:97
IndicesPortalType Superchildren
Definition: FindSuperArcForUnknownNode.h:410
static constexpr vtkm::Id PRUNE_LOW
Definition: FindSuperArcForUnknownNode.h:401
vtkm::worklet::contourtree_augmented::IdArrayType Hyperparents
Definition: FindSuperArcForUnknownNode.h:487
IndicesPortalType RegularNodeGlobalIds
Definition: FindSuperArcForUnknownNode.h:416
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::worklet::contourtree_augmented::IdArrayType Superarcs
Definition: FindSuperArcForUnknownNode.h:483
vtkm::worklet::contourtree_augmented::IdArrayType Superchildren
Definition: FindSuperArcForUnknownNode.h:484
typename vtkm::cont::ArrayHandle< FieldType >::ReadPortalType DataPortalType
Definition: FindSuperArcForUnknownNode.h:75
Base ExecutionObjectBase for execution objects to inherit from so that you can use an arbitrary objec...
Definition: ExecutionObjectBase.h:31
Definition: DeviceAdapterTag.h:52
IndicesPortalType Hypernodes
Definition: FindSuperArcForUnknownNode.h:414
IndicesPortalType Superparents
Definition: FindSuperArcForUnknownNode.h:407
typename vtkm::worklet::contourtree_augmented::IdArrayType::ReadPortalType IndicesPortalType
Definition: FindSuperArcForUnknownNode.h:74
IndicesPortalType Supernodes
Definition: FindSuperArcForUnknownNode.h:408
VTKM_CONT FindSuperArcForUnknownNodeDeviceData< FieldType > PrepareForExecution(vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const
Definition: FindSuperArcForUnknownNode.h:459
IndicesPortalType Hyperparents
Definition: FindSuperArcForUnknownNode.h:413
static constexpr vtkm::Id PRUNE_HIGH
Definition: FindSuperArcForUnknownNode.h:402
ExecutionObject to generate a device object to use FindSuperArcForUnknownNode for the HierarchicalCon...
Definition: FindSuperArcForUnknownNode.h:428
constexpr vtkm::Id NO_SUCH_ELEMENT
Definition: filter/scalar_topology/worklet/contourtree_augmented/Types.h:73
IndicesPortalType Superarcs
Definition: FindSuperArcForUnknownNode.h:409
VTKM_CONT FindSuperArcForUnknownNode(const vtkm::worklet::contourtree_augmented::IdArrayType &superparents, const vtkm::worklet::contourtree_augmented::IdArrayType &supernodes, const vtkm::worklet::contourtree_augmented::IdArrayType &superarcs, const vtkm::worklet::contourtree_augmented::IdArrayType &superchildren, const vtkm::worklet::contourtree_augmented::IdArrayType &whichRound, const vtkm::worklet::contourtree_augmented::IdArrayType &whichIteration, const vtkm::worklet::contourtree_augmented::IdArrayType &hyperparents, const vtkm::worklet::contourtree_augmented::IdArrayType &hypernodes, const vtkm::worklet::contourtree_augmented::IdArrayType &hyperarcs, const vtkm::worklet::contourtree_augmented::IdArrayType ®ularNodeGlobalIds, const vtkm::cont::ArrayHandle< FieldType > &dataValues)
constructor
Definition: FindSuperArcForUnknownNode.h:433