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

ODESolver.H

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 Class
00025     Foam::ODESolver
00026 
00027 Description
00028     Selection for ODE solver
00029 
00030 SourceFiles
00031     ODESolver.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef ODESolver_H
00036 #define ODESolver_H
00037 
00038 #include <ODE/ODE.H>
00039 #include <OpenFOAM/typeInfo.H>
00040 #include <OpenFOAM/autoPtr.H>
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                          Class ODESolver Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 class ODESolver
00052 {
00053 
00054 protected:
00055 
00056     // Private data
00057 
00058         label n_;
00059         mutable scalarField yScale_;
00060         mutable scalarField dydx_;
00061 
00062 
00063     // Private Member Functions
00064 
00065         //- Disallow default bitwise copy construct
00066         ODESolver(const ODESolver&);
00067 
00068         //- Disallow default bitwise assignment
00069         void operator=(const ODESolver&);
00070 
00071 
00072 public:
00073 
00074     //- Runtime type information
00075     TypeName("ODESolver");
00076 
00077 
00078     // Declare run-time constructor selection table
00079 
00080         declareRunTimeSelectionTable
00081         (
00082             autoPtr,
00083             ODESolver,
00084             ODE,
00085             (const ODE& ode),
00086             (ode)
00087         );
00088 
00089 
00090     // Constructors
00091 
00092         //- Construct for given ODE
00093         ODESolver(const ODE& ode);
00094 
00095 
00096     // Selectors
00097 
00098         //- Select null constructed
00099         static autoPtr<ODESolver> New
00100         (
00101             const word& ODESolverTypeName,
00102             const ODE& ode
00103         );
00104 
00105 
00106     // Destructor
00107 
00108         virtual ~ODESolver()
00109         {}
00110 
00111 
00112     // Member Functions
00113 
00114         virtual void solve
00115         (
00116             const ODE& ode,
00117             scalar& x,
00118             scalarField& y,
00119             scalarField& dydx,
00120             const scalar eps,
00121             const scalarField& yScale,
00122             const scalar hTry,
00123             scalar& hDid,
00124             scalar& hNext
00125         ) const = 0;
00126 
00127 
00128         virtual void solve
00129         (
00130             const ODE& ode,
00131             const scalar xStart,
00132             const scalar xEnd,
00133             scalarField& y,
00134             const scalar eps,
00135             scalar& hEst
00136         ) const;
00137 };
00138 
00139 
00140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00141 
00142 } // End namespace Foam
00143 
00144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00145 
00146 #endif
00147 
00148 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines