tensor.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2014 OpenFOAM Foundation
9 Copyright (C) 2019-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::tensor
29
30Description
31 Tensor of scalars, i.e. Tensor<scalar>.
32
33 Analytical functions for the computation of complex eigenvalues and
34 complex eigenvectors from a given tensor.
35
36See also
37 Test-Tensor.C
38
39SourceFiles
40 floatTensors.C
41 tensor.C
42
43\*---------------------------------------------------------------------------*/
44
45#ifndef Foam_tensor_H
46#define Foam_tensor_H
47
48#include "Tensor.H"
49#include "vector.H"
50#include "sphericalTensor.H"
51#include "symmTensor.H"
52#include "complex.H"
53
54// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55
56namespace Foam
57{
58
59// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63typedef Tensor<float> floatTensor;
67typedef Tensor<double> doubleTensor;
68
69// With float or double precision (depending on compilation)
70typedef Tensor<scalar> tensor;
71
72
73// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
74
75//- Return complex eigenvalues of a given tensor
76// \param T tensor
77//
78// \return Vector<complex> eigenvalues
79Vector<complex> eigenValues(const tensor& T);
80
81
82//- Return a complex eigenvector corresponding to
83//- a given complex eigenvalue of a given tensor
84// \param T tensor
85// \param eVal complex eigenvalue
86// \param standardBasis1 tensor orthogonal component 1
87// \param standardBasis2 tensor orthogonal component 2
88//
89// \return Vector<complex> eigenvector
90Vector<complex> eigenVector
91(
92 const tensor& T,
93 const complex& eVal,
94 const Vector<complex>& standardBasis1,
95 const Vector<complex>& standardBasis2
96);
97
98
99//- Return complex eigenvectors corresponding to
100//- given complex eigenvalues of a given tensor
101// \param T tensor
102// \param eVals complex eigenvalues
103//
104// \return Tensor<complex> eigenvectors, each row is an eigenvector
105Tensor<complex> eigenVectors
106(
107 const tensor& T,
108 const Vector<complex>& eVals
109);
110
111
112//- Return complex eigenvectors of a given tensor by computing
113//- the complex eigenvalues of the tensor in the background
114// \param T tensor
115//
116// \return Tensor<complex> complex eigenvectors, each row is an eigenvector
117Tensor<complex> eigenVectors(const tensor& T);
118
119
120// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121
122} // End namespace Foam
123
124// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125
126#endif
127
128// ************************************************************************* //
A templated (3 x 3) tensor of objects of <T> derived from MatrixSpace.
Definition: Tensor.H:64
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition: Vector.H:65
A complex number, similar to the C++ complex type.
Definition: complex.H:83
Tensor of scalars, i.e. Tensor<scalar>.
const volScalarField & T
Namespace for OpenFOAM.
dimensionedTensor eigenVectors(const dimensionedSymmTensor &dt)
dimensionedVector eigenValues(const dimensionedSymmTensor &dt)
vector eigenVector(const symmTensor &T, const scalar eVal, const vector &standardBasis1, const vector &standardBasis2)
Definition: symmTensor.C:152
Tensor< double > doubleTensor
Definition: tensor.H:66
Tensor< scalar > tensor
Definition: symmTensor.H:61
Tensor< float > floatTensor
Definition: tensor.H:62