From c96d019db180fb83a8e6dc32961e8d7535be7b89 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Tue, 4 Dec 2018 10:34:31 +0000 Subject: [PATCH] Possible bug fixes in stream flushing for mesh objects --- src/foam/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C | 4 +++- src/foam/meshes/polyMesh/polyMeshIO.C | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/foam/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C b/src/foam/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C index dd2533472..8e95a1873 100644 --- a/src/foam/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C +++ b/src/foam/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C @@ -1026,12 +1026,14 @@ bool Foam::polyBoundaryMesh::writeData(Ostream& os) const os << patches.size() << nl << token::BEGIN_LIST << incrIndent << nl; + // Note: careful write: endl is not allowed because it flushes a stream + // HJ, 24/Oct/2018 forAll (patches, patchi) { os << indent << patches[patchi].name() << nl << indent << token::BEGIN_BLOCK << nl << incrIndent << patches[patchi] << decrIndent - << indent << token::END_BLOCK << endl; + << indent << token::END_BLOCK << nl; } os << decrIndent << token::END_LIST << endl; diff --git a/src/foam/meshes/polyMesh/polyMeshIO.C b/src/foam/meshes/polyMesh/polyMeshIO.C index 8ddd82799..cb11796e9 100644 --- a/src/foam/meshes/polyMesh/polyMeshIO.C +++ b/src/foam/meshes/polyMesh/polyMeshIO.C @@ -657,7 +657,8 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const polyMesh& m) << m.boundaryMesh() << nl << m.pointZones() << nl << m.faceZones() << nl - << m.cellZones(); + << m.cellZones() << nl + << endl; return os; }