VTK  9.5.2
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
26VTK_ABI_NAMESPACE_BEGIN
27class vtkDataSet;
29class vtkIdList;
30class vtkInformation;
35
36class VTKFILTERSPARALLEL_EXPORT vtkIntegrateAttributes : public vtkUnstructuredGridAlgorithm
37{
38public:
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
44
49 vtkGetObjectMacro(Controller, vtkMultiProcessController);
51
53
59
61
65 vtkSetMacro(DivideAllCellDataByVolume, bool);
66 vtkGetMacro(DivideAllCellDataByVolume, bool);
68
69protected:
72
74
75 int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
76 vtkInformationVector* outputVector) override;
77
78 // Create a default executive.
80
82
83 static int CompareIntegrationDimension(vtkDataSet* output, int dim, double& totalSum,
84 double totalSumCenter[3], int& integrationDimension);
86
88
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).
102 vtkDataSetAttributes* data, bool skipLastArray, double sum);
103
104private:
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
118public:
120 {
121 IntegrateAttrInfo = 2000,
122 IntegrateAttrData
123 };
124};
125
126VTK_ABI_NAMESPACE_END
127#endif
represent and manipulate attribute data in a dataset
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:40
list of point or cell ids
Definition: vtkIdList.h:24
a simple class to control print indentation
Definition: vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Helper class for vtkIntegrateAttributes.
Integrates lines, surfaces and volume.
~vtkIntegrateAttributes() override
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)
void SetIntegrationStrategy(vtkIntegrationStrategy *strategy)
Get/Set the integration strategy.
static int CompareIntegrationDimension(vtkDataSet *output, int dim, double &totalSum, double totalSumCenter[3], int &integrationDimension)
static void ZeroAttributes(vtkDataSetAttributes *outda)
vtkIntegrationStrategy * GetIntegrationStrategy()
Get/Set the integration strategy.
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)
static vtkIntegrateAttributes * New()
void SetController(vtkMultiProcessController *controller)
Get/Set the parallel controller to use.
vtkExecutive * CreateDefaultExecutive() override
Create a default executive.
abstract class to define an integration strategy for vtkIntegrateAttributes
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