Skip to content
Snippets Groups Projects
Commit cdde58bb authored by Laura Stengel's avatar Laura Stengel
Browse files

use extrapolation in IterativePressureSolver

parent a6a065dc
No related branches found
No related tags found
No related merge requests found
Pipeline #414031 passed
...@@ -21,10 +21,21 @@ bool IterativePressureSolver::Method(IElasticity &assemble, Vector &u) { ...@@ -21,10 +21,21 @@ bool IterativePressureSolver::Method(IElasticity &assemble, Vector &u) {
<< endl; << endl;
Vector uNew(u); Vector uNew(u);
Vector uOld(u);
Vector deltaU(u);
bool useExtrapolation = false;
Config::Get("UseExtrapolation", useExtrapolation);
Initialize(assemble, uNew); Initialize(assemble, uNew);
while (!iteration.IsFinished()) { while (!iteration.IsFinished()) {
bool converged = Step(assemble, uNew); int n = iteration.Step();
if (n > 1) {
uOld = uNew; // u^{n-1}
}
bool converged = Step(assemble, uNew); // uNew = u^n
if(converged) { if(converged) {
//mapping von corse to finer //mapping von corse to finer
...@@ -42,6 +53,11 @@ bool IterativePressureSolver::Method(IElasticity &assemble, Vector &u) { ...@@ -42,6 +53,11 @@ bool IterativePressureSolver::Method(IElasticity &assemble, Vector &u) {
return Method(assemble, u); return Method(assemble, u);
return false; return false;
} }
// Extrapolation ab n = 2
if (useExtrapolation && n >= 2) {
deltaU = uNew - uOld; // Δu = u^n - u^{n-1}
uNew += deltaU; // Extrapolation: u^n = 2 u^n - u^{n-1}
}
} }
mout.EndBlock(); mout.EndBlock();
return true; return true;
......
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