ODESystem.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2013 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::ODESystem
29
30Description
31 Abstract base class for the systems of ordinary differential equations.
32
33\*---------------------------------------------------------------------------*/
34
35#ifndef ODESystem_H
36#define ODESystem_H
37
38#include "scalarField.H"
39#include "scalarMatrices.H"
40
41// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42
43namespace Foam
44{
45
46/*---------------------------------------------------------------------------*\
47 Class ODESystem Declaration
48\*---------------------------------------------------------------------------*/
50class ODESystem
51{
52
53public:
54
55 // Constructors
56
57 //- Construct null
58 ODESystem()
59 {}
60
61
62 //- Destructor
63 virtual ~ODESystem() = default;
64
65
66 // Member Functions
67
68 //- Return the number of equations in the system
69 virtual label nEqns() const = 0;
70
71 //- Calculate the derivatives in dydx
72 virtual void derivatives
73 (
74 const scalar x,
75 const scalarField& y,
76 scalarField& dydx
77 ) const = 0;
78
79 //- Calculate the Jacobian of the system
80 // Need by the stiff-system solvers
81 virtual void jacobian
82 (
83 const scalar x,
84 const scalarField& y,
85 scalarField& dfdx,
87 ) const = 0;
88};
89
90
91// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92
93} // End namespace Foam
94
95// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96
97#endif
98
99// ************************************************************************* //
scalar y
Abstract base class for the systems of ordinary differential equations.
Definition: ODESystem.H:50
ODESystem()
Construct null.
Definition: ODESystem.H:57
virtual void jacobian(const scalar x, const scalarField &y, scalarField &dfdx, scalarSquareMatrix &dfdy) const =0
Calculate the Jacobian of the system.
virtual ~ODESystem()=default
Destructor.
virtual void derivatives(const scalar x, const scalarField &y, scalarField &dydx) const =0
Calculate the derivatives in dydx.
virtual label nEqns() const =0
Return the number of equations in the system.
Namespace for OpenFOAM.