Fixing indentation in applications/solvers/solidMechanics
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticAcpSolidFoam / writeHistory.H
blobdcba5f2d825e180980d2c64003be52d0a7502602
1 //- write force displacement to file
2 if(historyPatchID != -1)
4     Info << "Writing disp and force of patch "<<historyPatchName<<" to file"
5         << endl;
7     //- for small strain or moving mesh
8     vector force = gSum(mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID]);
10     //- for large strain total lagrangian
11     // tensorField F = I + gradU.boundaryField()[historyPatchID];
12     // vectorField totalForce = mesh.Sf().boundaryField()[historyPatchID] & (sigma.boundaryField()[historyPatchID] & F);
14     //vector force = sum( totalForce );
16     //scalar force = force[vector::Y];
18     //- patchIntegrate utility integrates it this way but this is worng because the sigma tensor should
19     //- be dotted with the surface normal to give the actual traction/force
20     //- you cannot just take the component of the sigma tensor
21     //scalar forcePatchIntegrateMethod = gSum(
22     //     mesh.magSf().boundaryField()[historyPatchID]*
23     //     sigma.boundaryField()[historyPatchID].component(symmTensor::XY)
24     //);
26     vector avDisp = gAverage(U.boundaryField()[historyPatchID]);
28     //- write to file
29     if(Pstream::master())
30     {
31         OFstream& forceDispFile = *filePtr;
32         forceDispFile << avDisp.x() << " " << avDisp.y() << " " << avDisp.z() << " "
33             << force.x() << " " << force.y() << " " << force.z() << endl;
34     }