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 Class 00025 Foam::KRR4 00026 00027 Description 00028 Foam::KRR4 00029 00030 SourceFiles 00031 KRR4CK.C 00032 KRR4QS.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef KRR4_H 00037 #define KRR4_H 00038 00039 #include <ODE/ODESolver.H> 00040 00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00042 00043 namespace Foam 00044 { 00045 00046 /*---------------------------------------------------------------------------*\ 00047 Class KRR4 Declaration 00048 \*---------------------------------------------------------------------------*/ 00049 00050 class KRR4 00051 : 00052 public ODESolver 00053 { 00054 // Private data 00055 00056 mutable scalarField yTemp_; 00057 mutable scalarField dydxTemp_; 00058 mutable scalarField g1_; 00059 mutable scalarField g2_; 00060 mutable scalarField g3_; 00061 mutable scalarField g4_; 00062 mutable scalarField yErr_; 00063 mutable scalarField dfdx_; 00064 mutable scalarSquareMatrix dfdy_; 00065 mutable scalarSquareMatrix a_; 00066 mutable labelList pivotIndices_; 00067 00068 static const int maxtry = 40; 00069 00070 static const scalar safety, grow, pgrow, shrink, pshrink, errcon; 00071 00072 static const scalar 00073 gamma, 00074 a21, a31, a32, 00075 c21, c31, c32, c41, c42, c43, 00076 b1, b2, b3, b4, 00077 e1, e2, e3, e4, 00078 c1X, c2X, c3X, c4X, 00079 a2X, a3X; 00080 00081 00082 public: 00083 00084 //- Runtime type information 00085 TypeName("KRR4"); 00086 00087 00088 // Constructors 00089 00090 //- Construct from ODE 00091 KRR4(const ODE& ode); 00092 00093 00094 // Member Functions 00095 00096 void solve 00097 ( 00098 const ODE& ode, 00099 scalar& x, 00100 scalarField& y, 00101 scalarField& dydx, 00102 const scalar eps, 00103 const scalarField& yScale, 00104 const scalar hTry, 00105 scalar& hDid, 00106 scalar& hNext 00107 ) const; 00108 }; 00109 00110 00111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00112 00113 } // End namespace Foam 00114 00115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00116 00117 #endif 00118 00119 // ************************ vim: set sw=4 sts=4 et: ************************ //