Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Daniel Perry
Nektar
Commits
b52f6d46
Commit
b52f6d46
authored
Jul 17, 2013
by
Chris Cantwell
Browse files
Updated UnsteadySystem to use TimeIntegrationWrapper.
parent
faaead8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
library/SolverUtils/UnsteadySystem.cpp
View file @
b52f6d46
...
...
@@ -36,6 +36,7 @@
#include <iostream>
#include <iomanip>
#include <LibUtilities/TimeIntegration/TimeIntegrationWrapper.h>
#include <LibUtilities/BasicUtils/Timer.h>
#include <MultiRegions/AssemblyMap/AssemblyMapDG.h>
#include <SolverUtils/UnsteadySystem.h>
...
...
@@ -211,191 +212,13 @@ namespace Nektar
// - the last scheme will be used for all other time-steps
// (this will be the actual scheme)
Array
<
OneD
,
LibUtilities
::
TimeIntegration
Scheme
SharedPtr
>
IntScheme
;
LibUtilities
::
TimeIntegration
Wrapper
SharedPtr
IntScheme
;
LibUtilities
::
TimeIntegrationSolutionSharedPtr
u
;
int
numMultiSteps
;
switch
(
m_timeIntMethod
)
{
case
LibUtilities
::
eIMEXdirk_1_1_1
:
case
LibUtilities
::
eIMEXdirk_1_2_1
:
case
LibUtilities
::
eIMEXdirk_1_2_2
:
case
LibUtilities
::
eIMEXdirk_4_4_3
:
case
LibUtilities
::
eIMEXdirk_2_2_2
:
case
LibUtilities
::
eIMEXdirk_2_3_3
:
case
LibUtilities
::
eIMEXdirk_2_3_2
:
case
LibUtilities
::
eIMEXdirk_3_4_3
:
case
LibUtilities
::
eDIRKOrder2
:
case
LibUtilities
::
eDIRKOrder3
:
case
LibUtilities
::
eBackwardEuler
:
case
LibUtilities
::
eForwardEuler
:
case
LibUtilities
::
eClassicalRungeKutta4
:
case
LibUtilities
::
eIMEXOrder1
:
case
LibUtilities
::
eMidpoint
:
case
LibUtilities
::
eRungeKutta2_ModifiedEuler
:
case
LibUtilities
::
eRungeKutta2_ImprovedEuler
:
{
numMultiSteps
=
1
;
IntScheme
=
Array
<
OneD
,
LibUtilities
::
TimeIntegrationSchemeSharedPtr
>
(
numMultiSteps
);
LibUtilities
::
TimeIntegrationSchemeKey
IntKey
(
m_timeIntMethod
);
IntScheme
[
0
]
=
LibUtilities
::
TimeIntegrationSchemeManager
()[
IntKey
];
u
=
IntScheme
[
0
]
->
InitializeScheme
(
m_timestep
,
fields
,
m_time
,
m_ode
);
break
;
}
case
LibUtilities
::
eAdamsBashforthOrder2
:
case
LibUtilities
::
eAdamsBashforthOrder3
:
{
numMultiSteps
=
2
;
IntScheme
=
Array
<
OneD
,
LibUtilities
::
TimeIntegrationSchemeSharedPtr
>
(
numMultiSteps
);
// Used in the first time step to initalize the scheme
LibUtilities
::
TimeIntegrationSchemeKey
IntKey0
(
LibUtilities
::
eForwardEuler
);
// Used for all other time steps
LibUtilities
::
TimeIntegrationSchemeKey
IntKey1
(
m_timeIntMethod
);
IntScheme
[
0
]
=
LibUtilities
::
TimeIntegrationSchemeManager
()[
IntKey0
];
IntScheme
[
1
]
=
LibUtilities
::
TimeIntegrationSchemeManager
()[
IntKey1
];
// Initialise the scheme for actual time integration scheme
u
=
IntScheme
[
1
]
->
InitializeScheme
(
m_timestep
,
fields
,
m_time
,
m_ode
);
break
;
}
case
LibUtilities
::
eBDFImplicitOrder2
:
{
numMultiSteps
=
2
;
IntScheme
=
Array
<
OneD
,
LibUtilities
::
TimeIntegrationSchemeSharedPtr
>
(
numMultiSteps
);
// Used in the first time step to initalize the scheme
LibUtilities
::
TimeIntegrationSchemeKey
IntKey0
(
LibUtilities
::
eBackwardEuler
);
// Used for all other time steps
LibUtilities
::
TimeIntegrationSchemeKey
IntKey1
(
m_timeIntMethod
);
IntScheme
[
0
]
=
LibUtilities
::
TimeIntegrationSchemeManager
()[
IntKey0
];
IntScheme
[
1
]
=
LibUtilities
::
TimeIntegrationSchemeManager
()[
IntKey1
];
// Initialise the scheme for actual time integration scheme
u
=
IntScheme
[
1
]
->
InitializeScheme
(
m_timestep
,
fields
,
m_time
,
m_ode
);
break
;
}
case
LibUtilities
::
eIMEXOrder2
:
case
LibUtilities
::
eAdamsMoultonOrder2
:
{
numMultiSteps
=
2
;
IntScheme
=
Array
<
OneD
,
LibUtilities
::
TimeIntegrationSchemeSharedPtr
>
(
numMultiSteps
);
// Used in the first time step to initalize the scheme
LibUtilities
::
TimeIntegrationSchemeKey
IntKey0
(
LibUtilities
::
eIMEXOrder1
);
// Used for all other time steps
LibUtilities
::
TimeIntegrationSchemeKey
IntKey1
(
m_timeIntMethod
);
IntScheme
[
0
]
=
LibUtilities
::
TimeIntegrationSchemeManager
()[
IntKey0
];
IntScheme
[
1
]
=
LibUtilities
::
TimeIntegrationSchemeManager
()[
IntKey1
];
// Initialise the scheme for actual time integration scheme
u
=
IntScheme
[
1
]
->
InitializeScheme
(
m_timestep
,
fields
,
m_time
,
m_ode
);
break
;
}
case
LibUtilities
::
eIMEXGear
:
{
numMultiSteps
=
2
;
IntScheme
=
Array
<
OneD
,
LibUtilities
::
TimeIntegrationSchemeSharedPtr
>
(
numMultiSteps
);
// Used in the first time step to initalize the scheme
LibUtilities
::
TimeIntegrationSchemeKey
IntKey0
(
LibUtilities
::
eIMEXdirk_2_2_2
);
// Used for all other time steps
LibUtilities
::
TimeIntegrationSchemeKey
IntKey1
(
m_timeIntMethod
);
IntScheme
[
0
]
=
LibUtilities
::
TimeIntegrationSchemeManager
()[
IntKey0
];
IntScheme
[
1
]
=
LibUtilities
::
TimeIntegrationSchemeManager
()[
IntKey1
];
// Initialise the scheme for actual time integration scheme
u
=
IntScheme
[
1
]
->
InitializeScheme
(
m_timestep
,
fields
,
m_time
,
m_ode
);
break
;
}
case
LibUtilities
::
eIMEXOrder3
:
case
LibUtilities
::
eCNAB
:
case
LibUtilities
::
eMCNAB
:
{
numMultiSteps
=
3
;
IntScheme
=
Array
<
OneD
,
LibUtilities
::
TimeIntegrationSchemeSharedPtr
>
(
numMultiSteps
);
// Used in the first time step to initalize the scheme
LibUtilities
::
TimeIntegrationSchemeKey
IntKey0
(
LibUtilities
::
eIMEXdirk_3_4_3
);
LibUtilities
::
TimeIntegrationSchemeKey
IntKey1
(
LibUtilities
::
eIMEXdirk_3_4_3
);
// Used for all other time steps
LibUtilities
::
TimeIntegrationSchemeKey
IntKey2
(
m_timeIntMethod
);
IntScheme
[
0
]
=
LibUtilities
::
TimeIntegrationSchemeManager
()[
IntKey0
];
IntScheme
[
1
]
=
LibUtilities
::
TimeIntegrationSchemeManager
()[
IntKey1
];
IntScheme
[
2
]
=
LibUtilities
::
TimeIntegrationSchemeManager
()[
IntKey2
];
// Initialise the scheme for actual time integration scheme
u
=
IntScheme
[
2
]
->
InitializeScheme
(
m_timestep
,
fields
,
m_time
,
m_ode
);
break
;
}
default:
{
ASSERTL0
(
false
,
"populate switch statement for "
"integration scheme"
);
}
}
IntScheme
=
LibUtilities
::
GetTimeIntegrationWrapperFactory
().
CreateInstance
(
LibUtilities
::
TimeIntegrationMethodMap
[
m_timeIntMethod
]);
numMultiSteps
=
IntScheme
->
GetIntegrationSteps
();
u
=
IntScheme
->
InitializeScheme
(
m_timestep
,
fields
,
m_time
,
m_ode
);
std
::
vector
<
FilterSharedPtr
>::
iterator
x
;
for
(
x
=
m_filters
.
begin
();
x
!=
m_filters
.
end
();
++
x
)
...
...
@@ -453,8 +276,7 @@ namespace Nektar
}
timer
.
Start
();
fields
=
IntScheme
[
min
(
step
,
numMultiSteps
-
1
)]
->
TimeIntegrate
(
m_timestep
,
u
,
m_ode
);
fields
=
IntScheme
->
TimeIntegrate
(
step
,
m_timestep
,
u
,
m_ode
);
timer
.
Stop
();
const
NekDouble
elapsed
=
timer
.
TimePerTest
(
1
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment