boundaryRegion.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::boundaryRegion
28
29Description
30 The boundaryRegion persistent data saved as a Map<dictionary>.
31
32 The meshReader supports boundaryRegion information.
33
34 The <tt>constant/boundaryRegion</tt> file is an \c IOMap<dictionary>
35 that is used to save the information persistently.
36 It contains the boundaryRegion information of the following form:
37
38 \verbatim
39 (
40 INT
41 {
42 BoundaryType WORD;
43 Label WORD;
44 }
45 ...
46 )
47 \endverbatim
48
49SourceFiles
50 boundaryRegion.C
51
52\*---------------------------------------------------------------------------*/
53
54#ifndef boundaryRegion_H
55#define boundaryRegion_H
56
57#include "polyMesh.H"
58#include "Map.H"
59#include "dictionary.H"
60#include "labelList.H"
61#include "wordList.H"
62#include "wordRes.H"
63
64// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65
66namespace Foam
67{
68
69/*---------------------------------------------------------------------------*\
70 Class boundaryRegion Declaration
71\*---------------------------------------------------------------------------*/
74:
75 public Map<dictionary>
76{
77 // Private Member Functions
78
79 //- No copy construct
80 boundaryRegion(const boundaryRegion&) = delete;
81
82
83public:
84
85 // Constructors
86
87 //- Construct null
89
90 //- Construct read from registry, name. instance
92 (
93 const objectRegistry&,
94 const word& name = "boundaryRegion",
95 const fileName& instance = "constant"
96 );
97
98
99 //- Destructor
100 ~boundaryRegion() = default;
101
102
103 // Member Functions
104
105 //- Append to the end, return index
106 label append(const dictionary&);
107
108 //- Return index corresponding to patch 'name'
109 // returns -1 if not found
110 label findIndex(const word& name) const;
111
112 //- Return a Map of (id => name)
113 Map<word> names() const;
114
115 //- Return a Map of (id => names) selected by patterns
116 Map<word> names(const wordRes& patterns) const;
117
118 //- Return a Map of (id => type)
119 Map<word> boundaryTypes() const;
120
121 //- Return BoundaryType corresponding to patch 'name'
122 word boundaryType(const word& name) const;
123
124 //- Read constant/boundaryRegion
125 void readDict
126 (
127 const objectRegistry&,
128 const word& name = "boundaryRegion",
129 const fileName& instance = "constant"
130 );
131
132 //- Write constant/boundaryRegion for later reuse
133 void writeDict
134 (
135 const objectRegistry&,
136 const word& name = "boundaryRegion",
137 const fileName& instance = "constant"
138 ) const;
139
140
141 // Member Operators
142
143 //- Assignment
144 void operator=(const boundaryRegion&);
145
146 //- Assign from Map<dictionary>
147 void operator=(const Map<dictionary>&);
148
149
150 // Friend Functions
151
152 //- Rename regions
153 // each dictionary entry is a single word:
154 // \verbatim
155 // newPatchName originalName;
156 // \endverbatim
157 void rename(const dictionary&);
158};
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161
162} // End namespace Foam
163
164// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165
166#endif
167
168// ************************************************************************* //
A HashTable to objects of type <T> with a label key.
Definition: Map.H:60
The boundaryRegion persistent data saved as a Map<dictionary>.
word boundaryType(const word &name) const
Return BoundaryType corresponding to patch 'name'.
label findIndex(const word &name) const
Return index corresponding to patch 'name'.
void writeDict(const objectRegistry &, const word &name="boundaryRegion", const fileName &instance="constant") const
Write constant/boundaryRegion for later reuse.
boundaryRegion()
Construct null.
Map< word > boundaryTypes() const
Return a Map of (id => type)
Map< word > names() const
Return a Map of (id => name)
void readDict(const objectRegistry &, const word &name="boundaryRegion", const fileName &instance="constant")
Read constant/boundaryRegion.
label append(const dictionary &)
Append to the end, return index.
void rename(const dictionary &)
Rename regions.
void operator=(const boundaryRegion &)
Assignment.
~boundaryRegion()=default
Destructor.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A class for handling file names.
Definition: fileName.H:76
Registry of regIOobjects.
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:54
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59