1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM 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 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 A class holds the data needed to identify a patch in a dynamic mesh.
31 The patch is identified by name and its index in the boundary mesh
32 is updated if the mesh has changed.
34 \*---------------------------------------------------------------------------*/
39 #include "polyBoundaryMesh.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 // Forward declaration of friend functions and operators
49 Ostream& operator<<(Ostream& os, const polyPatchID& p);
52 /*---------------------------------------------------------------------------*\
53 Class polyPatchID Declaration
54 \*---------------------------------------------------------------------------*/
71 //- Construct from name
72 polyPatchID(const word& name, const polyBoundaryMesh& bm)
75 index_(bm.findPatchID(name))
78 //- Construct from Istream
79 polyPatchID(Istream& is, const polyBoundaryMesh& bm)
82 index_(bm.findPatchID(name_))
91 const word& name() const
102 //- Has the patch been found
112 void update(const polyBoundaryMesh& bm)
114 index_ = bm.findPatchID(name_);
120 friend Ostream& operator<<(Ostream& os, const polyPatchID& p)
122 os << token::BEGIN_LIST
123 << p.name_ << token::SPACE
127 // Check state of Ostream
128 os.check("Ostream& operator<<(Ostream&, const polyPatchID&)");
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 } // End namespace Foam
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 // ************************************************************************* //