| 971 | |
| 972 | |
| 973 | void Foam::lduPrimitiveMesh::gather |
| 974 | ( |
| 975 | const label comm, |
| 976 | const lduMesh& mesh, |
| 977 | const labelList& procIDs, |
| 978 | PtrList<lduPrimitiveMesh>& otherMeshes |
| 979 | ) |
| 980 | { |
| 981 | // Force calculation of schedule (since does parallel comms) |
| 982 | (void)mesh.lduAddr().patchSchedule(); |
| 983 | |
| 984 | if (Pstream::myProcNo(comm) == procIDs[0]) |
| 985 | { |
| 986 | otherMeshes.setSize(procIDs.size()-1); |
| 987 | |
| 988 | // Slave meshes |
| 989 | for (label i = 1; i < procIDs.size(); i++) |
| 990 | { |
| 991 | //Pout<< "on master :" |
| 992 | // << " receiving from slave " << procIDs[i] << endl; |
| 993 | |
| 994 | IPstream fromSlave |
| 995 | ( |
| 996 | Pstream::commsTypes::scheduled, |
| 997 | procIDs[i], |
| 998 | 0, // bufSize |
| 999 | Pstream::msgType(), |
| 1000 | comm |
| 1001 | ); |
| 1002 | |
| 1003 | label nCells = readLabel(fromSlave); |
| 1004 | labelList lowerAddr(fromSlave); |
| 1005 | labelList upperAddr(fromSlave); |
| 1006 | boolList validInterface(fromSlave); |
| 1007 | |
| 1008 | |
| 1009 | // Construct mesh without interfaces |
| 1010 | otherMeshes.set |
| 1011 | ( |
| 1012 | i-1, |
| 1013 | new lduPrimitiveMesh |
| 1014 | ( |
| 1015 | nCells, |
| 1016 | lowerAddr, |
| 1017 | upperAddr, |
| 1018 | comm, |
| 1019 | true // reuse |
| 1020 | ) |
| 1021 | ); |
| 1022 | |
| 1023 | // Construct GAMGInterfaces |
| 1024 | lduInterfacePtrsList newInterfaces(validInterface.size()); |
| 1025 | forAll(validInterface, intI) |
| 1026 | { |
| 1027 | if (validInterface[intI]) |
| 1028 | { |
| 1029 | word coupleType(fromSlave); |
| 1030 |
no test coverage detected