Remove trailing whitespace systematically
[foam-extend-3.2.git] / applications / solvers / solidMechanics / viscoElasticSolidFoam / updateBoundaryConditions.H
blob22ffb0ec07da0b77974f7929388041c3898fd5dd
3     label patchID = mesh.boundaryMesh().findPatchID("loadedEnd");
5     if(patchID == -1)
6     {
7         FatalErrorIn(args.executable())
8             << "Can't find patch with name loadedEnd" << abort(FatalError);
9     }
11     if
12     (
13         DU.boundaryField()[patchID].type()
14      != tractionDisplacementIncrementFvPatchVectorField::typeName
15     )
16     {
17         FatalErrorIn(args.executable())
18             << "Bounary condition on " << DU.name()
19                 <<  " is "
20                 << DU.boundaryField()[patchID].type()
21                 << "for patch: " << mesh.boundaryMesh()[patchID].name()
22                 <<  ", instead "
23                 << tractionDisplacementIncrementFvPatchVectorField::typeName
24                 << abort(FatalError);
25     }
27     tractionDisplacementIncrementFvPatchVectorField& tractionPatch =
28         refCast<tractionDisplacementIncrementFvPatchVectorField>
29         (
30             DU.boundaryField()[patchID]
31         );
33     vectorField n = mesh.boundary()[patchID].nf();
35     vector traction = vector::zero;
36     vector DTraction = vector::zero;
38     if(runTime.timeIndex()==1)
39     {
40         traction = vector::zero;
41         DTraction = maxTraction;
42     }
43     else if(runTime.timeIndex()>=2)
44     {
45         traction = maxTraction;
46         DTraction = vector::zero;
47     }
49     vectorField relaxedTraction =
50         (
51             n
52           & (
53                 sigma.boundaryField()[patchID]
54               + DSigmaCorr.boundaryField()[patchID]
55             )
56         );
58     tractionPatch.DTraction() = DTraction + (traction - relaxedTraction);
60     tractionPatch.DPressure() = 0.0;