initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / matrices / scalarMatrices / scalarMatrices.H
blob62a5e9435baee07249494161e496e39ad8a49203
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     scalarMatrices
28 Description
29     Scalar matrices
31 SourceFiles
32     scalarMatrices.C
33     scalarMatricesTemplates.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef scalarMatrices_H
38 #define scalarMatrices_H
40 #include "RectangularMatrix.H"
41 #include "SquareMatrix.H"
42 #include "DiagonalMatrix.H"
43 #include "scalarField.H"
44 #include "labelList.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
51 typedef RectangularMatrix<scalar> scalarRectangularMatrix;
52 typedef SquareMatrix<scalar> scalarSquareMatrix;
53 typedef DiagonalMatrix<scalar> scalarDiagonalMatrix;
55 //- Solve the matrix using Gaussian elimination with pivoting,
56 //  returning the solution in the source
57 template<class Type>
58 void solve(scalarSquareMatrix& matrix, Field<Type>& source);
60 //- Solve the matrix using Gaussian elimination with pivoting
61 //  and return the solution
62 template<class Type>
63 void solve
65     Field<Type>& psi,
66     const scalarSquareMatrix& matrix,
67     const Field<Type>& source
70 //- LU decompose the matrix with pivoting
71 void LUDecompose
73     scalarSquareMatrix& matrix,
74     labelList& pivotIndices
77 //- LU back-substitution with given source, returning the solution
78 //  in the source
79 template<class Type>
80 void LUBacksubstitute
82     const scalarSquareMatrix& luMmatrix,
83     const labelList& pivotIndices,
84     Field<Type>& source
87 //- Solve the matrix using LU decomposition with pivoting
88 //  returning the LU form of the matrix and the solution in the source
89 template<class Type>
90 void LUsolve(scalarSquareMatrix& matrix, Field<Type>& source);
92 void multiply
94     scalarRectangularMatrix& answer,         // value changed in return
95     const scalarRectangularMatrix& A,
96     const scalarRectangularMatrix& B
99 void multiply
101     scalarRectangularMatrix& answer,         // value changed in return
102     const scalarRectangularMatrix& A,
103     const scalarRectangularMatrix& B,
104     const scalarRectangularMatrix& C
107 void multiply
109     scalarRectangularMatrix& answer,         // value changed in return
110     const scalarRectangularMatrix& A,
111     const DiagonalMatrix<scalar>& B,
112     const scalarRectangularMatrix& C
115 //- Return the inverse of matrix A using SVD
116 scalarRectangularMatrix SVDinv
118     const scalarRectangularMatrix& A,
119     scalar minCondition = 0
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 } // End namespace Foam
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 #ifdef NoRepository
130 #   include "scalarMatricesTemplates.C"
131 #endif
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 #endif
137 // ************************************************************************* //