LagrangianSchemes.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) 2025 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::LagrangianSchemes
26 
27 Description
28  Selector class for Lagrangian schemes
29 
30 SourceFiles
31  LagrangianSchemes.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef LagrangianSchemes_H
36 #define LagrangianSchemes_H
37 
38 #include "IOdictionary.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class LagrangianSchemes Declaration
47 \*---------------------------------------------------------------------------*/
48 
50 :
51  public IOdictionary
52 {
53  // Private Data
54 
55  //- Time schemes sub-dictionary
56  dictionary ddtSchemes_;
57 
58  //- Default time scheme stream
59  ITstream defaultDdtScheme_;
60 
61  //- Source schemes sub-dictionary
62  dictionary SpSchemes_;
63 
64  //- Default source scheme stream
65  ITstream defaultSpScheme_;
66 
67  //- Averaging schemes sub-dictionary
68  dictionary averagingSchemes_;
69 
70  //- Default averaging scheme stream
71  ITstream defaultAveragingScheme_;
72 
73  //- Interpolation schemes sub-dictionary
74  dictionary interpolationSchemes_;
75 
76  //- Default interpolation scheme stream
77  ITstream defaultInterpolationScheme_;
78 
79  //- Accumulation schemes sub-dictionary
80  dictionary accumulationSchemes_;
81 
82  //- Default accumulation scheme stream
83  ITstream defaultAccumulationScheme_;
84 
85 
86  // Private Member Functions
87 
88  //- Clear the dictionaries and streams before reading
89  void clear();
90 
91  //- Read a scheme from the dictionary
92  static void read
93  (
94  const dictionary& dict,
95  const word& type,
96  dictionary& typeSchemes,
97  ITstream& defaultTypeScheme
98  );
99 
100  //- Read schemes from the dictionary
101  void read(const dictionary&);
102 
103  //- Look up a scheme
104  static ITstream& lookup
105  (
106  const word& name,
107  const dictionary& typeSchemes,
108  const ITstream& defaultTypeScheme
109  );
110 
111 
112 public:
113 
114  //- Type information
115  ClassName("LagrangianSchemes");
116 
117 
118  // Constructors
119 
120  //- Construct for objectRegistry
122 
123  //- Disallow default bitwise copy construction
124  LagrangianSchemes(const LagrangianSchemes&) = delete;
125 
126 
127  //- Destructor
129 
130 
131  // Member Functions
132 
133  // Access
134 
135  //- Access the dictionary
136  const dictionary& schemesDict() const;
137 
138  //- Get the time scheme for the given field name
139  ITstream& ddt(const word& name) const;
140 
141  //- Get the source scheme for the given field name
142  ITstream& Sp(const word& name) const;
143 
144  //- Get the averaging scheme for the given field name
145  ITstream& averaging(const word& name) const;
146 
147  //- Get the interpolation scheme for the given field name
148  ITstream& interpolation(const word& name) const;
149 
150  //- Get the accumulation scheme for the given field name
151  ITstream& accumulation(const word& name) const;
152 
153 
154  // Read
155 
156  //- Read the LagrangianSchemes
157  bool read();
158 
159 
160  // Member Operators
161 
162  //- Disallow default bitwise assignment
163  void operator=(const LagrangianSchemes&) = delete;
164 };
165 
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 } // End namespace Foam
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #endif
174 
175 // ************************************************************************* //
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
const objectRegistry & db() const
Return the local objectRegistry.
Definition: IOobject.C:309
Input token stream.
Definition: ITstream.H:53
Selector class for Lagrangian schemes.
void operator=(const LagrangianSchemes &)=delete
Disallow default bitwise assignment.
const dictionary & schemesDict() const
Access the dictionary.
ITstream & interpolation(const word &name) const
Get the interpolation scheme for the given field name.
ITstream & ddt(const word &name) const
Get the time scheme for the given field name.
ITstream & accumulation(const word &name) const
Get the accumulation scheme for the given field name.
ITstream & Sp(const word &name) const
Get the source scheme for the given field name.
ITstream & averaging(const word &name) const
Get the averaging scheme for the given field name.
LagrangianSchemes(const objectRegistry &db)
Construct for objectRegistry.
bool read()
Read the LagrangianSchemes.
ClassName("LagrangianSchemes")
Type information.
const fileName & name() const
Return the dictionary name.
Definition: dictionary.H:111
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Registry of regIOobjects.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
dictionary dict