1 //- write force displacement to file
2 if(historyPatchID != -1)
4 Info << "Writing disp and force of patch "<<historyPatchName<<" to file"
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)
26 vector avDisp = gAverage(U.boundaryField()[historyPatchID]);
31 OFstream& forceDispFile = *filePtr;
32 forceDispFile << avDisp.x() << " " << avDisp.y() << " " << avDisp.z() << " "
33 << force.x() << " " << force.y() << " " << force.z() << endl;