Removed unneeded lib dependency from mdInitialise
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticSolidFoam / calculateRelativeResidual.H
blobb45fa7af5c3ae985aff994b3496003193fdb4abe
2   //scalarField magDU = mag(U.internalField() - U.oldTime().internalField());
3     // forAll(magDU, cellI)
4     // {
5     //     if (magDU[cellI] < SMALL)
6     //     {
7     //         magDU[cellI] = SMALL;
8     //     }
9     // }
11     // relativeResidual =
12     //     gMax
13     //     (
14     //         mag
15     //         (
16     //             U.internalField()
17     //           - U.prevIter().internalField()
18     //         )
19     //        /magDU
20     //     );
22     scalar maxDU = gMax(mag(U.internalField() - U.oldTime().internalField()));
23     relativeResidual =
24         gMax
25         (
26             mag(U.internalField() - U.prevIter().internalField())
27            /(maxDU + SMALL)
28         );