Nektar++
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
Nektar::LibUtilities::EulerTimeIntegrationScheme Class Reference

#include <EulerTimeIntegrationSchemes.h>

Inheritance diagram for Nektar::LibUtilities::EulerTimeIntegrationScheme:
[legend]

Public Member Functions

 EulerTimeIntegrationScheme (std::string variant, size_t order, std::vector< NekDouble > freeParams)
 
 ~EulerTimeIntegrationScheme () override
 
- Public Member Functions inherited from Nektar::LibUtilities::TimeIntegrationSchemeGLM
LUE void InitializeSecondaryData (TimeIntegrationAlgorithmGLM *phase, NekDouble deltaT) const
 
- Public Member Functions inherited from Nektar::LibUtilities::TimeIntegrationScheme
LUE std::string GetFullName () const
 
LUE std::string GetName () const
 
LUE std::string GetVariant () const
 
LUE size_t GetOrder () const
 
LUE std::vector< NekDoubleGetFreeParams ()
 
LUE TimeIntegrationSchemeType GetIntegrationSchemeType ()
 
LUE NekDouble GetTimeStability () const
 
LUE size_t GetNumIntegrationPhases ()
 
LUE const TripleArrayGetSolutionVector () const
 Gets the solution vector of the ODE. More...
 
LUE TripleArrayUpdateSolutionVector ()
 
LUE void SetSolutionVector (const size_t Offset, const DoubleArray &y)
 Sets the solution vector of the ODE. More...
 
LUE void InitializeScheme (const NekDouble deltaT, ConstDoubleArray &y_0, const NekDouble time, const TimeIntegrationSchemeOperators &op)
 Explicit integration of an ODE. More...
 
LUE ConstDoubleArrayTimeIntegrate (const size_t timestep, const NekDouble delta_t)
 
LUE void print (std::ostream &os) const
 
LUE void printFull (std::ostream &os) const
 

Static Public Member Functions

static TimeIntegrationSchemeSharedPtr create (std::string variant, size_t order, std::vector< NekDouble > freeParams)
 
static LUE void SetupSchemeData (TimeIntegrationAlgorithmGLMSharedPtr &phase, std::string variant)
 

Static Public Attributes

static std::string className
 

Protected Member Functions

LUE std::string v_GetFullName () const override
 
LUE std::string v_GetName () const override
 
LUE NekDouble v_GetTimeStability () const override
 
- Protected Member Functions inherited from Nektar::LibUtilities::TimeIntegrationSchemeGLM
LUE std::string v_GetVariant () const override
 
LUE size_t v_GetOrder () const override
 
LUE std::vector< NekDoublev_GetFreeParams () const override
 
LUE TimeIntegrationSchemeType v_GetIntegrationSchemeType () const override
 
LUE size_t v_GetNumIntegrationPhases () const override
 
LUE const TripleArrayv_GetSolutionVector () const override
 
LUE TripleArrayv_UpdateSolutionVector () override
 
LUE void v_SetSolutionVector (const size_t Offset, const DoubleArray &y) override
 
LUE void v_InitializeScheme (const NekDouble deltaT, ConstDoubleArray &y_0, const NekDouble time, const TimeIntegrationSchemeOperators &op) override
 Worker method to initialize the integration scheme. More...
 
LUE ConstDoubleArrayv_TimeIntegrate (const size_t timestep, const NekDouble delta_t) override
 Worker method that actually does the time integration. More...
 
virtual LUE void v_InitializeSecondaryData (TimeIntegrationAlgorithmGLM *phase, NekDouble deltaT) const
 
LUE void v_print (std::ostream &os) const override
 Worker method to print details on the integration scheme. More...
 
LUE void v_printFull (std::ostream &os) const override
 
LUE TimeIntegrationSchemeGLM (std::string variant, size_t order, std::vector< NekDouble > freeParams)
 
 ~TimeIntegrationSchemeGLM () override
 
