meshingSurfaceList.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
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::meshingSurfaceList
26 
27 Description
28  List of meshingSurfaces which stores the overall bounding box of all the
29  meshingSurfaces.
30 
31 SourceFiles
32  meshingSurfaceList.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef meshingSurfaceList_H
37 #define meshingSurfaceList_H
38 
39 #include "meshingSurface.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class meshingSurfaceList Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 :
52  public PtrList<meshingSurface>
53 {
54  // Private Typedefs
55 
56  //- The surface type
58 
59 
60  // Private Data
61 
62  //- Bounding box for all the surfaces
63  boundBox bb_;
64 
65  //- Bounding box for the rotatingZone surfaces
66  boundBox rzbb_;
67 
68 
69  // Private Member Functions
70 
71  //- Merge the second bounding box into the first
72  void mergeBoundingBoxes
73  (
74  boundBox& bb1,
75  const boundBox& bb2
76  );
77 
78  //- Swap surfaces list to make external surface index 0
79  void swapExternalIndexZero(const label index);
80 
81  //- Return true if specified regions > 0 and match surface regions
82  bool regionsValid
83  (
84  const wordList& specifiedRegions,
85  const wordList& regions,
86  const word& opt
87  );
88 
89  //- Set the specified surface types
90  void setSurfaceTypes
91  (
92  const List<word>& surfaces,
93  const surfaceType& type
94  );
95 
96  //- Identify cell zones by analysing the surfaces
97  void identifyCellZones();
98 
99  //- Write a word list as comma separated entries
100  void reportWordList(const wordList& wl);
101 
102  //- Write a report on the surfaces to stdout
103  void reportSurfaces();
104 
105  //- Set bounds specified in boundBox
106  void setBounds(const boundBox& bb);
107 
108  //- Set bounds of rotatingZone surfaces
109  void setRotatingZoneBounds();
110 
111 public:
112 
113  // Constructors
114 
115  //- Construct from components
117  (
118  const Time& time,
119  const fileNameList& surfaces,
120  const wordList& cellZones,
121  const wordList& rotatingZones,
122  const wordList& baffles,
123  const boundBox& bb,
124  const wordList& inletRegions,
125  const wordList& outletRegions
126  );
127 
128  //- Disallow default bitwise copy construction
129  meshingSurfaceList(const meshingSurfaceList&) = delete;
130 
131 
132  //- Destructor
134 
135 
136  // Member Functions
137 
138  // Bounding box
139  const boundBox& bb() const
140  {
141  return bb_;
142  }
143 
144  // Bounding box of rotating zone surfaces
145  const boundBox& rzbb() const
146  {
147  return rzbb_;
148  }
149 
150 
151  // Member Operators
152 
153  //- Disallow default bitwise assignment
154  void operator=(const meshingSurfaceList&) = delete;
155 };
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace Foam
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 
165 #endif
166 
167 // ************************************************************************* //
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
A bounding box defined in terms of the points at its extremities.
Definition: boundBox.H:59
List of meshingSurfaces which stores the overall bounding box of all the meshingSurfaces.
const boundBox & bb() const
~meshingSurfaceList()
Destructor.
void operator=(const meshingSurfaceList &)=delete
Disallow default bitwise assignment.
meshingSurfaceList(const Time &time, const fileNameList &surfaces, const wordList &cellZones, const wordList &rotatingZones, const wordList &baffles, const boundBox &bb, const wordList &inletRegions, const wordList &outletRegions)
Construct from components.
const boundBox & rzbb() const
surfaceType
Type of surface.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488