Fixed URL for libccmio-2.6.1 (bug report #5 by Thomas Oliveira)
[foam-extend-3.2.git] / applications / solvers / solidMechanics / icoFsiElasticNonLinULSolidFoam / calcUnusedNewPoints.H
blob9f31f8f6512f3f6982202857e6a73a53e0920928
1 forAll(globalFaceZones, zoneI)
3     const label curZoneID = globalFaceZones[zoneI];
5     const labelList& curMap =
6         globalToLocalFaceZonePointMap[zoneI];
8     const labelList& curZoneMeshPoints =
9         stressMesh.faceZones()[curZoneID]().meshPoints();
11     vectorField curGlobalZonePointDispl
12     (
13         curZoneMeshPoints.size(),
14         vector::zero
15     );
17     //-Inter-proc points are shared by multiple procs
18     // pointNumProc is the number of procs which a point lies on
19     scalarField pointNumProcs(curZoneMeshPoints.size(), 0);
21     forAll(curGlobalZonePointDispl, globalPointI)
22     {
23         label localPoint = curMap[globalPointI];
25         if(curZoneMeshPoints[localPoint] < stressMesh.nPoints())
26         {
27             label procPoint = curZoneMeshPoints[localPoint];
29             curGlobalZonePointDispl[globalPointI] = pointDUI[procPoint];
31             pointNumProcs[globalPointI] = 1;
32         }
33     }
35     if (Pstream::parRun())
36     {
37         reduce(curGlobalZonePointDispl, sumOp<vectorField>());
38         reduce(pointNumProcs, sumOp<scalarField>());
40         //- now average the displacement between all procs
41         curGlobalZonePointDispl /= pointNumProcs;
42     }
44     //- The curZonePointsDisplGlobal now contains the correct face zone
45     //  displacement in a global master processor order, now convert them
46     //  back into the local proc order
48     vectorField curZonePointDispl
49     (
50         curZoneMeshPoints.size(),
51         vector::zero
52     );
54     forAll(curGlobalZonePointDispl, globalPointI)
55     {
56         label localPoint = curMap[globalPointI];
58         curZonePointDispl[localPoint] =
59             curGlobalZonePointDispl[globalPointI];
60     }
62     forAll(curZonePointDispl, pointI)
63     {
64         // unused points
65         if (curZoneMeshPoints[pointI] >= stressMesh.nPoints())
66         {
67             newPoints[curZoneMeshPoints[pointI]] +=
68                 curZonePointDispl[pointI];
69         }
70     }