Go to the documentation of this file.
53 #ifndef vtk_m_worklet_contourtree_distributed_boundary_tree_h
54 #define vtk_m_worklet_contourtree_distributed_boundary_tree_h
70 namespace contourtree_distributed
106 template <
typename Mesh,
typename FieldArrayType>
109 const FieldArrayType& fieldArray,
115 template <
typename FieldType>
122 std::string
DebugPrint(
const char* message,
const char* fileName,
long lineNum)
const;
131 std::stringstream resultStream;
132 resultStream <<
"Boundary-Restricted Augmented Contour Tree" << std::endl;
133 resultStream <<
"==========================================" << std::endl;
138 for (
vtkm::Id node = 0; node < superarcsPortal.GetNumberOfValues(); node++)
141 vtkm::Id from = vertexIndexPortal.Get(node);
142 vtkm::Id to = superarcsPortal.Get(node);
152 return resultStream.str();
156 template <
typename Mesh,
typename FieldArrayType>
159 const FieldArrayType& fieldArray,
165 std::stringstream resultStream;
167 resultStream <<
"digraph BRACT" << std::endl;
168 resultStream <<
"\t{" << std::endl;
169 resultStream <<
"\tlabel=\"" << label <<
"\"\n\tlabelloc=t\n\tfontsize=30" << std::endl;
172 blockOrigin, blockSize, globalSize);
178 auto sortOrderPortal = mesh.SortOrder.ReadPortal();
179 auto fieldArrayPortal = fieldArray.ReadPortal();
183 vtkm::Id from = vertexIndexPortal.Get(node);
185 vtkm::Id fromLocal = sortOrderPortal.Get(from);
186 vtkm::Id fromGlobal = relabeler(fromLocal);
187 auto fromValue = fieldArrayPortal.Get(fromLocal);
190 resultStream << node <<
" [style=filled,fillcolor="
192 <<
",label=\"" << fromGlobal <<
"\\nv" << fromValue <<
"\"];" << std::endl;
198 vtkm::Id to = superarcsPortal.Get(node);
206 resultStream << to <<
" -> " << node << std::endl;
210 resultStream << node <<
" -> " << to << std::endl;
213 resultStream <<
"\t}" << std::endl;
215 return resultStream.str();
219 template <
typename FieldType>
224 std::stringstream resultStream;
226 resultStream <<
"digraph BRACT\n\t{\n";
227 resultStream <<
"\tsize=\"6.5, 9\"\n\tratio=\"fill\"\n";
228 resultStream <<
"\tlabel=\"" << label <<
"\"\n\tlabelloc=t\n\tfontsize=30\n" << std::endl;
239 vtkm::Id meshIndex = vertexIndexPortal.Get(node);
240 vtkm::Id from = globalMeshIndexPortal.Get(meshIndex);
241 auto fromValue = sortedValuesPortal.Get(meshIndex);
243 resultStream << node <<
" [style=filled,fillcolor="
245 <<
",label=\"" << from <<
"\\nv" << fromValue <<
"\"];" << std::endl;
252 vtkm::Id to = superarcsPortal.Get(node);
260 resultStream << to <<
" -> " << node << std::endl;
264 resultStream << node <<
" -> " << to << std::endl;
267 resultStream <<
"\t}" << std::endl;
269 return resultStream.str();
283 const char* fileName,
286 std::stringstream resultStream;
288 resultStream <<
"[CUTHERE]-------------------------------------------------------" << std::endl;
289 resultStream << std::setw(30) << std::left << fileName <<
":" << std::right << std::setw(4)
290 << lineNum << std::endl;
291 resultStream << std::left << std::string(message) << std::endl;
292 resultStream <<
"Boundary Restricted Augmented Contour Tree Contains: " << std::endl;
293 resultStream <<
"----------------------------------------------------------------" << std::endl;
297 resultStream <<
"---------------------------" << std::endl;
298 resultStream << std::endl;
299 resultStream << std::flush;
305 return resultStream.str();
310 std::stringstream arraySizeLog;
311 arraySizeLog << std::setw(42) << std::left <<
" #VertexIndex"
313 << std::setw(42) << std::left <<
" #Superarcs"
315 << std::setw(42) << std::left <<
" #Boundary"
317 << std::setw(42) << std::left <<
" #BoundaryUsed"
319 return arraySizeLog.str();
IdArrayType GlobalMeshIndex
Definition: ContourTreeMesh.h:200
VTKM_CONT vtkm::Id GetNumberOfValues() const
Returns the number of entries in the array.
Definition: ArrayHandle.h:448
std::string PrintGlobalDot(const char *label, const Mesh &mesh, const FieldArrayType &fieldArray, const vtkm::Id3 blockOrigin, const vtkm::Id3 blockSize, const vtkm::Id3 globalSize) const
Definition: BoundaryTree.h:157
Groups connected points that have the same field value.
Definition: Atomic.h:19
Definition: ContourTreeMesh.h:129
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
std::string DebugPrint(const char *message, const char *fileName, long lineNum) const
Definition: BoundaryTree.h:282
vtkm::worklet::contourtree_augmented::IdArrayType VertexIndex
Definition: BoundaryTree.h:85
VTKM_EXEC_CONT bool NoSuchElement(vtkm::Id flaggedIndex)
Definition: filter/scalar_topology/worklet/contourtree_augmented/Types.h:97
std::string Print()
Definition: BoundaryTree.h:128
vtkm::Id NumBoundary
Definition: BoundaryTree.h:91
#define VTKM_IS_ARRAY_HANDLE(T)
Definition: ArrayHandle.h:132
vtkm::cont::ArrayHandle< FieldType > SortedValues
Definition: ContourTreeMesh.h:199
vtkm::Id NumBoundaryUsed
Definition: BoundaryTree.h:97
std::string PrintArraySizes() const
Definition: BoundaryTree.h:308
A utility class that converts Ids from local to global given a mesh.
Definition: IdRelabeler.h:79
Boundary Restricted Augmented Contour Tree (BRACT)
Definition: BoundaryTree.h:81
void PrintContent(std::ostream &outStream) const
Definition: BoundaryTree.h:273
VTKM_CONT ReadPortalType ReadPortal() const
Get an array portal that can be used in the control environment.
Definition: ArrayHandle.h:414
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
void PrintHeader(vtkm::Id howMany, std::ostream &outStream=std::cout)
Definition: augmented/PrintVectors.h:151
constexpr int PRINT_WIDTH
Definition: augmented/PrintVectors.h:75
vtkm::worklet::contourtree_augmented::IdArrayType Superarcs
Definition: BoundaryTree.h:88
BoundaryTree()
Definition: BoundaryTree.h:100