FreeFOAM The Cross-Platform CFD Toolkit
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 | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::boundaryRegion
26 
27 Description
28  The boundaryRegion persistent data saved as a Map<dictionary>.
29 
30  The meshReader supports boundaryRegion information.
31 
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:
35 
36  @verbatim
37  (
38  INT
39  {
40  BoundaryType WORD;
41  Label WORD;
42  }
43  ...
44  )
45  @endverbatim
46 
47 SourceFiles
48  boundaryRegion.C
49 
50 \*---------------------------------------------------------------------------*/
51 
52 #ifndef boundaryRegion_H
53 #define boundaryRegion_H
54 
55 #include <OpenFOAM/polyMesh.H>
56 #include <OpenFOAM/Map.H>
57 #include <OpenFOAM/dictionary.H>
58 #include <OpenFOAM/labelList.H>
59 #include <OpenFOAM/wordList.H>
60 #include <OpenFOAM/wordReList.H>
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 
67 /*---------------------------------------------------------------------------*\
68  Class boundaryRegion Declaration
69 \*---------------------------------------------------------------------------*/
70 
72 :
73  public Map<dictionary>
74 {
75  // Private Member Functions
76 
77  //- Disallow default bitwise copy construct
79 
80 
81 public:
82 
83  // Constructors
84 
85  //- Construct null
87 
88  //- Construct read from registry, name. instance
90  (
91  const objectRegistry&,
92  const word& name = "boundaryRegion",
93  const fileName& instance = "constant"
94  );
95 
96 
97  //- Destructor
99 
100 
101  // Member Functions
102 
103  //- Append to the end, return index
104  label append(const dictionary&);
105 
106  //- Return index corresponding to patch 'name'
107  // returns -1 if not found
108  label findIndex(const word& name) const;
109 
110  //- Return a Map of (id => name)
111  Map<word> names() const;
112 
113  //- Return a Map of (id => names) selected by patterns
114  Map<word> names(const List<wordRe>& patterns) const;
115 
116  //- Return a Map of (id => type)
117  Map<word> boundaryTypes() const;
118 
119  //- Return BoundaryType corresponding to patch 'name'
120  word boundaryType(const word& name) const;
121 
122  //- Read constant/boundaryRegion
123  void readDict
124  (
125  const objectRegistry&,
126  const word& name = "boundaryRegion",
127  const fileName& instance = "constant"
128  );
129 
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;
137 
138 
139  // Member Operators
140 
141  //- Assignment
142  void operator=(const boundaryRegion&);
143 
144  //- Assign from Map<dictionary>
145  void operator=(const Map<dictionary>&);
146 
147 
148  // Friend Functions
149 
150  //- Rename regions
151  // each dictionary entry is a single word:
152  // @verbatim
153  // newPatchName originalName;
154  // @endverbatim
155  void rename(const dictionary&);
156 };
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace Foam
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************ vim: set sw=4 sts=4 et: ************************ //