IOMRFZoneList.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) 2012-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::IOMRFZoneList
26 
27 Description
28  List of MRF zones with IO functionality. MRF zones are specified by a list
29  of dictionary entries, e.g.
30 
31  \verbatim
32  zone1
33  {
34  cellZone rotor1;
35  ...
36  }
37 
38  zone2
39  {
40  cellZone rotor2;
41  ...
42  }
43  \endverbatim
44 
45 SourceFiles
46  IOMRFZoneList.C
47 
48 \*---------------------------------------------------------------------------*/
49 
50 #ifndef IOMRFZoneList_H
51 #define IOMRFZoneList_H
52 
53 #include "IOdictionary.H"
54 #include "MRFZoneList.H"
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace Foam
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class IOMRFZoneList Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 class IOMRFZoneList
66 :
67  public IOdictionary,
68  public MRFZoneList
69 {
70  // Private Member Functions
71 
72  //- Create IO object if dictionary is present
73  IOobject createIOobject(const fvMesh& mesh) const;
74 
75 
76 public:
77 
78  // Constructors
79 
80  //- Construct from mesh
81  IOMRFZoneList(const fvMesh& mesh);
82 
83  //- Disallow default bitwise copy construction
84  IOMRFZoneList(const IOMRFZoneList&) = delete;
85 
86 
87  //- Destructor
88  virtual ~IOMRFZoneList()
89  {}
90 
91 
92  // Member Functions
93 
94  //- Read dictionary
95  virtual bool read();
96 
97  //- Use MRFZoneList::size for looping
98  using MRFZoneList::size;
99 
100 
101  // Member Operators
102 
103  //- Disallow default bitwise assignment
104  void operator=(const IOMRFZoneList&) = delete;
105 };
106 
107 
108 /*---------------------------------------------------------------------------*\
109  Class NullMRF Declaration
110 \*---------------------------------------------------------------------------*/
111 
112 class NullMRF
113 {
114 public:
115 
116  // Constructors
117 
118  //- Construct null
119  NullMRF()
120  {}
121 
122 
123  // Member Functions
124 
125  //- Return the argument unchanged
126  template<class Type>
127  inline const Type& relative(const Type& U) const
128  {
129  return U;
130  }
131 
132  //- Return the argument unchanged
133  template<class Type>
134  inline const Type& relative(const Type& U, const label patchi) const
135  {
136  return U;
137  }
138 
139  //- Return the argument unchanged
140  template<class Type>
141  inline const Type& absolute(const Type& U) const
142  {
143  return U;
144  }
145 
146  //- Return the argument unchanged
147  template<class Type>
148  inline const Type& absolute(const Type& U, const label patchi) const
149  {
150  return U;
151  }
152 
153 
154  //- Return the argument unchanged
155  template<class Type, class RhoType>
156  inline const Type& relative(const Type& U, const RhoType& rho) const
157  {
158  return U;
159  }
160 
161  //- Return the argument unchanged
162  template<class Type, class RhoType>
163  inline const Type& relative
164  (
165  const Type& U,
166  const RhoType& rho,
167  const label patchi
168  ) const
169  {
170  return U;
171  }
172 
173  //- Return the argument unchanged
174  template<class Type, class RhoType>
175  inline const Type& absolute(const Type& U, const RhoType& rho) const
176  {
177  return U;
178  }
179 
180  //- Return the argument unchanged
181  template<class Type, class RhoType>
182  inline const Type& absolute
183  (
184  const Type& U,
185  const RhoType& rho,
186  const label patchi
187  ) const
188  {
189  return U;
190  }
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace Foam
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #endif
201 
202 // ************************************************************************* //
List of MRF zones with IO functionality. MRF zones are specified by a list of dictionary entries,...
Definition: IOMRFZoneList.H:68
void operator=(const IOMRFZoneList &)=delete
Disallow default bitwise assignment.
virtual ~IOMRFZoneList()
Destructor.
Definition: IOMRFZoneList.H:87
IOMRFZoneList(const fvMesh &mesh)
Construct from mesh.
Definition: IOMRFZoneList.C:66
virtual bool read()
Read dictionary.
Definition: IOMRFZoneList.C:75
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
List container for MRF zones.
Definition: MRFZoneList.H:58
NullMRF()
Construct null.
const Type & absolute(const Type &U) const
Return the argument unchanged.
const Type & relative(const Type &U) const
Return the argument unchanged.
label size() const
Return the number of elements in the UPtrList.
Definition: UPtrListI.H:29
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
label patchi
U
Definition: pEqn.H:72
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