Merge commit 'd3b269b7c6ffa0cd68845adfecdfb849316dba71' into nextRelease
[foam-extend-3.2.git] / src / conversion / meshTables / boundaryRegion.H
blobff6262bf8b0cdcc4c3b4338b8e485567ba3e7b0e
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     |
5     \\  /    A nd           | For copyright notice see file Copyright
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::boundaryRegion
27 Description
28     The boundaryRegion persistent data saved as a Map<dictionary>.
30     The meshReader supports boundaryRegion information.
32     The <tt>constant/boundaryRegion</tt> file is an @c IOMap<dictionary>
33     that is used to save the information persistently.
34     It contains the boundaryRegion information of the following form:
36     @verbatim
37         (
38             INT
39             {
40                 BoundaryType    WORD;
41                 Label           WORD;
42             }
43             ...
44         )
45     @endverbatim
47 SourceFiles
48     boundaryRegion.C
50 \*---------------------------------------------------------------------------*/
52 #ifndef boundaryRegion_H
53 #define boundaryRegion_H
55 #include "polyMesh.H"
56 #include "Map.H"
57 #include "dictionary.H"
58 #include "labelList.H"
59 #include "wordList.H"
60 #include "wordReList.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 => names) selected by patterns
114         Map<word> names(const List<wordRe>& patterns) const;
116         //- Return a Map of (id => type)
117         Map<word> boundaryTypes() const;
119         //- Return BoundaryType corresponding to patch 'name'
120         word boundaryType(const word& name) const;
122         //- Read constant/boundaryRegion
123         void readDict
124         (
125             const objectRegistry&,
126             const word& name = "boundaryRegion",
127             const fileName& instance = "constant"
128         );
130         //- Write constant/boundaryRegion for later reuse
131         void writeDict
132         (
133             const objectRegistry&,
134             const word& name = "boundaryRegion",
135             const fileName& instance = "constant"
136         ) const;
139     // Member Operators
141         //- Assignment
142         void operator=(const boundaryRegion&);
144         //- Assign from Map<dictionary>
145         void operator=(const Map<dictionary>&);
148     // Friend Functions
150         //- Rename regions
151         //  each dictionary entry is a single word:
152         //  @verbatim
153         //      newPatchName    originalName;
154         //  @endverbatim
155         void rename(const dictionary&);
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 } // End namespace Foam
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 #endif
166 // ************************************************************************* //