VTK  9.7.1
vtkNativePartitioningStrategy.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
27 #ifndef vtkNativePartitioningStrategy_h
28 #define vtkNativePartitioningStrategy_h
29 
30 #include "vtkFiltersParallelDIY2Module.h" // for export macro
32 
33 VTK_ABI_NAMESPACE_BEGIN
34 class vtkBoundingBox;
35 class vtkDataObjectTree;
36 class vtkDataObject;
37 class VTKFILTERSPARALLELDIY2_EXPORT vtkNativePartitioningStrategy : public vtkPartitioningStrategy
38 {
39 public:
42  void PrintSelf(std::ostream& os, vtkIndent indent) override;
43 
47  std::vector<PartitionInformation> ComputePartition(vtkPartitionedDataSetCollection*) override;
48 
50 
55  vtkSetMacro(UseExplicitCuts, bool);
56  vtkGetMacro(UseExplicitCuts, bool);
57  vtkBooleanMacro(UseExplicitCuts, bool);
59 
61 
64  void SetExplicitCuts(const std::vector<vtkBoundingBox>& boxes);
65  const std::vector<vtkBoundingBox>& GetExplicitCuts() const { return this->ExplicitCuts; }
66  void RemoveAllExplicitCuts();
67  void AddExplicitCut(const vtkBoundingBox& bbox);
68  void AddExplicitCut(const double bbox[6]);
69  int GetNumberOfExplicitCuts() const;
70  const vtkBoundingBox& GetExplicitCut(int index) const;
72 
74 
84  vtkSetMacro(ExpandExplicitCuts, bool);
85  vtkGetMacro(ExpandExplicitCuts, bool);
86  vtkBooleanMacro(ExpandExplicitCuts, bool);
88 
95  std::vector<vtkBoundingBox> ExpandCuts(
96  const std::vector<vtkBoundingBox>& cuts, const vtkBoundingBox& bounds);
97 
99 
103  const std::vector<vtkBoundingBox>& GetCuts() const { return this->Cuts; }
105 
107 
115  vtkSetMacro(LoadBalanceAcrossAllBlocks, bool);
116  vtkGetMacro(LoadBalanceAcrossAllBlocks, bool);
117  vtkBooleanMacro(LoadBalanceAcrossAllBlocks, bool);
119 
121 
128  vtkSetMacro(AssignBoundaryCellsToSmallestRegionId, bool);
129  vtkGetMacro(AssignBoundaryCellsToSmallestRegionId, bool);
130  vtkBooleanMacro(AssignBoundaryCellsToSmallestRegionId, bool);
132 
142  virtual std::vector<vtkBoundingBox> GenerateCuts(vtkDataObject* data);
143 
144 protected:
145  vtkNativePartitioningStrategy() = default;
146  ~vtkNativePartitioningStrategy() override = default;
147 
148 private:
150  void operator=(const vtkNativePartitioningStrategy&) = delete;
151 
152  bool InitializeCuts(vtkDataObjectTree* input);
153 
154  std::vector<vtkBoundingBox> ExplicitCuts;
155  std::vector<vtkBoundingBox> Cuts;
156  bool UseExplicitCuts = false;
157  bool ExpandExplicitCuts = true;
158 
159  bool LoadBalanceAcrossAllBlocks = true;
160 
161  bool AssignBoundaryCellsToSmallestRegionId = false;
162 };
163 VTK_ABI_NAMESPACE_END
164 
165 #endif // vtkNativePartitioningStrategy_h
const std::vector< vtkBoundingBox > & GetCuts() const
Returns the cuts used by the most recent ComputePartition call.
provides implementation for most abstract methods in the superclass vtkCompositeDataSet ...
a simple class to control print indentation
Definition: vtkIndent.h:28
const std::vector< vtkBoundingBox > & GetExplicitCuts() const
Specify the cuts to use when UseExplicitCuts is true.
void PrintSelf(std::ostream &os, vtkIndent indent) override
A strategy interface for partitioning meshes.
virtual std::vector< PartitionInformation > ComputePartition(vtkPartitionedDataSetCollection *)=0
Main method for subclasses to implement in order to define their partitioning method (should be calle...
A partitioning strategy based on load balancing geometric bounding boxes as cuts of a data set...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
general representation of visualization data
Definition: vtkDataObject.h:55
Fast, simple class for representing and operating on 3D bounds.
Composite dataset that groups datasets as a collection.