Replace tabs by 4 spaces in applications/solvers/solidMechanics
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticSolidFoam / aitkenRelaxation.H
blob77983904692646875a4540514f5c6481c5217778
1 // aitken acceleration
3 aitkenDelta.storePrevIter();
5 // update delta
6 aitkenDelta = (U - U.prevIter()) / aitkenInitialRes;
8 // update relaxation factor
9 if(iCorr == 0)
11     aitkenTheta = 0.1;
13 else
15     vectorField b = aitkenDelta.internalField()
16         - aitkenDelta.prevIter().internalField();
18     scalar sumMagB = gSum(magSqr(b));
19     if(sumMagB < SMALL)
20     {
21         // Warning << "Aitken under-relaxation: denominator less then SMALL"
22         // << endl;
23         sumMagB += SMALL;
24     }
26     aitkenTheta = -aitkenTheta*
27         gSum(aitkenDelta.prevIter().internalField() & b)/
28         sumMagB;
31 // correction to the latest U
32 U += aitkenTheta*aitkenDelta*aitkenInitialRes;