fvSchemes.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  Copyright (C) 2020-2023 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::fvSchemes
29 
30 Description
31  Selector class for finite volume differencing schemes.
32  fvMesh is derived from fvSchemes so that all fields have access to the
33  fvSchemes from the mesh reference they hold.
34 
35  The optional fallback dictionary content for constructors is used
36  when a file is missing or for a NO_READ, with a null pointer being
37  treated like an empty dictionary.
38 
39 SeeAlso
40  Foam::schemesLookup
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef Foam_fvSchemes_H
45 #define Foam_fvSchemes_H
46 
47 #include "schemesLookup.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class fvSchemes Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class fvSchemes
59 :
60  public schemesLookup
61 {
62 public:
63 
64  //- No copy construct
65  fvSchemes(const fvSchemes&) = delete;
66 
67  //- No copy assignment
68  void operator=(const fvSchemes&) = delete;
69 
70 
71  // Constructors
72 
73  //- Construct for objectRegistry, readOption, (system) dictionary name.
75  (
76  const objectRegistry& obr,
78  const word& dictName,
79  const dictionary* fallback = nullptr
80  )
81  :
82  schemesLookup(obr, rOpt, dictName, fallback)
83  {}
84 
85  //- Construct for objectRegistry, (system) dictionary name
86  //- using the readOption from the registry.
87  fvSchemes
88  (
89  const objectRegistry& obr,
90  const word& dictName,
91  const dictionary* fallback = nullptr
92  )
93  :
94  schemesLookup(obr, dictName, fallback)
95  {}
96 
97  //- Construct for objectRegistry, readOption with the
98  //- default dictionary name ("fvSchemes").
99  fvSchemes
100  (
101  const objectRegistry& obr,
103  const dictionary* fallback = nullptr
104  )
105  :
106  schemesLookup(obr, rOpt, "fvSchemes", fallback)
107  {}
108 
109  //- Construct for objectRegistry, readOption with the
110  //- default dictionary name ("fvSchemes") and
111  //- fallback dictionary content.
112  fvSchemes
113  (
114  const objectRegistry& obr,
116  const dictionary& dict
117  )
118  :
119  schemesLookup(obr, rOpt, "fvSchemes", &dict)
120  {}
121 
122  //- Construct for objectRegistry with the
123  //- default dictionary name ("fvSchemes").
124  // Uses the readOption from the registry.
125  explicit fvSchemes
126  (
127  const objectRegistry& obr,
128  const dictionary* fallback = nullptr
129  )
130  :
131  schemesLookup(obr, "fvSchemes", fallback)
132  {}
133 
134  //- Construct for objectRegistry with the
135  //- default dictionary name ("fvSchemes") and
136  //- fallback dictionary content.
137  // Uses the readOption from the registry.
138  fvSchemes(const objectRegistry& obr, const dictionary& dict)
139  :
140  schemesLookup(obr, "fvSchemes", &dict)
141  {}
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 //- Global file type for fvSchemes - same content for all ranks
148 template<>
149 struct is_globalIOobject<fvSchemes> : std::true_type {};
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #endif
159 
160 // ************************************************************************* //
word dictName() const
The local dictionary name (final part of scoped name)
Definition: dictionaryI.H:53
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
Trait for specifying global vs. local file types.
Definition: IOobject.H:981
fvSchemes(const fvSchemes &)=delete
No copy construct.
void operator=(const fvSchemes &)=delete
No copy assignment.
A class for handling words, derived from Foam::string.
Definition: word.H:63
Selector class for finite area/finite volume differencing schemes.
Selector class for finite volume differencing schemes. fvMesh is derived from fvSchemes so that all f...
Definition: fvSchemes.H:51
Registry of regIOobjects.
Namespace for OpenFOAM.
readOption
Enumeration defining read preferences.