mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: distributedTriSurfaceMesh: handle zero sized local surfaces
This commit is contained in:
@ -2360,10 +2360,28 @@ bool Foam::distributedTriSurfaceMesh::writeObject
|
||||
// Make sure dictionary goes to same directory as surface
|
||||
const_cast<fileName&>(dict_.instance()) = searchableSurface::instance();
|
||||
|
||||
// Copy of triSurfaceMesh::writeObject except for the sorting of
|
||||
// triangles by region. This is done so we preserve region names,
|
||||
// even if locally we have zero triangles.
|
||||
{
|
||||
fileName fullPath(searchableSurface::objectPath());
|
||||
|
||||
if (!mkDir(fullPath.path()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Important: preserve any zero-sized patches
|
||||
triSurface::write(fullPath, true);
|
||||
|
||||
if (!isFile(fullPath))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Dictionary needs to be written in ascii - binary output not supported.
|
||||
return
|
||||
triSurfaceMesh::writeObject(fmt, ver, cmp)
|
||||
&& dict_.writeObject(IOstream::ASCII, ver, cmp);
|
||||
return dict_.writeObject(IOstream::ASCII, ver, cmp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -446,6 +446,10 @@ public:
|
||||
// regIOobject implementation
|
||||
|
||||
//- Write using given format, version and compression
|
||||
// Do not use the triSurfaceMesh::writeObject since it
|
||||
// would filter out empty regions. These need to be preserved
|
||||
// in case we want to make decisions based on the number of
|
||||
// regions.
|
||||
virtual bool writeObject
|
||||
(
|
||||
IOstream::streamFormat fmt,
|
||||
|
||||
Reference in New Issue
Block a user