VTK  9.7.1
vtkIntegrateAttributes.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
19 #ifndef vtkIntegrateAttributes_h
20 #define vtkIntegrateAttributes_h
21 
22 #include "vtkFiltersParallelModule.h" // For export macro
23 #include "vtkSmartPointer.h" // For holding strategy
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkDataSet;
29 class vtkIdList;
30 class vtkInformation;
35 
36 class VTKFILTERSPARALLEL_EXPORT vtkIntegrateAttributes : public vtkUnstructuredGridAlgorithm
37 {
38 public:
39  static vtkIntegrateAttributes* New();
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
44 
48  void SetController(vtkMultiProcessController* controller);
49  vtkGetObjectMacro(Controller, vtkMultiProcessController);
51 
53 
56  void SetIntegrationStrategy(vtkIntegrationStrategy* strategy);
57  vtkIntegrationStrategy* GetIntegrationStrategy();
59 
61 
65  vtkSetMacro(DivideAllCellDataByVolume, bool);
66  vtkGetMacro(DivideAllCellDataByVolume, bool);
68 
69 protected:
71  ~vtkIntegrateAttributes() override;
72 
74 
75  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
76  vtkInformationVector* outputVector) override;
77 
78  // Create a default executive.
80 
81  int FillInputPortInformation(int, vtkInformation*) override;
82 
83  static int CompareIntegrationDimension(vtkDataSet* output, int dim, double& totalSum,
84  double totalSumCenter[3], int& integrationDimension);
85  static void ZeroAttributes(vtkDataSetAttributes* outda);
86 
88 
89  static void IntegrateSatelliteData(vtkDataSetAttributes* inda, vtkDataSetAttributes* outda);
90  int PieceNodeMinToNode0(vtkUnstructuredGrid* data, double& totalSum, double totalSumCenter[3],
91  int& integrationDimension);
92  void SendPiece(vtkUnstructuredGrid* src, double totalSum, const double totalSumCenter[3],
93  int integrationDimension);
94  void ReceivePiece(vtkUnstructuredGrid* mergeTo, int fromId, double& totalSum,
95  double totalSumCenter[3], int& integrationDimension);
96 
97  // This function assumes the data is in the format of the output of this filter with one
98  // point/cell having the value computed as its only tuple. It divides each value by sum,
99  // skipping the last data array if requested (so the volume doesn't get divided by itself
100  // and set to 1).
101  static void DivideDataArraysByConstant(
102  vtkDataSetAttributes* data, bool skipLastArray, double sum);
103 
104 private:
106  void operator=(const vtkIntegrateAttributes&) = delete;
107  vtkSmartPointer<vtkIntegrationStrategy> IntegrationStrategy;
108 
109  class vtkIntegrateAttributesFunctor;
110 
111  static void AllocateAttributes(
113  static void InitializeAttributes(vtkDataSetAttributes* outda);
114  void ExecuteBlock(vtkDataSet* input, vtkUnstructuredGrid* output, int fieldset_index,
116  double& totalSum, double totalSumCenter[3], int integrationDimension);
117 
118 public:
120  {
121  IntegrateAttrInfo = 2000,
122  IntegrateAttrData
123  };
124 };
125 
126 VTK_ABI_NAMESPACE_END
127 #endif
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkMultiProcessController * Controller
virtual vtkExecutive * CreateDefaultExecutive()
Create a default executive.
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
static vtkUnstructuredGridAlgorithm * New()
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:39
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
abstract class to define an integration strategy for vtkIntegrateAttributes
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Helper class for vtkIntegrateAttributes.
a simple class to control print indentation
Definition: vtkIndent.h:28
list of point or cell ids
Definition: vtkIdList.h:25
dataset represents arbitrary combinations of all possible cell types
represent and manipulate attribute data in a dataset
Superclass for algorithms that produce only unstructured grid as output.
Integrates lines, surfaces and volume.
Store zero or more vtkInformation instances.
Multiprocessing communication superclass.