SymmetricSquareMatrix.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-2016 OpenFOAM Foundation
9 Copyright (C) 2019-2020 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::SymmetricSquareMatrix
29
30Description
31 A templated (N x N) square matrix of objects of <Type>,
32 containing N*N elements, derived from Matrix.
33
34See also
35 Test-SymmetricSquareMatrix.C
36
37SourceFiles
38 SymmetricSquareMatrixI.H
39 SymmetricSquareMatrix.C
40
41\*---------------------------------------------------------------------------*/
42
43#ifndef SymmetricSquareMatrix_H
44#define SymmetricSquareMatrix_H
45
46#include "SquareMatrix.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53/*---------------------------------------------------------------------------*\
54 Class SymmetricSquareMatrix Declaration
55\*---------------------------------------------------------------------------*/
56
57template<class Type>
59:
60 public Matrix<SymmetricSquareMatrix<Type>, Type>
61{
62
63public:
64
65 // Generated Methods
66
67 //- Default construct
68 SymmetricSquareMatrix() = default;
69
70 //- Copy construct
72
73 //- Copy assignment
75
76
77 // Constructors
78
79 //- Construct for given size (rows == cols)
80 inline explicit SymmetricSquareMatrix(const label n);
81
82 //- Construct for given size (rows == cols)
83 //- initializing all elements to zero
84 inline SymmetricSquareMatrix(const label n, const Foam::zero);
85
86 //- Construct for given size (rows == cols)
87 //- initializing all elements to the given value
88 inline SymmetricSquareMatrix(const label n, const Type& val);
89
90 //- Construct for given size (rows == cols)
91 //- initializing to the identity matrix
92 template<class AnyType>
93 inline SymmetricSquareMatrix(const label n, const Identity<AnyType>);
94
95 //- Construct from Istream
96 inline explicit SymmetricSquareMatrix(Istream& is);
97
98 //- Clone
100
101
102 // Member Operators
103
104 //- Assign all elements to zero
105 inline void operator=(const Foam::zero);
106
107 //- Assign all elements to value
108 inline void operator=(const Type& val);
109
110 //- Set to identity matrix
111 template<class AnyType>
112 void operator=(const Identity<AnyType>);
113};
114
115
116// Global Functions
117
118//- Return the LU decomposed SymmetricSquareMatrix inverse
119template<class Type>
121
122//- Return the SymmetricSquareMatrix inverse
123template<class Type>
125
126//- Return the LU decomposed SymmetricSquareMatrix det
127template<class Type>
129
130//- Return the SymmetricSquareMatrix det
131template<class Type>
133
134
135// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136
137} // End namespace Foam
138
139// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140
142
143// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144
145#ifdef NoRepository
146 #include "SymmetricSquareMatrix.C"
147#endif
148
149// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150
151#endif
152
153// ************************************************************************* //
Templated identity and dual space identity tensors derived from SphericalTensor.
Definition: Identity.H:52
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
A templated (m x n) matrix of objects of <T>. The layout is (mRows x nCols) - row-major order:
Definition: Matrix.H:81
label n() const noexcept
The number of columns.
Definition: MatrixI.H:103
A templated (N x N) square matrix of objects of <Type>, containing N*N elements, derived from Matrix.
SymmetricSquareMatrix()=default
Default construct.
SymmetricSquareMatrix(const SymmetricSquareMatrix &)=default
Copy construct.
autoPtr< SymmetricSquareMatrix< Type > > clone() const
Clone.
SymmetricSquareMatrix & operator=(const SymmetricSquareMatrix &)=default
Copy assignment.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:63
Namespace for OpenFOAM.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
scalar detDecomposed(const SquareMatrix< Type > &matrix, const label sign)
Return the determinant of the LU decomposed SquareMatrix.
Definition: SquareMatrix.C:107
SymmetricSquareMatrix< Type > invDecomposed(const SymmetricSquareMatrix< Type > &)
Return the LU decomposed SymmetricSquareMatrix inverse.