Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / solvers / solidMechanics / deprecatedSolvers / contactStressFoam / calculatePatchTraction.H
blob279adc08e3cf49f4325f8f95b81c07bdd1bc46e0
1     Info << "Calculating patch traction" << endl;
2     PtrList<vectorField> traction(mesh.boundary().size());
4     {
5         const surfaceVectorField::GeometricBoundaryField& Apatches =
6             mesh.Sf().boundaryField();
8         const surfaceScalarField::GeometricBoundaryField& magApatches =
9             mesh.magSf().boundaryField();
11         forAll(traction, patchI)
12         {
13             vectorField n = Apatches[patchI]/magApatches[patchI];
15             traction.set
16             (
17                 patchI,
18                 new vectorField
19                 (
20                     patchTraction[patchI]
21                   - patchPressure[patchI]*n
22                 )
23             );
24         }
25     }