1 //- write force displacement to file
2 if(historyPatchID != -1)
4 Info << "Writing disp-force to file for patch " << historyPatchName
7 //- for small strain or moving mesh
10 // (mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID])
13 //- for large strain total lagrangian
14 //tensorField F = I + gradU.boundaryField()[historyPatchID];
15 //vector force = gSum(mesh.Sf().boundaryField()[historyPatchID] & (sigma.boundaryField()[historyPatchID] & F));
17 //- for large strain updated lagrangian
18 vector force = gSum(mesh.Sf().boundaryField()[historyPatchID] & sigma.boundaryField()[historyPatchID]);
20 vector disp = gAverage(U.boundaryField()[historyPatchID]);
23 Info << "Writing strain-stress to file for patch " << historyPatchName
26 // avaerage stress strain
27 symmTensor stress = gAverage(sigma.boundaryField()[historyPatchID]);
28 symmTensor strain = gAverage(epsilon.boundaryField()[historyPatchID]);
34 OFstream& forceDispFile = *forceFilePtr;
36 forceDispFile << disp.x() << " " << disp.y() << " " << disp.z();
37 forceDispFile.width(width);
38 forceDispFile << force.x() << " " << force.y() << " " << force.z()
41 OFstream& stressStrainFile = *stressFilePtr;
42 stressStrainFile << strain.xx() << " " << strain.xy() << " " << strain.xz() << " "
43 << strain.yy() << " " << strain.yz() << " " << strain.zz();
44 stressStrainFile.width(width);
45 stressStrainFile << stress.xx() << " " << stress.xy() << " " << stress.xz() << " "
46 << stress.yy() << " " << stress.yz() << " " << stress.zz()