![]() |
|
00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2005 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 the 00013 Free Software Foundation; either version 2 of the License, or (at your 00014 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, write to the Free Software Foundation, 00023 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 Class 00026 ICCG 00027 00028 Description 00029 00030 SourceFiles 00031 ICCG.C 00032 00033 \*---------------------------------------------------------------------------*/ 00034 00035 #ifndef ICCG_H 00036 #define ICCG_H 00037 00038 #include "lduMatrix.H" 00039 00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00041 00042 namespace Foam 00043 { 00044 00045 /*---------------------------------------------------------------------------*\ 00046 Class ICCG Declaration 00047 \*---------------------------------------------------------------------------*/ 00048 00049 class ICCG 00050 : 00051 public lduMatrix::solver 00052 { 00053 private: 00054 00055 // Static data 00056 00057 //- Maximum number of iterations in the solver 00058 static label maxIter_; 00059 00060 00061 // Private Member Functions 00062 00063 //- Disallow default bitwise copy construct 00064 ICCG(const ICCG&); 00065 00066 //- Disallow default bitwise assignment 00067 void operator=(const ICCG&); 00068 00069 00070 protected: 00071 00072 // Protected data 00073 00074 scalar tolerance_; 00075 scalar relTol_; 00076 00077 00078 public: 00079 00080 //- Runtime type information 00081 # ifndef ICCGname 00082 # define ICCGname "ICCG" 00083 # endif 00084 TypeName(ICCGname); 00085 # undef ICCGname 00086 00087 00088 // Constructors 00089 00090 //- Construct from components 00091 ICCG 00092 ( 00093 const word& fieldName, 00094 scalarField& psi, 00095 const lduMatrix& matrix, 00096 const scalarField& source, 00097 const FieldField<Field, scalar>& coupleBouCoeffs, 00098 const FieldField<Field, scalar>& coupleIntCoeffs, 00099 const lduCoupledInterfacePtrsList& interfaces, 00100 const direction cmpt, 00101 const scalar tolerance, 00102 const scalar relTol = 0.0 00103 ); 00104 00105 //- Construct from matrix components and solver data stream 00106 ICCG 00107 ( 00108 const word& fieldName, 00109 scalarField& psi, 00110 const lduMatrix& matrix, 00111 const scalarField& source, 00112 const FieldField<Field, scalar>& coupleBouCoeffs, 00113 const FieldField<Field, scalar>& coupleIntCoeffs, 00114 const lduCoupledInterfacePtrsList& interfaces, 00115 const direction cmpt, 00116 Istream& solverData 00117 ); 00118 00119 00120 // Member Functions 00121 00122 //- Solve the matrix with this solver 00123 lduMatrix::solverPerformance solve(); 00124 00125 //- Set maximum number of iterations 00126 static label setMaxIter(const label mIter) 00127 { 00128 label oldMaxIter = maxIter_; 00129 maxIter_ = mIter; 00130 00131 return oldMaxIter; 00132 } 00133 }; 00134 00135 00136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00137 00138 } // End namespace Foam 00139 00140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00141 00142 #endif 00143 00144 // ************************************************************************* //