1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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
34 \*---------------------------------------------------------------------------*/
36 #ifndef simpleMatrix_H
37 #define simpleMatrix_H
39 #include "scalarMatrix.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 // Forward declaration of friend functions and operators
52 simpleMatrix<T> operator+
54 const simpleMatrix<T>&,
55 const simpleMatrix<T>&
59 simpleMatrix<T> operator-
61 const simpleMatrix<T>&,
62 const simpleMatrix<T>&
66 simpleMatrix<T> operator*
69 const simpleMatrix<T>&
76 const simpleMatrix<T>&
80 /*---------------------------------------------------------------------------*\
81 Class simpleMatrix Declaration
82 \*---------------------------------------------------------------------------*/
98 //- Construct given size
99 simpleMatrix(const label);
101 //- Construct from components
102 simpleMatrix(const scalarMatrix&, const Field<T>&);
104 //- Construct from Istream
105 simpleMatrix(Istream&);
107 //- Construct as copy
108 simpleMatrix(const simpleMatrix<T>&);
120 const Field<T>& source() const
126 //- Solve the matrix using Gaussian elimination with pivoting
127 // and return the solution
128 Field<T> solve() const;
130 //- Solve the matrix using LU decomposition with pivoting
131 // and return the solution
132 Field<T> LUsolve() const;
137 void operator=(const simpleMatrix<T>&);
142 friend simpleMatrix<T> operator+ <T>
144 const simpleMatrix<T>&,
145 const simpleMatrix<T>&
148 friend simpleMatrix<T> operator- <T>
150 const simpleMatrix<T>&,
151 const simpleMatrix<T>&
154 friend simpleMatrix<T> operator* <T>
157 const simpleMatrix<T>&
163 friend Ostream& operator<< <T>
166 const simpleMatrix<T>&
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 } // End namespace Foam
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 # include "simpleMatrix.C"
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 // ************************************************************************* //