The open source CFD toolbox
Trapezoid.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) 2013-2016 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
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::Trapezoid
29
30Group
31 grpODESolvers
32
33Description
34 Trapezoidal ODE solver of order (1)2.
35
36SourceFiles
37 Trapezoid.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef Trapezoid_H
42#define Trapezoid_H
43
44#include "ODESolver.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52/*---------------------------------------------------------------------------*\
53 Class Trapezoid Declaration
54\*---------------------------------------------------------------------------*/
56class Trapezoid
57:
58 public ODESolver,
60{
61 // Private data
62
63 mutable scalarField err_;
64
65
66public:
67
68 //- Runtime type information
69 TypeName("Trapezoid");
70
71
72 // Constructors
73
74 //- Construct from ODESystem
75 Trapezoid(const ODESystem& ode, const dictionary& dict);
76
77
78 //- Destructor
79 virtual ~Trapezoid() = default;
80
81
82 // Member Functions
83
84 //- Inherit solve from ODESolver
85 using ODESolver::solve;
86
87 //- Resize the ODE solver
88 virtual bool resize();
89
90 //- Solve a single step dx and return the error
91 virtual scalar solve
92 (
93 const scalar x0,
94 const scalarField& y0,
95 const scalarField& dydx0,
96 const scalar dx,
98 ) const;
99
100 //- Solve the ODE system and the update the state
101 virtual void solve
102 (
103 scalar& x,
104 scalarField& y,
105 scalar& dxTry
106 ) const;
107};
108
109
110// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111
112} // End namespace Foam
113
114// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115
116#endif
117
118// ************************************************************************* //
scalar y
Abstract base-class for ODE system solvers.
Definition: ODESolver.H:57
Abstract base class for the systems of ordinary differential equations.
Definition: ODESystem.H:50
Trapezoidal ODE solver of order (1)2.
Definition: Trapezoid.H:59
virtual ~Trapezoid()=default
Destructor.
virtual bool resize()
Resize the ODE solver.
Definition: Trapezoid.C:53
TypeName("Trapezoid")
Runtime type information.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
An ODE solver for chemistry.
Definition: ode.H:55
Namespace for OpenFOAM.
dimensionedScalar y0(const dimensionedScalar &ds)
dictionary dict
CEqn solve()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73