...
 
Commits (2)
......@@ -142,9 +142,6 @@ namespace Vmath
/********** Triad routines ***********************/
// Note: For de-coding of the following function names, see Reverse Polish Notation (RPN)
// discussion at top of file.
/// \brief vvtvp (vector times vector plus vector): z = w*x + y
template<class T> LIB_UTILITIES_EXPORT void Vvtvp( int n,
const T *w, const int incw,
......
#pragma once
///////////////////////////////////////////////////////////////////////////////
//
// File: AdamsMoultonTimeIntegrationSchemes.h
......@@ -36,15 +34,13 @@
//
///////////////////////////////////////////////////////////////////////////////
#define LUE LIB_UTILITIES_EXPORT
#pragma once
///////////////////////////////////////////////////////////////////////////////
#define LUE LIB_UTILITIES_EXPORT
#include <LibUtilities/TimeIntegration/EulerTimeIntegrationSchemes.h>
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
///////////////////////////////////////////////////////////////////////////////
namespace Nektar
{
namespace LibUtilities
......@@ -70,8 +66,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p = MemoryManager<
......@@ -79,22 +73,15 @@ public:
return p;
}
static std::string className; // Is set to "AdamsMoultonOrder1" in
// SchemeInitializor.cpp during program start
// up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eAdamsMoultonOrder1;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
// FIXME: Is this the way we want to initialize this scheme?
BackwardEulerTimeIntegrationScheme::SetupSchemeData(phase);
}
......@@ -124,8 +111,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p = MemoryManager<
......@@ -133,19 +118,13 @@ public:
return p;
}
static std::string className; // Is set to "AdamsMoultonOrder2" in
// SchemeInitializor.cpp during program start
// up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eAdamsMoultonOrder2;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_schemeType = eDiagonallyImplicit;
......@@ -159,9 +138,8 @@ public:
phase->m_A[0] =
Array<TwoD, NekDouble>(phase->m_numstages, phase->m_numstages, 0.5);
phase->m_B[0] = Array<TwoD, NekDouble>(
phase->m_numsteps, phase->m_numstages,
0.0); // Dd: In original line, 0.0 was not explicit...
phase->m_B[0] =
Array<TwoD, NekDouble>(phase->m_numsteps, phase->m_numstages, 0.0);
phase->m_U =
Array<TwoD, NekDouble>(phase->m_numstages, phase->m_numsteps, 0.0);
phase->m_V =
......
#pragma once
///////////////////////////////////////////////////////////////////////////////
//
// File: BDFImplicitTimeIntegrationSchemes.h
......@@ -36,15 +34,13 @@
//
///////////////////////////////////////////////////////////////////////////////
#define LUE LIB_UTILITIES_EXPORT
#pragma once
///////////////////////////////////////////////////////////////////////////////
#define LUE LIB_UTILITIES_EXPORT
#include <LibUtilities/TimeIntegration/EulerTimeIntegrationSchemes.h>
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
///////////////////////////////////////////////////////////////////////////////
namespace Nektar
{
namespace LibUtilities
......@@ -70,8 +66,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p = MemoryManager<
......@@ -79,22 +73,15 @@ public:
return p;
}
static std::string className; // Is set to "BDFImplicitOrder1" in
// SchemeInitializor.cpp during program start
// up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eBDFImplicitOrder1;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
// FIXME: Dd? Correct way to do this?
BackwardEulerTimeIntegrationScheme::SetupSchemeData(phase);
}
......@@ -124,8 +111,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p = MemoryManager<
......@@ -133,19 +118,13 @@ public:
return p;
}
static std::string className; // Is set to "BDFImplicitOrder2" in
// SchemeInitializor.cpp during program start
// up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eBDFImplicitOrder2;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_method = TimeIntegrationMethod::eBDFImplicitOrder2;
......
#pragma once
///////////////////////////////////////////////////////////////////////////////
//
// File: IMEXGearTimeIntegrationScheme.h
......@@ -35,16 +33,13 @@
//
///////////////////////////////////////////////////////////////////////////////
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#pragma once
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#include <LibUtilities/TimeIntegration/IMEXdirkTimeIntegrationSchemes.h>
///////////////////////////////////////////////////////////////////////////////
#define LUE LIB_UTILITIES_EXPORT
///////////////////////////////////////////////////////////////////////////////
namespace Nektar
{
namespace LibUtilities
......@@ -70,8 +65,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p =
......@@ -79,19 +72,13 @@ public:
return p;
}
static std::string className; // FIXME: Will be set in
// TimeIntegratorBase.cpp during program start
// up.
//////////////
static std::string className;
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eIMEXGear;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_method = TimeIntegrationMethod::eIMEXGear;
......
#pragma once
///////////////////////////////////////////////////////////////////////////////
//
// File: IMEXTimeIntegrationSchemes.h
......@@ -34,6 +32,10 @@
// Description: Combined header file for all basic IMEX time integration
// schemes.
//
///////////////////////////////////////////////////////////////////////////////
#pragma once
#define LUE LIB_UTILITIES_EXPORT
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
......
#pragma once
///////////////////////////////////////////////////////////////////////////////
//
// File: MCNABTimeIntegrationScheme.h
......@@ -35,14 +33,12 @@
//
///////////////////////////////////////////////////////////////////////////////
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#pragma once
///////////////////////////////////////////////////////////////////////////////
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#define LUE LIB_UTILITIES_EXPORT
///////////////////////////////////////////////////////////////////////////////
namespace Nektar
{
namespace LibUtilities
......@@ -72,8 +68,6 @@ public:
{
}
/////////////
static TimeIntegrationSchemeSharedPtr create()
{
TimeIntegrationSchemeSharedPtr p =
......@@ -81,21 +75,13 @@ public:
return p;
}
static std::string className; // FIXME: Will be set in
// TimeIntegratorBase.cpp during program start
// up.
static std::string className;
//////////////
// Replaces (from TimeIntegrationScheme.h): return
// m_schemeKey.GetIntegrationMethod();
LUE virtual TimeIntegrationMethod GetIntegrationMethod() const
{
return TimeIntegrationMethod::eMCNAB;
}
//////////////
LUE static void SetupSchemeData(TimeIntegrationSchemeDataSharedPtr &phase)
{
phase->m_method = TimeIntegrationMethod::eMCNAB;
......
#pragma once
///////////////////////////////////////////////////////////////////////////////
//
// File: TimeIntegrationScheme.h
......@@ -34,8 +32,7 @@
//
///////////////////////////////////////////////////////////////////////////////
#ifndef NEKTAR_LIB_UTILITIES_FOUNDATIONS_TIMEINTEGRATIONSCHEME_H
#define NEKTAR_LIB_UTILITIES_FOUNDATIONS_TIMEINTEGRATIONSCHEME_H
#pragma once
#include <string>
......@@ -175,8 +172,8 @@ public:
const NekDouble, const NekDouble)>
FunctorType2;
static TimeIntegrationMethod methodFromName(const std::string &name);
static std::string nameFromMethod(const TimeIntegrationMethod method);
LUE static TimeIntegrationMethod methodFromName(const std::string &name);
LUE static std::string nameFromMethod(const TimeIntegrationMethod method);
unsigned int GetNumIntegrationPhases() const
{
......@@ -193,7 +190,7 @@ public:
virtual TimeIntegrationMethod GetIntegrationMethod() const = 0;
TimeIntegrationSchemeType GetIntegrationSchemeType() const;
LUE TimeIntegrationSchemeType GetIntegrationSchemeType() const;
static const char *const TimeIntegrationMethodMap[36];
......@@ -241,11 +238,11 @@ protected:
const TimeIntegrationSchemeOperators &op);
// This should never be used directly... only used by child classes...
TimeIntegrationScheme()
LUE TimeIntegrationScheme()
{
}
TimeIntegrationScheme(const TimeIntegrationScheme &in)
LUE TimeIntegrationScheme(const TimeIntegrationScheme &in)
{
boost::ignore_unused(in);
NEKERROR(ErrorUtil::efatal, "Copy Constructor for the "
......@@ -280,4 +277,3 @@ LUE std::ostream &operator<<(std::ostream &os,
} // end of namespace LibUtilities
} // end of namespace Nektar
#endif
#pragma once
///////////////////////////////////////////////////////////////////////////////
//
// File: TimeIntegrationSchemeData.h
......@@ -38,6 +36,8 @@
//
///////////////////////////////////////////////////////////////////////////////
#pragma once
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#define LUE LIB_UTILITIES_EXPORT
......
......@@ -32,8 +32,7 @@
//
///////////////////////////////////////////////////////////////////////////////
#ifndef NEKTAR_LIB_UTILITIES_FOUNDATIONS_TIMEINTEGRATIONSCHEMEOPERATORS_H
#define NEKTAR_LIB_UTILITIES_FOUNDATIONS_TIMEINTEGRATIONSCHEMEOPERATORS_H
#pragma once
#include <string>
......@@ -170,4 +169,3 @@ private:
}
}
#endif
#pragma once
///////////////////////////////////////////////////////////////////////////////
//
// File: TimeIntegrationSolution.h
......@@ -35,17 +33,15 @@
//
///////////////////////////////////////////////////////////////////////////////
#pragma once
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/TimeIntegration/TimeIntegrationScheme.h>
#include <LibUtilities/TimeIntegration/TimeIntegrationSchemeData.h>
///////////////////////////////////////////////////////////////////////////////
#define LUE LIB_UTILITIES_EXPORT
///////////////////////////////////////////////////////////////////////////////
namespace Nektar
{
namespace LibUtilities
......
......@@ -101,8 +101,10 @@ namespace Nektar
// For steady problems, we do not initialise the time integration
if (m_session->DefinesSolverInfo("TIMEINTEGRATIONMETHOD"))
{
std::string methodName = m_session->GetSolverInfo( "TIMEINTEGRATIONMETHOD" );
m_intScheme = LibUtilities::GetTimeIntegrationSchemeFactory().CreateInstance( methodName );
std::string methodName = m_session->GetSolverInfo(
"TIMEINTEGRATIONMETHOD" );
m_intScheme = LibUtilities::GetTimeIntegrationSchemeFactory()
.CreateInstance( methodName );
// Load generic input parameters
m_session->LoadParameter("IO_InfoSteps", m_infosteps, 0);
......@@ -111,7 +113,8 @@ namespace Nektar
m_session->LoadParameter("CFL", m_cflSafetyFactor, 0.0);
// Time tolerance between filter update time and time integration
m_session->LoadParameter("FilterTimeWarning", m_filterTimeWarning, 1);
m_session->LoadParameter("FilterTimeWarning",
m_filterTimeWarning, 1);
// Ensure that there is no conflict of parameters
if(m_cflSafetyFactor > 0.0)
......@@ -240,9 +243,10 @@ namespace Nektar
fields[i] = m_fields[m_intVariables[i]]->GetPhys();
m_fields[m_intVariables[i]]->SetPhysState(false);
}
// Initialise time integration scheme
m_intSoln = m_intScheme->InitializeScheme( m_timestep, fields, m_time, m_ode );
m_intSoln = m_intScheme->InitializeScheme( m_timestep, fields,
m_time, m_ode );
// Initialise filters
for( auto &x : m_filters )
......@@ -569,7 +573,9 @@ namespace Nektar
AddSummaryItem( s, "Time Step", m_timestep );
AddSummaryItem( s, "No. of Steps", m_steps );
AddSummaryItem( s, "Checkpoints (steps)", m_checksteps );
AddSummaryItem( s, "Integration Type", LibUtilities::TimeIntegrationScheme::nameFromMethod( m_intScheme->GetIntegrationMethod() ) );
AddSummaryItem( s, "Integration Type",
LibUtilities::TimeIntegrationScheme::nameFromMethod(
m_intScheme->GetIntegrationMethod() ) );
}
/**
......
......@@ -470,9 +470,9 @@ namespace Nektar
*
*/
void UnsteadyAdvectionDiffusion::SubStepAdvance(
const LibUtilities::TimeIntegrationScheme::TimeIntegrationSolutionSharedPtr &integrationSoln,
int nstep,
NekDouble time)
const LibUtilities::TimeIntegrationScheme::TimeIntegrationSolutionSharedPtr &integrationSoln,
int nstep,
NekDouble time)
{
int n;
int nsubsteps;
......@@ -518,7 +518,9 @@ namespace Nektar
for(n = 0; n < nsubsteps; ++n)
{
fields = m_subStepIntegrationScheme->TimeIntegrate( n, dt, SubIntegrationSoln, m_subStepIntegrationOps );
fields = m_subStepIntegrationScheme->TimeIntegrate(
n, dt, SubIntegrationSoln,
m_subStepIntegrationOps );
}
// Reset time integrated solution in m_integrationSoln
......@@ -558,8 +560,8 @@ namespace Nektar
}
void UnsteadyAdvectionDiffusion::SetUpSubSteppingTimeIntegration(
int intMethod,
const LibUtilities::TimeIntegrationSchemeSharedPtr &IntegrationScheme)
int intMethod,
const LibUtilities::TimeIntegrationSchemeSharedPtr &IntegrationScheme)
{
// Set to 1 for first step and it will then be increased in
// time advance routines
......@@ -568,16 +570,21 @@ namespace Nektar
case LibUtilities::eBackwardEuler:
case LibUtilities::eBDFImplicitOrder1:
{
m_subStepIntegrationScheme = LibUtilities::GetTimeIntegrationSchemeFactory().CreateInstance( "ForwardEuler" );
m_subStepIntegrationScheme =
LibUtilities::GetTimeIntegrationSchemeFactory()
.CreateInstance( "ForwardEuler" );
}
break;
case LibUtilities::eBDFImplicitOrder2:
{
m_subStepIntegrationScheme = LibUtilities::GetTimeIntegrationSchemeFactory().CreateInstance( "RungeKutta2_ImprovedEuler" );
m_subStepIntegrationScheme =
LibUtilities::GetTimeIntegrationSchemeFactory()
.CreateInstance( "RungeKutta2_ImprovedEuler" );
}
break;
default:
ASSERTL0(0,"Integration method not suitable: Options include BackwardEuler or BDFImplicitOrder1");
NEKERROR(ErrorUtil::efatal, "Integration method not suitable: "
"Options include BackwardEuler or BDFImplicitOrder1");
break;
}
m_intSteps = IntegrationScheme->GetNumIntegrationPhases();
......
......@@ -158,8 +158,9 @@ namespace Nektar
const Array<OneD, const Array<OneD, NekDouble> > &N,
NekDouble kinvis)=0;
virtual void v_SubSteppingTimeIntegration( int intMethod,
const LibUtilities::TimeIntegrationSchemeSharedPtr & IntegrationScheme ) = 0;
virtual void v_SubSteppingTimeIntegration(
int intMethod,
const LibUtilities::TimeIntegrationSchemeSharedPtr & IntegrationScheme ) = 0;
virtual void v_SubStepSaveFields(
int nstep)=0;
......@@ -169,9 +170,10 @@ namespace Nektar
NekDouble Aii_DT,
NekDouble kinvis)=0;
virtual void v_SubStepAdvance( const LibUtilities::TimeIntegrationScheme::TimeIntegrationSolutionSharedPtr & integrationSoln,
int nstep,
NekDouble time ) = 0;
virtual void v_SubStepAdvance(
const LibUtilities::TimeIntegrationScheme::TimeIntegrationSolutionSharedPtr & integrationSoln,
int nstep,
NekDouble time ) = 0;
virtual void v_MountHOPBCs(
int HBCdata,
......
......@@ -98,8 +98,9 @@ namespace Nektar
/**
*
*/
void StandardExtrapolate::v_SubSteppingTimeIntegration( int intMethod,
const LibUtilities::TimeIntegrationSchemeSharedPtr & IntegrationScheme )
void StandardExtrapolate::v_SubSteppingTimeIntegration(
int intMethod,
const LibUtilities::TimeIntegrationSchemeSharedPtr & IntegrationScheme )
{
switch(intMethod)
{
......@@ -141,9 +142,10 @@ namespace Nektar
/**
*
*/
void StandardExtrapolate::v_SubStepAdvance( const LibUtilities::TimeIntegrationScheme::TimeIntegrationSolutionSharedPtr & integrationSoln,
int nstep,
NekDouble time )
void StandardExtrapolate::v_SubStepAdvance(
const LibUtilities::TimeIntegrationScheme::TimeIntegrationSolutionSharedPtr & integrationSoln,
int nstep,
NekDouble time )
{
}
......
......@@ -84,22 +84,26 @@ namespace Nektar
virtual ~StandardExtrapolate();
protected:
virtual void v_EvaluatePressureBCs( const Array<OneD, const Array<OneD, NekDouble> > & fields,
const Array<OneD, const Array<OneD, NekDouble> > & N,
NekDouble kinvis );
virtual void v_EvaluatePressureBCs(
const Array<OneD, const Array<OneD, NekDouble> > & fields,
const Array<OneD, const Array<OneD, NekDouble> > & N,
NekDouble kinvis );
virtual void v_SubSteppingTimeIntegration( int intMethod,
const LibUtilities::TimeIntegrationSchemeSharedPtr & IntegrationScheme );
virtual void v_SubSteppingTimeIntegration(
int intMethod,
const LibUtilities::TimeIntegrationSchemeSharedPtr & IntegrationScheme );
virtual void v_SubStepSaveFields( int nstep );
virtual void v_SubStepSetPressureBCs( const Array<OneD, const Array<OneD, NekDouble> > & inarray,
NekDouble Aii_DT,
NekDouble kinvis );
virtual void v_SubStepSetPressureBCs(
const Array<OneD, const Array<OneD, NekDouble> > & inarray,
NekDouble Aii_DT,
NekDouble kinvis );
virtual void v_SubStepAdvance( const LibUtilities::TimeIntegrationScheme::TimeIntegrationSolutionSharedPtr & integrationSoln,
int nstep,
NekDouble time );
virtual void v_SubStepAdvance(
const LibUtilities::TimeIntegrationScheme::TimeIntegrationSolutionSharedPtr & integrationSoln,
int nstep,
NekDouble time );
virtual void v_MountHOPBCs(
int HBCdata,
......
......@@ -84,8 +84,9 @@ namespace Nektar
}
void SubSteppingExtrapolate::v_SubSteppingTimeIntegration( int intMethod,
const LibUtilities::TimeIntegrationSchemeSharedPtr & IntegrationScheme )
void SubSteppingExtrapolate::v_SubSteppingTimeIntegration(
int intMethod,
const LibUtilities::TimeIntegrationSchemeSharedPtr & IntegrationScheme )
{
// Set to 1 for first step and it will then be increased in
// time advance routines
......@@ -312,9 +313,10 @@ namespace Nektar
/**
*
*/
void SubSteppingExtrapolate::v_SubStepAdvance( const LibUtilities::TimeIntegrationScheme::TimeIntegrationSolutionSharedPtr &integrationSoln,
int nstep,
NekDouble time )
void SubSteppingExtrapolate::v_SubStepAdvance(
const LibUtilities::TimeIntegrationScheme::TimeIntegrationSolutionSharedPtr &integrationSoln,
int nstep,
NekDouble time )
{
int n;
int nsubsteps;
......
......@@ -88,8 +88,9 @@ namespace Nektar
const Array<OneD, const Array<OneD, NekDouble> > &N,
NekDouble kinvis);
virtual void v_SubSteppingTimeIntegration( int intMethod,
const LibUtilities::TimeIntegrationSchemeSharedPtr & IntegrationScheme );
virtual void v_SubSteppingTimeIntegration(
int intMethod,
const LibUtilities::TimeIntegrationSchemeSharedPtr & IntegrationScheme );
virtual void v_SubStepSaveFields(
int nstep);
......