BUGFIX: Uninitialised member variables
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticAcpSolidFoam / aitkenRelaxation.H
bloba9e829bf8391456dfe74ac80dbf8ee3cbf659db4
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.1;
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;