Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticThermalSolidFoam / updateLoadingPatch.H
blobefb715b7b48e428a93cad020a4ef1e40751e5134
1 /* ------------------------------------------------------------------------- *\
2 ||                                                                           ||
3 ||                             Update loading patch                          ||
4 ||                                                                           ||
5 \* ------------------------------------------------------------------------- */
7     word patchName = "right";
8     label patchID = mesh.boundaryMesh().findPatchID(patchName);
9     if(patchID == -1)
10     {
11         FatalErrorIn("updateLoadingPatch.H") << "Patch " << patchName << " not found." << endl
12             << exit(FatalError);
13     }
15     //- update patch
16     if
17     (
18         U.boundaryField()[patchID].type()
19         == fixedValueFvPatchVectorField::typeName
20     )
21     {
22         //- 1 mm every 100 seconds
23         //- experimental ultimate failure occurred at 0.3 mm
24         vector disp(0.00001*runTime.value(), 0, 0);
25         U.boundaryField()[patchID] == disp;
27         Info << "Patch " << mesh.boundary()[patchID].name() << " has been updated"
28             << " to " << disp
29             << endl;
30     }
31     else
32     {
33         SeriousError << "Loading Patch " << patchName << " is type "
34             << U.boundaryField()[patchID].type()
35             << " and is not updated!" << endl
36             << exit(FatalError);
37     }
39 // ************************************************************************* //