diff --git a/src/surfMesh/keyedSurface/fileFormats/off/OFFfileFormat.C b/src/surfMesh/keyedSurface/fileFormats/off/OFFfileFormat.C index 0a71a4f224..ccc4f35106 100644 --- a/src/surfMesh/keyedSurface/fileFormats/off/OFFfileFormat.C +++ b/src/surfMesh/keyedSurface/fileFormats/off/OFFfileFormat.C @@ -220,7 +220,7 @@ Foam::fileFormats::OFFfileFormat::OFFfileFormat faces().transfer(faceLst); // no region information - regions().setSize(nFaces()); + regions().setSize(size()); regions() = 0; setPatches(0); diff --git a/src/surfMesh/keyedSurface/keyedSurface.C b/src/surfMesh/keyedSurface/keyedSurface.C index ec56558bcf..c752a661af 100644 --- a/src/surfMesh/keyedSurface/keyedSurface.C +++ b/src/surfMesh/keyedSurface/keyedSurface.C @@ -694,6 +694,13 @@ Foam::keyedSurface::~keyedSurface() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +void Foam::keyedSurface::setSize(const label s) +{ + MeshStorage::setSize(s); + regions_.setSize(s); +} + + //- Move points void Foam::keyedSurface::movePoints(const pointField& newPoints) { @@ -796,7 +803,7 @@ void Foam::keyedSurface::transfer(meshedSurface& surf) clearOut(); points().transfer(surf.points()); faces().transfer(surf.faces()); - regions_.setSize(nFaces()); + regions_.setSize(size()); surfacePatchList& patchLst = surf.patches(); @@ -968,11 +975,11 @@ void Foam::keyedSurface::write(Ostream& os) const << geoPatches_ << endl; // Note: Write with global point numbering - os << "\n// points:" + os << "\n// points:\n" << points() << nl - << "\n// faces:" + << "\n// faces:\n" << faces() << nl - << "\n// regions:" + << "\n// regions:\n" << regions() << endl; // Check state of Ostream diff --git a/src/surfMesh/keyedSurface/keyedSurface.H b/src/surfMesh/keyedSurface/keyedSurface.H index c392128bdc..d51d716fba 100644 --- a/src/surfMesh/keyedSurface/keyedSurface.H +++ b/src/surfMesh/keyedSurface/keyedSurface.H @@ -118,6 +118,10 @@ private: //- Generic read routine. Chooses reader based on extension. //? bool read(const fileName&, const word& ext); + + //- Disable setSize with value + void setSize(const label, const FaceType&); + protected: // Static protected functions @@ -341,15 +345,18 @@ public: //- Return the number of faces label nFaces() const { - return faces().size(); + return MeshStorage::size(); } //- The surface size is the number of faces label size() const { - return nFaces(); + return MeshStorage::size(); } + //- Reset size of face and region list + void setSize(const label); + //- Return const access to global points const pointField& points() const { diff --git a/src/surfMesh/meshedSurface/meshedSurface.C b/src/surfMesh/meshedSurface/meshedSurface.C index a08abb68f4..381ca0542e 100644 --- a/src/surfMesh/meshedSurface/meshedSurface.C +++ b/src/surfMesh/meshedSurface/meshedSurface.C @@ -893,9 +893,9 @@ void Foam::meshedSurface::write(Ostream& os) const os << token::END_LIST << endl; // Note: Write with global point numbering - os << "\n// points:" + os << "\n// points:\n" << points() << nl - << "\n// faces:" + << "\n// faces:\n" << faces() << endl; // Check state of Ostream diff --git a/src/surfMesh/meshedSurface/meshedSurface.H b/src/surfMesh/meshedSurface/meshedSurface.H index bfbd7685c4..e841dc7462 100644 --- a/src/surfMesh/meshedSurface/meshedSurface.H +++ b/src/surfMesh/meshedSurface/meshedSurface.H @@ -120,7 +120,6 @@ private: //- Read in Foam format bool read(Istream&); - // Static private functions public: @@ -309,13 +308,13 @@ public: //- Return the number of faces label nFaces() const { - return faces().size(); + return MeshStorage::size(); } //- The surface size is the number of faces label size() const { - return nFaces(); + return MeshStorage::size(); } //- Return const access to global points