VTK: Filters/Tensor/vtkTensorPrincipalInvariants.h Source File

| VTK 9.3.1

vtkTensorPrincipalInvariants.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
15 #ifndef vtkTensorPrincipalInvariants_h
16 #define vtkTensorPrincipalInvariants_h
17
18 #include "vtkDataSetAlgorithm.h"
19 #include "vtkFiltersTensorModule.h" // For export macro
20 #include "vtkNew.h" // For vtkNew
21
22 #include <array> // for std::array
23 #include <string> // for std::string
24
25 VTK_ABI_NAMESPACE_BEGIN
26 class vtkDataArray;
27 class vtkDataArraySelection;
28 class vtkDataSet;
29
30 class VTKFILTERSTENSOR_EXPORT vtkTensorPrincipalInvariants : public vtkDataSetAlgorithm
31 {
32 public:
33 static vtkTensorPrincipalInvariants* New();
34 vtkTypeMacro(vtkTensorPrincipalInvariants, vtkDataSetAlgorithm);
35 void PrintSelf(ostream& os, vtkIndent indent) override;
36
38
42 vtkGetMacro(ScaleVectors, bool);
43 vtkSetMacro(ScaleVectors, bool);
45
50 vtkGetObjectMacro(PointDataArraySelection, vtkDataArraySelection);
51
56 vtkGetObjectMacro(CellDataArraySelection, vtkDataArraySelection);
57
61 static std::string GetSigmaValueArrayName(const std::string& baseName, int index);
62
66 static std::string GetSigmaVectorArrayName(const std::string& baseName, int index);
67
68 protected:
69 vtkTensorPrincipalInvariants();
70 ~vtkTensorPrincipalInvariants() override = default;
71
78 bool IsSymmetricTensor(vtkDataArray* array) const;
79
84 bool ComputePrincipalInvariants(vtkDataSet* output, vtkDataArray* array,
85 const std::string& arrayName, vtkIdType nbTuples, bool isPointData) const;
86
90 std::array<int, 3> GetDecreasingOrder(double values[3]) const;
91
92 int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
93 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
94
95 vtkNew<vtkDataArraySelection> PointDataArraySelection;
96 vtkNew<vtkDataArraySelection> CellDataArraySelection;
97 bool ScaleVectors = false;
98
99 private:
100 vtkTensorPrincipalInvariants(const vtkTensorPrincipalInvariants&) = delete;
101 void operator=(const vtkTensorPrincipalInvariants&) = delete;
102 };
103
104 VTK_ABI_NAMESPACE_END
105 #endif
vtkDataArraySelection
Store on/off settings for data arrays, etc.
Definition: vtkDataArraySelection.h:37
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkDataSetAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkDataSetAlgorithm.h:38
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkNew< vtkDataArraySelection >
vtkTensorPrincipalInvariants
Compute principal values and directions from symmetric tensor.
Definition: vtkTensorPrincipalInvariants.h:31
vtkTensorPrincipalInvariants::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTensorPrincipalInvariants::IsSymmetricTensor
bool IsSymmetricTensor(vtkDataArray *array) const
Determine whether the given array corresponds to a symmetric 3D tensor (6 components) or 2D tensor (3...
vtkTensorPrincipalInvariants::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
vtkTensorPrincipalInvariants::vtkTensorPrincipalInvariants
vtkTensorPrincipalInvariants()
vtkTensorPrincipalInvariants::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks for Information.
vtkTensorPrincipalInvariants::GetDecreasingOrder
std::array< int, 3 > GetDecreasingOrder(double values[3]) const
Return the indices that sort the input values from largest to smallest.
vtkTensorPrincipalInvariants::PointDataArraySelection
vtkNew< vtkDataArraySelection > PointDataArraySelection
Definition: vtkTensorPrincipalInvariants.h:95
vtkTensorPrincipalInvariants::~vtkTensorPrincipalInvariants
~vtkTensorPrincipalInvariants() override=default
vtkTensorPrincipalInvariants::CellDataArraySelection
vtkNew< vtkDataArraySelection > CellDataArraySelection
Definition: vtkTensorPrincipalInvariants.h:96
vtkTensorPrincipalInvariants::GetSigmaVectorArrayName
static std::string GetSigmaVectorArrayName(const std::string &baseName, int index)
Return the given array name with a suffix for principal vectors attached.
vtkTensorPrincipalInvariants::GetSigmaValueArrayName
static std::string GetSigmaValueArrayName(const std::string &baseName, int index)
Return the given array name with a suffix for principal values attached.
vtkTensorPrincipalInvariants::New
static vtkTensorPrincipalInvariants * New()
vtkTensorPrincipalInvariants::ComputePrincipalInvariants
bool ComputePrincipalInvariants(vtkDataSet *output, vtkDataArray *array, const std::string &arrayName, vtkIdType nbTuples, bool isPointData) const
Compute and append to the given dataset the principal values and directions from the given array.
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkDataSetAlgorithm.h
vtkNew.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315