- Protected Member Functions inherited from Nektar::LibUtilities::TimeIntegrationScheme
virtual LUE std::string v_GetFullName () const
 
virtual LUE std::string v_GetName () const =0
 
virtual LUE std::string v_GetVariant () const =0
 
virtual LUE size_t v_GetOrder () const =0
 
virtual LUE std::vector< NekDoublev_GetFreeParams () const =0
 
virtual LUE TimeIntegrationSchemeType v_GetIntegrationSchemeType () const =0
 
virtual LUE NekDouble v_GetTimeStability () const =0
 
virtual LUE size_t v_GetNumIntegrationPhases () const =0
 
virtual LUE const TripleArrayv_GetSolutionVector () const =0
 
virtual LUE TripleArrayv_UpdateSolutionVector ()=0
 
virtual LUE void v_SetSolutionVector (const size_t Offset, const DoubleArray &y)=0
 
virtual LUE void v_InitializeScheme (const NekDouble deltaT, ConstDoubleArray &y_0, const NekDouble time, const TimeIntegrationSchemeOperators &op)=0
 
virtual LUE ConstDoubleArrayv_TimeIntegrate (const size_t timestep, const NekDouble delta_t)=0
 
virtual LUE void v_print (std::ostream &os) const =0
 
virtual LUE void v_printFull (std::ostream &os) const =0
 
LUE TimeIntegrationScheme (std::string variant, size_t order, std::vector< NekDouble > freeParams)
 
LUE TimeIntegrationScheme (const TimeIntegrationScheme &in)=delete
 
virtual ~TimeIntegrationScheme ()=default
 

Additional Inherited Members

- Protected Attributes inherited from Nektar::LibUtilities::TimeIntegrationSchemeGLM
TimeIntegrationAlgorithmGLMVector m_integration_phases
 
TimeIntegrationSolutionGLMSharedPtr m_solVector
 

Detailed Description

Definition at line 54 of file EulerTimeIntegrationSchemes.h.

Constructor & Destructor Documentation

◆ EulerTimeIntegrationScheme()

Nektar::LibUtilities::EulerTimeIntegrationScheme::EulerTimeIntegrationScheme ( std::string  variant,
size_t  order,
std::vector< NekDouble freeParams 
)
inline

Definition at line 57 of file EulerTimeIntegrationSchemes.h.

59 : TimeIntegrationSchemeGLM(variant, 1, freeParams)
60 {
61 boost::ignore_unused(variant, order);
62
63 ASSERTL1(variant == "Backward" || variant == "Forward",
64 "Euler Time integration scheme unknown variant: " + variant +
65 ". Must be 'Backward' or 'Forward'");
66
69 new TimeIntegrationAlgorithmGLM(this));
70
72 variant);
73 }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242
static LUE void SetupSchemeData(TimeIntegrationAlgorithmGLMSharedPtr &phase, std::string variant)
TimeIntegrationAlgorithmGLMVector m_integration_phases
LUE TimeIntegrationSchemeGLM(std::string variant, size_t order, std::vector< NekDouble > freeParams)
std::shared_ptr< TimeIntegrationAlgorithmGLM > TimeIntegrationAlgorithmGLMSharedPtr
std::vector< TimeIntegrationAlgorithmGLMSharedPtr > TimeIntegrationAlgorithmGLMVector

References ASSERTL1, Nektar::LibUtilities::TimeIntegrationSchemeGLM::m_integration_phases, and SetupSchemeData().

◆ ~EulerTimeIntegrationScheme()

Nektar::LibUtilities::EulerTimeIntegrationScheme::~EulerTimeIntegrationScheme ( )
inlineoverride

Definition at line 75 of file EulerTimeIntegrationSchemes.h.

76 {
77 }

Member Function Documentation

◆ create()

static TimeIntegrationSchemeSharedPtr Nektar::LibUtilities::EulerTimeIntegrationScheme::create ( std::string  variant,
size_t  order,
std::vector< NekDouble freeParams 
)
inlinestatic

