1 OFstream* filePtr(NULL);
2 word historyPatchName(mesh.solutionDict().subDict("solidMechanics").lookup("historyPatch"));
3 label historyPatchID = mesh.boundaryMesh().findPatchID(historyPatchName);
4 if(historyPatchID == -1)
6 Warning << "history patch " << historyPatchName
7 << " not found. Force-displacement will not be written"
10 else if(Pstream::master())
12 Info << "Force-displacement for patch " << historyPatchName
13 << " will be written to forceDisp.dat"
15 word hisDirName("history");
17 filePtr = new OFstream(hisDirName/historyPatchName+"forceDisp.dat");
18 OFstream& forceDispFile = *filePtr;
19 forceDispFile << "#Disp(mm)\tForce(N)" << endl;