initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / conversion / meshTables / boundaryRegion.H
blob643cc17f4dac8c68e7d931976a1d1a2607b6d724
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 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::boundaryRegion
28 Description
29     The boundaryRegion persistent data saved as a Map<dictionary>.
31     The meshReader supports boundaryRegion information.
33     The <tt>constant/boundaryRegion</tt> file is an @c IOMap<dictionary>
34     that is used to save the information persistently.
35     It contains the boundaryRegion information of the following form:
37     @verbatim
38         (
39             INT
40             {
41                 BoundaryType    WORD;
42                 Label           WORD;
43             }
44             ...
45         )
46     @endverbatim
48 SourceFiles
49     boundaryRegion.C
51 \*---------------------------------------------------------------------------*/
53 #ifndef boundaryRegion_H
54 #define boundaryRegion_H
56 #include "polyMesh.H"
57 #include "Map.H"
58 #include "dictionary.H"
59 #include "labelList.H"
60 #include "wordList.H"
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 namespace Foam
67 /*---------------------------------------------------------------------------*\
68                       Class boundaryRegion Declaration
69 \*---------------------------------------------------------------------------*/
71 class boundaryRegion
73     public Map<dictionary>
75     // Private Member Functions
77         //- Disallow default bitwise copy construct
78         boundaryRegion(const boundaryRegion&);
81 public:
83     // Constructors
85         //- Construct null
86         boundaryRegion();
88         //- Construct read from registry, name. instance
89         boundaryRegion
90         (
91             const objectRegistry&,
92             const word& name = "boundaryRegion",
93             const fileName& instance = "constant"
94         );
97     //- Destructor
98     ~boundaryRegion();
101     // Member Functions
103         //- Append to the end, return index
104         label append(const dictionary&);
106         //- Return index corresponding to patch 'name'
107         //  returns -1 if not found
108         label findIndex(const word& name) const;
110         //- Return a Map of (id => name)
111         Map<word> names() const;
113         //- Return a Map of (id => type)
114         Map<word> boundaryTypes() const;
116         //- Return BoundaryType corresponding to patch 'name'
117         word boundaryType(const word& name) const;
119         //- Read constant/boundaryRegion
120         void readDict
121         (
122             const objectRegistry&,
123             const word& name = "boundaryRegion",
124             const fileName& instance = "constant"
125         );
127         //- Write constant/boundaryRegion for later reuse
128         void writeDict
129         (
130             const objectRegistry&,
131             const word& name = "boundaryRegion",
132             const fileName& instance = "constant"
133         ) const;
136     // Member Operators
138         //- Assignment
139         void operator=(const boundaryRegion&);
141         //- Assign from Map<dictionary>
142         void operator=(const Map<dictionary>&);
145     // Friend Functions
147         //- Rename regions
148         //  each dictionary entry is a single word:
149         //  @verbatim
150         //      newPatchName    originalName;
151         //  @endverbatim
152         void rename(const dictionary&);
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 } // End namespace Foam
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 #endif
163 // ************************************************************************* //