Removed unneeded lib dependency from mdInitialise
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticOrthoAcpSolidFoam / aitkenRelaxation.H
blob4217104d721d5ec7d3f4c9348d0a7efa606c5b9c
1 // aitken acceleration 
2 aitkenDelta.storePrevIter();
4 // update delta
5 aitkenDelta = (U - U.prevIter()) / aitkenInitialRes;
7 // update relaxation factor
8 if(iCorr == 0)
9   {
10     aitkenTheta = 0.01;
11   }
12  else
13    {
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)
26        /
27        sumMagB;
28    }
30 // correction to the latest U
31 U += aitkenTheta*aitkenDelta*aitkenInitialRes;