Fixing indentation in applications/solvers/solidMechanics
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticAcpSolidFoam / aitkenRelaxation.H
blob18928201f711e98ae8658ec56ef00123b19ac2cb
1 // aitken acceleration
2 aitkenDelta.storePrevIter();
4 // update delta
5 aitkenDelta = (U - U.prevIter()) / aitkenInitialRes;
7 // update relaxation factor
8 if(iCorr == 0)
10     aitkenTheta = 0.1;
12 else
14     vectorField b = aitkenDelta.internalField() - aitkenDelta.prevIter().internalField();
15     //scalar sumMagB = gSum(mag(b));
16     scalar sumMagB = gSum(magSqr(b));
17     if(sumMagB < SMALL)
18     {
19         //Warning << "Aitken under-relaxation: denominator less then SMALL"
20         //    << endl;
21         sumMagB += SMALL;
22     }
24     aitkenTheta = -aitkenTheta*
25         gSum(aitkenDelta.prevIter().internalField() & b)/sumMagB;
28 // correction to the latest U
29 U += aitkenTheta*aitkenDelta*aitkenInitialRes;