...
 
Commits (2)
......@@ -84,6 +84,7 @@
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#include <LibUtilities/TimeIntegration/TimeIntegrationSchemeOperators.h>
#include <LibUtilities/TimeIntegration/TimeIntegrationSolution.h>
///////////////////////////////////////////////////////////////////////////////////////////////
......
#pragma once
///////////////////////////////////////////////////////////////////////////////
//
// File: AdamsBashforthTimeIntegrationSchemes.h
......@@ -36,20 +34,14 @@
//
///////////////////////////////////////////////////////////////////////////////
#define LUE LIB_UTILITIES_EXPORT
#pragma once
///////////////////////////////////////////////////////////////////////////////
#define LUE LIB_UTILITIES_EXPORT
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#include <LibUtilities/TimeIntegration/EulerTimeIntegrationSchemes.h>
#include <LibUtilities/TimeIntegration/RungeKuttaTimeIntegrationSchemes.h>
///////////////////////////////////////////////////////////////////////////////
// For debugging:
#include <iostream>
namespace Nektar
{
namespace LibUtilities
......@@ -63,10 +55,6 @@ class AdamsBashforthOrder2TimeIntegrationScheme : public TimeIntegrationScheme
public:
AdamsBashforthOrder2TimeIntegrationScheme() : TimeIntegrationScheme()
{
std::cout
<< "AdamsBashforthOrder2TimeIntegrationScheme Construtor: this is "
<< this << "\n";
m_integration_phases = TimeIntegrationSchemeDataVector(2);
m_integration_phases[0] = TimeIntegrationSchemeDataSharedPtr(
new TimeIntegrationSchemeData(this));
......@@ -74,8 +62,7 @@ public:
new TimeIntegrationSchemeData(this));
ForwardEulerTimeIntegrationScheme::SetupSchemeData(
m_integration_phases[0]); // FIXME... need the correct initial
// phase.... (eForwardEuler)
m_integration_phases[0]);
AdamsBashforthOrder2TimeIntegrationScheme::SetupSchemeData(
m_integration_phases[1]);
}
......@@ -84,35 +71,22 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create() // FYI, the create() function
// is called by the Factory.
static TimeIntegrationSchemeSharedPtr create()
{
std::cout << "AdamsBashforthOrder2TimeIntegrationScheme::create()\n";
TimeIntegrationSchemeSharedPtr p = MemoryManager<
AdamsBashforthOrder2TimeIntegrationScheme>::AllocateSharedPtr();
return p;
}
static std::string className; // Is set to "AdamsBashforthOrder2" in
// SchemeInitializor.cpp during program start
// up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eAdamsBashforthOrder2;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
std::cout
<< "AdamsBashforthOrder2TimeIntegrationScheme::SetupSchemeData()\n";
phase->m_method = TimeIntegrationMethod::eAdamsBashforthOrder2;
phase->m_schemeType = eExplicit;
......@@ -189,8 +163,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p = MemoryManager<
......@@ -198,18 +170,13 @@ public:
return p;
}
static std::string
className; // Is set in SchemeInitializor.cpp during program start up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eAdamsBashforthOrder3;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_method = TimeIntegrationMethod::eAdamsBashforthOrder3;
......@@ -299,8 +266,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p = MemoryManager<
......@@ -308,18 +273,13 @@ public:
return p;
}
static std::string
className; // Is set in SchemeInitializor.cpp during program start up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eAdamsBashforthOrder4;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_method = TimeIntegrationMethod::eAdamsBashforthOrder4;
......
#pragma once
///////////////////////////////////////////////////////////////////////////////
//
// File: CNABTimeIntegrationScheme.h
......@@ -35,18 +33,13 @@
//
///////////////////////////////////////////////////////////////////////////////
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#pragma once
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#include <LibUtilities/TimeIntegration/IMEXdirkTimeIntegrationSchemes.h>
#include <iostream>
///////////////////////////////////////////////////////////////////////////////
#define LUE LIB_UTILITIES_EXPORT
///////////////////////////////////////////////////////////////////////////////
namespace Nektar
{
namespace LibUtilities
......@@ -57,7 +50,6 @@ class CNABTimeIntegrationScheme : public TimeIntegrationScheme
public:
CNABTimeIntegrationScheme() : TimeIntegrationScheme()
{
std::cout << "creating a CNABTimeIntegrationScheme\n";
m_integration_phases = TimeIntegrationSchemeDataVector(3);
m_integration_phases[0] = TimeIntegrationSchemeDataSharedPtr(
new TimeIntegrationSchemeData(this));
......@@ -78,11 +70,8 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
std::cout << "CNABTimeIntegrationScheme::create()\n";
TimeIntegrationSchemeSharedPtr p =
MemoryManager<CNABTimeIntegrationScheme>::AllocateSharedPtr();
return p;
......@@ -90,19 +79,13 @@ public:
static std::string className;
//////////////
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eCNAB;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
std::cout << "SetupSchemeData for CNABTimeIntegrationScheme\n";
phase->m_method = TimeIntegrationMethod::eCNAB;
phase->m_schemeType = eIMEX;
......
#pragma once
///////////////////////////////////////////////////////////////////////////////
//
// File: DIRKTimeIntegrationSchemes.h
......@@ -36,14 +34,12 @@
//
///////////////////////////////////////////////////////////////////////////////
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#pragma once
///////////////////////////////////////////////////////////////////////////////
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#define LUE LIB_UTILITIES_EXPORT
///////////////////////////////////////////////////////////////////////////////
namespace Nektar
{
namespace LibUtilities
......@@ -69,30 +65,20 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
std::cout << "DIRKOrder2TimeIntegrationScheme::create()\n";
TimeIntegrationSchemeSharedPtr p =
MemoryManager<DIRKOrder2TimeIntegrationScheme>::AllocateSharedPtr();
return p;
}
static std::string className; // Is set to "DIRKOrder2" in
// SchemeInitializor.cpp during program start
// up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eIMEXdirk_3_4_3;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_method = TimeIntegrationMethod::eIMEXdirk_3_4_3;
......@@ -161,8 +147,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p =
......@@ -170,19 +154,13 @@ public:
return p;
}
static std::string className; // Is set to "DIRKOrder3" in
// SchemeInitializor.cpp during program start
// up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eDIRKOrder3;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_method = TimeIntegrationMethod::eDIRKOrder3;
......
#pragma once
///////////////////////////////////////////////////////////////////////////////
//
// File: EulerTimeIntegrationSchemes.h
......@@ -36,15 +34,13 @@
//
///////////////////////////////////////////////////////////////////////////////
#define LUE LIB_UTILITIES_EXPORT
#pragma once
///////////////////////////////////////////////////////////////////////////////
#define LUE LIB_UTILITIES_EXPORT
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#include <LibUtilities/TimeIntegration/TimeIntegrationSchemeData.h>
///////////////////////////////////////////////////////////////////////////////
namespace Nektar
{
namespace LibUtilities
......@@ -70,29 +66,20 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
std::cout << "BackwardEulerTimeIntegrationScheme::create()\n";
TimeIntegrationSchemeSharedPtr p = MemoryManager<
BackwardEulerTimeIntegrationScheme>::AllocateSharedPtr();
return p;
}
static std::string className; // Is set to "BackwardEuler" in
// SchemeInitializor.cpp during program start
// up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eBackwardEuler;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_method = TimeIntegrationMethod::eBackwardEuler;
......@@ -153,33 +140,22 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
std::cout << "ForwardEulerTimeIntegrationScheme::create()\n";
TimeIntegrationSchemeSharedPtr p = MemoryManager<
ForwardEulerTimeIntegrationScheme>::AllocateSharedPtr();
return p;
}
static std::string className; // Is set to "ForwardEuler" in
// SchemeInitializor.cpp during program start
// up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eForwardEuler;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
std::cout << "ForwardEulerTimeIntegrationScheme::SetupSchemeData()\n";
phase->m_method = TimeIntegrationMethod::eForwardEuler;
phase->m_schemeType = eExplicit;
......
......@@ -34,18 +34,11 @@
// Description: Combined header file for all basic IMEX time integration
// schemes.
//
///////////////////////////////////////////////////////////////////////////////
#define LUE LIB_UTILITIES_EXPORT
///////////////////////////////////////////////////////////////////////////////
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#include <LibUtilities/TimeIntegration/IMEXdirkTimeIntegrationSchemes.h>
///////////////////////////////////////////////////////////////////////////////
namespace Nektar
{
namespace LibUtilities
......@@ -71,9 +64,6 @@ public:
{
}
/////////////
// The create() function is called by the Factory.
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p =
......@@ -81,19 +71,13 @@ public:
return p;
}
static std::string className; // Will be set to "IMEXOrder1" in
// SchemeInitializor.cpp during program start
// up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eIMEXOrder1;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_method = TimeIntegrationMethod::eIMEXOrder1;
......@@ -153,55 +137,38 @@ class IMEXOrder2TimeIntegrationScheme : public TimeIntegrationScheme
public:
IMEXOrder2TimeIntegrationScheme() : TimeIntegrationScheme()
{
std::cout << "IMEXOrder2TimeIntegrationScheme Construtor: this is "
<< this << "\n";
m_integration_phases = TimeIntegrationSchemeDataVector(2);
m_integration_phases[0] = TimeIntegrationSchemeDataSharedPtr(
new TimeIntegrationSchemeData(this));
m_integration_phases[1] = TimeIntegrationSchemeDataSharedPtr(
new TimeIntegrationSchemeData(this));
// IMEXdirk_2_3_2TimeIntegrationScheme::SetupSchemeData(
// m_integration_phases[0] ); // Setup 1st part using ???? FIXME...
// should be dirk or imex order 1?
IMEXOrder1TimeIntegrationScheme::SetupSchemeData(
m_integration_phases[0]); // Setup 1st part using ???? FIXME...
// should be dirk or imex order 1?
m_integration_phases[0]);
IMEXOrder2TimeIntegrationScheme::SetupSchemeData(
m_integration_phases[1]); // Setup 2nd part using IMEX Order 2
m_integration_phases[1]);
}
virtual ~IMEXOrder2TimeIntegrationScheme()
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
std::cout << "IMEXOrder2TimeIntegrationScheme::create()\n";
TimeIntegrationSchemeSharedPtr p =
MemoryManager<IMEXOrder2TimeIntegrationScheme>::AllocateSharedPtr();
return p;
}
static std::string className; // Will be set in SchemeInitializor.cpp during
// program start up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eIMEXOrder2;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
std::cout << "IMEXOrder2TimeIntegrationScheme::SetupSchemeData()\n";
phase->m_method = TimeIntegrationMethod::eIMEXOrder2;
phase->m_schemeType = eIMEX;
......@@ -271,9 +238,6 @@ class IMEXOrder3TimeIntegrationScheme : public TimeIntegrationScheme
public:
IMEXOrder3TimeIntegrationScheme() : TimeIntegrationScheme()
{
std::cout << "IMEXOrder3TimeIntegrationScheme Construtor: this is "
<< this << "\n";
m_integration_phases = TimeIntegrationSchemeDataVector(3);
m_integration_phases[0] = TimeIntegrationSchemeDataSharedPtr(
new TimeIntegrationSchemeData(this));
......@@ -288,36 +252,26 @@ public:
m_integration_phases[1]);
IMEXOrder3TimeIntegrationScheme::SetupSchemeData(
m_integration_phases[2]);
std::cout << "done with IMEXOrder3TimeIntegrationScheme constructor\n";
}
virtual ~IMEXOrder3TimeIntegrationScheme()
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
std::cout << "IMEXOrder3TimeIntegrationScheme::create()\n";
TimeIntegrationSchemeSharedPtr p =
MemoryManager<IMEXOrder3TimeIntegrationScheme>::AllocateSharedPtr();
return p;
}
static std::string className; // Will be set in SchemeInitializor.cpp during
// program start up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eIMEXOrder3;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_method = TimeIntegrationMethod::eIMEXOrder3;
......@@ -397,9 +351,6 @@ class IMEXOrder4TimeIntegrationScheme : public TimeIntegrationScheme
public:
IMEXOrder4TimeIntegrationScheme() : TimeIntegrationScheme()
{
std::cout << "IMEXOrder4TimeIntegrationScheme Construtor: this is "
<< this << "\n";
m_integration_phases = TimeIntegrationSchemeDataVector(4);
m_integration_phases[0] = TimeIntegrationSchemeDataSharedPtr(
new TimeIntegrationSchemeData(this));
......@@ -418,36 +369,26 @@ public:
m_integration_phases[2]);
IMEXOrder4TimeIntegrationScheme::SetupSchemeData(
m_integration_phases[3]);
std::cout << "done with IMEXOrder4TimeIntegrationScheme constructor\n";
}
virtual ~IMEXOrder4TimeIntegrationScheme()
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
std::cout << "IMEXOrder4TimeIntegrationScheme::create()\n";
TimeIntegrationSchemeSharedPtr p =
MemoryManager<IMEXOrder4TimeIntegrationScheme>::AllocateSharedPtr();
return p;
}
static std::string className; // Will be set in SchemeInitializor.cpp during
// program start up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eIMEXOrder4;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
......
#pragma once
///////////////////////////////////////////////////////////////////////////////
//
// File: IMEXdirkTimeIntegrationSchemes.h
......@@ -36,14 +34,12 @@
//
///////////////////////////////////////////////////////////////////////////////
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#pragma once
///////////////////////////////////////////////////////////////////////////////
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#define LUE LIB_UTILITIES_EXPORT
///////////////////////////////////////////////////////////////////////////////
namespace Nektar
{
namespace LibUtilities
......@@ -69,8 +65,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p = MemoryManager<
......@@ -78,19 +72,13 @@ public:
return p;
}
static std::string className; // Is set to "IMEXdirk_1_2_1" in
// SchemeInitializor.cpp during program start
// up.
//////////////
static std::string className;
LUE TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eIMEXdirk_1_2_1;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_method = TimeIntegrationMethod::eIMEXdirk_1_2_1;
......@@ -163,8 +151,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p = MemoryManager<
......@@ -172,18 +158,13 @@ public:
return p;
}
static std::string
className; // Is set in SchemeInitializor.cpp during program start up.
//////////////
static std::string className;
LUE TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eIMEXdirk_1_2_2;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_method = TimeIntegrationMethod::eIMEXdirk_1_2_2;
......@@ -256,8 +237,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p = MemoryManager<
......@@ -265,18 +244,13 @@ public:
return p;
}
static std::string
className; // Is set in SchemeInitializor.cpp during program start up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eIMEXdirk_2_2_2;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_method = TimeIntegrationMethod::eIMEXdirk_2_2_2;
......@@ -359,8 +333,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p = MemoryManager<
......@@ -368,22 +340,15 @@ public:
return p;
}
static std::string
className; // Is set in SchemeInitializor.cpp during program start up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eIMEXdirk_2_3_2;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
std::cout << "IMEXdirk_2_3_2TimeIntegrationScheme::SetupSchemeData()\n";
phase->m_method = TimeIntegrationMethod::eIMEXdirk_2_3_2;
phase->m_schemeType = eIMEX;
......@@ -464,8 +429,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p = MemoryManager<
......@@ -473,22 +436,15 @@ public:
return p;
}
static std::string
className; // Is set in SchemeInitializor.cpp during program start up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eIMEXdirk_2_3_3;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
std::cout << "IMEXdirk_2_3_3TimeIntegrationScheme::SetupSchemeData()\n";
phase->m_method = TimeIntegrationMethod::eIMEXdirk_2_3_3;
phase->m_schemeType = eIMEX;
......@@ -568,8 +524,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p = MemoryManager<
......@@ -577,22 +531,15 @@ public:
return p;
}
static std::string
className; // Is set in SchemeInitializor.cpp during program start up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eIMEXdirk_3_4_3;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
std::cout
<< "SetupSchemeData for IMEXdirk_3_4_3TimeIntegrationScheme\n";
phase->m_method = TimeIntegrationMethod::eIMEXdirk_3_4_3;
phase->m_schemeType = eIMEX;
......@@ -686,8 +633,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p = MemoryManager<
......@@ -695,22 +640,15 @@ public:
return p;
}
static std::string
className; // Is set in SchemeInitializor.cpp during program start up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eIMEXdirk_4_4_3;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
std::cout
<< "SetupSchemeData for IMEXdirk_4_4_3TimeIntegrationScheme\n";
phase->m_method = TimeIntegrationMethod::eIMEXdirk_4_4_3;
phase->m_schemeType = eIMEX;
......
#pragma once
///////////////////////////////////////////////////////////////////////////////
//
// File: RungeKuttaTimeIntegrationSchemes.h
......@@ -36,14 +34,12 @@
//
///////////////////////////////////////////////////////////////////////////////
#define LUE LIB_UTILITIES_EXPORT
#pragma once
///////////////////////////////////////////////////////////////////////////////
#define LUE LIB_UTILITIES_EXPORT
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
///////////////////////////////////////////////////////////////////////////////
namespace Nektar
{
namespace LibUtilities
......@@ -69,8 +65,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p = MemoryManager<
......@@ -78,19 +72,13 @@ public:
return p;
}
static std::string className; // Is set to "RungeKutta2" in
// SchemeInitializor.cpp during program start
// up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eRungeKutta2;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_method = TimeIntegrationMethod::eRungeKutta2;
......@@ -155,8 +143,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p =
......@@ -165,18 +151,13 @@ public:
return p;
}
static std::string
className; // Is set in SchemeInitializor.cpp during program start up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eRungeKutta2_ImprovedEuler;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_method = TimeIntegrationMethod::eRungeKutta2_ImprovedEuler;
......@@ -242,8 +223,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p = MemoryManager<
......@@ -251,24 +230,15 @@ public:
return p;
}
static std::string
className; // Is set in SchemeInitializor.cpp during program start up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eRungeKutta2_SSP;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
// FIXME: Dd: Do it like this? Note, this is never (currently) called
// anyway because of the switch statement in
// TimeIntegrationScheme::TimeIntegrationScheme()...
// FIXME: are these the same things?
RungeKutta2_ImprovedEulerTimeIntegrationScheme::SetupSchemeData(phase);
}
......@@ -294,8 +264,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p = MemoryManager<
......@@ -303,18 +271,13 @@ public:
return p;
}
static std::string
className; // Is set in SchemeInitializor.cpp during program start up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eRungeKutta3_SSP;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_method = TimeIntegrationMethod::eRungeKutta3_SSP;
......@@ -383,28 +346,20 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
std::cout << "RungeKutta5TimeIntegrationScheme::create()\n";
TimeIntegrationSchemeSharedPtr p = MemoryManager<
RungeKutta5TimeIntegrationScheme>::AllocateSharedPtr();
return p;
}
static std::string
className; // Is set in SchemeInitializor.cpp during program start up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eRungeKutta5;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_method = TimeIntegrationMethod::eRungeKutta5;
......@@ -485,28 +440,20 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
std::cout << "ClassicalRungeKutta4TimeIntegrationScheme::create()\n";
TimeIntegrationSchemeSharedPtr p = MemoryManager<
ClassicalRungeKutta4TimeIntegrationScheme>::AllocateSharedPtr();
return p;
}
static std::string
className; // Is set in SchemeInitializor.cpp during program start up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eClassicalRungeKutta4;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_method = TimeIntegrationMethod::eClassicalRungeKutta4;
......
......@@ -38,6 +38,7 @@
using namespace std;
#include <LibUtilities/TimeIntegration/TimeIntegrationSolution.h>
#include <LibUtilities/TimeIntegration/TimeIntegrationSchemeOperators.h>
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#include <LibUtilities/TimeIntegration/TimeIntegrationSchemeData.h>
#include <LibUtilities/BasicConst/NektarUnivConsts.hpp>
......@@ -234,10 +235,8 @@ TimeIntegrationMethod TimeIntegrationScheme::methodFromName(const string &name)
"'" + name +
"' is not a known TimeIntegrationMethod. (Check spelling?)";
NEKERROR(ErrorUtil::efatal, msg);
// return eNoTimeIntegrationMethod;
return eNoTimeIntegrationMethod;
}
return eNoTimeIntegrationMethod; // Note: This line should never be reached,
// but it does remove a compiler warning.
}
string TimeIntegrationScheme::nameFromMethod(const TimeIntegrationMethod method)
......
......@@ -47,12 +47,8 @@
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/LibUtilitiesDeclspec.h>
///////////////////////////////////////////////////////////////////////////////
#define LUE LIB_UTILITIES_EXPORT
///////////////////////////////////////////////////////////////////////////////
namespace Nektar
{
namespace LibUtilities
......@@ -61,6 +57,7 @@ namespace LibUtilities
class TimeIntegrationScheme;
class TimeIntegrationSchemeData;
class TimeIntegrationSolution;
class TimeIntegrationSchemeOperators;
typedef std::shared_ptr<TimeIntegrationScheme> TimeIntegrationSchemeSharedPtr;
......@@ -143,121 +140,6 @@ const char *const TimeIntegrationSchemeTypeMap[] = {
"Implicit"};
/**
* @brief Binds a set of functions for use by time integration schemes.
*/
class TimeIntegrationSchemeOperators
{
public:
typedef const Array<OneD, const Array<OneD, NekDouble>> InArrayType;
typedef Array<OneD, Array<OneD, NekDouble>> OutArrayType;
typedef std::function<void(InArrayType &, OutArrayType &, const NekDouble)>
FunctorType1;
typedef std::function<void(InArrayType &, OutArrayType &, const NekDouble,
const NekDouble)>
FunctorType2;
typedef const FunctorType1 &ConstFunctorType1Ref;
typedef const FunctorType2 &ConstFunctorType2Ref;
typedef Array<OneD, FunctorType1> FunctorType1Array;
typedef Array<OneD, FunctorType2> FunctorType2Array;
TimeIntegrationSchemeOperators(void) : m_functors1(4), m_functors2(1)
{
}
template <typename FuncPointerT, typename ObjectPointerT>
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
{
m_functors1[0] =
std::bind(func, obj, std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3);
}
template <typename FuncPointerT, typename ObjectPointerT>
void DefineOdeExplicitRhs(FuncPointerT func, ObjectPointerT obj)
{
m_functors1[1] =
std::bind(func, obj, std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3);
}
template <typename FuncPointerT, typename ObjectPointerT>
void DefineOdeImplicitRhs(FuncPointerT func, ObjectPointerT obj)
{
m_functors1[2] =
std::bind(func, obj, std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3);
}
template <typename FuncPointerT, typename ObjectPointerT>
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
{
m_functors1[3] =
std::bind(func, obj, std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3);
}
template <typename FuncPointerT, typename ObjectPointerT>
void DefineImplicitSolve(FuncPointerT func, ObjectPointerT obj)
{
m_functors2[0] =
std::bind(func, obj, std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3, std::placeholders::_4);
}
inline void DoOdeRhs(InArrayType &inarray, OutArrayType &outarray,
const NekDouble time) const
{
ASSERTL1(m_functors1[0], "OdeRhs should be defined for this time "
"integration scheme");
m_functors1[0](inarray, outarray, time);
}
inline void DoOdeExplicitRhs(InArrayType &inarray, OutArrayType &outarray,
const NekDouble time) const
{
ASSERTL1(m_functors1[1], "OdeExplicitRhs should be defined for this "
"time integration scheme");
m_functors1[1](inarray, outarray, time);
}
inline void DoOdeImplicitRhs(InArrayType &inarray, OutArrayType &outarray,
const NekDouble time) const
{
ASSERTL1(m_functors1[2], "OdeImplictRhs should be defined for this "
"time integration scheme");
m_functors1[2](inarray, outarray, time);
}
inline void DoProjection(InArrayType &inarray, OutArrayType &outarray,
const NekDouble time) const
{
ASSERTL1(m_functors1[3], "Projection operation should be defined for "
"this time integration scheme");
m_functors1[3](inarray, outarray, time);
}
inline void DoImplicitSolve(InArrayType &inarray, OutArrayType &outarray,
const NekDouble time,
const NekDouble lambda) const
{
ASSERTL1(m_functors2[0], "ImplicitSolve should be defined for this "
"time integration scheme");
m_functors2[0](inarray, outarray, time, lambda);
}
protected:
FunctorType1Array m_functors1;
FunctorType2Array m_functors2;
private:
}; // end class TimeIntegrationSchemeOperators()
/**
* @brief Base class for time integration schemes.
*/
......@@ -313,9 +195,13 @@ public:
TimeIntegrationSchemeType GetIntegrationSchemeType() const;
static const char *const TimeIntegrationMethodMap[36];
protected:
friend class TimeIntegrationSolution;
friend class TimeIntegrationSchemeData;
TimeIntegrationSchemeDataVector m_integration_phases;
bool m_firstStageEqualsOldSolution; //< Optimisation flag
bool m_lastStageEqualsNewSolution; //< Optimisation flag
virtual ~TimeIntegrationScheme()
{
......@@ -326,8 +212,8 @@ protected:
friend std::ostream &operator<<(std::ostream &os,
const TimeIntegrationSchemeSharedPtr &rhs);
friend std::ostream &operator<<(std::ostream &os,
const TimeIntegrationSchemeData &rhs);
// friend std::ostream &operator<<(std::ostream &os,
// const TimeIntegrationSchemeData &rhs);
/**
* \brief Explicit integration of an ODE.
......@@ -357,20 +243,6 @@ protected:
const NekDouble timestep, TimeIntegrationSolutionSharedPtr &y,
const TimeIntegrationSchemeOperators &op);
// TimeIntegrationSchemeKey m_schemeKey;
// TimeIntegrationSchemeType m_schemeType;
// unsigned int m_numsteps; //< Number of steps in multi-step
// component.
// unsigned int m_numstages; //< Number of stages in
// multi-stage component.
public: // FIXME m_integration_phases should not be public...
TimeIntegrationSchemeDataVector
m_integration_phases; // Was called m_intSchemes
protected: // FIXME
bool m_firstStageEqualsOldSolution; //< Optimisation-flag
bool m_lastStageEqualsNewSolution; //< Optimisation-flag
// This should never be used directly... only used by child classes...
TimeIntegrationScheme()
{
......@@ -399,9 +271,7 @@ protected: // FIXME
ConstSingleArray &t_old, TripleArray &y_new, SingleArray &t_new,
const TimeIntegrationSchemeOperators &op) const;
// !!! Always make sure that this matches TimeIntegrationMethod enum... !!!
//
static const char *const TimeIntegrationMethodMap[36];
}; // end class TimeIntegrationScheme
......
......@@ -38,6 +38,7 @@
#include <LibUtilities/BasicUtils/VmathArray.hpp>
#include <LibUtilities/LinearAlgebra/Blas.hpp>
#include <LibUtilities/TimeIntegration/TimeIntegrationSolution.h>
#include <LibUtilities/TimeIntegration/TimeIntegrationSchemeOperators.h>
#include <iostream>
......@@ -108,9 +109,7 @@ bool TimeIntegrationSchemeData::VerifyIntegrationSchemeType(
return (vertype[0] == type);
}
TimeIntegrationSchemeData:: // FIXME: Dd: <- this qualifier should not be
// necessary...
TimeIntegrationSolutionSharedPtr
TimeIntegrationSchemeData::TimeIntegrationSolutionSharedPtr
TimeIntegrationSchemeData::InitializeData(
const NekDouble deltaT, ConstDoubleArray &y_0, const NekDouble time,
const TimeIntegrationSchemeOperators &op)
......@@ -119,9 +118,6 @@ TimeIntegrationSchemeData:: // FIXME: Dd: <- this qualifier should not be
// initial value. Initialise all other multi-step values
// and derivatives to zero
// FIXME: Dd: figure out what the following allocation does and do it
// without the memory manager... or not...
TimeIntegrationSolutionSharedPtr y_out =
MemoryManager<TimeIntegrationSolution>::AllocateSharedPtr(this, y_0,
time, deltaT);
......
......@@ -40,19 +40,13 @@
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
///////////////////////////////////////////////////////////////////////////////
#define LUE LIB_UTILITIES_EXPORT
///////////////////////////////////////////////////////////////////////////////
namespace Nektar
{
namespace LibUtilities
{
// =====================================================================
// ==== DEFINITION OF THE CLASS TimeIntegrationScheme
// =====================================================================
class TimeIntegrationSchemeData
{
public:
......@@ -64,10 +58,6 @@ public:
{
}
private: // Note: All functions are private as they should only be used by their
// friend
// classes TimeIntegrationScheme and TimeIntegrationSolution
friend std::ostream &operator<<(std::ostream &os,
const TimeIntegrationScheme &rhs);
friend std::ostream &operator<<(std::ostream &os,
......@@ -79,45 +69,6 @@ private: // Note: All functions are private as they should only be used by their
std::ostream &os,
const TimeIntegrationScheme::TimeIntegrationSchemeDataSharedPtr &rhs);
friend class TimeIntegrationScheme;
friend class TimeIntegrationSolution;
friend class AdamsBashforthOrder2TimeIntegrationScheme;
friend class AdamsBashforthOrder3TimeIntegrationScheme;
friend class AdamsBashforthOrder4TimeIntegrationScheme;
friend class AdamsMoultonOrder1TimeIntegrationScheme;
friend class AdamsMoultonOrder2TimeIntegrationScheme;
friend class BackwardEulerTimeIntegrationScheme;
friend class BDFImplicitOrder2TimeIntegrationScheme;
friend class ClassicalRungeKutta4TimeIntegrationScheme;
friend class RungeKutta5TimeIntegrationScheme;
friend class CNABTimeIntegrationScheme;
friend class DIRKOrder2TimeIntegrationScheme;
friend class DIRKOrder3TimeIntegrationScheme;
friend class ForwardEulerTimeIntegrationScheme;
friend class IMEXdirk_1_2_1TimeIntegrationScheme;
friend class IMEXdirk_1_2_2TimeIntegrationScheme;
friend class IMEXdirk_2_2_2TimeIntegrationScheme;
friend class IMEXdirk_2_3_2TimeIntegrationScheme;
friend class IMEXdirk_2_3_3TimeIntegrationScheme;
friend class IMEXdirk_3_4_3TimeIntegrationScheme;
friend class IMEXdirk_4_4_3TimeIntegrationScheme;
friend class IMEXGearTimeIntegrationScheme;
friend class IMEXOrder1TimeIntegrationScheme;
friend class IMEXOrder2TimeIntegrationScheme;
friend class IMEXOrder3TimeIntegrationScheme;
friend class IMEXOrder4TimeIntegrationScheme;
friend class MCNABTimeIntegrationScheme;
friend class RungeKutta2TimeIntegrationScheme;
friend class RungeKutta2_ImprovedEulerTimeIntegrationScheme;
friend class RungeKutta2_SSPTimeIntegrationScheme;
friend class RungeKutta3_SSPTimeIntegrationScheme;
//////////////////////////////////////////////////////////////
// FIXME: Dd: move to the right spot:
const TimeIntegrationScheme *m_parent;
inline TimeIntegrationMethod GetIntegrationMethod() const
{
return m_method;
......@@ -254,6 +205,8 @@ private: // Note: All functions are private as they should only be used by their
const NekDouble deltaT, TimeIntegrationSolutionSharedPtr &y,
const TimeIntegrationSchemeOperators &op);
const TimeIntegrationScheme *m_parent;
TimeIntegrationMethod m_method;
TimeIntegrationSchemeType m_schemeType;
......@@ -298,30 +251,6 @@ private: // Note: All functions are private as they should only be used by their
NekDouble m_T; /// Time at the different stages
// template <typename> friend class Nektar::MemoryManager;
// LUE friend TimeIntegrationSchemeManagerT &
// GetTimeIntegrationSchemeManager();
// LUE static TimeIntegrationSchemeDataSharedPtr Create( const
// TimeIntegrationSchemeKey & key );
// TimeIntegrationSchemeData( const TimeIntegrationSchemeKey & key );
// These should never be called
// TimeIntegrationSchemeData() : m_schemeKey( NullTimeIntegrationSchemeKey )
// {
// NEKERROR(ErrorUtil::efatal,"Default Constructor for the
// TimeIntegrationScheme class should not be called");
// }
// TimeIntegrationSchemeData( const TimeIntegrationScheme & in ) :
// m_schemeKey( NullTimeIntegrationSchemeKey )
// {
// NEKERROR(ErrorUtil::efatal,"Copy Constructor for the
// TimeIntegrationScheme class should not be called");
// }
static LUE bool VerifyIntegrationSchemeType(
TimeIntegrationSchemeType type,
const Array<OneD, const Array<TwoD, NekDouble>> &A,
......
///////////////////////////////////////////////////////////////////////////////
//
// File: TimeIntegrationOperators.h
//
// For more information, please see: http://www.nektar.info
//
// The MIT License
//
// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
// Department of Aeronautics, Imperial College London (UK), and Scientific
// Computing and Imaging Institute, University of Utah (USA).
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Header file of time integration operators class
//
///////////////////////////////////////////////////////////////////////////////
#ifndef NEKTAR_LIB_UTILITIES_FOUNDATIONS_TIMEINTEGRATIONSCHEMEOPERATORS_H
#define NEKTAR_LIB_UTILITIES_FOUNDATIONS_TIMEINTEGRATIONSCHEMEOPERATORS_H
#include <string>
#include <boost/core/ignore_unused.hpp>
#include <LibUtilities/BasicUtils/ErrorUtil.hpp>
#include <LibUtilities/BasicUtils/NekFactory.hpp>
#include <LibUtilities/BasicConst/NektarUnivTypeDefs.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/LibUtilitiesDeclspec.h>
///////////////////////////////////////////////////////////////////////////////
#define LUE LIB_UTILITIES_EXPORT
namespace Nektar
{
namespace LibUtilities
{
/**
* @brief Binds a set of functions for use by time integration schemes.
*/
class TimeIntegrationSchemeOperators
{
public:
typedef const Array<OneD, const Array<OneD, NekDouble>> InArrayType;
typedef Array<OneD, Array<OneD, NekDouble>> OutArrayType;
typedef std::function<void(InArrayType &, OutArrayType &, const NekDouble)>
FunctorType1;
typedef std::function<void(InArrayType &, OutArrayType &, const NekDouble,
const NekDouble)>
FunctorType2;
typedef const FunctorType1 &ConstFunctorType1Ref;
typedef const FunctorType2 &ConstFunctorType2Ref;
typedef Array<OneD, FunctorType1> FunctorType1Array;
typedef Array<OneD, FunctorType2> FunctorType2Array;
TimeIntegrationSchemeOperators(void) : m_functors1(4), m_functors2(1)
{
}
template <typename FuncPointerT, typename ObjectPointerT>
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
{
m_functors1[0] =
std::bind(func, obj, std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3);
}
template <typename FuncPointerT, typename ObjectPointerT>
void DefineOdeExplicitRhs(FuncPointerT func, ObjectPointerT obj)
{
m_functors1[1] =
std::bind(func, obj, std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3);
}
template <typename FuncPointerT, typename ObjectPointerT>
void DefineOdeImplicitRhs(FuncPointerT func, ObjectPointerT obj)
{
m_functors1[2] =
std::bind(func, obj, std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3);
}
template <typename FuncPointerT, typename ObjectPointerT>
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
{
m_functors1[3] =
std::bind(func, obj, std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3);
}
template <typename FuncPointerT, typename ObjectPointerT>
void DefineImplicitSolve(FuncPointerT func, ObjectPointerT obj)
{
m_functors2[0] =
std::bind(func, obj, std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3, std::placeholders::_4);
}
inline void DoOdeRhs(InArrayType &inarray, OutArrayType &outarray,
const NekDouble time) const
{
ASSERTL1(m_functors1[0], "OdeRhs should be defined for this time "
"integration scheme");
m_functors1[0](inarray, outarray, time);
}
inline void DoOdeExplicitRhs(InArrayType &inarray, OutArrayType &outarray,
const NekDouble time) const
{
ASSERTL1(m_functors1[1], "OdeExplicitRhs should be defined for this "
"time integration scheme");
m_functors1[1](inarray, outarray, time);
}
inline void DoOdeImplicitRhs(InArrayType &inarray, OutArrayType &outarray,
const NekDouble time) const
{
ASSERTL1(m_functors1[2], "OdeImplictRhs should be defined for this "
"time integration scheme");
m_functors1[2](inarray, outarray, time);
}
inline void DoProjection(InArrayType &inarray, OutArrayType &outarray,
const NekDouble time) const
{
ASSERTL1(m_functors1[3], "Projection operation should be defined for "
"this time integration scheme");
m_functors1[3](inarray, outarray, time);
}
inline void DoImplicitSolve(InArrayType &inarray, OutArrayType &outarray,
const NekDouble time,
const NekDouble lambda) const
{
ASSERTL1(m_functors2[0], "ImplicitSolve should be defined for this "
"time integration scheme");
m_functors2[0](inarray, outarray, time, lambda);
}
protected:
FunctorType1Array m_functors1;
FunctorType2Array m_functors2;
private:
};
}
}
#endif
......@@ -84,9 +84,7 @@ TimeIntegrationSolution::TimeIntegrationSolution(
const TimeIntegrationSchemeData *schemeData, const unsigned int nvar,
const unsigned int npoints)
: m_schemeData(schemeData),
m_solVector(
schemeData
->m_numsteps), // FIXME <- direct use of m_numsteps seems bad...
m_solVector(schemeData->m_numsteps),
m_t(schemeData->m_numsteps)
{
for (int i = 0; i < m_schemeData->m_numsteps; i++)
......@@ -104,19 +102,12 @@ TimeIntegrationSolution::TimeIntegrationSolution(
: m_schemeData(schemeData), m_solVector(m_schemeData->m_numsteps),
m_t(m_schemeData->m_numsteps)
{
// FIXME: Dd: does this constructor really have no code?
}
// FIMXE: is this right, should it be the parent's method, or the data's method?
TimeIntegrationMethod TimeIntegrationSolution::GetIntegrationMethod() const
{
return m_schemeData->m_parent->GetIntegrationMethod();
}
int TimeIntegrationSolution::GetNsteps()
{
return m_schemeData->m_numsteps;
} // FIXME should this be in .h file? ... GetNumIntegrationSteps(); }
} // end namespace LibUtilities
} // end namespace NekTar
......@@ -50,15 +50,7 @@ namespace Nektar
{
namespace LibUtilities
{
// FIXME: Dd: Find a better way to do these typedefs as they happen all over the
// place...
// typedef std::shared_ptr<TimeIntegrationScheme>
// TimeIntegrationSchemeSharedPtr;
// =========================================================================
// ==== DEFINITION OF THE CLASS TimeIntegrationSolution
// =========================================================================
class TimeIntegrationSolution
{
public:
......@@ -85,8 +77,6 @@ public:
{
return m_schemeData;
}
// inline const TimeIntegrationSchemeKey & GetIntegrationSchemeKey()
// const { return m_scheme->GetIntegrationSchemeKey(); }
TimeIntegrationMethod GetIntegrationMethod() const;
......@@ -121,8 +111,11 @@ public:
{
return m_t[0];
}
int GetNsteps(); // { return m_schemeData->m_numIntSteps; } // FIXME
// GetNumIntegrationSteps(); }
int GetNsteps()
{
return m_schemeData->m_numsteps;
}
inline int GetFirstDim() const
{
return m_solVector[0].num_elements();
......
......@@ -36,6 +36,7 @@
#define NEKTAR_SOLVERUTILS_UNSTEADYSYSTEM_H
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#include <LibUtilities/TimeIntegration/TimeIntegrationSchemeOperators.h>
#include <SolverUtils/EquationSystem.h>
#include <SolverUtils/Filters/Filter.h>
......
......@@ -39,6 +39,7 @@
#include <LibUtilities/BasicUtils/SessionReader.h>
#include <LibUtilities/BasicUtils/FieldIO.h>
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#include <LibUtilities/TimeIntegration/TimeIntegrationSchemeOperators.h>
#include <SpatialDomains/MeshGraph.h>
#include <MultiRegions/ContField2D.h>
......