ENH: non-blocking for all transfers to master.
This commit is contained in:
parent
827d7d7a8f
commit
7cd9f82373
@ -110,30 +110,40 @@ void writeAllData
|
|||||||
{
|
{
|
||||||
if (nPrims)
|
if (nPrims)
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
||||||
|
{
|
||||||
|
toMaster<< map(vf, prims, cmpt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
ensightFile << key << nl;
|
ensightFile << key << nl;
|
||||||
|
|
||||||
|
PtrList<UIPstream> fromSlaves(Pstream::nProcs());
|
||||||
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
|
{
|
||||||
|
fromSlaves.set(slave, new UIPstream(slave, pBufs));
|
||||||
|
}
|
||||||
|
|
||||||
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
||||||
{
|
{
|
||||||
writeData(map(vf, prims, cmpt), ensightFile);
|
writeData(map(vf, prims, cmpt), ensightFile);
|
||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
scalarField data(fromSlaves[slave]);
|
||||||
scalarField data(fromSlave);
|
|
||||||
writeData(data, ensightFile);
|
writeData(data, ensightFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< map(vf, prims, cmpt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,30 +160,40 @@ void writeAllDataBinary
|
|||||||
{
|
{
|
||||||
if (nPrims)
|
if (nPrims)
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
||||||
|
{
|
||||||
|
toMaster<< map(vf, prims, cmpt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
writeEnsDataBinary(key,ensightFile);
|
writeEnsDataBinary(key,ensightFile);
|
||||||
|
|
||||||
|
PtrList<UIPstream> fromSlaves(Pstream::nProcs());
|
||||||
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
|
{
|
||||||
|
fromSlaves.set(slave, new UIPstream(slave, pBufs));
|
||||||
|
}
|
||||||
|
|
||||||
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
||||||
{
|
{
|
||||||
writeEnsDataBinary(map(vf, prims, cmpt), ensightFile);
|
writeEnsDataBinary(map(vf, prims, cmpt), ensightFile);
|
||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
scalarField data(fromSlaves[slave]);
|
||||||
scalarField data(fromSlave);
|
|
||||||
writeEnsDataBinary(data, ensightFile);
|
writeEnsDataBinary(data, ensightFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< map(vf, prims, cmpt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,31 +210,40 @@ void writeAllFaceData
|
|||||||
{
|
{
|
||||||
if (nPrims)
|
if (nPrims)
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
||||||
|
{
|
||||||
|
toMaster<< map(pf, prims, cmpt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
ensightFile << key << nl;
|
ensightFile << key << nl;
|
||||||
|
|
||||||
|
PtrList<UIPstream> fromSlaves(Pstream::nProcs());
|
||||||
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
|
{
|
||||||
|
fromSlaves.set(slave, new UIPstream(slave, pBufs));
|
||||||
|
}
|
||||||
|
|
||||||
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
||||||
{
|
{
|
||||||
writeData(map(pf, prims, cmpt), ensightFile);
|
writeData(map(pf, prims, cmpt), ensightFile);
|
||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
scalarField pf(fromSlaves[slave]);
|
||||||
scalarField pf(fromSlave);
|
|
||||||
|
|
||||||
writeData(pf, ensightFile);
|
writeData(pf, ensightFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< map(pf, prims, cmpt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,31 +260,40 @@ void writeAllFaceDataBinary
|
|||||||
{
|
{
|
||||||
if (nPrims)
|
if (nPrims)
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
||||||
|
{
|
||||||
|
toMaster<< map(pf, prims, cmpt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
writeEnsDataBinary(key,ensightFile);
|
writeEnsDataBinary(key,ensightFile);
|
||||||
|
|
||||||
|
PtrList<UIPstream> fromSlaves(Pstream::nProcs());
|
||||||
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
|
{
|
||||||
|
fromSlaves.set(slave, new UIPstream(slave, pBufs));
|
||||||
|
}
|
||||||
|
|
||||||
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
||||||
{
|
{
|
||||||
writeEnsDataBinary(map(pf, prims, cmpt), ensightFile);
|
writeEnsDataBinary(map(pf, prims, cmpt), ensightFile);
|
||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
scalarField pf(fromSlaves[slave]);
|
||||||
scalarField pf(fromSlave);
|
|
||||||
|
|
||||||
writeEnsDataBinary(pf, ensightFile);
|
writeEnsDataBinary(pf, ensightFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< map(pf, prims, cmpt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -554,10 +592,29 @@ void ensightFieldAscii
|
|||||||
|
|
||||||
if (meshCellSets.nHexesWedges)
|
if (meshCellSets.nHexesWedges)
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
||||||
|
{
|
||||||
|
toMaster<< map(vf, hexes, wedges, cmpt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
ensightFile << "hexa8" << nl;
|
ensightFile << "hexa8" << nl;
|
||||||
|
|
||||||
|
PtrList<UIPstream> fromSlaves(Pstream::nProcs());
|
||||||
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
|
{
|
||||||
|
fromSlaves.set(slave, new UIPstream(slave, pBufs));
|
||||||
|
}
|
||||||
|
|
||||||
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
||||||
{
|
{
|
||||||
writeData
|
writeData
|
||||||
@ -568,20 +625,11 @@ void ensightFieldAscii
|
|||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
scalarField data(fromSlaves[slave]);
|
||||||
scalarField data(fromSlave);
|
|
||||||
writeData(data, ensightFile);
|
writeData(data, ensightFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< map(vf, hexes, wedges, cmpt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
writeAllData("penta6", vf, prisms, meshCellSets.nPrisms, ensightFile);
|
writeAllData("penta6", vf, prisms, meshCellSets.nPrisms, ensightFile);
|
||||||
@ -695,10 +743,29 @@ void ensightFieldBinary
|
|||||||
|
|
||||||
if (meshCellSets.nHexesWedges)
|
if (meshCellSets.nHexesWedges)
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
||||||
|
{
|
||||||
|
toMaster<< map(vf, hexes, wedges, cmpt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
writeEnsDataBinary("hexa8",ensightFile);
|
writeEnsDataBinary("hexa8",ensightFile);
|
||||||
|
|
||||||
|
PtrList<UIPstream> fromSlaves(Pstream::nProcs());
|
||||||
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
|
{
|
||||||
|
fromSlaves.set(slave, new UIPstream(slave, pBufs));
|
||||||
|
}
|
||||||
|
|
||||||
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
||||||
{
|
{
|
||||||
writeEnsDataBinary
|
writeEnsDataBinary
|
||||||
@ -709,20 +776,11 @@ void ensightFieldBinary
|
|||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
scalarField data(fromSlaves[slave]);
|
||||||
scalarField data(fromSlave);
|
|
||||||
writeEnsDataBinary(data, ensightFile);
|
writeEnsDataBinary(data, ensightFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< map(vf, hexes, wedges, cmpt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
writeAllDataBinary
|
writeAllDataBinary
|
||||||
|
@ -467,6 +467,17 @@ void Foam::ensightMesh::writeAllPolys
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Number of faces for each poly cell
|
// Number of faces for each poly cell
|
||||||
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
toMaster<< meshCellSets_.polys << cellFaces;
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
// Master
|
// Master
|
||||||
@ -479,7 +490,7 @@ void Foam::ensightMesh::writeAllPolys
|
|||||||
// Slaves
|
// Slaves
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
UIPstream fromSlave(slave, pBufs);
|
||||||
labelList polys(fromSlave);
|
labelList polys(fromSlave);
|
||||||
cellList cellFaces(fromSlave);
|
cellList cellFaces(fromSlave);
|
||||||
|
|
||||||
@ -491,14 +502,20 @@ void Foam::ensightMesh::writeAllPolys
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< meshCellSets_.polys << cellFaces;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Number of points for each face of the above list
|
// Number of points for each face of the above list
|
||||||
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
toMaster<< meshCellSets_.polys << cellFaces << faces;
|
||||||
|
}
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
// Master
|
// Master
|
||||||
@ -512,7 +529,7 @@ void Foam::ensightMesh::writeAllPolys
|
|||||||
// Slaves
|
// Slaves
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
UIPstream fromSlave(slave, pBufs);
|
||||||
labelList polys(fromSlave);
|
labelList polys(fromSlave);
|
||||||
cellList cellFaces(fromSlave);
|
cellList cellFaces(fromSlave);
|
||||||
faceList faces(fromSlave);
|
faceList faces(fromSlave);
|
||||||
@ -526,13 +543,21 @@ void Foam::ensightMesh::writeAllPolys
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< meshCellSets_.polys << cellFaces << faces;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// List of points id for each face of the above list
|
// List of points id for each face of the above list
|
||||||
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
toMaster<< meshCellSets_.polys << cellFaces << faces;
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
// Master
|
// Master
|
||||||
@ -546,7 +571,7 @@ void Foam::ensightMesh::writeAllPolys
|
|||||||
// Slaves
|
// Slaves
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
UIPstream fromSlave(slave, pBufs);
|
||||||
labelList polys(fromSlave);
|
labelList polys(fromSlave);
|
||||||
cellList cellFaces(fromSlave);
|
cellList cellFaces(fromSlave);
|
||||||
faceList faces(fromSlave);
|
faceList faces(fromSlave);
|
||||||
@ -560,10 +585,6 @@ void Foam::ensightMesh::writeAllPolys
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< meshCellSets_.polys << cellFaces << faces;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -659,37 +680,55 @@ void Foam::ensightMesh::writeAllPolysBinary
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Number of faces for each poly cell
|
// Number of faces for each poly cell
|
||||||
if (Pstream::master())
|
|
||||||
{
|
{
|
||||||
// Master
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
writePolysNFacesBinary
|
|
||||||
(
|
|
||||||
meshCellSets_.polys,
|
|
||||||
cellFaces,
|
|
||||||
ensightGeometryFile
|
|
||||||
);
|
|
||||||
// Slaves
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
|
||||||
{
|
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
|
||||||
labelList polys(fromSlave);
|
|
||||||
cellList cellFaces(fromSlave);
|
|
||||||
|
|
||||||
writePolysNFacesBinary
|
if (!Pstream::master())
|
||||||
(
|
|
||||||
polys,
|
|
||||||
cellFaces,
|
|
||||||
ensightGeometryFile
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
toMaster<< meshCellSets_.polys << cellFaces;
|
toMaster<< meshCellSets_.polys << cellFaces;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
|
if (Pstream::master())
|
||||||
|
{
|
||||||
|
// Master
|
||||||
|
writePolysNFacesBinary
|
||||||
|
(
|
||||||
|
meshCellSets_.polys,
|
||||||
|
cellFaces,
|
||||||
|
ensightGeometryFile
|
||||||
|
);
|
||||||
|
// Slaves
|
||||||
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
|
{
|
||||||
|
UIPstream fromSlave(slave, pBufs);
|
||||||
|
labelList polys(fromSlave);
|
||||||
|
cellList cellFaces(fromSlave);
|
||||||
|
|
||||||
|
writePolysNFacesBinary
|
||||||
|
(
|
||||||
|
polys,
|
||||||
|
cellFaces,
|
||||||
|
ensightGeometryFile
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Number of points for each face of the above list
|
// Number of points for each face of the above list
|
||||||
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
toMaster<< meshCellSets_.polys << cellFaces << faces;
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
// Master
|
// Master
|
||||||
@ -703,7 +742,7 @@ void Foam::ensightMesh::writeAllPolysBinary
|
|||||||
// Slaves
|
// Slaves
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
UIPstream fromSlave(slave, pBufs);
|
||||||
labelList polys(fromSlave);
|
labelList polys(fromSlave);
|
||||||
cellList cellFaces(fromSlave);
|
cellList cellFaces(fromSlave);
|
||||||
faceList faces(fromSlave);
|
faceList faces(fromSlave);
|
||||||
@ -717,13 +756,20 @@ void Foam::ensightMesh::writeAllPolysBinary
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< meshCellSets_.polys << cellFaces << faces;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of points id for each face of the above list
|
// List of points id for each face of the above list
|
||||||
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
toMaster<< meshCellSets_.polys << cellFaces << faces;
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
// Master
|
// Master
|
||||||
@ -737,7 +783,7 @@ void Foam::ensightMesh::writeAllPolysBinary
|
|||||||
// Slaves
|
// Slaves
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
UIPstream fromSlave(slave, pBufs);
|
||||||
labelList polys(fromSlave);
|
labelList polys(fromSlave);
|
||||||
cellList cellFaces(fromSlave);
|
cellList cellFaces(fromSlave);
|
||||||
faceList faces(fromSlave);
|
faceList faces(fromSlave);
|
||||||
@ -751,10 +797,6 @@ void Foam::ensightMesh::writeAllPolysBinary
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< meshCellSets_.polys << cellFaces << faces;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -770,6 +812,16 @@ void Foam::ensightMesh::writeAllPrims
|
|||||||
{
|
{
|
||||||
if (nPrims)
|
if (nPrims)
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
toMaster<< cellShapes;
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
ensightGeometryFile << key << nl << setw(10) << nPrims << nl;
|
ensightGeometryFile << key << nl << setw(10) << nPrims << nl;
|
||||||
@ -778,17 +830,12 @@ void Foam::ensightMesh::writeAllPrims
|
|||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
UIPstream fromSlave(slave, pBufs);
|
||||||
cellShapeList cellShapes(fromSlave);
|
cellShapeList cellShapes(fromSlave);
|
||||||
|
|
||||||
writePrims(cellShapes, ensightGeometryFile);
|
writePrims(cellShapes, ensightGeometryFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< cellShapes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -803,6 +850,16 @@ void Foam::ensightMesh::writeAllPrimsBinary
|
|||||||
{
|
{
|
||||||
if (nPrims)
|
if (nPrims)
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
toMaster<< cellShapes;
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
writeEnsDataBinary(key,ensightGeometryFile);
|
writeEnsDataBinary(key,ensightGeometryFile);
|
||||||
@ -812,17 +869,12 @@ void Foam::ensightMesh::writeAllPrimsBinary
|
|||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
UIPstream fromSlave(slave, pBufs);
|
||||||
cellShapeList cellShapes(fromSlave);
|
cellShapeList cellShapes(fromSlave);
|
||||||
|
|
||||||
writePrimsBinary(cellShapes, ensightGeometryFile);
|
writePrimsBinary(cellShapes, ensightGeometryFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< cellShapes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -832,8 +884,6 @@ void Foam::ensightMesh::writeFacePrims
|
|||||||
const faceList& patchFaces,
|
const faceList& patchFaces,
|
||||||
OFstream& ensightGeometryFile
|
OFstream& ensightGeometryFile
|
||||||
) const
|
) const
|
||||||
{
|
|
||||||
if (patchFaces.size())
|
|
||||||
{
|
{
|
||||||
forAll(patchFaces, i)
|
forAll(patchFaces, i)
|
||||||
{
|
{
|
||||||
@ -846,7 +896,6 @@ void Foam::ensightMesh::writeFacePrims
|
|||||||
ensightGeometryFile << nl;
|
ensightGeometryFile << nl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::ensightMesh::writeFacePrimsBinary
|
void Foam::ensightMesh::writeFacePrimsBinary
|
||||||
@ -854,8 +903,6 @@ void Foam::ensightMesh::writeFacePrimsBinary
|
|||||||
const faceList& patchFaces,
|
const faceList& patchFaces,
|
||||||
std::ofstream& ensightGeometryFile
|
std::ofstream& ensightGeometryFile
|
||||||
) const
|
) const
|
||||||
{
|
|
||||||
if (patchFaces.size())
|
|
||||||
{
|
{
|
||||||
forAll(patchFaces, i)
|
forAll(patchFaces, i)
|
||||||
{
|
{
|
||||||
@ -867,7 +914,6 @@ void Foam::ensightMesh::writeFacePrimsBinary
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::ensightMesh::writeAllFacePrims
|
void Foam::ensightMesh::writeAllFacePrims
|
||||||
@ -881,6 +927,16 @@ void Foam::ensightMesh::writeAllFacePrims
|
|||||||
{
|
{
|
||||||
if (nPrims)
|
if (nPrims)
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
toMaster<< UIndirectList<face>(patchFaces, prims);
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
ensightGeometryFile << key << nl << setw(10) << nPrims << nl;
|
ensightGeometryFile << key << nl << setw(10) << nPrims << nl;
|
||||||
@ -893,17 +949,12 @@ void Foam::ensightMesh::writeAllFacePrims
|
|||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
UIPstream fromSlave(slave, pBufs);
|
||||||
faceList patchFaces(fromSlave);
|
faceList patchFaces(fromSlave);
|
||||||
|
|
||||||
writeFacePrims(patchFaces, ensightGeometryFile);
|
writeFacePrims(patchFaces, ensightGeometryFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< UIndirectList<face>(patchFaces, prims);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -948,6 +999,17 @@ void Foam::ensightMesh::writeAllNSided
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Number of points for each face
|
// Number of points for each face
|
||||||
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
toMaster<< UIndirectList<face>(patchFaces, prims);
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
writeNSidedNPointsPerFace
|
writeNSidedNPointsPerFace
|
||||||
@ -958,7 +1020,7 @@ void Foam::ensightMesh::writeAllNSided
|
|||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
UIPstream fromSlave(slave, pBufs);
|
||||||
faceList patchFaces(fromSlave);
|
faceList patchFaces(fromSlave);
|
||||||
|
|
||||||
writeNSidedNPointsPerFace
|
writeNSidedNPointsPerFace
|
||||||
@ -968,13 +1030,20 @@ void Foam::ensightMesh::writeAllNSided
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< UIndirectList<face>(patchFaces, prims);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of points id for each face
|
// List of points id for each face
|
||||||
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
toMaster<< UIndirectList<face>(patchFaces, prims);
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
writeNSidedPoints
|
writeNSidedPoints
|
||||||
@ -985,16 +1054,12 @@ void Foam::ensightMesh::writeAllNSided
|
|||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
UIPstream fromSlave(slave, pBufs);
|
||||||
faceList patchFaces(fromSlave);
|
faceList patchFaces(fromSlave);
|
||||||
|
|
||||||
writeNSidedPoints(patchFaces, ensightGeometryFile);
|
writeNSidedPoints(patchFaces, ensightGeometryFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< UIndirectList<face>(patchFaces, prims);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1040,6 +1105,17 @@ void Foam::ensightMesh::writeAllNSidedBinary
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Number of points for each face
|
// Number of points for each face
|
||||||
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
toMaster<< UIndirectList<face>(patchFaces, prims);
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
writeNSidedNPointsPerFaceBinary
|
writeNSidedNPointsPerFaceBinary
|
||||||
@ -1050,7 +1126,7 @@ void Foam::ensightMesh::writeAllNSidedBinary
|
|||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
UIPstream fromSlave(slave, pBufs);
|
||||||
faceList patchFaces(fromSlave);
|
faceList patchFaces(fromSlave);
|
||||||
|
|
||||||
writeNSidedNPointsPerFaceBinary
|
writeNSidedNPointsPerFaceBinary
|
||||||
@ -1060,13 +1136,20 @@ void Foam::ensightMesh::writeAllNSidedBinary
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< UIndirectList<face>(patchFaces, prims);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of points id for each face
|
// List of points id for each face
|
||||||
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
toMaster<< UIndirectList<face>(patchFaces, prims);
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
writeNSidedPointsBinary
|
writeNSidedPointsBinary
|
||||||
@ -1077,16 +1160,16 @@ void Foam::ensightMesh::writeAllNSidedBinary
|
|||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
UIPstream fromSlave(slave, pBufs);
|
||||||
faceList patchFaces(fromSlave);
|
faceList patchFaces(fromSlave);
|
||||||
|
|
||||||
writeNSidedPointsBinary(patchFaces, ensightGeometryFile);
|
writeNSidedPointsBinary
|
||||||
|
(
|
||||||
|
patchFaces,
|
||||||
|
ensightGeometryFile
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< UIndirectList<face>(patchFaces, prims);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1103,6 +1186,16 @@ void Foam::ensightMesh::writeAllFacePrimsBinary
|
|||||||
{
|
{
|
||||||
if (nPrims)
|
if (nPrims)
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
toMaster<< UIndirectList<face>(patchFaces, prims);
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
writeEnsDataBinary(key,ensightGeometryFile);
|
writeEnsDataBinary(key,ensightGeometryFile);
|
||||||
@ -1116,17 +1209,12 @@ void Foam::ensightMesh::writeAllFacePrimsBinary
|
|||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
UIPstream fromSlave(slave, pBufs);
|
||||||
faceList patchFaces(fromSlave);
|
faceList patchFaces(fromSlave);
|
||||||
|
|
||||||
writeFacePrimsBinary(patchFaces, ensightGeometryFile);
|
writeFacePrimsBinary(patchFaces, ensightGeometryFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< UIndirectList<face>(patchFaces, prims);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1245,6 +1333,20 @@ void Foam::ensightMesh::writeAscii
|
|||||||
{
|
{
|
||||||
label nPoints = globalPoints.size();
|
label nPoints = globalPoints.size();
|
||||||
|
|
||||||
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
for (direction d=0; d<vector::nComponents; d++)
|
||||||
|
{
|
||||||
|
toMaster<< uniquePoints.component(d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
@ -1255,25 +1357,24 @@ void Foam::ensightMesh::writeAscii
|
|||||||
<< setw(10) << nPoints
|
<< setw(10) << nPoints
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
|
|
||||||
|
PtrList<UIPstream> fromSlaves(Pstream::nProcs());
|
||||||
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
|
{
|
||||||
|
fromSlaves.set(slave, new UIPstream(slave, pBufs));
|
||||||
|
}
|
||||||
|
|
||||||
for (direction d=0; d<vector::nComponents; d++)
|
for (direction d=0; d<vector::nComponents; d++)
|
||||||
{
|
{
|
||||||
writePoints(uniquePoints.component(d), ensightGeometryFile);
|
writePoints(uniquePoints.component(d), ensightGeometryFile);
|
||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
scalarField pointsComponent(fromSlaves[slave]);
|
||||||
scalarField pointsComponent(fromSlave);
|
|
||||||
writePoints(pointsComponent, ensightGeometryFile);
|
writePoints(pointsComponent, ensightGeometryFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
for (direction d=0; d<vector::nComponents; d++)
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< uniquePoints.component(d);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1352,7 +1453,6 @@ void Foam::ensightMesh::writeAscii
|
|||||||
uniqueMeshPointLabels
|
uniqueMeshPointLabels
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
pointField uniquePoints(mesh_.points(), uniqueMeshPointLabels);
|
pointField uniquePoints(mesh_.points(), uniqueMeshPointLabels);
|
||||||
// Renumber the patch faces
|
// Renumber the patch faces
|
||||||
faceList patchFaces(p.localFaces());
|
faceList patchFaces(p.localFaces());
|
||||||
@ -1362,6 +1462,20 @@ void Foam::ensightMesh::writeAscii
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
for (direction d=0; d<vector::nComponents; d++)
|
||||||
|
{
|
||||||
|
toMaster<< uniquePoints.component(d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
@ -1372,6 +1486,12 @@ void Foam::ensightMesh::writeAscii
|
|||||||
<< setw(10) << globalPointsPtr().size()
|
<< setw(10) << globalPointsPtr().size()
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
|
PtrList<UIPstream> fromSlaves(Pstream::nProcs());
|
||||||
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
|
{
|
||||||
|
fromSlaves.set(slave, new UIPstream(slave, pBufs));
|
||||||
|
}
|
||||||
|
|
||||||
for (direction d=0; d<vector::nComponents; d++)
|
for (direction d=0; d<vector::nComponents; d++)
|
||||||
{
|
{
|
||||||
writePoints
|
writePoints
|
||||||
@ -1382,8 +1502,10 @@ void Foam::ensightMesh::writeAscii
|
|||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
scalarField patchPointsComponent
|
||||||
scalarField patchPointsComponent(fromSlave);
|
(
|
||||||
|
fromSlaves[slave]
|
||||||
|
);
|
||||||
|
|
||||||
writePoints
|
writePoints
|
||||||
(
|
(
|
||||||
@ -1393,17 +1515,6 @@ void Foam::ensightMesh::writeAscii
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
for (direction d=0; d<vector::nComponents; d++)
|
|
||||||
{
|
|
||||||
OPstream toMaster
|
|
||||||
(
|
|
||||||
Pstream::scheduled,
|
|
||||||
Pstream::masterNo()
|
|
||||||
);
|
|
||||||
toMaster<< uniquePoints.component(d);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
writeAllFacePrims
|
writeAllFacePrims
|
||||||
@ -1497,6 +1608,20 @@ void Foam::ensightMesh::writeBinary
|
|||||||
{
|
{
|
||||||
label nPoints = globalPoints.size();
|
label nPoints = globalPoints.size();
|
||||||
|
|
||||||
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
for (direction d=0; d<vector::nComponents; d++)
|
||||||
|
{
|
||||||
|
toMaster<< uniquePoints.component(d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
writeEnsDataBinary("part",ensightGeometryFile);
|
writeEnsDataBinary("part",ensightGeometryFile);
|
||||||
@ -1505,6 +1630,12 @@ void Foam::ensightMesh::writeBinary
|
|||||||
writeEnsDataBinary("coordinates",ensightGeometryFile);
|
writeEnsDataBinary("coordinates",ensightGeometryFile);
|
||||||
writeEnsDataBinary(nPoints,ensightGeometryFile);
|
writeEnsDataBinary(nPoints,ensightGeometryFile);
|
||||||
|
|
||||||
|
PtrList<UIPstream> fromSlaves(Pstream::nProcs());
|
||||||
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
|
{
|
||||||
|
fromSlaves.set(slave, new UIPstream(slave, pBufs));
|
||||||
|
}
|
||||||
|
|
||||||
for (direction d=0; d<vector::nComponents; d++)
|
for (direction d=0; d<vector::nComponents; d++)
|
||||||
{
|
{
|
||||||
writeEnsDataBinary
|
writeEnsDataBinary
|
||||||
@ -1515,19 +1646,15 @@ void Foam::ensightMesh::writeBinary
|
|||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
scalarField pointsComponent(fromSlaves[slave]);
|
||||||
scalarField pointsComponent(fromSlave);
|
writeEnsDataBinary
|
||||||
writeEnsDataBinary(pointsComponent, ensightGeometryFile);
|
(
|
||||||
|
pointsComponent,
|
||||||
|
ensightGeometryFile
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
for (direction d=0; d<vector::nComponents; d++)
|
|
||||||
{
|
|
||||||
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
|
||||||
toMaster<< uniquePoints.component(d);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
writeAllPrimsBinary
|
writeAllPrimsBinary
|
||||||
@ -1605,7 +1732,6 @@ void Foam::ensightMesh::writeBinary
|
|||||||
pointToGlobal,
|
pointToGlobal,
|
||||||
uniqueMeshPointLabels
|
uniqueMeshPointLabels
|
||||||
);
|
);
|
||||||
|
|
||||||
pointField uniquePoints(mesh_.points(), uniqueMeshPointLabels);
|
pointField uniquePoints(mesh_.points(), uniqueMeshPointLabels);
|
||||||
// Renumber the patch faces
|
// Renumber the patch faces
|
||||||
faceList patchFaces(p.localFaces());
|
faceList patchFaces(p.localFaces());
|
||||||
@ -1615,12 +1741,31 @@ void Foam::ensightMesh::writeBinary
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
|
if (!Pstream::master())
|
||||||
|
{
|
||||||
|
UOPstream toMaster(Pstream::masterNo(), pBufs);
|
||||||
|
for (direction d=0; d<vector::nComponents; d++)
|
||||||
|
{
|
||||||
|
toMaster<< uniquePoints.component(d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
writeEnsDataBinary("part",ensightGeometryFile);
|
writeEnsDataBinary("part",ensightGeometryFile);
|
||||||
writeEnsDataBinary(ensightPatchI++,ensightGeometryFile);
|
writeEnsDataBinary(ensightPatchI++,ensightGeometryFile);
|
||||||
//writeEnsDataBinary(patchName.c_str(),ensightGeometryFile);
|
//writeEnsDataBinary
|
||||||
writeEnsDataBinary(patchName.c_str(),ensightGeometryFile);
|
//(patchName.c_str(),ensightGeometryFile);
|
||||||
|
writeEnsDataBinary
|
||||||
|
(
|
||||||
|
patchName.c_str(),
|
||||||
|
ensightGeometryFile
|
||||||
|
);
|
||||||
writeEnsDataBinary("coordinates",ensightGeometryFile);
|
writeEnsDataBinary("coordinates",ensightGeometryFile);
|
||||||
writeEnsDataBinary
|
writeEnsDataBinary
|
||||||
(
|
(
|
||||||
@ -1628,6 +1773,12 @@ void Foam::ensightMesh::writeBinary
|
|||||||
ensightGeometryFile
|
ensightGeometryFile
|
||||||
);
|
);
|
||||||
|
|
||||||
|
PtrList<UIPstream> fromSlaves(Pstream::nProcs());
|
||||||
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
|
{
|
||||||
|
fromSlaves.set(slave, new UIPstream(slave, pBufs));
|
||||||
|
}
|
||||||
|
|
||||||
for (direction d=0; d<vector::nComponents; d++)
|
for (direction d=0; d<vector::nComponents; d++)
|
||||||
{
|
{
|
||||||
//writePointsBinary
|
//writePointsBinary
|
||||||
@ -1639,8 +1790,10 @@ void Foam::ensightMesh::writeBinary
|
|||||||
|
|
||||||
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
for (int slave=1; slave<Pstream::nProcs(); slave++)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::scheduled, slave);
|
scalarField patchPointsComponent
|
||||||
scalarField patchPointsComponent(fromSlave);
|
(
|
||||||
|
fromSlaves[slave]
|
||||||
|
);
|
||||||
|
|
||||||
//writePointsBinary
|
//writePointsBinary
|
||||||
writeEnsDataBinary
|
writeEnsDataBinary
|
||||||
@ -1651,17 +1804,6 @@ void Foam::ensightMesh::writeBinary
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
for (direction d=0; d<vector::nComponents; d++)
|
|
||||||
{
|
|
||||||
OPstream toMaster
|
|
||||||
(
|
|
||||||
Pstream::scheduled,
|
|
||||||
Pstream::masterNo()
|
|
||||||
);
|
|
||||||
toMaster<< uniquePoints.component(d);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
writeAllFacePrimsBinary
|
writeAllFacePrimsBinary
|
||||||
|
Loading…
Reference in New Issue
Block a user