VTK  9.7.1
vtkDIYKdTreeUtilities.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
15 #ifndef vtkDIYKdTreeUtilities_h
16 #define vtkDIYKdTreeUtilities_h
17 
18 #include "vtkBoundingBox.h" // for vtkBoundingBox
19 #include "vtkDIYExplicitAssigner.h" // for vtkDIYExplicitAssigner
20 #include "vtkFiltersParallelDIY2Module.h" // for export macros
21 #include "vtkObject.h"
22 #include "vtkSmartPointer.h" // for vtkSmartPointer
23 
24 #include <memory> // for std::shared_ptr
25 #include <vector> // for std::vector
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class vtkDataObject;
29 class vtkDataSet;
30 class vtkIntArray;
33 class vtkPoints;
35 
36 class VTKFILTERSPARALLELDIY2_EXPORT vtkDIYKdTreeUtilities : public vtkObject
37 {
38 public:
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
55  static std::vector<vtkBoundingBox> GenerateCuts(vtkDataObject* dobj, int number_of_partitions,
56  bool use_cell_centers, vtkMultiProcessController* controller = nullptr,
57  const double* local_bounds = nullptr);
58 
63  static std::vector<vtkBoundingBox> GenerateCuts(const std::vector<vtkDataObject*>& dobjs,
64  int number_of_partitions, bool use_cell_centers,
65  vtkMultiProcessController* controller = nullptr, const double* local_bounds = nullptr);
66 
80  static std::vector<vtkBoundingBox> GenerateCuts(
81  const std::vector<vtkSmartPointer<vtkPoints>>& points, int number_of_partitions,
82  vtkMultiProcessController* controller = nullptr, const double* local_bounds = nullptr);
83 
104  vtkMultiProcessController* controller, std::shared_ptr<diy::Assigner> block_assigner = nullptr);
105 
114  static bool GenerateGlobalCellIds(vtkPartitionedDataSet* parts,
115  vtkMultiProcessController* controller, vtkIdType* mb_offset = nullptr);
116 
125  static std::vector<int> ComputeAssignments(int num_blocks, int num_ranks);
126 
132  static vtkDIYExplicitAssigner CreateAssigner(diy::mpi::communicator& comm, int num_blocks);
133 
142  static void ResizeCuts(std::vector<vtkBoundingBox>& cuts, int size);
143 
144 protected:
146  ~vtkDIYKdTreeUtilities() override;
147 
148 private:
150  void operator=(const vtkDIYKdTreeUtilities&) = delete;
151 };
152 
153 VTK_ABI_NAMESPACE_END
154 #endif
composite dataset to encapsulates a dataset consisting of partitions.
abstract base class for most VTK objects
Definition: vtkObject.h:52
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:56
int vtkIdType
Definition: vtkType.h:363
collection of utility functions for DIY-based KdTree algorithm
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:35
a simple class to control print indentation
Definition: vtkIndent.h:28
dataset represents arbitrary combinations of all possible cell types
general representation of visualization data
Definition: vtkDataObject.h:55
represent and manipulate 3D points
Definition: vtkPoints.h:30
assigner for use with DIY
Multiprocessing communication superclass.