Loading...
Searching...
No Matches
regionProperties.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-2015 OpenFOAM Foundation
9 Copyright (C) 2018-2025 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::regionProperties
29
30Description
31 Simple class to hold region information for coupled region simulations.
32
33 Gives per physics ('fluid', 'solid') the names of the regions. There
34 is no assumption on this level that a region should only have a single
35 set of physics.
36
37 Uses the "regions" table from the constant/regionProperties file.
38 For example,
39
40 \verbatim
41 regions
42 (
43 fluid (air water)
44 solid (walls)
45 );
46 \endverbatim
47
48SourceFiles
49 regionProperties.cxx
50 regionModelProperties.cxx
51
52\*---------------------------------------------------------------------------*/
53
54#ifndef Foam_regionProperties_H
55#define Foam_regionProperties_H
56
57#include "fileName.H"
58#include "wordList.H"
59#include "HashTable.H"
60#include "IOobjectOption.H"
61
62// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63
64// General controls
65
66namespace Foam
67{
68namespace regionModels
70
71//- The enable/disable state for regionFaModel (default: true)
72bool allowFaModels() noexcept;
73
74//- Set enable/disable state for regionFaModel
75// \return previous state
76bool allowFaModels(bool on) noexcept;
77
78} // End namespace regionModels
79} // End namespace Foam
80
81
82// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83
84namespace Foam
85{
86
87// Forward Declarations
88class Time;
89class wordRes;
90
91/*---------------------------------------------------------------------------*\
92 Class regionProperties Declaration
93\*---------------------------------------------------------------------------*/
94
96:
97 public HashTable<wordList>
98{
99public:
100
101 // Generated Methods
102
103 //- Default construct
104 regionProperties() = default;
105
106 //- Copy construct
107 regionProperties(const regionProperties&) = default;
108
109 //- Move construct
112 //- Copy assignment
114
115 //- Move assignment
117
118
119 // Constructors
120
121 //- Construct from Time with specified read option
122 //- (default: MUST_READ)
123 explicit regionProperties
124 (
125 const Time& runTime,
127 );
128
129 //- Construct from Time and local (prefix) with specified read option
130 //- (default: MUST_READ)
132 (
133 const Time& runTime,
134 const fileName& local,
136 );
137
138
139 //- Destructor
140 ~regionProperties() = default;
141
142
143 // Static Member Functions
144
145 //- The expected search path (eg, constant/regionProperties).
146 // Can be useful when generation error messages
148 (
149 const Time& runTime,
151 );
152
153
154 // Member Functions
155
156 //- Total count of all region names.
157 label count() const;
158
159 //- The names of the region types (sorted)
160 auto types() const { return HashTable<wordList>::sortedToc(); }
161
162 //- The region names (sorted by region type)
163 wordList names() const;
164
165 //- The region names in sorted order.
167
168 //- The region names (sorted by region type) for all matches
169 // \returns an empty list for an empty matcher
170 wordList names(const wordRes& matcher) const;
171};
172
173
174// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175
176} // End namespace Foam
177
178// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179
180#endif
181
182// ************************************************************************* //
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
Definition HashTable.C:156
constexpr HashTable() noexcept
Definition HashTable.C:33
readOption
Enumeration defining read preferences.
@ MUST_READ
Reading required.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
A class for handling file names.
Definition fileName.H:75
static const fileName null
An empty fileName.
Definition fileName.H:111
label count() const
Total count of all region names.
regionProperties(const regionProperties &)=default
Copy construct.
regionProperties & operator=(regionProperties &&)=default
Move assignment.
wordList names(const wordRes &matcher) const
The region names (sorted by region type) for all matches.
wordList sortedNames() const
The region names in sorted order.
regionProperties & operator=(const regionProperties &)=default
Copy assignment.
auto types() const
The names of the region types (sorted).
regionProperties(const Time &runTime, IOobjectOption::readOption rOpt=IOobjectOption::MUST_READ)
Construct from Time with specified read option (default: MUST_READ).
static fileName objectRelPath(const Time &runTime, const fileName &local=fileName::null)
The expected search path (eg, constant/regionProperties).
regionProperties(const Time &runTime, const fileName &local, IOobjectOption::readOption rOpt=IOobjectOption::MUST_READ)
Construct from Time and local (prefix) with specified read option (default: MUST_READ).
wordList names() const
The region names (sorted by region type).
regionProperties()=default
Default construct.
~regionProperties()=default
Destructor.
regionProperties(regionProperties &&)=default
Move construct.
A List of wordRe with additional matching capabilities.
Definition wordRes.H:56
bool local
Definition EEqn.H:20
engineTime & runTime
bool allowFaModels() noexcept
The enable/disable state for regionFaModel (default: true).
Namespace for OpenFOAM.
List< word > wordList
List of word.
Definition fileName.H:60
const direction noexcept
Definition scalarImpl.H:265