Commit df2063c5 authored by Henry's avatar Henry
Browse files

ODE solvers: rationalised naming of the embedded order solvers

parent 037950ca
......@@ -8,11 +8,11 @@ ODESolvers/Trapezoid/Trapezoid.C
ODESolvers/RKF45/RKF45.C
ODESolvers/RKCK45/RKCK45.C
ODESolvers/RKDP45/RKDP45.C
ODESolvers/Rosenbrock21/Rosenbrock21.C
ODESolvers/Rosenbrock32/Rosenbrock32.C
ODESolvers/Rosenbrock43/Rosenbrock43.C
ODESolvers/rodas32/rodas32.C
ODESolvers/rodas43/rodas43.C
ODESolvers/Rosenbrock12/Rosenbrock12.C
ODESolvers/Rosenbrock23/Rosenbrock23.C
ODESolvers/Rosenbrock34/Rosenbrock34.C
ODESolvers/rodas23/rodas23.C
ODESolvers/rodas34/rodas34.C
ODESolvers/SIBS/SIBS.C
ODESolvers/SIBS/SIMPR.C
ODESolvers/SIBS/polyExtrapolate.C
......
......@@ -23,33 +23,33 @@ License
\*---------------------------------------------------------------------------*/
#include "Rosenbrock21.H"
#include "Rosenbrock12.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(Rosenbrock21, 0);
addToRunTimeSelectionTable(ODESolver, Rosenbrock21, dictionary);
defineTypeNameAndDebug(Rosenbrock12, 0);
addToRunTimeSelectionTable(ODESolver, Rosenbrock12, dictionary);
const scalar
Rosenbrock21::gamma = 1 + 1.0/std::sqrt(2.0),
Rosenbrock21::a21 = 1.0/gamma,
Rosenbrock21::c2 = 1.0,
Rosenbrock21::c21 = -2.0/gamma,
Rosenbrock21::b1 = (3.0/2.0)/gamma,
Rosenbrock21::b2 = (1.0/2.0)/gamma,
Rosenbrock21::e1 = b1 - 1.0/gamma,
Rosenbrock21::e2 = b2,
Rosenbrock21::d1 = gamma,
Rosenbrock21::d2 = -gamma;
Rosenbrock12::gamma = 1 + 1.0/std::sqrt(2.0),
Rosenbrock12::a21 = 1.0/gamma,
Rosenbrock12::c2 = 1.0,
Rosenbrock12::c21 = -2.0/gamma,
Rosenbrock12::b1 = (3.0/2.0)/gamma,
Rosenbrock12::b2 = (1.0/2.0)/gamma,
Rosenbrock12::e1 = b1 - 1.0/gamma,
Rosenbrock12::e2 = b2,
Rosenbrock12::d1 = gamma,
Rosenbrock12::d2 = -gamma;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::Rosenbrock21::Rosenbrock21(const ODESystem& ode, const dictionary& dict)
Foam::Rosenbrock12::Rosenbrock12(const ODESystem& ode, const dictionary& dict)
:
ODESolver(ode, dict),
adaptiveSolver(ode, dict),
......@@ -66,7 +66,7 @@ Foam::Rosenbrock21::Rosenbrock21(const ODESystem& ode, const dictionary& dict)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::Rosenbrock21::solve
Foam::scalar Foam::Rosenbrock12::solve
(
const scalar x0,
const scalarField& y0,
......@@ -123,7 +123,7 @@ Foam::scalar Foam::Rosenbrock21::solve
}
void Foam::Rosenbrock21::solve
void Foam::Rosenbrock12::solve
(
scalar& x,
scalarField& y,
......
......@@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::Rosenbrock21
Foam::Rosenbrock12
Description
L-stable embedded Rosenbrock ODE solver of order (1)2.
......@@ -39,12 +39,12 @@ Description
\endverbatim
SourceFiles
Rosenbrock21.C
Rosenbrock12.C
\*---------------------------------------------------------------------------*/
#ifndef Rosenbrock21_H
#define Rosenbrock21_H
#ifndef Rosenbrock12_H
#define Rosenbrock12_H
#include "ODESolver.H"
#include "adaptiveSolver.H"
......@@ -55,10 +55,10 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class Rosenbrock21 Declaration
Class Rosenbrock12 Declaration
\*---------------------------------------------------------------------------*/
class Rosenbrock21
class Rosenbrock12
:
public ODESolver,
public adaptiveSolver
......@@ -87,13 +87,13 @@ class Rosenbrock21
public:
//- Runtime type information
TypeName("Rosenbrock21");
TypeName("Rosenbrock12");
// Constructors
//- Construct from ODE
Rosenbrock21(const ODESystem& ode, const dictionary& dict);
Rosenbrock12(const ODESystem& ode, const dictionary& dict);
// Member Functions
......
......@@ -23,45 +23,45 @@ License
\*---------------------------------------------------------------------------*/
#include "Rosenbrock32.H"
#include "Rosenbrock23.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(Rosenbrock32, 0);
addToRunTimeSelectionTable(ODESolver, Rosenbrock32, dictionary);
defineTypeNameAndDebug(Rosenbrock23, 0);
addToRunTimeSelectionTable(ODESolver, Rosenbrock23, dictionary);
const scalar
Rosenbrock32::a21 = 1,
Rosenbrock32::a31 = 1,
Rosenbrock32::a32 = 0,
Rosenbrock23::a21 = 1,
Rosenbrock23::a31 = 1,
Rosenbrock23::a32 = 0,
Rosenbrock32::c21 = -1.0156171083877702091975600115545,
Rosenbrock32::c31 = 4.0759956452537699824805835358067,
Rosenbrock32::c32 = 9.2076794298330791242156818474003,
Rosenbrock23::c21 = -1.0156171083877702091975600115545,
Rosenbrock23::c31 = 4.0759956452537699824805835358067,
Rosenbrock23::c32 = 9.2076794298330791242156818474003,
Rosenbrock32::b1 = 1,
Rosenbrock32::b2 = 6.1697947043828245592553615689730,
Rosenbrock32::b3 = -0.4277225654321857332623837380651,
Rosenbrock23::b1 = 1,
Rosenbrock23::b2 = 6.1697947043828245592553615689730,
Rosenbrock23::b3 = -0.4277225654321857332623837380651,
Rosenbrock32::e1 = 0.5,
Rosenbrock32::e2 = -2.9079558716805469821718236208017,
Rosenbrock32::e3 = 0.2235406989781156962736090927619,
Rosenbrock23::e1 = 0.5,
Rosenbrock23::e2 = -2.9079558716805469821718236208017,
Rosenbrock23::e3 = 0.2235406989781156962736090927619,
Rosenbrock32::gamma = 0.43586652150845899941601945119356,
Rosenbrock32::c2 = 0.43586652150845899941601945119356,
Rosenbrock23::gamma = 0.43586652150845899941601945119356,
Rosenbrock23::c2 = 0.43586652150845899941601945119356,
Rosenbrock32::d1 = 0.43586652150845899941601945119356,
Rosenbrock32::d2 = 0.24291996454816804366592249683314,
Rosenbrock32::d3 = 2.1851380027664058511513169485832;
Rosenbrock23::d1 = 0.43586652150845899941601945119356,
Rosenbrock23::d2 = 0.24291996454816804366592249683314,
Rosenbrock23::d3 = 2.1851380027664058511513169485832;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::Rosenbrock32::Rosenbrock32(const ODESystem& ode, const dictionary& dict)
Foam::Rosenbrock23::Rosenbrock23(const ODESystem& ode, const dictionary& dict)
:
ODESolver(ode, dict),
adaptiveSolver(ode, dict),
......@@ -79,7 +79,7 @@ Foam::Rosenbrock32::Rosenbrock32(const ODESystem& ode, const dictionary& dict)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::Rosenbrock32::solve
Foam::scalar Foam::Rosenbrock23::solve
(
const scalar x0,
const scalarField& y0,
......@@ -145,7 +145,7 @@ Foam::scalar Foam::Rosenbrock32::solve
}
void Foam::Rosenbrock32::solve
void Foam::Rosenbrock23::solve
(
scalar& x,
scalarField& y,
......
......@@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::Rosenbrock32
Foam::Rosenbrock23
Description
L-stable embedded Rosenbrock ODE solver of order (3)4.
......@@ -42,12 +42,12 @@ Description
\endverbatim
SourceFiles
Rosenbrock32.C
Rosenbrock23.C
\*---------------------------------------------------------------------------*/
#ifndef Rosenbrock32_H
#define Rosenbrock32_H
#ifndef Rosenbrock23_H
#define Rosenbrock23_H
#include "ODESolver.H"
#include "adaptiveSolver.H"
......@@ -58,10 +58,10 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class Rosenbrock32 Declaration
Class Rosenbrock23 Declaration
\*---------------------------------------------------------------------------*/
class Rosenbrock32
class Rosenbrock23
:
public ODESolver,
public adaptiveSolver
......@@ -91,13 +91,13 @@ class Rosenbrock32
public:
//- Runtime type information
TypeName("Rosenbrock32");
TypeName("Rosenbrock23");
// Constructors
//- Construct from ODE
Rosenbrock32(const ODESystem& ode, const dictionary& dict);
Rosenbrock23(const ODESystem& ode, const dictionary& dict);
// Member Functions
......
......@@ -23,89 +23,89 @@ License
\*---------------------------------------------------------------------------*/
#include "Rosenbrock43.H"
#include "Rosenbrock34.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(Rosenbrock43, 0);
addToRunTimeSelectionTable(ODESolver, Rosenbrock43, dictionary);
defineTypeNameAndDebug(Rosenbrock34, 0);
addToRunTimeSelectionTable(ODESolver, Rosenbrock34, dictionary);
const scalar
// L-Stable constants from Hairer et. al.
Rosenbrock43::a21 = 2,
Rosenbrock43::a31 = 1.867943637803922,
Rosenbrock43::a32 = 0.2344449711399156,
Rosenbrock43::c21 = -7.137615036412310,
Rosenbrock43::c31 = 2.580708087951457,
Rosenbrock43::c32 = 0.6515950076447975,
Rosenbrock43::c41 = -2.137148994382534,
Rosenbrock43::c42 = -0.3214669691237626,
Rosenbrock43::c43 = -0.6949742501781779,
Rosenbrock43::b1 = 2.255570073418735,
Rosenbrock43::b2 = 0.2870493262186792,
Rosenbrock43::b3 = 0.435317943184018,
Rosenbrock43::b4 = 1.093502252409163,
Rosenbrock43::e1 = -0.2815431932141155,
Rosenbrock43::e2 = -0.0727619912493892,
Rosenbrock43::e3 = -0.1082196201495311,
Rosenbrock43::e4 = -1.093502252409163,
Rosenbrock43::gamma = 0.57282,
Rosenbrock43::c2 = 1.14564,
Rosenbrock43::c3 = 0.65521686381559,
Rosenbrock43::d1 = 0.57282,
Rosenbrock43::d2 = -1.769193891319233,
Rosenbrock43::d3 = 0.7592633437920482,
Rosenbrock43::d4 = -0.1049021087100450;
// Constants by Shampine
// More accurate than the L-Stable coefficients for small step-size
// but less stable for large step-size
Rosenbrock34::a21 = 2,
Rosenbrock34::a31 = 48.0/25.0,
Rosenbrock34::a32 = 6.0/25.0,
Rosenbrock34::c21 = -8,
Rosenbrock34::c31 = 372.0/25.0,
Rosenbrock34::c32 = 12.0/5.0,
Rosenbrock34::c41 = -112.0/125.0,
Rosenbrock34::c42 = -54.0/125.0,
Rosenbrock34::c43 = -2.0/5.0,
Rosenbrock34::b1 = 19.0/9.0,
Rosenbrock34::b2 = 1.0/2.0,
Rosenbrock34::b3 = 25.0/108.0,
Rosenbrock34::b4 = 125.0/108.0,
Rosenbrock34::e1 = 34.0/108.0,
Rosenbrock34::e2 = 7.0/36.0,
Rosenbrock34::e3 = 0,
Rosenbrock34::e4 = 125.0/108.0,
Rosenbrock34::gamma = 1.0/2.0,
Rosenbrock34::c2 = 1,
Rosenbrock34::c3 = 3.0/5.0,
Rosenbrock34::d1 = 1.0/2.0,
Rosenbrock34::d2 = -3.0/2.0,
Rosenbrock34::d3 = 605.0/250.0,
Rosenbrock34::d4 = 29.0/250.0;
/*
Rosenbrock43::a21 = 2,
Rosenbrock43::a31 = 48.0/25.0,
Rosenbrock43::a32 = 6.0/25.0,
Rosenbrock43::c21 = -8,
Rosenbrock43::c31 = 372.0/25.0,
Rosenbrock43::c32 = 12.0/5.0,
Rosenbrock43::c41 = -112.0/125.0,
Rosenbrock43::c42 = -54.0/125.0,
Rosenbrock43::c43 = -2.0/5.0,
Rosenbrock43::b1 = 19.0/9.0,
Rosenbrock43::b2 = 1.0/2.0,
Rosenbrock43::b3 = 25.0/108.0,
Rosenbrock43::b4 = 125.0/108.0,
Rosenbrock43::e1 = 34.0/108.0,
Rosenbrock43::e2 = 7.0/36.0,
Rosenbrock43::e3 = 0,
Rosenbrock43::e4 = 125.0/108.0,
Rosenbrock43::gamma = 1.0/2.0,
Rosenbrock43::c2 = 1,
Rosenbrock43::c3 = 3.0/5.0,
Rosenbrock43::d1 = 1.0/2.0,
Rosenbrock43::d2 = -3.0/2.0,
Rosenbrock43::d3 = 605.0/250.0,
Rosenbrock43::d4 = 29.0/250.0;
// L-Stable constants from Hairer et. al.
Rosenbrock34::a21 = 2,
Rosenbrock34::a31 = 1.867943637803922,
Rosenbrock34::a32 = 0.2344449711399156,
Rosenbrock34::c21 = -7.137615036412310,
Rosenbrock34::c31 = 2.580708087951457,
Rosenbrock34::c32 = 0.6515950076447975,
Rosenbrock34::c41 = -2.137148994382534,
Rosenbrock34::c42 = -0.3214669691237626,
Rosenbrock34::c43 = -0.6949742501781779,
Rosenbrock34::b1 = 2.255570073418735,
Rosenbrock34::b2 = 0.2870493262186792,
Rosenbrock34::b3 = 0.435317943184018,
Rosenbrock34::b4 = 1.093502252409163,
Rosenbrock34::e1 = -0.2815431932141155,
Rosenbrock34::e2 = -0.0727619912493892,
Rosenbrock34::e3 = -0.1082196201495311,
Rosenbrock34::e4 = -1.093502252409163,
Rosenbrock34::gamma = 0.57282,
Rosenbrock34::c2 = 1.14564,
Rosenbrock34::c3 = 0.65521686381559,
Rosenbrock34::d1 = 0.57282,
Rosenbrock34::d2 = -1.769193891319233,
Rosenbrock34::d3 = 0.7592633437920482,
Rosenbrock34::d4 = -0.1049021087100450;
*/
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::Rosenbrock43::Rosenbrock43(const ODESystem& ode, const dictionary& dict)
Foam::Rosenbrock34::Rosenbrock34(const ODESystem& ode, const dictionary& dict)
:
ODESolver(ode, dict),
adaptiveSolver(ode, dict),
......@@ -124,7 +124,7 @@ Foam::Rosenbrock43::Rosenbrock43(const ODESystem& ode, const dictionary& dict)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::Rosenbrock43::solve
Foam::scalar Foam::Rosenbrock34::solve
(
const scalar x0,
const scalarField& y0,
......@@ -205,7 +205,7 @@ Foam::scalar Foam::Rosenbrock43::solve
}
void Foam::Rosenbrock43::solve
void Foam::Rosenbrock34::solve
(
scalar& x,
scalarField& y,
......
......@@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::Rosenbrock43
Foam::Rosenbrock34
Description
L-stable embedded Rosenbrock ODE solver of order (3)4.
......@@ -45,15 +45,15 @@ Description
with which the scheme is more accurate than with the L-Stable coefficients
for small step-size but less stable for large step-size.
The L-Stable scheme constants are provided commented-out in Rosenbrock43.C
The L-Stable scheme constants are provided commented-out in Rosenbrock34.C
SourceFiles
Rosenbrock43.C
Rosenbrock34.C
\*---------------------------------------------------------------------------*/
#ifndef Rosenbrock43_H
#define Rosenbrock43_H
#ifndef Rosenbrock34_H
#define Rosenbrock34_H
#include "ODESolver.H"
#include "adaptiveSolver.H"
......@@ -64,10 +64,10 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class Rosenbrock43 Declaration
Class Rosenbrock34 Declaration
\*---------------------------------------------------------------------------*/
class Rosenbrock43
class Rosenbrock34
:
public ODESolver,
public adaptiveSolver
......@@ -99,13 +99,13 @@ class Rosenbrock43
public:
//- Runtime type information
TypeName("Rosenbrock43");
TypeName("Rosenbrock34");
// Constructors
//- Construct from ODE
Rosenbrock43(const ODESystem& ode, const dictionary& dict);
Rosenbrock34(const ODESystem& ode, const dictionary& dict);
// Member Functions
......
......@@ -23,35 +23,35 @@ License
\*---------------------------------------------------------------------------*/
#include "rodas32.H"
#include "rodas23.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(rodas32, 0);
addToRunTimeSelectionTable(ODESolver, rodas32, dictionary);
defineTypeNameAndDebug(rodas23, 0);
addToRunTimeSelectionTable(ODESolver, rodas23, dictionary);
const scalar
rodas32::c3 = 1,
rodas32::d1 = 1.0/2.0,
rodas32::d2 = 3.0/2.0,
rodas32::a31 = 2,
rodas32::a41 = 2,
rodas32::c21 = 4,
rodas32::c31 = 1,
rodas32::c32 = -1,
rodas32::c41 = 1,
rodas32::c42 = -1,
rodas32::c43 = -8.0/3.0,
rodas32::gamma = 1.0/2.0;
rodas23::c3 = 1,
rodas23::d1 = 1.0/2.0,
rodas23::d2 = 3.0/2.0,
rodas23::a31 = 2,
rodas23::a41 = 2,
rodas23::c21 = 4,
rodas23::c31 = 1,
rodas23::c32 = -1,
rodas23::c41 = 1,
rodas23::c42 = -1,
rodas23::c43 = -8.0/3.0,
rodas23::gamma = 1.0/2.0;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::rodas32::rodas32(const ODESystem& ode, const dictionary& dict)
Foam::rodas23::rodas23(const ODESystem& ode, const dictionary& dict)
:
ODESolver(ode, dict),
adaptiveSolver(ode, dict),
......@@ -70,7 +70,7 @@ Foam::rodas32::rodas32(const ODESystem& ode, const dictionary& dict)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::rodas32::solve
Foam::scalar Foam::rodas23::solve
(
const scalar x0,
const scalarField& y0,
......@@ -150,7 +150,7 @@ Foam::scalar Foam::rodas32::solve
}
void Foam::rodas32::solve
void Foam::rodas23::solve
(
scalar& x,
scalarField& y,
......
......@@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::rodas32
Foam::rodas23
Description
L-stable, stiffly-accurate embedded Rosenbrock ODE solver of order (2)3.
......@@ -42,12 +42,12 @@ Description
\endverbatim
SourceFiles
rodas32.C
rodas23.C
\*---------------------------------------------------------------------------*/
#ifndef rodas32_H
#define rodas32_H
#ifndef rodas23_H
#define rodas23_H
#include "ODESolver.H"
#include "adaptiveSolver.H"
......@@ -58,10 +58,10 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class rodas32 Declaration
Class rodas23 Declaration
\*---------------------------------------------------------------------------*/
class rodas32
class rodas23
:
public ODESolver,
public adaptiveSolver
......@@ -91,13 +91,13 @@ class rodas32
public: