keyedSurface::setSize() affects faces and regions

This commit is contained in:
Mark Olesen
2008-10-28 02:20:15 +01:00
parent eba9bbf0d8
commit 9c204f9eed
5 changed files with 25 additions and 12 deletions

View File

@ -220,7 +220,7 @@ Foam::fileFormats::OFFfileFormat::OFFfileFormat
faces().transfer(faceLst); faces().transfer(faceLst);
// no region information // no region information
regions().setSize(nFaces()); regions().setSize(size());
regions() = 0; regions() = 0;
setPatches(0); setPatches(0);

View File

@ -694,6 +694,13 @@ Foam::keyedSurface::~keyedSurface()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::keyedSurface::setSize(const label s)
{
MeshStorage::setSize(s);
regions_.setSize(s);
}
//- Move points //- Move points
void Foam::keyedSurface::movePoints(const pointField& newPoints) void Foam::keyedSurface::movePoints(const pointField& newPoints)
{ {
@ -796,7 +803,7 @@ void Foam::keyedSurface::transfer(meshedSurface& surf)
clearOut(); clearOut();
points().transfer(surf.points()); points().transfer(surf.points());
faces().transfer(surf.faces()); faces().transfer(surf.faces());
regions_.setSize(nFaces()); regions_.setSize(size());
surfacePatchList& patchLst = surf.patches(); surfacePatchList& patchLst = surf.patches();
@ -968,11 +975,11 @@ void Foam::keyedSurface::write(Ostream& os) const
<< geoPatches_ << endl; << geoPatches_ << endl;
// Note: Write with global point numbering // Note: Write with global point numbering
os << "\n// points:" os << "\n// points:\n"
<< points() << nl << points() << nl
<< "\n// faces:" << "\n// faces:\n"
<< faces() << nl << faces() << nl
<< "\n// regions:" << "\n// regions:\n"
<< regions() << endl; << regions() << endl;
// Check state of Ostream // Check state of Ostream

View File

@ -118,6 +118,10 @@ private:
//- Generic read routine. Chooses reader based on extension. //- Generic read routine. Chooses reader based on extension.
//? bool read(const fileName&, const word& ext); //? bool read(const fileName&, const word& ext);
//- Disable setSize with value
void setSize(const label, const FaceType&);
protected: protected:
// Static protected functions // Static protected functions
@ -341,15 +345,18 @@ public:
//- Return the number of faces //- Return the number of faces
label nFaces() const label nFaces() const
{ {
return faces().size(); return MeshStorage::size();
} }
//- The surface size is the number of faces //- The surface size is the number of faces
label size() const 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 //- Return const access to global points
const pointField& points() const const pointField& points() const
{ {

View File

@ -893,9 +893,9 @@ void Foam::meshedSurface::write(Ostream& os) const
os << token::END_LIST << endl; os << token::END_LIST << endl;
// Note: Write with global point numbering // Note: Write with global point numbering
os << "\n// points:" os << "\n// points:\n"
<< points() << nl << points() << nl
<< "\n// faces:" << "\n// faces:\n"
<< faces() << endl; << faces() << endl;
// Check state of Ostream // Check state of Ostream

View File

@ -120,7 +120,6 @@ private:
//- Read in Foam format //- Read in Foam format
bool read(Istream&); bool read(Istream&);
// Static private functions // Static private functions
public: public:
@ -309,13 +308,13 @@ public:
//- Return the number of faces //- Return the number of faces
label nFaces() const label nFaces() const
{ {
return faces().size(); return MeshStorage::size();
} }
//- The surface size is the number of faces //- The surface size is the number of faces
label size() const label size() const
{ {
return nFaces(); return MeshStorage::size();
} }
//- Return const access to global points //- Return const access to global points