Definition at line 79 of file EulerTimeIntegrationSchemes.h.

82 {
85 variant, 1, freeParams);
86 return p;
87 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< TimeIntegrationScheme > TimeIntegrationSchemeSharedPtr

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), and CellMLToNektar.cellml_metadata::p.

◆ SetupSchemeData()

static LUE void Nektar::LibUtilities::EulerTimeIntegrationScheme::SetupSchemeData ( TimeIntegrationAlgorithmGLMSharedPtr phase,
std::string  variant 
)
inlinestatic

Definition at line 91 of file EulerTimeIntegrationSchemes.h.

93 {
94 double A = 0;
95
96 if (variant == "Backward")
97 {
98 phase->m_schemeType = eDiagonallyImplicit;
99
100 A = 1;
101 }
102 else if (variant == "Forward")
103 {
104 phase->m_schemeType = eExplicit;
105
106 A = 0;
107 }
108
109 phase->m_variant = variant;
110 phase->m_order = 1;
111 phase->m_name = variant + std::string("EulerOrder") +
112 std::to_string(phase->m_order);
113
114 phase->m_numsteps = 1;
115 phase->m_numstages = 1;
116
117 phase->m_A = Array<OneD, Array<TwoD, NekDouble>>(1);
118 phase->m_B = Array<OneD, Array<TwoD, NekDouble>>(1);
119
120 phase->m_A[0] =
121 Array<TwoD, NekDouble>(phase->m_numstages, phase->m_numstages, A);
122 phase->m_B[0] =
123 Array<TwoD, NekDouble>(phase->m_numsteps, phase->m_numstages, 1.0);
124 phase->m_U =
125 Array<TwoD, NekDouble>(phase->m_numstages, phase->m_numsteps, 1.0);
126 phase->m_V =
127 Array<TwoD, NekDouble>(phase->m_numsteps, phase->m_numsteps, 1.0);
128
129 phase->m_numMultiStepValues = 1;
130 phase->m_numMultiStepImplicitDerivs = 0;
131 phase->m_numMultiStepExplicitDerivs = 0;
132 phase->m_timeLevelOffset = Array<OneD, size_t>(phase->m_numsteps);
133 phase->m_timeLevelOffset[0] = 0;
134
135 phase->CheckAndVerify();
136 }
@ eExplicit
Formally explicit scheme.
@ eDiagonallyImplicit
Diagonally implicit scheme (e.g. the DIRK schemes)

References Nektar::LibUtilities::eDiagonallyImplicit, and Nektar::LibUtilities::eExplicit.

Referenced by EulerTimeIntegrationScheme().

◆ v_GetFullName()

LUE std::string Nektar::LibUtilities::EulerTimeIntegrationScheme::v_GetFullName ( ) const
inlineoverrideprotectedvirtual

◆ v_GetName()

LUE std::string Nektar::LibUtilities::EulerTimeIntegrationScheme::v_GetName ( ) const
inlineoverrideprotectedvirtual

Implements Nektar::LibUtilities::TimeIntegrationScheme.

Definition at line 144 of file EulerTimeIntegrationSchemes.h.

145 {
146 return std::string("Euler");
147 }

◆ v_GetTimeStability()

LUE NekDouble Nektar::LibUtilities::EulerTimeIntegrationScheme::v_GetTimeStability ( ) const
inlineoverrideprotectedvirtual

Implements Nektar::LibUtilities::TimeIntegrationScheme.

Definition at line 149 of file EulerTimeIntegrationSchemes.h.

150 {
151 if (GetVariant() == "Backward")
152 {
153 return 1.0;
154 }
155 else
156 {
157 return 2.0;
158 }
159 }

References Nektar::LibUtilities::TimeIntegrationScheme::GetVariant().

Member Data Documentation

◆ className

std::string Nektar::LibUtilities::EulerTimeIntegrationScheme::className
static

Definition at line 89 of file EulerTimeIntegrationSchemes.h.