Transferred copyright to the OpenFOAM Foundation
[OpenFOAM-2.0.x.git] / src / OpenFOAM / matrices / lduMatrix / solvers / diagonalSolver / diagonalSolver.C
blobfd03af39e7a6b3c1d1d710d3b4807780a6e85713
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "diagonalSolver.H"
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 defineTypeNameAndDebug(Foam::diagonalSolver, 0);
33 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
35 Foam::diagonalSolver::diagonalSolver
37     const word& fieldName,
38     const lduMatrix& matrix,
39     const FieldField<Field, scalar>& interfaceBouCoeffs,
40     const FieldField<Field, scalar>& interfaceIntCoeffs,
41     const lduInterfaceFieldPtrsList& interfaces,
42     const dictionary& solverControls
45     lduMatrix::solver
46     (
47         fieldName,
48         matrix,
49         interfaceBouCoeffs,
50         interfaceIntCoeffs,
51         interfaces,
52         solverControls
53     )
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 Foam::lduMatrix::solverPerformance Foam::diagonalSolver::solve
61     scalarField& psi,
62     const scalarField& source,
63     const direction cmpt
64 ) const
66     psi = source/matrix_.diag();
68     return lduMatrix::solverPerformance
69     (
70         typeName,
71         fieldName_,
72         0,
73         0,
74         0,
75         true,
76         false
77     );
81 // ************************************************************************* //