2013-10-14 08:26:40 +00:00
|
|
|
forAll(globalFaceZones, zoneI)
|
|
|
|
{
|
|
|
|
const label curZoneID = globalFaceZones[zoneI];
|
|
|
|
|
2014-06-01 18:12:52 +00:00
|
|
|
const labelList& curMap =
|
2013-10-14 08:26:40 +00:00
|
|
|
globalToLocalFaceZonePointMap[zoneI];
|
|
|
|
|
|
|
|
const labelList& curZoneMeshPoints =
|
|
|
|
stressMesh.faceZones()[curZoneID]().meshPoints();
|
|
|
|
|
|
|
|
vectorField curGlobalZonePointDispl
|
|
|
|
(
|
2014-06-01 18:12:52 +00:00
|
|
|
curZoneMeshPoints.size(),
|
2013-10-14 08:26:40 +00:00
|
|
|
vector::zero
|
|
|
|
);
|
|
|
|
|
|
|
|
//-Inter-proc points are shared by multiple procs
|
|
|
|
// pointNumProc is the number of procs which a point lies on
|
|
|
|
scalarField pointNumProcs(curZoneMeshPoints.size(), 0);
|
|
|
|
|
|
|
|
forAll(curGlobalZonePointDispl, globalPointI)
|
|
|
|
{
|
|
|
|
label localPoint = curMap[globalPointI];
|
2014-06-01 18:12:52 +00:00
|
|
|
|
2013-10-14 08:26:40 +00:00
|
|
|
if(curZoneMeshPoints[localPoint] < stressMesh.nPoints())
|
|
|
|
{
|
|
|
|
label procPoint = curZoneMeshPoints[localPoint];
|
2014-06-01 18:12:52 +00:00
|
|
|
|
2013-10-14 08:26:40 +00:00
|
|
|
curGlobalZonePointDispl[globalPointI] = pointDUI[procPoint];
|
2014-06-01 18:12:52 +00:00
|
|
|
|
2013-10-14 08:26:40 +00:00
|
|
|
pointNumProcs[globalPointI] = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Pstream::parRun())
|
|
|
|
{
|
|
|
|
reduce(curGlobalZonePointDispl, sumOp<vectorField>());
|
|
|
|
reduce(pointNumProcs, sumOp<scalarField>());
|
|
|
|
|
|
|
|
//- now average the displacement between all procs
|
|
|
|
curGlobalZonePointDispl /= pointNumProcs;
|
|
|
|
}
|
|
|
|
|
2014-06-01 18:12:52 +00:00
|
|
|
//- The curZonePointsDisplGlobal now contains the correct face zone
|
|
|
|
// displacement in a global master processor order, now convert them
|
2013-10-14 08:26:40 +00:00
|
|
|
// back into the local proc order
|
|
|
|
|
|
|
|
vectorField curZonePointDispl
|
|
|
|
(
|
2014-06-01 18:12:52 +00:00
|
|
|
curZoneMeshPoints.size(),
|
2013-10-14 08:26:40 +00:00
|
|
|
vector::zero
|
|
|
|
);
|
|
|
|
|
|
|
|
forAll(curGlobalZonePointDispl, globalPointI)
|
|
|
|
{
|
|
|
|
label localPoint = curMap[globalPointI];
|
|
|
|
|
2014-06-01 18:12:52 +00:00
|
|
|
curZonePointDispl[localPoint] =
|
2013-10-14 08:26:40 +00:00
|
|
|
curGlobalZonePointDispl[globalPointI];
|
|
|
|
}
|
|
|
|
|
|
|
|
forAll(curZonePointDispl, pointI)
|
|
|
|
{
|
|
|
|
// unused points
|
|
|
|
if (curZoneMeshPoints[pointI] >= stressMesh.nPoints())
|
|
|
|
{
|
|
|
|
newPoints[curZoneMeshPoints[pointI]] +=
|
|
|
|
curZonePointDispl[pointI];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|