faSchemes.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) 2016-2017 Wikki Ltd
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::faSchemes
28 
29 Description
30  Selector class for finite area differencing schemes.
31  faMesh is derived from faShemes so that all fields have access to the
32  faSchemes from the mesh reference they hold.
33 
34 SourceFiles
35  faSchemes.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef faSchemes_H
40 #define faSchemes_H
41 
42 #include "IOdictionary.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class faSchemes Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class faSchemes
54 :
55  public IOdictionary
56 {
57  // Private data
58 
59  dictionary ddtSchemes_;
60  ITstream defaultDdtScheme_;
61 
62  dictionary d2dt2Schemes_;
63  ITstream defaultD2dt2Scheme_;
64 
65  dictionary interpolationSchemes_;
66  ITstream defaultInterpolationScheme_;
67 
68  dictionary divSchemes_;
69  ITstream defaultDivScheme_;
70 
71  dictionary gradSchemes_;
72  ITstream defaultGradScheme_;
73 
74  dictionary lnGradSchemes_;
75  ITstream defaultLnGradScheme_;
76 
77  dictionary laplacianSchemes_;
78  ITstream defaultLaplacianScheme_;
79 
80  mutable dictionary fluxRequired_;
81  bool defaultFluxRequired_;
82 
83 
84  // Private Member Functions
85 
86  //- Clear the dictionaries and streams before reading
87  void clear();
88 
89  //- Read settings from the dictionary
90  void read(const dictionary&);
91 
92  //- No copy construct
93  faSchemes(const faSchemes&) = delete;
94 
95  //- No copy assignment
96  void operator=(const faSchemes&) = delete;
97 
98 
99 public:
100 
101  //- Debug switch
102  static int debug;
103 
104 
105  // Constructors
106 
107  //- Construct from objectRegistry
108  faSchemes(const objectRegistry& obr);
109 
110 
111  // Member Functions
112 
113  // Access
114 
115  const dictionary& schemesDict() const;
116 
117  ITstream& ddtScheme(const word& name) const;
118 
119  ITstream& d2dt2Scheme(const word& name) const;
120 
121  ITstream& interpolationScheme(const word& name) const;
122 
123  ITstream& divScheme(const word& name) const;
124 
125  ITstream& gradScheme(const word& name) const;
126 
127  ITstream& lnGradScheme(const word& name) const;
128 
129  ITstream& laplacianScheme(const word& name) const;
130 
131  void setFluxRequired(const word& name) const;
132 
133  bool fluxRequired(const word& name) const;
134 
135 
136  // Edit
137 
138  //- Return access to ddt schemes
140  {
141  return ddtSchemes_;
142  }
143 
144  //- Return access to d2dt2 schemes
146  {
147  return d2dt2Schemes_;
148  }
149 
150  //- Return access to interpolation schemes
152  {
153  return interpolationSchemes_;
154  }
155 
156  //- Return access to div schemes
158  {
159  return divSchemes_;
160  }
161 
162  //- Return access to grad schemes
164  {
165  return gradSchemes_;
166  }
167 
168  //- Return access to lnGrad schemes
170  {
171  return lnGradSchemes_;
172  }
173 
174  //- Return access to laplacian schemes
176  {
177  return laplacianSchemes_;
178  }
179 
180  //- Return access to flux required
182  {
183  return fluxRequired_;
184  }
185 
186 
187  // Read
188 
189  //- Read the faSchemes
190  bool read();
191 
192 
193  // Write
194 
195  //- WriteData function required for regIOobject write operation
196  virtual bool writeData(Ostream&) const;
197 };
198 
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 } // End namespace Foam
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 #endif
207 
208 // ************************************************************************* //
Foam::faSchemes::interpolationSchemes
dictionary & interpolationSchemes()
Return access to interpolation schemes.
Definition: faSchemes.H:150
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:54
Foam::faSchemes::schemesDict
const dictionary & schemesDict() const
Definition: faSchemes.C:343
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::faSchemes::divSchemes
dictionary & divSchemes()
Return access to div schemes.
Definition: faSchemes.H:156
Foam::faSchemes
Selector class for finite area differencing schemes. faMesh is derived from faShemes so that all fiel...
Definition: faSchemes.H:52
Foam::faSchemes::writeData
virtual bool writeData(Ostream &) const
WriteData function required for regIOobject write operation.
Definition: faSchemes.C:520
Foam::baseIOdictionary::name
const word & name() const
Definition: baseIOdictionary.C:82
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::faSchemes::laplacianScheme
ITstream & laplacianScheme(const word &name) const
Definition: faSchemes.C:472
Foam::ITstream
An input stream of tokens.
Definition: ITstream.H:55
Foam::faSchemes::divScheme
ITstream & divScheme(const word &name) const
Definition: faSchemes.C:415
Foam::faSchemes::interpolationScheme
ITstream & interpolationScheme(const word &name) const
Definition: faSchemes.C:392
Foam::faSchemes::lnGradScheme
ITstream & lnGradScheme(const word &name) const
Definition: faSchemes.C:453
Foam::faSchemes::ddtSchemes
dictionary & ddtSchemes()
Return access to ddt schemes.
Definition: faSchemes.H:138
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::faSchemes::debug
static int debug
Debug switch.
Definition: faSchemes.H:101
Foam::faSchemes::gradSchemes
dictionary & gradSchemes()
Return access to grad schemes.
Definition: faSchemes.H:162
Foam::faSchemes::ddtScheme
ITstream & ddtScheme(const word &name) const
Definition: faSchemes.C:354
IOdictionary.H
Foam::faSchemes::lnGradSchemes
dictionary & lnGradSchemes()
Return access to lnGrad schemes.
Definition: faSchemes.H:168
Foam::faSchemes::d2dt2Scheme
ITstream & d2dt2Scheme(const word &name) const
Definition: faSchemes.C:373
Foam::faSchemes::setFluxRequired
void setFluxRequired(const word &name) const
Definition: faSchemes.C:491
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::faSchemes::laplacianSchemes
dictionary & laplacianSchemes()
Return access to laplacian schemes.
Definition: faSchemes.H:174
Foam::faSchemes::gradScheme
ITstream & gradScheme(const word &name) const
Definition: faSchemes.C:434
Foam::faSchemes::fluxRequired
dictionary & fluxRequired()
Return access to flux required.
Definition: faSchemes.H:180
Foam::faSchemes::d2dt2Schemes
dictionary & d2dt2Schemes()
Return access to d2dt2 schemes.
Definition: faSchemes.H:144
Foam::faSchemes::read
bool read()
Read the faSchemes.
Definition: faSchemes.C:327