1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | cfMesh: A library for mesh generation
5 \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6 \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of cfMesh.
11 cfMesh is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 3 of the License, or (at your
14 option) any later version.
16 cfMesh is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
27 \*---------------------------------------------------------------------------*/
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 inline faceListPMG::faceListPMG(const IOobject& io)
43 faceList(readStream(typeName)),
44 nElmts_(faceList::size())
48 inline faceListPMG::faceListPMG(const IOobject& io, const label s)
56 inline faceListPMG::faceListPMG(const IOobject& io, const faceList& fcs)
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 inline faceListPMG::~faceListPMG()
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 inline label faceListPMG::size() const
78 inline void faceListPMG::setSize(const label nElmts)
80 if( nElmts >= faceList::size() )
82 if( faceList::size() != 0 )
84 Info << "Resizing faces!" << endl;
85 faceList copy(label(1.5*nElmts));
86 for(label i=0;i<nElmts_;++i)
87 copy[i].transfer(this->operator[](i));
89 faceList::transfer(copy);
93 faceList::setSize(label(1.5*nElmts));
100 inline void faceListPMG::clear()
105 inline void faceListPMG::append(const face& f)
107 const label i = nElmts_;
109 this->operator[](i) = f;
112 inline face& faceListPMG::newElmt(const label fI)
115 return this->operator[](fI);
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 inline bool faceListPMG::writeData(Ostream& os) const
122 return (os << *this).good();
125 inline void faceListPMG::operator=(const faceList& fcs)
129 this->operator[](fI) = fcs[fI];
132 inline Ostream& operator<<(Ostream& os, const faceListPMG& fcs)
134 SubList<face> f(fcs, fcs.nElmts_, 0);
140 inline Istream& operator>>(Istream& is, faceListPMG& fcs)
142 faceList& faces = static_cast<faceList&>(fcs);
144 fcs.nElmts_ = faces.size();
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 } // End namespace Foam
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //