1 OFstream* forceFilePtr(NULL);
2 OFstream* stressFilePtr(NULL);
3 word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch"));
4 label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName);
5 if(historyPatchID == -1)
7 Warning << "history patch " << historyPatchName
8 << " not found. Force-displacement will not be written"
11 else if(Pstream::master())
13 fileName historyDir = "history";
17 fileName forceFileName(historyDir/"forceDisp_"+historyPatchName+".dat");
18 Info << "\nForce-displacement for patch " << historyPatchName
19 << " will be written to " << forceFileName
21 forceFilePtr = new OFstream(forceFileName);
22 OFstream& forceDispFile = *forceFilePtr;
23 forceDispFile << "#Disp(mm)\tForce(N)" << endl;
27 fileName stressFileName(historyDir/"stressStrain_"+historyPatchName+".dat");
28 Info << "\nStress(2nd Piola-Kirchoff)-strain(Green) for patch "
30 << " will be written to " << stressFileName
32 stressFilePtr = new OFstream(stressFileName);
33 OFstream& stressStrainFile = *stressFilePtr;
34 stressStrainFile << "#Strain(-)\tStress(Pa)" << endl;