Loading...
Searching...
No Matches
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 Foam_SymmetricSquareMatrix_H
44#define Foam_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{
62public:
63
64 // Generated Methods
65
66 //- Default construct
67 SymmetricSquareMatrix() = default;
68
69 //- Copy construct
71
72 //- Copy assignment
74 operator=(const SymmetricSquareMatrix&) = default;
76
77 // Constructors
78
79 //- Construct for given size (rows == cols), uninitialised content
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, 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);
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=(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>
113};
114
115
116// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117
118// Global Functions
119
120//- Return the LU decomposed SymmetricSquareMatrix inverse
121template<class Type>
123
124//- Return the SymmetricSquareMatrix inverse
125template<class Type>
127
128//- Return the LU decomposed SymmetricSquareMatrix det
129template<class Type>
132//- Return the SymmetricSquareMatrix det
133template<class Type>
135
136
137// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138
139} // End namespace Foam
140
141// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142
144
145// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146
147#ifdef NoRepository
148 #include "SymmetricSquareMatrix.C"
149#endif
150
151// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152
153#endif
154
155// ************************************************************************* //
Templated identity and dual space identity tensors derived from SphericalTensor.
Definition Identity.H:46
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
label n() const noexcept
The number of columns.
Definition Matrix.H:271
A templated (N x N) square matrix of objects of <Type>, containing N*N elements, derived from Matrix.
void operator=(Foam::zero)
Assign all elements to zero.
SymmetricSquareMatrix(const label n, Foam::zero)
Construct for given size (rows == cols) initializing all elements to zero.
SymmetricSquareMatrix()=default
Default construct.
SymmetricSquareMatrix(const label n)
Construct for given size (rows == cols), uninitialised content.
SymmetricSquareMatrix(const SymmetricSquareMatrix &)=default
Copy construct.
autoPtr< SymmetricSquareMatrix< Type > > clone() const
Clone.
SymmetricSquareMatrix & operator=(const SymmetricSquareMatrix &)=default
Copy assignment.
void operator=(const Type &val)
Assign all elements to value.
SymmetricSquareMatrix(const label n, const Identity< AnyType >)
Construct for given size (rows == cols) initializing to the identity matrix.
void operator=(const Identity< AnyType >)
Set to identity matrix.
SymmetricSquareMatrix(Istream &is)
Construct from Istream.
SymmetricSquareMatrix(const label n, const Type &val)
Construct for given size (rows == cols) initializing all elements to the given value.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition zero.H:58
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.
SymmetricSquareMatrix< Type > invDecomposed(const SymmetricSquareMatrix< Type > &)
Return the LU decomposed SymmetricSquareMatrix inverse.