19 lines
648 B
C++
19 lines
648 B
C++
//- write force displacement to file
|
|
if(historyPatchID != -1)
|
|
{
|
|
Info << "Found patch "<<historyPatchName<<", writing y force and displacement to file"
|
|
<< endl;
|
|
|
|
//- for small strain or moving mesh
|
|
vector force = gSum(mesh.boundary()[historyPatchID].Sf() & sigma.boundaryField()[historyPatchID]);
|
|
|
|
vector avDisp = gAverage(U.boundaryField()[historyPatchID]);
|
|
|
|
//- write to file
|
|
if(Pstream::master())
|
|
{
|
|
OFstream& forceDispFile = *filePtr;
|
|
forceDispFile << avDisp.x() << " " << avDisp.y() << " " << avDisp.z() << " "
|
|
<< force.x() << " " << force.y() << " " << force.z() << endl;
|
|
}
|
|
}
|