This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/solidMechanics/elasticOrthoAcpSolidFoam/writeHistory.H
2014-06-01 20:12:52 +02:00

19 lines
642 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;
}
}