VTK  9.3.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
12 #ifndef vtkDIYKdTreeUtilities_h
13 #define vtkDIYKdTreeUtilities_h
14 
15 #include "vtkBoundingBox.h" // for vtkBoundingBox
16 #include "vtkDIYExplicitAssigner.h" // for vtkDIYExplicitAssigner
17 #include "vtkFiltersParallelDIY2Module.h" // for export macros
18 #include "vtkObject.h"
19 #include "vtkSmartPointer.h" // for vtkSmartPointer
20 
21 #include <memory> // for std::shared_ptr
22 #include <vector> // for std::vector
23 
24 VTK_ABI_NAMESPACE_BEGIN
25 class vtkDataObject;
26 class vtkDataSet;
27 class vtkIntArray;
30 class vtkPoints;
32 
33 class VTKFILTERSPARALLELDIY2_EXPORT vtkDIYKdTreeUtilities : public vtkObject
34 {
35 public:
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
52  static std::vector<vtkBoundingBox> GenerateCuts(vtkDataObject* dobj, int number_of_partitions,
53  bool use_cell_centers, vtkMultiProcessController* controller = nullptr,
54  const double* local_bounds = nullptr);
55 
60  static std::vector<vtkBoundingBox> GenerateCuts(const std::vector<vtkDataObject*>& dobjs,
61  int number_of_partitions, bool use_cell_centers,
62  vtkMultiProcessController* controller = nullptr, const double* local_bounds = nullptr);
63 
77  static std::vector<vtkBoundingBox> GenerateCuts(
78  const std::vector<vtkSmartPointer<vtkPoints>>& points, int number_of_partitions,
79  vtkMultiProcessController* controller = nullptr, const double* local_bounds = nullptr);
80 
101  vtkMultiProcessController* controller, std::shared_ptr<diy::Assigner> block_assigner = nullptr);
102 
111  static bool GenerateGlobalCellIds(vtkPartitionedDataSet* parts,
112  vtkMultiProcessController* controller, vtkIdType* mb_offset = nullptr);
113 
122  static std::vector<int> ComputeAssignments(int num_blocks, int num_ranks);
123 
129  static vtkDIYExplicitAssigner CreateAssigner(diy::mpi::communicator& comm, int num_blocks);
130 
139  static void ResizeCuts(std::vector<vtkBoundingBox>& cuts, int size);
140 
141 protected:
143  ~vtkDIYKdTreeUtilities() override;
144 
145 private:
147  void operator=(const vtkDIYKdTreeUtilities&) = delete;
148 };
149 
150 VTK_ABI_NAMESPACE_END
151 #endif
composite dataset to encapsulates a dataset consisting of partitions.
abstract base class for most VTK objects
Definition: vtkObject.h:51
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:52
int vtkIdType
Definition: vtkType.h:315
collection of utility functions for DIY-based KdTree algorithm
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:34
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:54
represent and manipulate 3D points
Definition: vtkPoints.h:28
assigner for use with DIY
Multiprocessing communication superclass.