VTK-m  2.0
BoundaryTreeMaker.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 // Copyright (c) 2018, The Regents of the University of California, through
11 // Lawrence Berkeley National Laboratory (subject to receipt of any required approvals
12 // from the U.S. Dept. of Energy). All rights reserved.
13 //
14 // Redistribution and use in source and binary forms, with or without modification,
15 // are permitted provided that the following conditions are met:
16 //
17 // (1) Redistributions of source code must retain the above copyright notice, this
18 // list of conditions and the following disclaimer.
19 //
20 // (2) Redistributions in binary form must reproduce the above copyright notice,
21 // this list of conditions and the following disclaimer in the documentation
22 // and/or other materials provided with the distribution.
23 //
24 // (3) Neither the name of the University of California, Lawrence Berkeley National
25 // Laboratory, U.S. Dept. of Energy nor the names of its contributors may be
26 // used to endorse or promote products derived from this software without
27 // specific prior written permission.
28 //
29 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
30 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
31 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
32 // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
33 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
34 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
36 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
37 // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
38 // OF THE POSSIBILITY OF SUCH DAMAGE.
39 //
40 //=============================================================================
41 //
42 // This code is an extension of the algorithm presented in the paper:
43 // Parallel Peak Pruning for Scalable SMP Contour Tree Computation.
44 // Hamish Carr, Gunther Weber, Christopher Sewell, and James Ahrens.
45 // Proceedings of the IEEE Symposium on Large Data Analysis and Visualization
46 // (LDAV), October 2016, Baltimore, Maryland.
47 //
48 // The PPP2 algorithm and software were jointly developed by
49 // Hamish Carr (University of Leeds), Gunther H. Weber (LBNL), and
50 // Oliver Ruebel (LBNL)
51 //==============================================================================
52 
53 #ifndef vtk_m_worklet_contourtree_distributed_boundary_tree_maker_h
54 #define vtk_m_worklet_contourtree_distributed_boundary_tree_maker_h
55 
56 // augmented contour tree includes
61 
62 // distibuted contour tree includes
66 
94 
95 
96 // vtkm includes
97 #include <vtkm/Types.h>
98 
99 // std includes
100 #include <sstream>
101 #include <string>
102 #include <utility>
103 
104 // TODO: Change all pointers to std mangaged pointers or use references (the memory for those pointers should be managed outside in the filter)
105 
106 namespace vtkm
107 {
108 namespace worklet
109 {
110 namespace contourtree_distributed
111 {
112 
115 template <typename MeshType, typename MeshBoundaryExecObjType>
117 {
118 public:
119  // pointers to underlying data structures
121  MeshType* Mesh;
122  MeshBoundaryExecObjType& MeshBoundaryExecutionObject;
123 
130 
133 
136 
139 
141 
142  // arrays sized to all regular vertices - this may not be necessary, but is robust
145 
146  // arrays sized to number of boundary vertices
153 
154  // arrays sized to number of supernodes/superarcs
157 
160 
162  // TODO: May be able to reuse Petar's Hypersweep, which uses less storage AND/OR use Petar's generic hypersweep to simplify code
170 
171  // vectors needed for collapsing out "regular" supernodes
172  // up- and down- neighbours in the tree (unique for regular nodes)
173  // sized to BRACT
178 
179  VTKM_CONT
180  BoundaryTreeMaker(MeshType* inputMesh,
181  MeshBoundaryExecObjType& meshBoundaryExecObj,
183  BoundaryTree* boundaryTree,
184  InteriorForest* interiorTree)
185  : Mesh(inputMesh)
186  , MeshBoundaryExecutionObject(meshBoundaryExecObj)
187  , ContourTree(inputTree)
188  , BoundaryTreeData(boundaryTree)
189  , InteriorForestData(interiorTree)
190  , NumBoundary(0)
191  , NumNecessary(0)
192  {
193  }
194 
203  VTKM_CONT
205  localToGlobalIdRelabeler = nullptr,
206  bool boundaryCritical = true);
207 
212  VTKM_CONT
213  void FindBoundaryVertices(bool boundaryCritical);
214 
217  VTKM_CONT
219 
221  VTKM_CONT
223 
225  VTKM_CONT
227 
229  VTKM_CONT
231 
233  VTKM_CONT
235 
237  VTKM_CONT
239 
242  VTKM_CONT
243  void SetUpAndDownNeighbours();
244 
246  VTKM_CONT
248 
251  VTKM_CONT
253 
255  VTKM_CONT
257 
259  VTKM_CONT
261 
265  VTKM_CONT
267  localToGlobalIdRelabeler = nullptr);
268 
270  VTKM_CONT
271  std::string DebugPrint(const char* message, const char* fileName, long lineNum) const;
272 
273 private:
276 
277 }; // BoundaryTreeMaker class
278 
279 
280 template <typename MeshType, typename MeshBoundaryExecObjType>
282  const vtkm::worklet::contourtree_augmented::mesh_dem::IdRelabeler* localToGlobalIdRelabeler,
283  bool boundaryCritical)
284 { // Construct
285 
286  // 0. Retrieve the number of iterations used to construct the contour tree
287  // NB: There may be sense in reusing transfer & dependent weight arrays,
288  // and nIterations, and the arrays for the super/hyper arc subsegments per pass
289  // but for now, burn extra memory
290  // The +1 is because this is 0-indexed
291 
292  // Step I: Initialise the bract to hold the set of boundary vertices
293  // & save how many for later
294  this->FindBoundaryVertices(boundaryCritical);
295 
296  // Step II: For each supernode / superarc, compute the dependent boundary counts
297  this->ComputeDependentBoundaryCounts();
298 
299  // Step III: We now have initial weights and do the standard inward propagation through
300  // the hyperstructure to compute properly over the entire tree
301  this->PropagateBoundaryCounts();
302 
303  // Step IV: We now use the dependent weight to identify which internal supernodes are necessary
304  this->FindNecessaryInteriorSupernodes();
305 
306  // Step V: Add the necessary interior nodes to the end of the boundary set
307  this->AugmentBoundaryWithNecessaryInteriorSupernodes();
308 
309  // Step VI: Use the hyperparents to sort these vertices into contiguous chunks as usual
310  // We will store the BRACT ID for the superarc target this to simplify the next step
311  this->FindBoundaryTreeSuperarcs();
312 
313  // Step VII: Suppress interior supernodes that are regular in the BRACT
314  // At the end, we will reset the superarc target from BRACT ID to block ID
315  this->SuppressRegularisedInteriorSupernodes();
316 
317  // Step VIII: Set the Residue for passing to the TreeGrafter
318  this->SetInteriorForest(localToGlobalIdRelabeler);
319 
320 #ifdef DEBUG_PRINT
322  this->BoundaryTreeData->DebugPrint("All Completed\n", __FILE__, __LINE__));
323 #endif
324 } // Construct
325 
326 
332 template <typename MeshType, typename MeshBoundaryExecObjType>
334  bool boundaryCritical)
335 { // FindBoundaryVertices
336 
337  // ask the mesh to give us a list of boundary verticels (with their regular indices)
338  this->Mesh->GetBoundaryVertices(
339  this->BoundaryVertexSuperset, this->BoundaryIndices, &(this->MeshBoundaryExecutionObject));
340  // pull a local copy of the size (they can diverge)
341  this->BoundaryTreeData->NumBoundary = this->BoundaryVertexSuperset.GetNumberOfValues();
342  // Identify the points that are boundary critical and update this->BoundaryVertexSuperset,
343  // and this->BoundaryIndices accordingly by removing all boundary vertices that are
344  // not boundary cirtical, and hence, are not neccessary for merging neighboring data blocks
345  if (boundaryCritical)
346  {
348  isNecessaryWorklet;
349  vtkm::cont::ArrayHandle<bool> isBoundaryCritical;
350  this->Invoke(isNecessaryWorklet,
351  this->BoundaryVertexSuperset,
352  &(this->MeshBoundaryExecutionObject),
353  isBoundaryCritical);
354  vtkm::worklet::contourtree_augmented::IdArrayType necessaryBoundaryVertexSuperset;
355  vtkm::worklet::contourtree_augmented::IdArrayType necessaryBoundaryIndices;
357  this->BoundaryVertexSuperset, isBoundaryCritical, necessaryBoundaryVertexSuperset);
358  this->BoundaryVertexSuperset = necessaryBoundaryVertexSuperset;
360  this->BoundaryIndices, isBoundaryCritical, necessaryBoundaryIndices);
361  this->BoundaryIndices = necessaryBoundaryIndices;
362  }
363 
364  this->NumBoundary = this->BoundaryVertexSuperset.GetNumberOfValues();
365  this->BoundaryTreeData->NumBoundaryUsed = this->NumBoundary;
366 
367 #ifdef DEBUG_PRINT
369  this->DebugPrint("Boundary Vertices Set", __FILE__, __LINE__));
370 #endif
371 } // FindBoundaryVertices
372 
373 
381 template <typename MeshType, typename MeshBoundaryExecObjType>
383 { // ComputeDependentBoundaryCounts
384  // 1. copy in the superparent from the regular arrays in the contour tree
385  auto permutedContourTreeSuperparents =
386  vtkm::cont::make_ArrayHandlePermutation(this->BoundaryIndices, this->ContourTree.Superparents);
387  vtkm::cont::Algorithm::Copy(permutedContourTreeSuperparents, this->BoundarySuperparents);
388 
389 #ifdef DEBUG_PRINT
390  VTKM_LOG_S(vtkm::cont::LogLevel::Info, this->DebugPrint("Superparents Set", __FILE__, __LINE__));
391 #endif
392 
393  // 2. Sort this set & count by superarc to set initial intrinsic boundary counts
394  // Note that this is in the parallel style, but can be done more efficiently in serial
395  // a. Allocate space for the count & initialise to zero
397  vtkm::cont::make_ArrayHandleConstant(0, this->ContourTree.Superarcs.GetNumberOfValues()),
398  this->SuperarcIntrinsicBoundaryCount);
399  // b. sort the superparents
401  vtkm::cont::Algorithm::Sort(this->BoundarySuperparents);
402 
403  // c. Now compute the number of boundary vertices per superarc
404  // This *could* be done with a prefix sum, but it's cheaper to do it this way with 2 passes
405  // NB: first superarc's beginning is always 0, so we can omit it, which simplifies the IF logic
406  // i. Start by detecting the high end of the range and then ii) setting the last element explicitly
407  bract_maker::BoundaryVerticiesPerSuperArcStepOneWorklet tempWorklet1(this->NumBoundary);
408  this->Invoke(tempWorklet1,
409  this->BoundarySuperparents,
410  this->SuperarcIntrinsicBoundaryCount // output
411  );
412 
413  // iii.Repeat to subtract and compute the extent lengths (i.e. the counts)
414  // Note that the 0th element will subtract 0 and can be omitted
416  this->Invoke(tempWorklet2,
417  this->BoundarySuperparents,
418  this->SuperarcIntrinsicBoundaryCount // output
419  );
420 
421  // resize local array
422  this->BoundarySuperparents.ReleaseResources();
423 
424 #ifdef DEBUG_PRINT
426  this->DebugPrint("Initial Counts Set", __FILE__, __LINE__));
427 #endif
428 } // ComputeDependentBoundaryCounts
429 
430 
437 template <typename MeshType, typename MeshBoundaryExecObjType>
439 { // PropagateBoundaryCounts
440  // 1. Propagate boundary counts inwards along super/hyperarcs (same as ComputeWeights)
441  // a. Initialise arrays for transfer & dependent counts
443  vtkm::cont::make_ArrayHandleConstant(0, this->ContourTree.Supernodes.GetNumberOfValues()),
444  this->SupernodeTransferBoundaryCount);
446  vtkm::cont::make_ArrayHandleConstant(0, this->ContourTree.Superarcs.GetNumberOfValues()),
447  this->SuperarcDependentBoundaryCount);
449  vtkm::cont::make_ArrayHandleConstant(0, this->ContourTree.Hyperarcs.GetNumberOfValues()),
450  this->HyperarcDependentBoundaryCount);
451 
452 #ifdef DEBUG_PRINT
454  this->DebugPrint("Arrays initialised", __FILE__, __LINE__));
455 #endif
456 
457  // b. Iterate, propagating counts inwards
458  for (vtkm::Id iteration = 0; iteration < this->ContourTree.NumIterations; iteration++)
459  { // b. per iteration
460 #ifdef DEBUG_PRINT
461  VTKM_LOG_S(vtkm::cont::LogLevel::Info, this->DebugPrint("Top of Loop:", __FILE__, __LINE__));
462 #endif
463  // i. Pull the array bounds into register
464  vtkm::Id firstSupernode =
465  vtkm::cont::ArrayGetValue(iteration, this->ContourTree.FirstSupernodePerIteration);
466  vtkm::Id lastSupernode =
467  vtkm::cont::ArrayGetValue(iteration + 1, this->ContourTree.FirstSupernodePerIteration);
468 
469  if (lastSupernode == firstSupernode)
470  {
471 #ifdef DEBUG_PRINT
473  "BoundaryTreeMaker::PropagateBoundaryCounts(): lastSupernode == firstSupernode "
474  " -> Skipping iteration");
475 #endif
476  continue;
477  }
478 
479  vtkm::Id firstHypernode =
480  vtkm::cont::ArrayGetValue(iteration, this->ContourTree.FirstHypernodePerIteration);
481  vtkm::Id lastHypernode =
482  vtkm::cont::ArrayGetValue(iteration + 1, this->ContourTree.FirstHypernodePerIteration);
483 
484  // ii. Add xfer + int & store in dependent count
485  // Compute the sum of this->SupernodeTransferBoundaryCount and this->SuperarcIntrinsicBoundaryCount
486  // for the [firstSupernodex, lastSupernode) subrange and copy to the this->SuperarcDependentBoundaryCount
487  { // make local context so fancyTempSumArray gets deleted
488  auto fancyTempZippedArray = vtkm::cont::make_ArrayHandleZip(
489  this->SupernodeTransferBoundaryCount, this->SuperarcIntrinsicBoundaryCount);
490  auto fancyTempSumArray =
492 
494  fancyTempSumArray, // input array
495  firstSupernode, // start index for the copy
496  lastSupernode - firstSupernode, // number of values to copy
497  this->SuperarcDependentBoundaryCount, // target output array
498  firstSupernode // index in the output array where we start writing values to
499  );
500  } // end local context for step ii
501 
502 #ifdef DEBUG_PRINT
503  VTKM_LOG_S(vtkm::cont::LogLevel::Info, this->DebugPrint("After Transfer", __FILE__, __LINE__));
504 #endif
505  // iii.Perform prefix sum on dependent count range
506  { // make local context so tempArray and fancyRangeArraySuperarcDependentBoundaryCountget deleted
507  auto fancyRangeArraySuperarcDependentBoundaryCount = make_ArrayHandleView(
508  this->SuperarcDependentBoundaryCount, firstSupernode, lastSupernode - firstSupernode);
509  // Write to temporary array first as it is not clear whether ScanInclusive is safe to read and write
510  // to the same array and range
512  vtkm::cont::Algorithm::ScanInclusive(fancyRangeArraySuperarcDependentBoundaryCount,
513  tempArray);
515  tempArray,
516  0,
517  tempArray.GetNumberOfValues(), // copy all of tempArray
518  this->SuperarcDependentBoundaryCount,
519  firstSupernode // to the SuperarcDependentBoundaryCound starting at firstSupernode
520  );
521  } // end local context for step iii
522 
523 #ifdef DEBUG_PRINT
525  this->DebugPrint("After Prefix Sum", __FILE__, __LINE__));
526 #endif
527  // iv. Subtract out the dependent count of the prefix to the entire hyperarc
528  { // make local context for iv so newSuperArcDependentBoundaryCount and the worklet gets deleted
529  // Storage for the vector portion that will be modified
530  vtkm::worklet::contourtree_augmented::IdArrayType newSuperArcDependentBoundaryCount;
531  vtkm::cont::Algorithm::CopySubRange(this->SuperarcDependentBoundaryCount,
532  firstSupernode,
533  lastSupernode - firstSupernode,
534  newSuperArcDependentBoundaryCount);
535  auto subtractDependentCountsWorklet =
537  firstHypernode);
538  // per supenode
539  this->Invoke(
540  subtractDependentCountsWorklet,
541  // use backwards counting array for consistency with original code, but if forward or backward doesn't matter
543  lastSupernode - 1, -1, lastSupernode - firstSupernode - 1), // input
544  this->ContourTree.Hyperparents, // input
545  this->ContourTree.Hypernodes, // input
546  this->SuperarcDependentBoundaryCount, // input
547  newSuperArcDependentBoundaryCount // (input/output)
548  );
549  // copy the results back into our main array
550  vtkm::cont::Algorithm::CopySubRange(newSuperArcDependentBoundaryCount,
551  0,
552  newSuperArcDependentBoundaryCount.GetNumberOfValues(),
553  this->SuperarcDependentBoundaryCount,
554  firstSupernode);
555  } // end local context of iv
556 #ifdef DEBUG_PRINT
558  this->DebugPrint("After Hyperarc Subtraction", __FILE__, __LINE__));
559 #endif
560 
561  // v. Transfer the dependent count to the hyperarc's target supernode
562  { // local context of v.
563  auto transferDependentCountsWorklet =
565  this->ContourTree.Supernodes.GetNumberOfValues(),
566  this->ContourTree.Hypernodes.GetNumberOfValues());
567  this->Invoke(
568  transferDependentCountsWorklet,
569  // for (vtkm::Id hypernode = firstHypernode; hypernode < lastHypernode; hypernode++)
571  firstHypernode, 1, lastHypernode - firstHypernode), // input
572  this->ContourTree.Hypernodes, // input
573  this->SuperarcDependentBoundaryCount, // input
574  this->HyperarcDependentBoundaryCount // output
575  );
576  // transferring the count is done as a separate reduction
577  } // end local context for step iv
578 #ifdef DEBUG_PRINT
580  this->DebugPrint("After Dependent Count transfer", __FILE__, __LINE__));
581 #endif
582 
583  // next we want to end up summing transfer count & storing in the target.
584  // Unfortunately, there may be multiple hyperarcs in a given
585  // pass that target the same supernode, so we have to do this separately.
586  // 1. permute so that all hypernodes with the same target are contiguous
587  { // local context for summing transfer count & storing in the target.
588  vtkm::worklet::contourtree_augmented::IdArrayType hyperarcTargetSortPermutation;
590  firstHypernode, 1, lastHypernode - firstHypernode),
591  hyperarcTargetSortPermutation);
592 
593  // 2. sort the elements to cluster by hyperarc target, using a lambda function for comparator
594  // we need a reference that a lambda function can use
595  auto hyperarcComparator = bract_maker::HyperarcComparator(this->ContourTree.Hyperarcs);
596  vtkm::cont::Algorithm::Sort(hyperarcTargetSortPermutation, hyperarcComparator);
597 
598  // 3. now compute the partial sum for the properly permuted boundary counts
599  // total boundary count at each node
600  vtkm::worklet::contourtree_augmented::IdArrayType accumulatedBoundaryCount;
601  auto permutedHyperarcDependentCount =
602  vtkm::cont::make_ArrayHandlePermutation(hyperarcTargetSortPermutation, // id array
603  this->HyperarcDependentBoundaryCount // value array
604  );
605  vtkm::cont::Algorithm::ScanInclusive(permutedHyperarcDependentCount,
606  accumulatedBoundaryCount);
607 
608  // 4. The partial sum is now over ALL hypertargets, so within each group we need to subtract the first from the last
609  // To do so, the last hyperarc in each cluster copies its cumulative count to the output array
610  auto transferCumulativeCountsWorklet =
612  this->Invoke(transferCumulativeCountsWorklet,
613  hyperarcTargetSortPermutation,
614  this->ContourTree.Hyperarcs,
615  accumulatedBoundaryCount,
616  this->SupernodeTransferBoundaryCount);
617 
618 #ifdef DEBUG_PRINT
620  this->DebugPrint("After Tail Addition", __FILE__, __LINE__));
621 #endif
622 
623  // 5. Finally, we subtract the beginning of the group to get the total for each group
624  // Note that we start the loop from 1, which means we don't need a special case if statement
625  // because the prefix sum of the first element is the correct value anyway
626  auto computeGroupTotalsWorklet =
628  this->Invoke(computeGroupTotalsWorklet,
629  hyperarcTargetSortPermutation,
630  this->ContourTree.Hyperarcs,
631  accumulatedBoundaryCount,
632  this->SupernodeTransferBoundaryCount);
633  } // end local context for summing transfer count & storing in the target.
634 #ifdef DEBUG_PRINT
636  this->DebugPrint("After Hyperarc Transfer", __FILE__, __LINE__));
637 #endif
638  } // b. per iteration
639 
640  // when we are done, we need to force the summation for the root node, JUST IN CASE it is a boundary node itself
641  // BTW, the value *SHOULD* be the number of boundary nodes, anyway
642  vtkm::Id rootSuperId = this->ContourTree.Supernodes.GetNumberOfValues() - 1;
644  rootSuperId,
645  vtkm::cont::ArrayGetValue(rootSuperId, this->SupernodeTransferBoundaryCount) +
646  vtkm::cont::ArrayGetValue(rootSuperId, this->SuperarcIntrinsicBoundaryCount),
647  this->SuperarcDependentBoundaryCount);
649  this->ContourTree.Hypernodes.GetNumberOfValues() - 1,
650  vtkm::cont::ArrayGetValue(rootSuperId, this->SuperarcDependentBoundaryCount),
651  this->HyperarcDependentBoundaryCount);
652 
653 #ifdef DEBUG_PRINT
655  this->DebugPrint("Iterations Complete", __FILE__, __LINE__));
656 #endif
657 } // PropagateBoundaryCounts
658 
659 
673 template <typename MeshType, typename MeshBoundaryExecObjType>
675 { // FindNecessaryInteriorSupernodes
676  // 1. Identify the necessary supernodes (between two boundary points & still critical)
677  // 1.A. Start by setting all of them to "unnecessary"
678  // Initalize isNecessary with False
680  vtkm::cont::make_ArrayHandleConstant(false, this->ContourTree.Supernodes.GetNumberOfValues()),
681  this->InteriorForestData->IsNecessary);
682  // 1.B. Our condition is that if the superarc dependent count is neither 0 nor the # of boundary
683  // points, the superarc target is necessary. Note that there may be write conflicts, but it's
684  // an OR operation, so it doesn't matter
685  auto findNodesWorklet =
687  this->Invoke(findNodesWorklet,
688  this->ContourTree.Superarcs, // input
689  this->SuperarcDependentBoundaryCount, // input
690  this->InteriorForestData->IsNecessary // output
691  );
692 #ifdef DEBUG_PRINT
694  this->DebugPrint("Is Necessary Based on Dependency", __FILE__, __LINE__));
695 #endif
696 
697  // separate pass to set the superparent of every boundary node to be necessary
698  auto setSuperparentNecessaryWorklet =
700  this->Invoke(setSuperparentNecessaryWorklet,
701  this->BoundaryIndices,
702  this->ContourTree.Superparents,
703  this->ContourTree.Superarcs,
704  this->InteriorForestData->IsNecessary);
705 #ifdef DEBUG_PRINT
706  VTKM_LOG_S(vtkm::cont::LogLevel::Info, this->DebugPrint("Is Necessary Set", __FILE__, __LINE__));
707 #endif
708 } // FindNecessaryInteriorSupernodes()
709 
716 template <typename MeshType, typename MeshBoundaryExecObjType>
717 void BoundaryTreeMaker<MeshType,
718  MeshBoundaryExecObjType>::AugmentBoundaryWithNecessaryInteriorSupernodes()
719 { // AugmentBoundaryWithNecessaryInteriorSupernodes
720  // 1. Collect the necessary supernodes & boundary vertices & suppress duplicates
722  vtkm::cont::Algorithm::Copy(this->InteriorForestData->IsNecessary, isNecessaryAndInterior);
723 
724  // a. To do this, first *UNSET* the necessary flags for all supernodes that are also on the boundary
725  auto unsetBoundarySupernodesWorklet =
727  this->Invoke(unsetBoundarySupernodesWorklet,
728  this->BoundaryIndices, // input
729  this->ContourTree.Superparents, // input
730  this->ContourTree.Supernodes, // input
731  isNecessaryAndInterior // output
732  );
733 
734 #ifdef DEBUG_PRINT
735  DebugPrint("Flags Unset", __FILE__, __LINE__);
736 #endif
737 
738  // b. Now append all necessary supernodes to the boundary vertex array
739  // first count how many are needed, then resize the arrays
740  this->NumNecessary =
741  vtkm::cont::Algorithm::Reduce(isNecessaryAndInterior, static_cast<vtkm::Id>(0));
742  // We need to grow the arrays, without loosing our original data, so we need
743  // to create new arrays of the approbriate size, copy our data in and then
744  // assign. TODO: Would be great if VTKm allow resize without losing the values
745  if (this->NumNecessary == 0)
746  {
747 #ifdef DEBUG_PRINT
749  "BoundaryTreeMaker::AugmentBoundaryWithNecessaryInteriorSupernodes():"
750  "No additional nodes necessary. Returning.");
751 #endif
752  return;
753  }
754  {
755  // Create a new resized array and copy the original values to the array
756  vtkm::worklet::contourtree_augmented::IdArrayType tempBoundaryVertexSuperset;
757  tempBoundaryVertexSuperset.Allocate(this->NumBoundary + this->NumNecessary);
759  this->BoundaryVertexSuperset, // input
760  0, // start index
761  this->NumBoundary, // number of values to copy. Same as size of this->BoundaryVertexSuperset
762  tempBoundaryVertexSuperset, // copy to temp
763  0 // start inserting at 0
764  );
765  // Set the added values to 0
766  // TODO: Check if it is really necessary to initalize the new values
768  vtkm::cont::make_ArrayHandleConstant<vtkm::Id>(0, this->NumBoundary), // set to 0
769  0, // start index
770  this->NumNecessary, // number of values to copy
771  tempBoundaryVertexSuperset, // copy to temp
772  this->NumBoundary // start where our original values end
773  );
774  // Set the BoundaryVertexSuperset to our new array
775  this->BoundaryVertexSuperset.ReleaseResources();
776  this->BoundaryVertexSuperset = tempBoundaryVertexSuperset;
777  }
778  // Now do the same for the BoundaryIndicies (i.e,. resize while keeping the original values)
779  {
780  // Create a new resized array and copy the original values to the array
782  tempBoundaryIndices.Allocate(this->NumBoundary + this->NumNecessary);
784  this->BoundaryIndices, // input
785  0, // start index
786  this->NumBoundary, // number of values to copy. Same as size of this->BoundaryIndices
787  tempBoundaryIndices, // copy to temp
788  0 // start inserting at 0
789  );
790  // Set the added values to 0
791  // TODO: Check if it is really necessary to initalize the new values
793  vtkm::cont::make_ArrayHandleConstant<vtkm::Id>(0, this->NumBoundary), // set to 0
794  0, // start index
795  this->NumNecessary, // number of values to copy
796  tempBoundaryIndices, // copy to temp
797  this->NumBoundary // start where our original values end
798  );
799  // Set the BoundaryVertexSuperset to our new array
800  this->BoundaryIndices.ReleaseResources();
801  this->BoundaryIndices = tempBoundaryIndices;
802  }
803 
804  // create a temporary array for transfer IDs
806  boundaryNecessaryId.Allocate(this->ContourTree.Supernodes.GetNumberOfValues());
807  // and partial sum them in place
808  vtkm::cont::Algorithm::ScanInclusive(isNecessaryAndInterior, boundaryNecessaryId);
809 
810  // now do a parallel for loop to copy them
811  auto appendNecessarySupernodesWorklet =
813  this->NumBoundary);
814  this->Invoke(appendNecessarySupernodesWorklet,
815  this->ContourTree.Supernodes,
816  isNecessaryAndInterior,
817  boundaryNecessaryId,
818  this->Mesh->SortOrder,
819  this->BoundaryIndices,
820  this->BoundaryVertexSuperset);
821 
822 #ifdef DEBUG_PRINT
824  this->DebugPrint("Necessary Appended", __FILE__, __LINE__));
825 #endif
826 } // AugmentBoundaryWithNecessaryInteriorSupernodes
827 
828 
837 template <typename MeshType, typename MeshBoundaryExecObjType>
839 { // FindBoundaryTreeSuperarcs
840  // 0. Allocate memory for the tree2superset map
843  this->ContourTree.Supernodes.GetNumberOfValues()),
844  this->TreeToSuperset);
845 
846  // 1. Sort the boundary set by hyperparent
847  auto contourTreeNodeHyperArcComparator = bract_maker::ContourTreeNodeHyperArcComparator(
848  this->ContourTree.Superarcs, this->ContourTree.Superparents);
849  vtkm::cont::Algorithm::Sort(this->BoundaryIndices, contourTreeNodeHyperArcComparator);
850 
851 #ifdef DEBUG_PRINT
853  this->DebugPrint("Sorted by Superparent", __FILE__, __LINE__));
854 #endif
855 
856  // 2. Reset the order of the vertices in the BRACT
858  vtkm::cont::make_ArrayHandlePermutation(this->BoundaryIndices, // index array to permute with
859  this->Mesh->SortOrder // value array to be permuted
860  ),
861  this->BoundaryVertexSuperset // Copy the permuted Mesh->SortOrder to BoundaryVertexSuperset
862  );
863 #ifdef DEBUG_PRINT
864  VTKM_LOG_S(vtkm::cont::LogLevel::Info, this->DebugPrint("Vertices Reset", __FILE__, __LINE__));
865 #endif
866 
867  // allocate memory for the superarcs (same size as supernodes for now)
870  this->BoundaryVertexSuperset.GetNumberOfValues()),
871  this->BoundaryTreeData->Superarcs);
872 
873  // We would like to connect vertices to their neighbour on the hyperarc as usual
874  // The problem here is that the root of the tree may be unnecessary
875  // and if that is the case we will need to adjust
876 
877  // The test will be:
878  // i. if there is a "next", we will take it
879  // ii. if we are dangling at the end of the hyperarc, two possibilities exist
880  // a. the supernode target of the hyperarc is in the BRACT anyway
881  // b. the supernode target is not in the BRACT
882 
883  // To resolve all this, we will need to have an array the size of all the regular nodes
884  // in order to find the boundary ID of each vertex transferred
885  {
886  // Allocate this->BoundaryTreeId with NoSuchElemet
889  this->ContourTree.Nodes.GetNumberOfValues()),
890  this->BoundaryTreeId);
891  // Fill the relevant values
892  auto tempPermutedBoundaryTreeId =
893  vtkm::cont::make_ArrayHandlePermutation(this->BoundaryVertexSuperset, // index array
894  this->BoundaryTreeId // value array
895  );
898  this->BoundaryVertexSuperset.GetNumberOfValues()), // copy 0,1, ... n
899  tempPermutedBoundaryTreeId // copy to BoundaryTreeId permuted by BoundaryTreeVertexSuperset
900  );
901  }
902 
903  // We now compute the superarc "to" for every bract node
905  this->Invoke(superarcToWorklet,
906  this->BoundaryVertexSuperset, // input
907  this->BoundaryIndices, // input
908  this->BoundaryTreeId, // input
909  this->ContourTree.Superparents, // input
910  this->ContourTree.Hyperparents, // input
911  this->ContourTree.Hyperarcs, // input
912  this->ContourTree.Supernodes, // input
913  this->Mesh->SortOrder, // input
914  this->TreeToSuperset, // output
915  this->BoundaryTreeData->Superarcs // output
916  );
917 
918 #ifdef DEBUG_PRINT
920  this->DebugPrint("Restricted to Boundary", __FILE__, __LINE__));
921 #endif
922 } // FindBoundaryTreeSuperarcs
923 
924 
933 template <typename MeshType, typename MeshBoundaryExecObjType>
935 { // SuppressRegularisedInteriorSupernodes
936  // 1. We have to suppress regular vertices that were interior critical points
937  // We can't get rid of them earlier because we need them to connect super-/hyper- arcs
938 
939  // STEP I: Find a (non-canonical) up/down neighbour for each vertex
940  SetUpAndDownNeighbours();
941 
942  // STEP II: Find the critical points
943  IdentifyRegularisedSupernodes();
944 
945  // STEP III: Set flags to indicate which pointers are terminal
946  AddTerminalFlagsToUpDownNeighbours();
947 
948  // STEP IV: Use pointer-doubling to collapse past regular nodes
949  PointerDoubleUpDownNeighbours();
950 
951  // STEP V: Get rid of the now regular interior supernodes
952  CompressRegularisedNodes();
953 } // SuppressRegularisedInteriorSupernodes
954 
955 
962 template <typename MeshType, typename MeshBoundaryExecObjType>
964 { // SetUpAndDownNeighbours
965  // So, we will set an up- and down-neighbour for each one (for critical points, non-canonical)
966  { // local context
967  auto tempNoSuchElementArray =
969  this->BoundaryVertexSuperset.GetNumberOfValues());
970  vtkm::cont::Algorithm::Copy(tempNoSuchElementArray, this->UpNeighbour);
971  vtkm::cont::Algorithm::Copy(tempNoSuchElementArray, this->DownNeighbour);
972  } // end local context
973 
974  auto setUpAndDownNeighboursWorklet = bract_maker::SetUpAndDownNeighboursWorklet();
975  this->Invoke(setUpAndDownNeighboursWorklet,
976  this->BoundaryVertexSuperset, // input
977  this->BoundaryTreeData->Superarcs, // input
978  this->Mesh->SortIndices, // input
979  this->UpNeighbour, // output
980  this->DownNeighbour // output
981  );
982 
983 #ifdef DEBUG_PRINT
985  this->DebugPrint("Initial Up/Down Neighbours Set", __FILE__, __LINE__));
986 #endif
987 } // SetUpAndDownNeighbours
988 
989 
994 template <typename MeshType, typename MeshBoundaryExecObjType>
996 { // IdentifyRegularisedSupernodes
997  // here, if any edge detects the up/down neighbours mismatch, we must have had a write conflict
998  // it then follows we have a critical point and can set a flag accordingly
999  // we will use a vector that stores NO_SUCH_ELEMENT for false, anything else for true
1000  // it gets reused as an ID
1003  this->BoundaryVertexSuperset.GetNumberOfValues()),
1004  this->NewVertexId);
1005 
1007  this->Invoke(stepOneWorklet,
1008  this->BoundaryVertexSuperset, // input
1009  this->BoundaryTreeData->Superarcs, // input
1010  this->Mesh->SortIndices, // input
1011  this->UpNeighbour, // input
1012  this->DownNeighbour, // input
1013  this->NewVertexId // output
1014  );
1015 
1016  // c. We also want to flag the leaves and boundary nodes as necessary
1018  this->Invoke(stepTwoWorklet,
1019  this->BoundaryVertexSuperset, // input
1020  this->UpNeighbour, // input
1021  this->DownNeighbour, // input
1022  this->MeshBoundaryExecutionObject, // input
1023  this->NewVertexId // output
1024  );
1025 
1026 #ifdef DEBUG_PRINT
1028  this->DebugPrint("Boundaries & Leaves Set", __FILE__, __LINE__));
1029 #endif
1030 } // IdentifyRegularisedSupernodes
1031 
1032 
1039 template <typename MeshType, typename MeshBoundaryExecObjType>
1041 { //
1042  // d. Now that we know which vertices are necessary, we can set the upNeighbour & downNeighbour flags
1043  auto addTerminalFlagsToUpDownNeighboursWorklet =
1045  this->Invoke(addTerminalFlagsToUpDownNeighboursWorklet,
1046  this->NewVertexId, // input
1047  this->UpNeighbour, // output
1048  this->DownNeighbour // output
1049  );
1050 
1051 #ifdef DEBUG_PRINT
1053  this->DebugPrint("Up/Down Neighbours Terminated", __FILE__, __LINE__));
1054 #endif
1055 } //
1056 
1057 
1063 template <typename MeshType, typename MeshBoundaryExecObjType>
1065 { // PointerDoubleUpDownNeighbours
1066  // e. Use pointer-doubling to eliminate regular nodes
1067  // 1. Compute the number of log steps
1068  vtkm::Id nLogSteps = 1;
1069  for (vtkm::Id shifter = this->BoundaryVertexSuperset.GetNumberOfValues(); shifter != 0;
1070  shifter >>= 1)
1071  {
1072  nLogSteps++;
1073  }
1074 
1075  // 2. loop that many times to do the compression
1076  for (vtkm::Id iteration = 0; iteration < nLogSteps; iteration++)
1077  { // per iteration
1078  // loop through the vertices, updating both ends
1079  auto pointerDoubleUpDownNeighboursWorklet = bract_maker::PointerDoubleUpDownNeighboursWorklet();
1080  this->Invoke(pointerDoubleUpDownNeighboursWorklet, this->UpNeighbour, this->DownNeighbour);
1081  } // per iteration
1082 #ifdef DEBUG_PRINT
1084  this->DebugPrint("Pointer Doubling Done", __FILE__, __LINE__));
1085 #endif
1086 } // PointerDoubleUpDownNeighbours
1087 
1088 
1096 template <typename MeshType, typename MeshBoundaryExecObjType>
1098 { // CompressRegularisedNodes
1099  // f. Compress the regular nodes out of the tree
1100  // 1. Assign new indices
1101  // Copy the necessary ones only - this is a compression call in parallel
1102  // HAC: to use a different array, keeping isNecessary indexed on everything
1103  // We now reset it to the size of the return tree
1105  // Start by creating the ID #s with a partial sum (these will actually start from 1, not 0
1108  keptInBoundaryTree);
1109  // Update newVertexID, i.e., for each element set:
1110  // if (!noSuchElement(newVertexID[returnIndex]))
1111  // newVertexID[returnIndex] = keptInBoundaryTree[returnIndex]-1;
1112  auto copyNecessaryRegularNodesWorklet =
1114  this->Invoke(copyNecessaryRegularNodesWorklet,
1115  this->NewVertexId, // input/output
1116  keptInBoundaryTree // input
1117  );
1118 
1119 #ifdef DEBUG_PRINT
1121  this->DebugPrint("Compressed IDs Computed", __FILE__, __LINE__));
1122 #endif
1123  // 2. Work out the new superarcs, which is slightly tricky, since they point inbound.
1124  // For each necessary vertex N, the inbound vertex I in the original contour tree can point to:
1125  // i. Another necessary vertex (in which case we keep the superarc)
1126  // ii. Nothing (in the case of the root) - again, we keep it, since we already know it's necessar
1127  // iii. An unnecessary vertex (i.e. any other case). Here, the treatment is more complex.
1128  // In this case, we know that the pointer-doubling has forced the up/down neighbours of I
1129  // to point to necessary vertices (or nothing). And since we know that there is an inbound
1130  // edge from N, N must therefore be either the up or down neighbour of I after doubling.
1131  // We therefore go the other way to find which necessary vertex V that N must connect to.
1132  //
1133  // Just to make it interesting, the root vertex can become unnecessary. If this is the case, we end up with two
1134  // necessary vertices each with a superarc to the other. In serial, we can deal with this by checking to see whether
1135  // the far end has already been set to ourself, but this doesn't parallelise properly. So we will have an extra pass
1136  // just to get this correct.
1137  // We will compute the new superarcs directly with the new size
1138  //
1139  // To do this in parallel, we compute for every vertex
1140 
1141  // first create the array: start by observing that the last entry is guaranteed
1142  // to hold the total number of necessary vertices
1143  this->NumKept =
1144  vtkm::cont::ArrayGetValue(keptInBoundaryTree.GetNumberOfValues() - 1, keptInBoundaryTree);
1145  // create an array to store the new superarc Ids and initalize it with NO_SUCH_ELEMENT
1149  this->NumKept),
1150  newSuperarc);
1151  auto findNewSuperarcsWorklet = bract_maker::CompressRegularisedNodesFindNewSuperarcsWorklet();
1152  this->Invoke(findNewSuperarcsWorklet,
1153  this->NewVertexId, //input
1154  this->BoundaryTreeData->Superarcs, //input
1155  this->UpNeighbour, //input
1156  this->DownNeighbour, //input
1157  newSuperarc //output
1158  );
1159 
1160 #ifdef DEBUG_PRINT
1162  this->DebugPrint("New Superarcs Found", __FILE__, __LINE__));
1163 #endif
1164 
1165  // 3. Now do the pass to resolve the root: choose the direction with decreasing index
1166  auto resolveRootWorklet = bract_maker::CompressRegularisedNodesResolveRootWorklet();
1167  this->Invoke(resolveRootWorklet,
1168  vtkm::cont::ArrayHandleIndex(this->NumKept), // input
1169  newSuperarc // output
1170  );
1171 
1172 #ifdef DEBUG_PRINT
1173  VTKM_LOG_S(vtkm::cont::LogLevel::Info, this->DebugPrint("Root Resolved", __FILE__, __LINE__));
1174 #endif
1175 
1176  // 4. Now transfer the vertices & resize
1178  newVertexIndex.Allocate(this->NumKept);
1179  auto transferVerticesWorklet = bract_maker::CompressRegularisedNodesTransferVerticesWorklet();
1180  this->Invoke(transferVerticesWorklet,
1181  this->BoundaryVertexSuperset, // input
1182  this->NewVertexId, // input
1183  newVertexIndex // output
1184  );
1185 
1186  //vtkm::worklet::contourtree_augmented::PrintHeader(newVertexIndex.GetNumberOfValues(), std::cerr);
1187  //vtkm::worklet::contourtree_augmented::PrintIndices("New Vertex Index", newVertexIndex, -1, std::cerr);
1188 
1189 #ifdef DEBUG_PRINT
1191  this->DebugPrint("Vertices Transferred", __FILE__, __LINE__));
1192 #endif
1193 
1194  // 5. Create an index array and sort it indirectly by sortOrder
1196  vtkm::cont::Algorithm::Copy(vtkm::cont::ArrayHandleIndex(this->NumKept), vertexSorter);
1197  auto bractNodeComparator =
1198  bract_maker::BoundaryTreeNodeComparator(newVertexIndex, this->Mesh->SortIndices);
1199  vtkm::cont::Algorithm::Sort(vertexSorter, bractNodeComparator);
1200  // 5.1. Compute the reverseSorter
1202  reverseSorter.Allocate(
1203  this->NumKept); // Reserve space since we need to permute the array for copy
1204  {
1205  auto permutedReverseSorter =
1206  vtkm::cont::make_ArrayHandlePermutation(vertexSorter, reverseSorter);
1207  vtkm::cont::Algorithm::Copy(vtkm::cont::ArrayHandleIndex(this->NumKept), permutedReverseSorter);
1208  }
1209 
1210 #ifdef DEBUG_PRINT
1212  this->DebugPrint("Indirect Sort Complete", __FILE__, __LINE__));
1213 #endif
1214 
1215  //vtkm::worklet::contourtree_augmented::PrintHeader(vertexSorter.GetNumberOfValues(), std::cerr);
1216  //vtkm::worklet::contourtree_augmented::PrintIndices("Vertex Sorter", vertexSorter, -1, std::cerr);
1217  //vtkm::worklet::contourtree_augmented::PrintIndices("Reverse Sorter", reverseSorter, -1, std::cerr);
1218 
1219  // 6. Resize both vertex IDs and superarcs, and copy in by sorted order
1220  // copy the vertex index with indirection, and using the sort order NOT the regular ID
1221  // the following Copy operation is equivilant to
1222  // bract->vertexIndex[bractID] = mesh->SortIndex(newVertexIndex[vertexSorter[bractID]]);
1225  vtkm::cont::make_ArrayHandlePermutation(vertexSorter, newVertexIndex),
1226  this->Mesh->SortIndices),
1227  this->BoundaryTreeData->VertexIndex);
1228 
1229  // now copy the this->BoundaryTreeData->Superarcs
1230  this->BoundaryTreeData->Superarcs.Allocate(this->NumKept, vtkm::CopyFlag::On);
1231  auto fillBoundaryTreeSuperarcsWorklet =
1233  this->Invoke(fillBoundaryTreeSuperarcsWorklet,
1234  newSuperarc,
1235  reverseSorter,
1236  vertexSorter,
1237  this->BoundaryTreeData->Superarcs);
1238 
1239 #ifdef DEBUG_PRINT
1241  this->DebugPrint("Regularised Nodes Compressed", __FILE__, __LINE__));
1242 #endif
1243 } // CompressRegularisedNodes
1244 
1245 
1252 template <typename MeshType, typename MeshBoundaryExecObjType>
1254  const vtkm::worklet::contourtree_augmented::mesh_dem::IdRelabeler* localToGlobalIdRelabeler)
1255 { // SetInteriorForest()
1256  // allocate memory for the residue arrays
1257  auto tempNoSuchElementArray =
1259  this->ContourTree.Supernodes.GetNumberOfValues());
1260  vtkm::cont::Algorithm::Copy(tempNoSuchElementArray, this->InteriorForestData->Above);
1261  vtkm::cont::Algorithm::Copy(tempNoSuchElementArray, this->InteriorForestData->Below);
1262 
1263  // now fill them in
1264  auto meshGlobalIds =
1265  this->Mesh
1266  ->template GetGlobalIdsFromMeshIndices<vtkm::worklet::contourtree_augmented::IdArrayType>(
1267  this->BoundaryVertexSuperset, localToGlobalIdRelabeler);
1268  auto setInteriorForestWorklet =
1270  // NOTE: We don't need this->BoundaryVertexSuperset as input since meshGlobalIds is already transformed accordingly
1271  this->Invoke(setInteriorForestWorklet,
1272  this->ContourTree.Supernodes, // input
1273  this->InteriorForestData->IsNecessary, // input
1274  this->TreeToSuperset, // input,
1275  meshGlobalIds, // input
1276  this->UpNeighbour, // input
1277  this->DownNeighbour, // input
1278  this->InteriorForestData->Above, // output
1279  this->InteriorForestData->Below // output
1280  );
1281 
1282  // now copy the mesh indices of the BRACT's vertices for the TreeGrafter to use
1283  InteriorForestData->BoundaryTreeMeshIndices.Allocate(
1284  this->BoundaryTreeData->VertexIndex.GetNumberOfValues());
1285  // per vertex in the bract, convert it to a sort ID and then mesh ID and copy to the InteriorForestData
1287  this->BoundaryTreeData->VertexIndex, this->Mesh->SortOrder),
1288  InteriorForestData->BoundaryTreeMeshIndices);
1289 } // SetInteriorForest()
1290 
1291 
1292 
1294 template <typename MeshType, typename MeshBoundaryExecObjType>
1296  const char* fileName,
1297  long lineNum) const
1298 { // DebugPrint
1299  std::stringstream resultStream;
1300  resultStream << std::setw(30) << std::left << fileName << ":" << std::right << std::setw(4)
1301  << lineNum << " ";
1302  resultStream << std::left << std::string(message) << std::endl;
1303 
1304  resultStream << "------------------------------------------------------" << std::endl;
1305  resultStream << "BRACT Contains: " << std::endl;
1306  resultStream << "------------------------------------------------------" << std::endl;
1308  this->BoundaryTreeData->VertexIndex.GetNumberOfValues(), resultStream);
1310  "BRACT Vertices", this->BoundaryTreeData->VertexIndex, -1, resultStream);
1312  "BRACT Superarcs", this->BoundaryTreeData->Superarcs, -1, resultStream);
1313  resultStream << "------------------------------------------------------" << std::endl;
1314  resultStream << "BRACT Maker Contains: " << std::endl;
1315  resultStream << "------------------------------------------------------" << std::endl;
1316  resultStream << "nBoundary: " << this->NumBoundary << std::endl;
1317  resultStream << "nNecessary: " << this->NumNecessary << std::endl;
1318 
1319  // Regular Vertex Arrays
1320  vtkm::worklet::contourtree_augmented::PrintHeader(this->BoundaryTreeId.GetNumberOfValues(),
1321  resultStream);
1323  "ID in Boundary Tree", this->BoundaryTreeId, -1, resultStream);
1324  resultStream << std::endl;
1325 
1326  // Boundary Vertex Arrays
1327  vtkm::worklet::contourtree_augmented::PrintHeader(this->BoundaryIndices.GetNumberOfValues(),
1328  resultStream);
1330  "Boundary Sort Indices", this->BoundaryIndices, -1, resultStream);
1332  "Boundary Vertex Superset", this->BoundaryVertexSuperset, -1, resultStream);
1334  "Boundary Superparents", this->BoundarySuperparents, -1, resultStream);
1335  resultStream << std::endl;
1336 
1337  // Per Supernode Arrays
1339  this->SupernodeTransferBoundaryCount.GetNumberOfValues(), resultStream);
1341  "Supernode Transfer Count", this->SupernodeTransferBoundaryCount, -1, resultStream);
1343  "Superarc Intrinsic Count", this->SuperarcIntrinsicBoundaryCount, -1, resultStream);
1345  "Superarc Dependent Count", this->SuperarcDependentBoundaryCount, -1, resultStream);
1346  // Print IsNecessary as bool
1348  "isNecessary", this->InteriorForestData->IsNecessary, -1, resultStream);
1350  "Tree To Superset", this->TreeToSuperset, -1, resultStream);
1351  resultStream << std::endl;
1352 
1353  // Per Hypernode Arrays
1355  this->HyperarcDependentBoundaryCount.GetNumberOfValues(), resultStream);
1357  "Hyperarc Dependent Count", this->HyperarcDependentBoundaryCount, -1, resultStream);
1358  resultStream << std::endl;
1359 
1360  // BRACT sized Arrays
1361  vtkm::worklet::contourtree_augmented::PrintHeader(this->NewVertexId.GetNumberOfValues(),
1362  resultStream);
1364  "New Vertex ID", this->NewVertexId, -1, resultStream);
1365 
1366  // arrays with double use & different sizes
1367  vtkm::worklet::contourtree_augmented::PrintHeader(this->UpNeighbour.GetNumberOfValues(),
1368  resultStream);
1370  "Up Neighbour", this->UpNeighbour, -1, resultStream);
1372  "Down Neighbour", this->DownNeighbour, -1, resultStream);
1373 
1374  resultStream << "------------------------------------------------------" << std::endl;
1375  resultStream << std::endl;
1376  resultStream << std::flush;
1377  return resultStream.str();
1378 } // DebugPrint
1379 
1380 
1381 } // namespace contourtree_distributed
1382 } // namespace worklet
1383 } // namespace vtkm
1384 
1385 #endif
SumFunctor.h
vtkm::worklet::contourtree_distributed::bract_maker::HyperarcComparator
comparator used to compare hyperarcs for sort
Definition: HyperarcComparator.h:96
CompressRegularisedNodesFillBoundaryTreeSuperarcsWorklet.h
ContourTreeNodeHyperArcComparator.h
IdentifyRegularisedSupernodesStepTwoWorklet.h
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::SuperarcDependentBoundaryCount
vtkm::worklet::contourtree_augmented::IdArrayType SuperarcDependentBoundaryCount
count of dependent boundary nodes for each superarc
Definition: BoundaryTreeMaker.h:167
vtkm::cont::ArrayHandle::GetNumberOfValues
VTKM_CONT vtkm::Id GetNumberOfValues() const
Returns the number of entries in the array.
Definition: ArrayHandle.h:448
vtkm::cont::ArrayHandle< vtkm::Id >
NoSuchElementFunctor.h
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::NewVertexId
vtkm::worklet::contourtree_augmented::IdArrayType NewVertexId
array needed for compression
Definition: BoundaryTreeMaker.h:177
vtkm::worklet::contourtree_distributed::bract_maker::FindNecessaryInteriorSetSuperparentNecessaryWorklet
Worklet to transfer the dependent counts for hyperarcs Part of the BoundaryRestrictedAugmentedContour...
Definition: FindNecessaryInteriorSetSuperparentNecessaryWorklet.h:70
AugmentBoundaryWithNecessaryInteriorSupernodesUnsetBoundarySupernodesWorklet.h
vtkm::cont::Algorithm::ScanInclusive
static VTKM_CONT T ScanInclusive(vtkm::cont::DeviceAdapterId devId, const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< T, COut > &output)
Definition: Algorithm.h:731
vtkm::worklet::contourtree_distributed::bract_maker::BoundaryTreeNodeComparator
comparator used to compare hyperarcs for sort
Definition: BoundaryTreeNodeComparator.h:121
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::NumKept
vtkm::Id NumKept
how many vertices are kept in the BRACT
Definition: BoundaryTreeMaker.h:138
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
FindNecessaryInteriorSetSuperparentNecessaryWorklet.h
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::NumBoundary
vtkm::Id NumBoundary
how many vertices ARE on the boundary
Definition: BoundaryTreeMaker.h:132
HierarchicalContourTree.h
vtkm::worklet::contourtree_distributed::bract_maker::SetUpAndDownNeighboursWorklet
Worklet to transfer the dependent counts for hyperarcs Part of the BoundaryRestrictedAugmentedContour...
Definition: SetUpAndDownNeighboursWorklet.h:70
vtkm::cont::make_ArrayHandleView
ArrayHandleView< ArrayHandleType > make_ArrayHandleView(const ArrayHandleType &array, vtkm::Id startIndex, vtkm::Id numValues)
Definition: ArrayHandleView.h:222
SetInteriorForestWorklet.h
Types.h
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::FindBoundaryVertices
VTKM_CONT void FindBoundaryVertices(bool boundaryCritical)
routine to find the set of boundary vertices
Definition: BoundaryTreeMaker.h:333
CompressRegularisedNodesFindNewSuperarcsWorklet.h
vtkm::worklet::contourtree_augmented::ContourTree
Definition: augmented/ContourTree.h:106
vtkm::worklet::contourtree_distributed::bract_maker::IdentifyRegularisedSupernodesStepOneWorklet
Step 1 of IdentifyRegularisedSupernodes.
Definition: IdentifyRegularisedSupernodesStepOneWorklet.h:69
vtkm::cont::ArrayHandle::Allocate
VTKM_CONT void Allocate(vtkm::Id numberOfValues, vtkm::CopyFlag preserve, vtkm::cont::Token &token) const
Allocates an array large enough to hold the given number of values.
Definition: ArrayHandle.h:465
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::BoundaryTreeId
vtkm::worklet::contourtree_augmented::IdArrayType BoundaryTreeId
arrays for computation - stored here to simplify debug print
Definition: BoundaryTreeMaker.h:144
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::PointerDoubleUpDownNeighbours
VTKM_CONT void PointerDoubleUpDownNeighbours()
routine that uses pointer-doubling to collapse regular nodes in the BRACT
Definition: BoundaryTreeMaker.h:1064
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::TreeToSuperset
vtkm::worklet::contourtree_augmented::IdArrayType TreeToSuperset
these are essentially the same as the transfer/intrinsic/dependent weights probably about time to ref...
Definition: BoundaryTreeMaker.h:159
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::FindNecessaryInteriorSupernodes
VTKM_CONT void FindNecessaryInteriorSupernodes()
routine to find the necessary interior supernodes for the BRACT
Definition: BoundaryTreeMaker.h:674
vtkm::worklet::contourtree_distributed::bract_maker::PropagateBoundaryCountsSubtractDependentCountsWorklet
Worklet to Subtract out the dependent count of the prefix to the entire hyperarc Part of the Boundary...
Definition: PropagateBoundaryCountsSubtractDependentCountsWorklet.h:70
PropagateBoundaryCountsComputeGroupTotalsWorklet.h
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::Invoke
vtkm::cont::Invoker Invoke
Used internally to Invoke worklets.
Definition: BoundaryTreeMaker.h:275
vtkm::worklet::contourtree_distributed::bract_maker::BoundaryVerticiesPerSuperArcStepTwoWorklet
Definition: BoundaryVerticesPerSuperArcWorklets.h:131
PropagateBoundaryCountsTransferCumulativeCountsWorklet.h
vtkm::worklet::contourtree_distributed::bract_maker::CompressRegularisedNodesFillBoundaryTreeSuperarcsWorklet
Step 1 of IdentifyRegularisedSupernodes.
Definition: CompressRegularisedNodesFillBoundaryTreeSuperarcsWorklet.h:69
BoundaryTree.h
vtkm::worklet::contourtree_distributed::InteriorForest
The contour tree of a data block restricted to the interior of a data block.
Definition: InteriorForest.h:84
vtkm::worklet::contourtree_distributed::bract_maker::PropagateBoundaryCountsComputeGroupTotalsWorklet
Worklet to subtract the beginning of the group to get the total for each group Part of the BoundaryRe...
Definition: PropagateBoundaryCountsComputeGroupTotalsWorklet.h:72
vtkm::worklet::contourtree_distributed::bract_maker::FindBoundaryTreeSuperarcsSuperarcToWorklet
Compute the superarc "to" for every bract node Part of the BoundaryRestrictedAugmentedContourTree....
Definition: FindBoundaryTreeSuperarcsSuperarcToWorklet.h:70
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::SetUpAndDownNeighbours
VTKM_CONT void SetUpAndDownNeighbours()
routine to find AN up/down neighbour for each vertex this is deliberately non-canonical and exploits ...
Definition: BoundaryTreeMaker.h:963
vtkm::cont::Algorithm::CopySubRange
static VTKM_CONT bool CopySubRange(vtkm::cont::DeviceAdapterId devId, const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::Id inputStartIndex, vtkm::Id numberOfElementsToCopy, vtkm::cont::ArrayHandle< U, COut > &output, vtkm::Id outputIndex=0)
Definition: Algorithm.h:472
vtkm::worklet::contourtree_augmented::AssertArrayHandleNoFlagsSet
VTKM_CONT void AssertArrayHandleNoFlagsSet(const vtkm::cont::ArrayHandle< vtkm::Id, S > &ah)
Definition: filter/scalar_topology/worklet/contourtree_augmented/Types.h:149
vtkm::cont::Algorithm::Sort
static VTKM_CONT void Sort(vtkm::cont::DeviceAdapterId devId, vtkm::cont::ArrayHandle< T, Storage > &values)
Definition: Algorithm.h:965
FindNecessaryInteriorSupernodesFindNodesWorklet.h
vtkm::worklet::contourtree_distributed::bract_maker::CompressRegularisedNodesFindNewSuperarcsWorklet
Step 1 of IdentifyRegularisedSupernodes.
Definition: CompressRegularisedNodesFindNewSuperarcsWorklet.h:69
vtkm::cont::make_ArrayHandleConstant
vtkm::cont::ArrayHandleConstant< T > make_ArrayHandleConstant(T value, vtkm::Id numberOfValues)
make_ArrayHandleConstant is convenience function to generate an ArrayHandleImplicit.
Definition: ArrayHandleConstant.h:89
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::NumNecessary
vtkm::Id NumNecessary
how many interior vertices are necessary
Definition: BoundaryTreeMaker.h:135
SetUpAndDownNeighboursWorklet.h
vtkm::cont::ArrayGetValue
VTKM_CONT T ArrayGetValue(vtkm::Id id, const vtkm::cont::ArrayHandle< T, S > &data)
Obtain a small set of values from an ArrayHandle with minimal device transfers.
Definition: ArrayGetValues.h:264
PointerDoubleUpDownNeighboursWorklet.h
vtkm::cont::Algorithm::Copy
static VTKM_CONT bool Copy(vtkm::cont::DeviceAdapterId devId, const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< U, COut > &output)
Definition: Algorithm.h:410
PrintVectors.h
vtkm::worklet::contourtree_distributed::bract_maker::AddTerminalFlagsToUpDownNeighboursWorklet
Step 1 of IdentifyRegularisedSupernodes.
Definition: AddTerminalFlagsToUpDownNeighboursWorklet.h:69
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::FindBoundaryTreeSuperarcs
VTKM_CONT void FindBoundaryTreeSuperarcs()
routine that sorts on hyperparent to find BRACT superarcs
Definition: BoundaryTreeMaker.h:838
vtkm::worklet::contourtree_distributed::bract_maker::CompressRegularisedNodesResolveRootWorklet
Step 1 of IdentifyRegularisedSupernodes.
Definition: CompressRegularisedNodesResolveRootWorklet.h:69
CompressRegularisedNodesTransferVerticesWorklet.h
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::worklet::contourtree_distributed::bract_maker::CompressRegularisedNodesTransferVerticesWorklet
Step 1 of IdentifyRegularisedSupernodes.
Definition: CompressRegularisedNodesTransferVerticesWorklet.h:69
vtkm::worklet::contourtree_distributed::bract_maker::FindNecessaryInteriorSupernodesFindNodesWorklet
1.B.
Definition: FindNecessaryInteriorSupernodesFindNodesWorklet.h:72
FindBoundaryVerticesIsNecessaryWorklet.h
vtkm::cont::LogLevel::Info
@ Info
Information messages (detected hardware, etc) and temporary debugging output.
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::BoundaryIndices
vtkm::worklet::contourtree_augmented::IdArrayType BoundaryIndices
their sort indices (may be redundant, but . . .)
Definition: BoundaryTreeMaker.h:150
IdRelabeler.h
vtkm::cont::make_ArrayHandleTransform
VTKM_CONT vtkm::cont::ArrayHandleTransform< HandleType, FunctorType > make_ArrayHandleTransform(HandleType handle, FunctorType functor)
make_ArrayHandleTransform is convenience function to generate an ArrayHandleTransform.
Definition: ArrayHandleTransform.h:474
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::SupernodeTransferBoundaryCount
vtkm::worklet::contourtree_augmented::IdArrayType SupernodeTransferBoundaryCount
count of boundary nodes being transferred at eah supernode
Definition: BoundaryTreeMaker.h:165
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::AddTerminalFlagsToUpDownNeighbours
VTKM_CONT void AddTerminalFlagsToUpDownNeighbours()
this routine sets a flag on every up/down neighbour that points to a critical point to force terminat...
Definition: BoundaryTreeMaker.h:1040
vtkm::cont::make_ArrayHandleZip
VTKM_CONT vtkm::cont::ArrayHandleZip< FirstHandleType, SecondHandleType > make_ArrayHandleZip(const FirstHandleType &first, const SecondHandleType &second)
A convenience function for creating an ArrayHandleZip.
Definition: ArrayHandleZip.h:288
vtkm::cont::ArrayHandleCounting< vtkm::Id >
vtkm::cont::Invoker
Allows launching any worklet without a dispatcher.
Definition: Invoker.h:41
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::UpNeighbour
vtkm::worklet::contourtree_augmented::IdArrayType UpNeighbour
Definition: BoundaryTreeMaker.h:174
InteriorForest.h
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::InteriorForestData
InteriorForest * InteriorForestData
Data structure for the interior forest of a data block, i.e, the contourtree of a block minus the Bou...
Definition: BoundaryTreeMaker.h:129
vtkm::worklet::contourtree_distributed::bract_maker::NoSuchElementFunctor
Definition: NoSuchElementFunctor.h:69
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::SuperarcIntrinsicBoundaryCount
vtkm::worklet::contourtree_augmented::IdArrayType SuperarcIntrinsicBoundaryCount
count of boundary nodes on each superarc
Definition: BoundaryTreeMaker.h:163
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::ContourTree
vtkm::worklet::contourtree_augmented::ContourTree & ContourTree
Pointer to the contour tree for the mesh.
Definition: BoundaryTreeMaker.h:125
vtkm::cont::Algorithm::CopyIf
static VTKM_CONT void CopyIf(vtkm::cont::DeviceAdapterId devId, const vtkm::cont::ArrayHandle< T, CIn > &input, const vtkm::cont::ArrayHandle< U, CStencil > &stencil, vtkm::cont::ArrayHandle< T, COut > &output)
Definition: Algorithm.h:435
FindBoundaryTreeSuperarcsSuperarcToWorklet.h
Types.h
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::SuppressRegularisedInteriorSupernodes
VTKM_CONT void SuppressRegularisedInteriorSupernodes()
compresses out supernodes in the interior that have become regular in the BRACT
Definition: BoundaryTreeMaker.h:934
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::worklet::contourtree_distributed::bract_maker::PointerDoubleUpDownNeighboursWorklet
Step 1 of IdentifyRegularisedSupernodes.
Definition: PointerDoubleUpDownNeighboursWorklet.h:69
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::BoundaryTreeData
BoundaryTree * BoundaryTreeData
Data structure for storing the results from this class.
Definition: BoundaryTreeMaker.h:127
PropagateBoundaryCountsSubtractDependentCountsWorklet.h
vtkm::worklet::contourtree_augmented::PrintValues
void PrintValues(std::string label, const vtkm::cont::ArrayHandle< T, StorageType > &dVec, vtkm::Id nValues=-1, std::ostream &outStream=std::cout)
Definition: augmented/PrintVectors.h:197
vtkm::CopyFlag::On
@ On
vtkm::worklet::contourtree_distributed::bract_maker::AugmentBoundaryWithNecessaryInteriorSupernodesAppendNecessarySupernodesWorklet
Worklet to transfer the dependent counts for hyperarcs Part of the BoundaryRestrictedAugmentedContour...
Definition: AugmentBoundaryWithNecessaryInteriorSupernodesAppendNecessarySupernodesWorklet.h:70
vtkm::worklet::contourtree_distributed::bract_maker::FindBoundaryVerticesIsNecessaryWorklet
Worklet used in BoundaryTreeMaker<>::FindBoundaryVertices to create a stencil of the vertices that ar...
Definition: FindBoundaryVerticesIsNecessaryWorklet.h:71
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::ComputeDependentBoundaryCounts
VTKM_CONT void ComputeDependentBoundaryCounts()
routine to compute the initial dependent counts (i.e.
Definition: BoundaryTreeMaker.h:382
HyperarcComparator.h
vtkm::worklet::contourtree_augmented::mesh_dem::IdRelabeler
A utility class that converts Ids from local to global given a mesh.
Definition: IdRelabeler.h:79
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::SetInteriorForest
VTKM_CONT void SetInteriorForest(const vtkm::worklet::contourtree_augmented::mesh_dem::IdRelabeler *localToGlobalIdRelabeler=nullptr)
sets the arrays in the InteriorForest (i.e., the residue) that need to be passed to the grafting stag...
Definition: BoundaryTreeMaker.h:1253
VTKM_LOG_S
#define VTKM_LOG_S(level,...)
Writes a message using stream syntax to the indicated log level.
Definition: Logging.h:261
vtkm::cont::make_ArrayHandlePermutation
VTKM_CONT vtkm::cont::ArrayHandlePermutation< IndexArrayHandleType, ValueArrayHandleType > make_ArrayHandlePermutation(IndexArrayHandleType indexArray, ValueArrayHandleType valueArray)
make_ArrayHandleTransform is convenience function to generate an ArrayHandleTransform.
Definition: ArrayHandlePermutation.h:279
vtkm::worklet::contourtree_distributed::bract_maker::SetInteriorForestWorklet
Worklet to transfer the dependent counts for hyperarcs Part of the BoundaryRestrictedAugmentedContour...
Definition: SetInteriorForestWorklet.h:70
vtkm::worklet::contourtree_distributed::bract_maker::AugmentBoundaryWithNecessaryInteriorSupernodesUnsetBoundarySupernodesWorklet
Worklet to transfer the dependent counts for hyperarcs Part of the BoundaryRestrictedAugmentedContour...
Definition: AugmentBoundaryWithNecessaryInteriorSupernodesUnsetBoundarySupernodesWorklet.h:70
BoundaryTreeNodeComparator.h
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::AugmentBoundaryWithNecessaryInteriorSupernodes
VTKM_CONT void AugmentBoundaryWithNecessaryInteriorSupernodes()
routine to add the necessary interior supernodes to the boundary array
Definition: BoundaryTreeMaker.h:718
vtkm::worklet::contourtree_distributed::bract_maker::PropagateBoundaryCountsTransferCumulativeCountsWorklet
Worklet to transfer the cumulative counts for hyperarcs Part of the BoundaryRestrictedAugmentedContou...
Definition: PropagateBoundaryCountsTransferCumulativeCountsWorklet.h:73
vtkm::worklet::contourtree_distributed::BoundaryTree
Boundary Restricted Augmented Contour Tree (BRACT)
Definition: BoundaryTree.h:81
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::Construct
VTKM_CONT void Construct(const vtkm::worklet::contourtree_augmented::mesh_dem::IdRelabeler *localToGlobalIdRelabeler=nullptr, bool boundaryCritical=true)
computes a BRACT from a contour tree for a known block note the block ID for debug purposes
Definition: BoundaryTreeMaker.h:281
vtkm::worklet::contourtree_distributed::bract_maker::IdentifyRegularisedSupernodesStepTwoWorklet
Step 2 of IdentifyRegularisedSupernodes We also want to flag the leaves and boundary nodes as necessa...
Definition: IdentifyRegularisedSupernodesStepTwoWorklet.h:70
vtkm::cont::Algorithm::Reduce
static VTKM_CONT U Reduce(vtkm::cont::DeviceAdapterId devId, const vtkm::cont::ArrayHandle< T, CIn > &input, U initialValue)
Definition: Algorithm.h:656
vtkm::worklet::contourtree_distributed::bract_maker::BoundaryVerticiesPerSuperArcStepOneWorklet
Definition: BoundaryVerticesPerSuperArcWorklets.h:69
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker
Class to compute the Boundary Restricted Augmented Contour Tree (BRACT), a.k.a., BoundaryTree.
Definition: BoundaryTreeMaker.h:116
CompressRegularisedNodesCopyNecessaryRegularNodesWorklet.h
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::IdentifyRegularisedSupernodes
VTKM_CONT void IdentifyRegularisedSupernodes()
routine to set a flag for each vertex that has become regular in the interior of the BRACT
Definition: BoundaryTreeMaker.h:995
vtkm::worklet::contourtree_distributed::bract_maker::CompressRegularisedNodesCopyNecessaryRegularNodesWorklet
Step 1 of IdentifyRegularisedSupernodes.
Definition: CompressRegularisedNodesCopyNecessaryRegularNodesWorklet.h:69
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::PropagateBoundaryCounts
VTKM_CONT void PropagateBoundaryCounts()
routine for hyper-propagation to compute dependent boundary counts
Definition: BoundaryTreeMaker.h:438
vtkm::worklet::contourtree_augmented::PrintIndices
void PrintIndices(std::string label, const vtkm::cont::ArrayHandle< T > &iVec, vtkm::Id nIndices=-1, std::ostream &outStream=std::cout)
Definition: augmented/PrintVectors.h:253
vtkm::worklet::contourtree_augmented::PrintHeader
void PrintHeader(vtkm::Id howMany, std::ostream &outStream=std::cout)
Definition: augmented/PrintVectors.h:151
vtkm::worklet::contourtree_distributed::bract_maker::PropagateBoundaryCountsTransferDependentCountsWorklet
Worklet to transfer the dependent counts for hyperarcs Part of the BoundaryRestrictedAugmentedContour...
Definition: PropagateBoundaryCountsTransferDependentCountsWorklet.h:70
PropagateBoundaryCountsTransferDependentCountsWorklet.h
BoundaryVerticesPerSuperArcWorklets.h
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::HyperarcDependentBoundaryCount
vtkm::worklet::contourtree_augmented::IdArrayType HyperarcDependentBoundaryCount
count of dependent boundary nodes for each hyperarc
Definition: BoundaryTreeMaker.h:169
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::CompressRegularisedNodes
VTKM_CONT void CompressRegularisedNodes()
routine that compresses the regular nodes out of the BRACT
Definition: BoundaryTreeMaker.h:1097
vtkm::worklet::contourtree_augmented::IdArraySetValue
VTKM_CONT void IdArraySetValue(vtkm::Id index, vtkm::Id value, IdArrayType &arr)
Helper function to set a single array valye with CopySubRange to avoid pulling the array to the contr...
Definition: filter/scalar_topology/worklet/contourtree_augmented/Types.h:165
ContourTree.h
AugmentBoundaryWithNecessaryInteriorSupernodesAppendNecessarySupernodesWorklet.h
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::DebugPrint
VTKM_CONT std::string DebugPrint(const char *message, const char *fileName, long lineNum) const
prints the contents of the restrictor object in a standard format
Definition: BoundaryTreeMaker.h:1295
vtkm::worklet::contourtree_distributed::bract_maker::ContourTreeNodeHyperArcComparator
comparator to use for sorting nodes by hyperparent (i.e.
Definition: ContourTreeNodeHyperArcComparator.h:132
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::BoundarySuperparents
vtkm::worklet::contourtree_augmented::IdArrayType BoundarySuperparents
the superparents for each boundary vertex
Definition: BoundaryTreeMaker.h:152
AddTerminalFlagsToUpDownNeighboursWorklet.h
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::MeshBoundaryExecutionObject
MeshBoundaryExecObjType & MeshBoundaryExecutionObject
Definition: BoundaryTreeMaker.h:122
vtkm::worklet::contourtree_augmented::NO_SUCH_ELEMENT
constexpr vtkm::Id NO_SUCH_ELEMENT
Definition: filter/scalar_topology/worklet/contourtree_augmented/Types.h:73
vtkm::cont::ArrayHandleIndex
An implicit array handle containing the its own indices.
Definition: ArrayHandleIndex.h:54
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::BoundaryVertexSuperset
vtkm::worklet::contourtree_augmented::IdArrayType BoundaryVertexSuperset
the regular IDs of the boundary vertices (a conservative over-estimate, needed for hierarchical compu...
Definition: BoundaryTreeMaker.h:148
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::Mesh
MeshType * Mesh
Pointer to the input mesh.
Definition: BoundaryTreeMaker.h:121
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::BoundaryTreeMaker
VTKM_CONT BoundaryTreeMaker(MeshType *inputMesh, MeshBoundaryExecObjType &meshBoundaryExecObj, vtkm::worklet::contourtree_augmented::ContourTree &inputTree, BoundaryTree *boundaryTree, InteriorForest *interiorTree)
Definition: BoundaryTreeMaker.h:180
CompressRegularisedNodesResolveRootWorklet.h
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker::DownNeighbour
vtkm::worklet::contourtree_augmented::IdArrayType DownNeighbour
Definition: BoundaryTreeMaker.h:175
vtkm::worklet::contourtree_distributed::bract_maker::SumFunctor
Definition: SumFunctor.h:69
IdentifyRegularisedSupernodesStepOneWorklet.h