VTK  9.2.6
vtkDIYKdTreeUtilities.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDIYKdTreeUtilities.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
24 #ifndef vtkDIYKdTreeUtilities_h
25 #define vtkDIYKdTreeUtilities_h
26 
27 #include "vtkBoundingBox.h" // for vtkBoundingBox
28 #include "vtkDIYExplicitAssigner.h" // for vtkDIYExplicitAssigner
29 #include "vtkFiltersParallelDIY2Module.h" // for export macros
30 #include "vtkObject.h"
31 #include "vtkSmartPointer.h" // for vtkSmartPointer
32 
33 #include <memory> // for std::shared_ptr
34 #include <vector> // for std::vector
35 
36 class vtkDataObject;
37 class vtkDataSet;
38 class vtkIntArray;
41 class vtkPoints;
43 
44 class VTKFILTERSPARALLELDIY2_EXPORT vtkDIYKdTreeUtilities : public vtkObject
45 {
46 public:
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
63  static std::vector<vtkBoundingBox> GenerateCuts(vtkDataObject* dobj, int number_of_partitions,
64  bool use_cell_centers, vtkMultiProcessController* controller = nullptr,
65  const double* local_bounds = nullptr);
66 
71  static std::vector<vtkBoundingBox> GenerateCuts(const std::vector<vtkDataObject*>& dobjs,
72  int number_of_partitions, bool use_cell_centers,
73  vtkMultiProcessController* controller = nullptr, const double* local_bounds = nullptr);
74 
88  static std::vector<vtkBoundingBox> GenerateCuts(
89  const std::vector<vtkSmartPointer<vtkPoints>>& points, int number_of_partitions,
90  vtkMultiProcessController* controller = nullptr, const double* local_bounds = nullptr);
91 
112  vtkMultiProcessController* controller, std::shared_ptr<diy::Assigner> block_assigner = nullptr);
113 
122  static bool GenerateGlobalCellIds(vtkPartitionedDataSet* parts,
123  vtkMultiProcessController* controller, vtkIdType* mb_offset = nullptr);
124 
133  static std::vector<int> ComputeAssignments(int num_blocks, int num_ranks);
134 
140  static vtkDIYExplicitAssigner CreateAssigner(diy::mpi::communicator& comm, int num_blocks);
141 
150  static void ResizeCuts(std::vector<vtkBoundingBox>& cuts, int size);
151 
152 protected:
154  ~vtkDIYKdTreeUtilities() override;
155 
156 private:
158  void operator=(const vtkDIYKdTreeUtilities&) = delete;
159 };
160 
161 #endif
composite dataset to encapsulates a dataset consisting of partitions.
abstract base class for most VTK objects
Definition: vtkObject.h:62
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
int vtkIdType
Definition: vtkType.h:332
collection of utility functions for DIY-based KdTree algorithm
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:45
a simple class to control print indentation
Definition: vtkIndent.h:39
dataset represents arbitrary combinations of all possible cell types
general representation of visualization data
Definition: vtkDataObject.h:65
represent and manipulate 3D points
Definition: vtkPoints.h:39
assigner for use with DIY
Multiprocessing communication superclass.