Get list of my processor neighbours
| 47 | |
| 48 | // Get list of my processor neighbours |
| 49 | labelList procNeighbours(const polyMesh& mesh) |
| 50 | { |
| 51 | word procLabel = '[' + word(name(Pstream::myProcNo())) + "]-"; |
| 52 | |
| 53 | label nNeighbours = 0; |
| 54 | |
| 55 | forAll(mesh.boundaryMesh(), patchi) |
| 56 | { |
| 57 | if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchi])) |
| 58 | { |
| 59 | nNeighbours++; |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | labelList neighbours(nNeighbours); |
| 64 | |
| 65 | nNeighbours = 0; |
| 66 | |
| 67 | forAll(mesh.boundaryMesh(), patchi) |
| 68 | { |
| 69 | if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchi])) |
| 70 | { |
| 71 | const polyPatch& patch = mesh.boundaryMesh()[patchi]; |
| 72 | |
| 73 | const processorPolyPatch& procPatch = |
| 74 | refCast<const processorPolyPatch>(patch); |
| 75 | |
| 76 | label procId = procPatch.neighbProcNo() - Pstream::firstSlave() + 1; |
| 77 | |
| 78 | neighbours[nNeighbours++] = procId; |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | return neighbours; |
| 83 | } |
| 84 | |
| 85 | |
| 86 | // Calculate some average position for mesh. |
no test coverage detected