Removed unneeded lib dependency from mdInitialise
[foam-extend-3.2.git] / applications / solvers / solidMechanics / elasticNonLinULSolidFoam / calcUnusedNewPoints.H
blob0f5599bec9d387ca94311f04b7e43da1ecf3cc36
1 forAll(globalFaceZones, zoneI)
3     const label curZoneID = globalFaceZones[zoneI];
5     const labelList& curMap = 
6         globalToLocalFaceZonePointMap[zoneI];
8     const labelList& curZoneMeshPoints =
9         mesh.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];
24             
25         if(curZoneMeshPoints[localPoint] < mesh.nPoints())
26         {
27             label procPoint = curZoneMeshPoints[localPoint];
28             
29             curGlobalZonePointDispl[globalPointI] = pointDUI[procPoint];
30             
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] >= mesh.nPoints())
66         {
67             newPoints[curZoneMeshPoints[pointI]] +=
68                 curZonePointDispl[pointI];
69         }
70     }