initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / triSurface / triSurface / geometricSurfacePatch / geometricSurfacePatch.H
blob7db3f27bd99cfc25d46778f001b7fa3ddc867cd8
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::geometricSurfacePatch
28 Description
29     The geometricSurfacePatch is like patchIdentifier but for surfaces.
30     Holds type, name and index.
32 SourceFiles
33     geometricSurfacePatch.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef geometricSurfacePatch_H
38 #define geometricSurfacePatch_H
40 #include "word.H"
41 #include "label.H"
42 #include "typeInfo.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 class dictionary;
51 /*---------------------------------------------------------------------------*\
52                            Class geometricSurfacePatch Declaration
53 \*---------------------------------------------------------------------------*/
55 class geometricSurfacePatch
57     // Private data
59         //- Type name of patch
60         word geometricType_;
62         //- Name of patch
63         word name_;
65         //- Index of patch in boundary
66         label index_;
68 public:
70     //- Runtime type information
71     ClassName("geometricSurfacePatch");
74     // Constructors
76         //- Construct null
77         geometricSurfacePatch();
79         //- Construct from components
80         geometricSurfacePatch
81         (
82             const word& geometricType,
83             const word& name,
84             const label index
85         );
87         //- Construct from Istream
88         geometricSurfacePatch(Istream&, const label index);
90         //- Construct from dictionary
91         geometricSurfacePatch
92         (
93             const word& name,
94             const dictionary& dict,
95             const label index
96         );
99     // Member Functions
101         //- Return name
102         const word& name() const
103         {
104             return name_;
105         }
107         //- Return name
108         word& name()
109         {
110             return name_;
111         }
113         //- Return the type of the patch
114         const word& geometricType() const
115         {
116             return geometricType_;
117         }
119         //- Return the type of the patch
120         word& geometricType()
121         {
122             return geometricType_;
123         }
125         //- Return the index of this patch in the boundaryMesh
126         label index() const
127         {
128             return index_;
129         }
131         //- Write
132         void write(Ostream&) const;
134         //- Write dictionary
135         void writeDict(Ostream&) const;
138     // Member Operators
140         bool operator!=(const geometricSurfacePatch&) const;
142         //- compare.
143         bool operator==(const geometricSurfacePatch&) const;
146     // Ostream Operator
148         friend Ostream& operator<<(Ostream&, const geometricSurfacePatch&);
149         friend Istream& operator>>(Istream&, geometricSurfacePatch&);
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 } // End namespace Foam
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 #endif
161 // ************************************************************************* //