diff --git a/src/OpenFOAM/meshes/zones/ZoneList/ZoneList.C b/src/OpenFOAM/meshes/zones/ZoneList/ZoneList.C index 82b6fa7ec1..a8f8d3f6e3 100644 --- a/src/OpenFOAM/meshes/zones/ZoneList/ZoneList.C +++ b/src/OpenFOAM/meshes/zones/ZoneList/ZoneList.C @@ -492,6 +492,26 @@ bool Foam::ZoneList::writeData(Ostream& os) const } +template +bool Foam::ZoneList::writeObject +( + IOstream::streamFormat fmt, + IOstream::versionNumber ver, + IOstream::compressionType cmp, + const bool write +) const +{ + if (this->size()) + { + return regIOobject::writeObject(fmt, ver, cmp, write); + } + else + { + return false; + } +} + + // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // template diff --git a/src/OpenFOAM/meshes/zones/ZoneList/ZoneList.H b/src/OpenFOAM/meshes/zones/ZoneList/ZoneList.H index 74f2a7e812..31d967bf6d 100644 --- a/src/OpenFOAM/meshes/zones/ZoneList/ZoneList.H +++ b/src/OpenFOAM/meshes/zones/ZoneList/ZoneList.H @@ -165,7 +165,17 @@ public: bool readIfPresent(); //- writeData member function required by regIOobject - bool writeData(Ostream&) const; + virtual bool writeData(Ostream&) const; + + //- Write using given format, version and compression + // Only write the zones file if there are zones in the list + virtual bool writeObject + ( + IOstream::streamFormat, + IOstream::versionNumber, + IOstream::compressionType, + const bool write + ) const; // Member Operators