Skip to content
Snippets Groups Projects
Commit 3f38838b authored by Elias Pipping's avatar Elias Pipping
Browse files

[Algorit] Use 0.5*(V0 + V1) in state computation

parent adcb60c3
No related branches found
No related tags found
No related merge requests found
...@@ -318,6 +318,7 @@ int main(int argc, char *argv[]) { ...@@ -318,6 +318,7 @@ int main(int argc, char *argv[]) {
parset.get<double>("boundary.friction.L")); parset.get<double>("boundary.friction.L"));
Vector v = v_initial; Vector v = v_initial;
Vector v_m(fineVertexCount);
ScalarVector alpha(fineVertexCount); ScalarVector alpha(fineVertexCount);
auto const timeSteps = parset.get<size_t>("timeSteps.number"), auto const timeSteps = parset.get<size_t>("timeSteps.number"),
...@@ -378,7 +379,11 @@ int main(int argc, char *argv[]) { ...@@ -378,7 +379,11 @@ int main(int argc, char *argv[]) {
ScalarVector alpha_saved; ScalarVector alpha_saved;
double lastStateCorrection; double lastStateCorrection;
for (size_t stateFPI = 1; stateFPI <= maximumStateFPI; ++stateFPI) { for (size_t stateFPI = 1; stateFPI <= maximumStateFPI; ++stateFPI) {
stateUpdater->solve(v); timeSteppingScheme->extractOldVelocity(v_m);
v_m *= 0.5;
Arithmetic::addProduct(v_m, 0.5, v);
stateUpdater->solve(v_m);
stateUpdater->extractLogState(alpha); stateUpdater->extractLogState(alpha);
if (stateFPI == 1) if (stateFPI == 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment