Commit 143d3f79 authored by Chris Cantwell's avatar Chris Cantwell

Merge branch 'tidy/TimeIntegratorCleanUp' into 'master'

removed the time integration enum and added a time stability

See merge request !1103
parents 45ef448c 0e11cf92
Pipeline #1335 failed with stages
in 1 minute and 40 seconds
...@@ -338,8 +338,7 @@ int main(int argc, char *argv[]) ...@@ -338,8 +338,7 @@ int main(int argc, char *argv[])
"step).\n"; "step).\n";
outfile << "#\n"; outfile << "#\n";
outfile << "# Delta T: " << dt << "\n"; outfile << "# Delta T: " << dt << "\n";
outfile << "# Method: " << TimeIntegrationScheme::nameFromMethod( outfile << "# Method: " << tiScheme->GetName()
tiScheme->GetIntegrationMethod())
<< "\n"; << "\n";
outfile << "#\n"; outfile << "#\n";
outfile << "# There are 3 columns with the following headers:\n"; outfile << "# There are 3 columns with the following headers:\n";
...@@ -372,8 +371,7 @@ int main(int argc, char *argv[]) ...@@ -372,8 +371,7 @@ int main(int argc, char *argv[])
<< "\n"; << "\n";
// Some more writing out the results // Some more writing out the results
solver->GenerateGnuplotScript(TimeIntegrationScheme::nameFromMethod( solver->GenerateGnuplotScript(tiScheme->GetName());
tiScheme->GetIntegrationMethod()));
outfile.close(); outfile.close();
delete solver; delete solver;
......
...@@ -34,6 +34,10 @@ ...@@ -34,6 +34,10 @@
// //
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Note : If adding a new integrator be sure to register the
// integrator with the Time Integration Scheme Facatory in
// SchemeInitializor.cpp.
#pragma once #pragma once
#define LUE LIB_UTILITIES_EXPORT #define LUE LIB_UTILITIES_EXPORT
...@@ -80,14 +84,18 @@ public: ...@@ -80,14 +84,18 @@ public:
static std::string className; static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const LUE virtual std::string GetName() const
{ {
return TimeIntegrationMethod::eAdamsBashforthOrder2; return std::string("AdamsBashforthOrder2");
}
LUE virtual NekDouble GetTimeStability() const
{
return 1.0;
} }
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase) LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{ {
phase->m_method = TimeIntegrationMethod::eAdamsBashforthOrder2;
phase->m_schemeType = eExplicit; phase->m_schemeType = eExplicit;
phase->m_numstages = 1; phase->m_numstages = 1;
...@@ -172,14 +180,18 @@ public: ...@@ -172,14 +180,18 @@ public:
static std::string className; static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const LUE virtual std::string GetName() const
{
return std::string("AdamsBashforthOrder3");
}
LUE virtual NekDouble GetTimeStability() const
{ {
return TimeIntegrationMethod::eAdamsBashforthOrder3; return 1.0;
} }
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase) LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{ {
phase->m_method = TimeIntegrationMethod::eAdamsBashforthOrder3;
phase->m_schemeType = eExplicit; phase->m_schemeType = eExplicit;
phase->m_numsteps = 4; phase->m_numsteps = 4;
...@@ -275,14 +287,18 @@ public: ...@@ -275,14 +287,18 @@ public:
static std::string className; static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const LUE virtual std::string GetName() const
{
return std::string("AdamsBashforthOrder4");
}
LUE virtual NekDouble GetTimeStability() const
{ {
return TimeIntegrationMethod::eAdamsBashforthOrder4; return 1.0;
} }
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase) LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{ {
phase->m_method = TimeIntegrationMethod::eAdamsBashforthOrder4;
phase->m_schemeType = eExplicit; phase->m_schemeType = eExplicit;
phase->m_numsteps = 5; phase->m_numsteps = 5;
......
...@@ -34,6 +34,10 @@ ...@@ -34,6 +34,10 @@
// //
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Note : If adding a new integrator be sure to register the
// integrator with the Time Integration Scheme Facatory in
// SchemeInitializor.cpp.
#pragma once #pragma once
#define LUE LIB_UTILITIES_EXPORT #define LUE LIB_UTILITIES_EXPORT
...@@ -75,9 +79,14 @@ public: ...@@ -75,9 +79,14 @@ public:
static std::string className; static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const LUE virtual std::string GetName() const
{
return std::string("AdamsMoultonOrder1");
}
LUE virtual NekDouble GetTimeStability() const
{ {
return TimeIntegrationMethod::eAdamsMoultonOrder1; return 1.0;
} }
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase) LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
...@@ -120,15 +129,19 @@ public: ...@@ -120,15 +129,19 @@ public:
static std::string className; static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const LUE virtual std::string GetName() const
{
return std::string("AdamsMoultonOrder2");
}
LUE virtual NekDouble GetTimeStability() const
{ {
return TimeIntegrationMethod::eAdamsMoultonOrder2; return 1.0;
} }
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase) LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{ {
phase->m_schemeType = eDiagonallyImplicit; phase->m_schemeType = eDiagonallyImplicit;
phase->m_method = TimeIntegrationMethod::eAdamsMoultonOrder2;
phase->m_numsteps = 2; phase->m_numsteps = 2;
phase->m_numstages = 1; phase->m_numstages = 1;
......
...@@ -34,6 +34,10 @@ ...@@ -34,6 +34,10 @@
// //
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Note : If adding a new integrator be sure to register the
// integrator with the Time Integration Scheme Facatory in
// SchemeInitializor.cpp.
#pragma once #pragma once
#define LUE LIB_UTILITIES_EXPORT #define LUE LIB_UTILITIES_EXPORT
...@@ -75,9 +79,14 @@ public: ...@@ -75,9 +79,14 @@ public:
static std::string className; static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const LUE virtual std::string GetName() const
{
return std::string("BDFImplicitOrder1");
}
LUE virtual NekDouble GetTimeStability() const
{ {
return TimeIntegrationMethod::eBDFImplicitOrder1; return 1.0;
} }
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase) LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
...@@ -120,14 +129,18 @@ public: ...@@ -120,14 +129,18 @@ public:
static std::string className; static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const LUE virtual std::string GetName() const
{
return std::string("BDFImplicitOrder2");
}
LUE virtual NekDouble GetTimeStability() const
{ {
return TimeIntegrationMethod::eBDFImplicitOrder2; return 1.0;
} }
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase) LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{ {
phase->m_method = TimeIntegrationMethod::eBDFImplicitOrder2;
phase->m_schemeType = eDiagonallyImplicit; phase->m_schemeType = eDiagonallyImplicit;
phase->m_numsteps = 2; phase->m_numsteps = 2;
......
...@@ -33,6 +33,10 @@ ...@@ -33,6 +33,10 @@
// //
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Note : If adding a new integrator be sure to register the
// integrator with the Time Integration Scheme Facatory in
// SchemeInitializor.cpp.
#pragma once #pragma once
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h> #include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
...@@ -79,14 +83,18 @@ public: ...@@ -79,14 +83,18 @@ public:
static std::string className; static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const LUE virtual std::string GetName() const
{
return std::string("CNAB");
}
LUE virtual NekDouble GetTimeStability() const
{ {
return TimeIntegrationMethod::eCNAB; return 1.0;
} }
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase) LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{ {
phase->m_method = TimeIntegrationMethod::eCNAB;
phase->m_schemeType = eIMEX; phase->m_schemeType = eIMEX;
phase->m_numsteps = 4; phase->m_numsteps = 4;
......
...@@ -34,6 +34,10 @@ ...@@ -34,6 +34,10 @@
// //
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Note : If adding a new integrator be sure to register the
// integrator with the Time Integration Scheme Facatory in
// SchemeInitializor.cpp.
#pragma once #pragma once
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h> #include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
...@@ -74,14 +78,18 @@ public: ...@@ -74,14 +78,18 @@ public:
static std::string className; static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const LUE virtual std::string GetName() const
{
return std::string("IMEXdirk_3_4_3");
}
LUE virtual NekDouble GetTimeStability() const
{ {
return TimeIntegrationMethod::eIMEXdirk_3_4_3; return 1.0;
} }
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase) LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{ {
phase->m_method = TimeIntegrationMethod::eIMEXdirk_3_4_3;
phase->m_schemeType = eDiagonallyImplicit; phase->m_schemeType = eDiagonallyImplicit;
phase->m_numsteps = 1; phase->m_numsteps = 1;
...@@ -156,14 +164,18 @@ public: ...@@ -156,14 +164,18 @@ public:
static std::string className; static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const LUE virtual std::string GetName() const
{
return std::string("DIRKOrder3");
}
LUE virtual NekDouble GetTimeStability() const
{ {
return TimeIntegrationMethod::eDIRKOrder3; return 1.0;
} }
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase) LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{ {
phase->m_method = TimeIntegrationMethod::eDIRKOrder3;
phase->m_schemeType = eDiagonallyImplicit; phase->m_schemeType = eDiagonallyImplicit;
phase->m_numsteps = 1; phase->m_numsteps = 1;
......
...@@ -34,6 +34,10 @@ ...@@ -34,6 +34,10 @@
// //
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Note : If adding a new integrator be sure to register the
// integrator with the Time Integration Scheme Facatory in
// SchemeInitializor.cpp.
#pragma once #pragma once
#define LUE LIB_UTILITIES_EXPORT #define LUE LIB_UTILITIES_EXPORT
...@@ -75,14 +79,18 @@ public: ...@@ -75,14 +79,18 @@ public:
static std::string className; static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const LUE virtual std::string GetName() const
{
return std::string("BackwardEuler");
}
LUE virtual NekDouble GetTimeStability() const
{ {
return TimeIntegrationMethod::eBackwardEuler; return 1.0;
} }
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase) LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{ {
phase->m_method = TimeIntegrationMethod::eBackwardEuler;
phase->m_schemeType = eDiagonallyImplicit; phase->m_schemeType = eDiagonallyImplicit;
phase->m_numsteps = 1; phase->m_numsteps = 1;
...@@ -149,14 +157,18 @@ public: ...@@ -149,14 +157,18 @@ public:
static std::string className; static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const LUE virtual std::string GetName() const
{
return std::string("ForwardEuler");
}
LUE virtual NekDouble GetTimeStability() const
{ {
return TimeIntegrationMethod::eForwardEuler; return 2.784;
} }
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase) LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{ {
phase->m_method = TimeIntegrationMethod::eForwardEuler;
phase->m_schemeType = eExplicit; phase->m_schemeType = eExplicit;
phase->m_numsteps = 1; phase->m_numsteps = 1;
......
...@@ -33,6 +33,10 @@ ...@@ -33,6 +33,10 @@
// //
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Note : If adding a new integrator be sure to register the
// integrator with the Time Integration Scheme Facatory in
// SchemeInitializor.cpp.
#pragma once #pragma once
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h> #include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
...@@ -74,14 +78,18 @@ public: ...@@ -74,14 +78,18 @@ public:
static std::string className; static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const LUE virtual std::string GetName() const
{
return std::string("IMEXGear");
}
LUE virtual NekDouble GetTimeStability() const
{ {
return TimeIntegrationMethod::eIMEXGear; return 1.0;
} }
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase) LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{ {
phase->m_method = TimeIntegrationMethod::eIMEXGear;
phase->m_schemeType = eIMEX; phase->m_schemeType = eIMEX;
phase->m_numsteps = 3; phase->m_numsteps = 3;
......
...@@ -34,6 +34,10 @@ ...@@ -34,6 +34,10 @@
// //
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Note : If adding a new integrator be sure to register the
// integrator with the Time Integration Scheme Facatory in
// SchemeInitializor.cpp.
#pragma once #pragma once
#define LUE LIB_UTILITIES_EXPORT #define LUE LIB_UTILITIES_EXPORT
...@@ -75,14 +79,18 @@ public: ...@@ -75,14 +79,18 @@ public:
static std::string className; static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const LUE virtual std::string GetName() const
{
return std::string("IMEXOrder1");
}
LUE virtual NekDouble GetTimeStability() const
{ {
return TimeIntegrationMethod::eIMEXOrder1; return 1.0;
} }
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase) LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{ {
phase->m_method = TimeIntegrationMethod::eIMEXOrder1;
phase->m_schemeType = eIMEX; phase->m_schemeType = eIMEX;
phase->m_numstages = 1; phase->m_numstages = 1;
...@@ -164,14 +172,18 @@ public: ...@@ -164,14 +172,18 @@ public:
static std::string className; static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const LUE virtual std::string GetName() const
{
return std::string("IMEXOrder2");
}
LUE virtual NekDouble GetTimeStability() const
{ {
return TimeIntegrationMethod::eIMEXOrder2; return 1.0;
} }
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase) LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{ {
phase->m_method = TimeIntegrationMethod::eIMEXOrder2;
phase->m_schemeType = eIMEX; phase->m_schemeType = eIMEX;
phase->m_numsteps = 4; phase->m_numsteps = 4;
...@@ -269,14 +281,18 @@ public: ...@@ -269,14 +281,18 @@ public:
static std::string className; static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const LUE virtual std::string GetName() const
{ {
return TimeIntegrationMethod::eIMEXOrder3; return std::string("IMEXOrder3");
}
LUE virtual NekDouble GetTimeStability() const
{
return 1.0;
} }
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase) LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{ {
phase->m_method = TimeIntegrationMethod::eIMEXOrder3;
phase->m_schemeType = eIMEX; phase->m_schemeType = eIMEX;
phase->m_numsteps = 6; phase->m_numsteps = 6;
...@@ -386,15 +402,18 @@ public: ...@@ -386,15 +402,18 @@ public:
static std::string className; static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const LUE virtual std::string GetName() const
{ {
return TimeIntegrationMethod::eIMEXOrder4; return std::string("IMEXOrder4");
} }
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase) LUE virtual NekDouble GetTimeStability() const
{ {
return 1.0;
}