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 LUscalarMatrix_H
37 #define LUscalarMatrix_H
39 #include "scalarMatrix.H"
40 #include "labelList.H"
41 #include "FieldField.H"
42 #include "lduInterfaceFieldPtrsList.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 /*---------------------------------------------------------------------------*\
53 Class LUscalarMatrix Declaration
54 \*---------------------------------------------------------------------------*/
62 //- Processor matrix offsets
63 labelList procOffsets_;
65 //- The pivot indices used in the LU decomposition
66 labelList pivotIndices_;
68 //- Convert the given lduMatrix into this LUscalarMatrix
71 const lduMatrix& ldum,
72 const FieldField<Field, scalar>& interfaceCoeffs,
73 const lduInterfaceFieldPtrsList& interfaces
76 //- Convert the given list of procLduMatrix into this LUscalarMatrix
77 // on the master processor
78 void convert(const PtrList<procLduMatrix>& lduMatrices);
81 //- Print the ratio of the mag-sum of the off-diagonal coefficients
82 // to the mag-diagonal
83 void printDiagonalDominance() const;
90 //- Construct from Matrix<scalar> and perform LU decomposition
91 LUscalarMatrix(const Matrix<scalar>&);
93 //- Construct from lduMatrix and perform LU decomposition
97 const FieldField<Field, scalar>& interfaceCoeffs,
98 const lduInterfaceFieldPtrsList& interfaces
104 //- Solve the matrix using the LU decomposition with pivoting
105 // returning the solution in the source
107 void solve(Field<T>& source) const;
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 } // End namespace Foam
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 # include "LUscalarMatrixTemplates.C"
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 // ************************************************************************* //