Fixing indentation in applications/solvers/solidMechanics
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticPlasticNonLinTLSolidFoam / aitkenRelaxation.H
blobd2553ced3e794c12076af6f05170a2e947cf5864
1 // aitken acceleration
2 if(iCorr == 0)
3   {
4     aitkenInitialRes = gMax(mag(DU.internalField()));
5   }
7 aitkenDelta.storePrevIter();
9 // update delta
10 aitkenDelta = (DU - DU.prevIter()) / aitkenInitialRes;
12 // update relaxation factor
13 if(iCorr == 0)
15     aitkenTheta = 0.1;
17 else
19     vectorField b = aitkenDelta.internalField() - aitkenDelta.prevIter().internalField();
20     //scalar sumMagB = gSum(mag(b));
21     scalar sumMagB = gSum(magSqr(b));
22     if(sumMagB < SMALL)
23     {
24         //Warning << "Aitken under-relaxation: denominator less then SMALL"
25         //    << endl;
26         sumMagB += SMALL;
27     }
29     aitkenTheta = -aitkenTheta*
30         gSum(aitkenDelta.prevIter().internalField() & b)/sumMagB;
33 // correction to the latest DU
34 DU += aitkenTheta*aitkenDelta*aitkenInitialRes;