tensor2D.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-2017 OpenFOAM Foundation
9  Copyright (C) 2019-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Typedef
28  Foam::tensor2D
29 
30 Description
31  Tensor2D of scalars, i.e. Tensor2D<scalar>.
32 
33  Analytical functions for the computation of complex eigenvalues and
34  complex eigenvectors from a given tensor2D.
35 
36  Reference:
37  \verbatim
38  2-by-2 eigenvalue algorithm (tags:F; B):
39  Ford, W. (2014).
40  Numerical linear algebra with applications: Using MATLAB.
41  London: Elsevier/Academic Press.
42  DOI:10.1016/C2011-0-07533-6
43 
44  Blinn, J. (1996).
45  Consider the lowly 2 x 2 matrix.
46  IEEE Computer Graphics and Applications, 16(2), 82-88.
47  DOI:10.1109/38.486688
48 
49  2-by-2 eigenvector algorithm (tag:K):
50  Knill, O. (2004).
51  Mathematics Math21b Fall 2004.
52  bit.ly/2kjPVlX (Retrieved:06-09-19)
53 
54  Kahan summation algorithm for 2-by-2 matrix determinants (tag:JLM):
55  Jeannerod, C.-P., Louvet, N., & Muller, J.-M., (2013).
56  Further analysis of Kahan's algorithm for the accurate computation
57  of 2x2 determinants.
58  Math. Comp. 82 (2013), 2245-2264.
59  DOI:10.1090/S0025-5718-2013-02679-8
60  \endverbatim
61 
62 See also
63  Test-Tensor2D.C
64 
65 SourceFiles
66  tensor2D.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef tensor2D_H
71 #define tensor2D_H
72 
73 #include "Tensor2D.H"
74 #include "complex.H"
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 typedef Tensor2D<scalar> tensor2D;
84 
85 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86 
87 //- Return complex eigenvalues of a given tensor2D
88 // \param T tensor2D
89 //
90 // \return Vector2D<complex> eigenvalues
91 Vector2D<complex> eigenValues(const tensor2D& T);
92 
93 
94 //- Return a complex eigenvector corresponding to
95 //- a given complex eigenvalue of a given tensor2D
96 // \param T tensor2D
97 // \param eVal complex eigenvalue
98 // \param standardBasis tensor2D orthogonal component, e.g. vector2D(1, 0)
99 //
100 // \return Vector2D<complex> eigenvector
101 Vector2D<complex> eigenVector
102 (
103  const tensor2D& T,
104  const complex& eVal,
105  const Vector2D<complex>& standardBasis
106 );
107 
108 
109 //- Return complex eigenvectors corresponding to
110 //- given complex eigenvalues of a given tensor2D
111 // \param T tensor2D
112 // \param eVals eigenvalues
113 //
114 // \return Tensor2D<complex> eigenvectors, each row is an eigenvector
115 Tensor2D<complex> eigenVectors
116 (
117  const tensor2D& T,
118  const Vector2D<complex>& eVals
119 );
120 
121 
122 //- Return complex eigenvectors of a given tensor2D by computing
123 //- the complex eigenvalues of the tensor2D in the background
124 // \param T tensor2D
125 //
126 // \return Tensor2D<complex> eigenvectors, each row is an eigenvector
127 Tensor2D<complex> eigenVectors(const tensor2D& T);
128 
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #include "sphericalTensor2D.H"
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #endif
141 
142 // ************************************************************************* //
Foam::roots::complex
Definition: Roots.H:57
Tensor2D.H
Foam::eigenVector
vector eigenVector(const symmTensor &T, const scalar eVal, const vector &standardBasis1, const vector &standardBasis2)
Definition: symmTensor.C:152
Foam::eigenValues
dimensionedVector eigenValues(const dimensionedSymmTensor &dt)
Definition: dimensionedTensor.C:149
Foam::eigenVectors
dimensionedTensor eigenVectors(const dimensionedSymmTensor &dt)
Definition: dimensionedTensor.C:160
Foam::tensor2D
Tensor2D< scalar > tensor2D
Tensor2D of scalars, i.e. Tensor2D<scalar>.
Definition: symmTensor2D.H:68
complex.H
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
sphericalTensor2D.H