Removed unneeded lib dependency from mdInitialise
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticPlasticNonLinTLSolidFoam / aitkenRelaxation.H
blobfb11c83537130f20d40be29c5f0b77d2af31cbd2
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)
14   {
15     aitkenTheta = 0.1;
16   }
17  else
18    {
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)
31        /
32        sumMagB;
33    }
35 // correction to the latest DU
36 DU += aitkenTheta*aitkenDelta*aitkenInitialRes;