1 labelList globalFaceZones;
4 SLList<label> globalFaceZonesSet;
6 const faceZoneMesh& faceZones = mesh.faceZones();
8 forAll(faceZones, zoneI)
10 const faceZone& curFaceZone = faceZones[zoneI];
12 forAll(curFaceZone, faceI)
14 // if unused face exist
15 if (curFaceZone[faceI] >= mesh.nFaces())
17 globalFaceZonesSet.insert(zoneI);
23 globalFaceZones = labelList(globalFaceZonesSet);
26 labelListList globalToLocalFaceZonePointMap
28 globalFaceZones.size()
31 forAll(globalFaceZones, zoneI)
33 label curZoneID = globalFaceZones[zoneI];
35 labelList curMap(mesh.faceZones()[curZoneID]().nPoints(), -1);
37 vectorField fzGlobalPoints =
38 mesh.faceZones()[curZoneID]().localPoints();
40 //- set all slave points to zero because only the master order is used
41 if(!Pstream::master())
43 fzGlobalPoints *= 0.0;
46 //- pass points to all procs
47 reduce(fzGlobalPoints, sumOp<vectorField>());
49 //- now every proc has the master's list of FZ points
50 //- every proc must now find the mapping from their local FZ points to
51 //- the global FZ points
53 const vectorField& fzLocalPoints =
54 mesh.faceZones()[curZoneID]().localPoints();
56 const edgeList& fzLocalEdges =
57 mesh.faceZones()[curZoneID]().edges();
59 const labelListList& fzPointEdges =
60 mesh.faceZones()[curZoneID]().pointEdges();
62 scalarField minEdgeLength(fzLocalPoints.size(), GREAT);
64 forAll(minEdgeLength, pI)
66 const labelList& curPointEdges = fzPointEdges[pI];
68 forAll(curPointEdges, eI)
70 scalar Le = fzLocalEdges[curPointEdges[eI]].mag(fzLocalPoints);
71 if (Le < minEdgeLength[pI])
73 minEdgeLength[pI] = Le;
78 forAll(fzGlobalPoints, globalPointI)
80 // scalar minDist = GREAT;
82 forAll(fzLocalPoints, procPointI)
87 fzLocalPoints[procPointI]
88 - fzGlobalPoints[globalPointI]
91 // if (curDist < minDist)
96 if (curDist < 1e-4*minEdgeLength[procPointI])
98 curMap[globalPointI] = procPointI;
103 // if (curMap[globalPointI] == -1)
105 // Pout << "minDist: " << minDist << endl;
109 forAll(curMap, globalPointI)
111 if (curMap[globalPointI] == -1)
113 FatalErrorIn(args.executable())
114 << "local to global face zone point map is not correct"
115 << abort(FatalError);
119 globalToLocalFaceZonePointMap[zoneI] = curMap;