MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / gather

Function gather

src/OpenFOAM/meshes/lduMesh/lduPrimitiveMesh.C:973–1096  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

971
972
973void 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

Callers 6

gatherMethod · 0.85
gatherScatter.CFile · 0.85
reduceFunction · 0.85

Calls 11

readLabelFunction · 0.85
GAMGInterfaceClass · 0.85
findIndexFunction · 0.85
lduPrimitiveMeshClass · 0.70
forAllFunction · 0.50
setSizeMethod · 0.45
sizeMethod · 0.45
setMethod · 0.45
ptrMethod · 0.45
typeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected