VTK  9.3.20240329
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
24 
25 VTK_ABI_NAMESPACE_BEGIN
26 class vtkDataSet;
27 class vtkIdList;
28 class vtkInformation;
32 
33 class VTKFILTERSPARALLEL_EXPORT vtkIntegrateAttributes : public vtkUnstructuredGridAlgorithm
34 {
35 public:
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
41 
46  vtkGetObjectMacro(Controller, vtkMultiProcessController);
48 
50 
54  vtkSetMacro(DivideAllCellDataByVolume, bool);
55  vtkGetMacro(DivideAllCellDataByVolume, bool);
57 
58 protected:
61 
63 
64  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
65  vtkInformationVector* outputVector) override;
66 
67  // Create a default executive.
69 
71 
72  static int CompareIntegrationDimension(vtkDataSet* output, int dim, double& totalSum,
73  double totalSumCenter[3], int& integrationDimension);
74  static void ZeroAttributes(vtkDataSetAttributes* outda);
75 
77 
79  int PieceNodeMinToNode0(vtkUnstructuredGrid* data, double& totalSum, double totalSumCenter[3],
80  int& integrationDimension);
81  void SendPiece(vtkUnstructuredGrid* src, double totalSum, const double totalSumCenter[3],
82  int integrationDimension);
83  void ReceivePiece(vtkUnstructuredGrid* mergeTo, int fromId, double& totalSum,
84  double totalSumCenter[3], int& integrationDimension);
85 
86  // This function assumes the data is in the format of the output of this filter with one
87  // point/cell having the value computed as its only tuple. It divides each value by sum,
88  // skipping the last data array if requested (so the volume doesn't get divided by itself
89  // and set to 1).
91  vtkDataSetAttributes* data, bool skipLastArray, double sum);
92 
93 private:
95  void operator=(const vtkIntegrateAttributes&) = delete;
96 
97  class vtkFieldList;
98  class vtkIntegrateAttributesFunctor;
99 
100  static void AllocateAttributes(vtkFieldList& fieldList, vtkDataSetAttributes* outda);
101  static void InitializeAttributes(vtkDataSetAttributes* outda);
102  void ExecuteBlock(vtkDataSet* input, vtkUnstructuredGrid* output, int fieldset_index,
103  vtkFieldList& pdList, vtkFieldList& cdList, double& totalSum, double totalSumCenter[3],
104  int integrationDimension);
105 
106 public:
108  {
109  IntegrateAttrInfo = 2000,
110  IntegrateAttrData
111  };
112 };
113 
114 VTK_ABI_NAMESPACE_END
115 #endif
represent and manipulate attribute data in a dataset
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:69
list of point or cell ids
Definition: vtkIdList.h:133
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Integrates lines, surfaces and volume.
~vtkIntegrateAttributes() override
static vtkIntegrateAttributes * New()
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called by the superclass.
int PieceNodeMinToNode0(vtkUnstructuredGrid *data, double &totalSum, double totalSumCenter[3], int &integrationDimension)
static void IntegrateSatelliteData(vtkDataSetAttributes *inda, vtkDataSetAttributes *outda)
vtkExecutive * CreateDefaultExecutive() override
Create a default executive.
static int CompareIntegrationDimension(vtkDataSet *output, int dim, double &totalSum, double totalSumCenter[3], int &integrationDimension)
static void ZeroAttributes(vtkDataSetAttributes *outda)
vtkMultiProcessController * Controller
static void DivideDataArraysByConstant(vtkDataSetAttributes *data, bool skipLastArray, double sum)
void SendPiece(vtkUnstructuredGrid *src, double totalSum, const double totalSumCenter[3], int integrationDimension)
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ReceivePiece(vtkUnstructuredGrid *mergeTo, int fromId, double &totalSum, double totalSumCenter[3], int &integrationDimension)
void SetController(vtkMultiProcessController *controller)
Get/Set the parallel controller to use.
Multiprocessing communication superclass.
Superclass for algorithms that produce only unstructured grid as output.
dataset represents arbitrary combinations of all possible cell types
@ data
Definition: vtkX3D.h:315