FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

ICCG.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include "ICCG.H"
00027 
00028 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00029 
00030 namespace Foam
00031 {
00032     defineTypeNameAndDebug(ICCG, 0);
00033 
00034     lduMatrix::solver::addsymMatrixConstructorToTable<ICCG>
00035         addICCGSymMatrixConstructorToTable_;
00036 }
00037 
00038 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
00039 
00040 Foam::dictionary Foam::ICCG::solverDict
00041 (
00042     const scalar tol,
00043     const scalar relTol
00044 )
00045 {
00046     dictionary dict(IStringStream("solver PCG; preconditioner DIC;")());
00047     dict.add("tolerance", tol);
00048     dict.add("relTol", relTol);
00049 
00050     return dict;
00051 }
00052 
00053 
00054 Foam::dictionary Foam::ICCG::solverDict
00055 (
00056     Istream& is
00057 )
00058 {
00059     scalar tol(readScalar(is));
00060     scalar relTol(readScalar(is));
00061 
00062     return solverDict(tol, relTol);
00063 }
00064 
00065 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00066 
00067 Foam::ICCG::ICCG
00068 (
00069     const word& fieldName,
00070     const lduMatrix& matrix,
00071     const FieldField<Field, scalar>& interfaceBouCoeffs,
00072     const FieldField<Field, scalar>& interfaceIntCoeffs,
00073     const lduInterfaceFieldPtrsList& interfaces,
00074     const dictionary& solverControls
00075 )
00076 :
00077     PCG
00078     (
00079         fieldName,
00080         matrix,
00081         interfaceBouCoeffs,
00082         interfaceIntCoeffs,
00083         interfaces,
00084         solverControls
00085     )
00086 {}
00087 
00088 
00089 Foam::ICCG::ICCG
00090 (
00091     const word& fieldName,
00092     const lduMatrix& matrix,
00093     const FieldField<Field, scalar>& interfaceBouCoeffs,
00094     const FieldField<Field, scalar>& interfaceIntCoeffs,
00095     const lduInterfaceFieldPtrsList& interfaces,
00096     const scalar tolerance,
00097     const scalar relTol
00098 )
00099 :
00100     PCG
00101     (
00102         fieldName,
00103         matrix,
00104         interfaceBouCoeffs,
00105         interfaceIntCoeffs,
00106         interfaces,
00107         solverDict(tolerance, relTol)
00108     )
00109 {}
00110 
00111 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines