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

[Algorit] Use v to check convergence

parent 15421517
No related branches found
No related tags found
No related merge requests found
...@@ -373,11 +373,8 @@ int main(int argc, char *argv[]) { ...@@ -373,11 +373,8 @@ int main(int argc, char *argv[]) {
iterationCounter = velocityProblemSolver.getResult().iterations; iterationCounter = velocityProblemSolver.getResult().iterations;
}; };
// Since the velocity explodes in the quasistatic case, use the
// displacement as a convergence criterion
// Q: is this reasonable?
Vector u; Vector u;
Vector u_saved; Vector v_saved;
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) {
...@@ -410,7 +407,7 @@ int main(int argc, char *argv[]) { ...@@ -410,7 +407,7 @@ int main(int argc, char *argv[]) {
std::cout << '.' << std::flush; std::cout << '.' << std::flush;
if (stateFPI > 1) { if (stateFPI > 1) {
double const velocityCorrection = AMNorm.diff(u_saved, u); double const velocityCorrection = AMNorm.diff(v_saved, v);
if (velocityCorrection < fixedPointTolerance) if (velocityCorrection < fixedPointTolerance)
break; break;
} }
...@@ -418,7 +415,7 @@ int main(int argc, char *argv[]) { ...@@ -418,7 +415,7 @@ int main(int argc, char *argv[]) {
DUNE_THROW(Dune::Exception, "FPI failed to converge"); DUNE_THROW(Dune::Exception, "FPI failed to converge");
alpha_saved = alpha; alpha_saved = alpha;
u_saved = u; v_saved = v;
} }
if (printProgress) if (printProgress)
std::cout << std::endl; std::cout << std::endl;
......
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