solverTemplate.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 | Copyright (C) 2015 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::solverTemplate
26 
27 Description
28  Class to store solver template specifications
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef solverTemplate_H
33 #define solverTemplate_H
34 
35 #include "boolList.H"
36 #include "wordList.H"
37 #include "dimensionSet.H"
38 #include "IOobject.H"
39 #include "NamedEnum.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 class Time;
47 
48 /*---------------------------------------------------------------------------*\
49  Class solverTemplate Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class solverTemplate
53 {
54 public:
55 
56  // Public enumerations
57 
58  //- Solver type
59  enum solverType
60  {
64  stUnknown
65  };
66 
67  //- Solver type names
69 
70 
71 private:
72 
73  // Private data
74 
75  //- Solver type
77 
78  //- Multi-region flag
79  bool multiRegion_;
80 
81 
82  // Per-region info
83 
84  //- Region types
86 
87  //- Region names
89 
90  //- Field names
92 
93  //- Field types
95 
96  //- Field dimensions
98 
99 
100  // Public member functions
101 
102  //- Read a word from a dictionary (offers some protection...)
104  (
105  IOobject& dictHeader,
106  const word& entryName
107  ) const;
108 
109  //- Read fluid region templates
111  (
112  const word& regionName,
113  const fileName& baseDir,
114  const dictionary& solverDict,
115  const Time& runTime
116  ) const;
117 
118  //- Read solid region templates
120  (
121  const word& regionName,
122  const dictionary& solverDict
123  ) const;
124 
125  //- Set the properties for region with index regionI
127  (
128  const dictionary& dict,
129  const word& regionType,
130  const word& regionName,
131  const label regionI
132  );
133 
134 
135 public:
136 
137  //- Constructor
139  (
140  const fileName& baseDir,
141  const Time& runTime,
142  const word& regionName
143  );
144 
145 
146  // Public member functions
147 
148  //- Solver type name
149  word type() const;
150 
151  //- Return the multi-region flag
152  bool multiRegion() const;
153 
154  //- Return the number of regions
155  label nRegion() const;
156 
157 
158  // Per-region info
159 
160  //- Return the region type
161  const word& regionType(const label regionI) const;
162 
163  //- Return the region name
164  const word& regionName(const label regionI) const;
165 
166  //- Return the field names
167  const wordList& fieldNames(const label regionI) const;
168 
169  //- Return the field types
170  const wordList& fieldTypes(const label regionI) const;
171 
172  //- Return the field dimensions
174  (
175  const label regionI
176  ) const;
177 };
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 } // End namespace Foam
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 #endif
186 
187 // ************************************************************************* //
Foam::solverTemplate::solverType_
solverType solverType_
Solver type.
Definition: solverTemplate.H:75
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
boolList.H
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::solverTemplate::fieldNames
const wordList & fieldNames(const label regionI) const
Return the field names.
NamedEnum.H
Foam::solverTemplate::solverType
solverType
Solver type.
Definition: solverTemplate.H:58
Foam::solverTemplate::stCompressible
@ stCompressible
Definition: solverTemplate.H:60
Foam::solverTemplate::stBuoyant
@ stBuoyant
Definition: solverTemplate.H:62
Foam::solverTemplate
Class to store solver template specifications.
Definition: solverTemplate.H:51
Foam::solverTemplate::fieldDimensions
const PtrList< dimensionSet > & fieldDimensions(const label regionI) const
Return the field dimensions.
Foam::solverTemplate::stUnknown
@ stUnknown
Definition: solverTemplate.H:63
Foam::solverTemplate::regionName
const word & regionName(const label regionI) const
Return the region name.
Foam::solverTemplate::readFluidFieldTemplates
dictionary readFluidFieldTemplates(const word &regionName, const fileName &baseDir, const dictionary &solverDict, const Time &runTime) const
Read fluid region templates.
wordList.H
Foam::solverTemplate::fieldNames_
List< wordList > fieldNames_
Field names.
Definition: solverTemplate.H:90
Foam::solverTemplate::readSolidFieldTemplates
dictionary readSolidFieldTemplates(const word &regionName, const dictionary &solverDict) const
Read solid region templates.
Foam::solverTemplate::solverTypeNames_
static const NamedEnum< solverType, 4 > solverTypeNames_
Solver type names.
Definition: solverTemplate.H:67
Foam::solverTemplate::readFromDict
word readFromDict(IOobject &dictHeader, const word &entryName) const
Read a word from a dictionary (offers some protection...)
Foam::solverTemplate::multiRegion_
bool multiRegion_
Multi-region flag.
Definition: solverTemplate.H:78
Foam::label
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
Foam::solverTemplate::solverTemplate
solverTemplate(const fileName &baseDir, const Time &runTime, const word &regionName)
Constructor.
Foam::solverTemplate::regionNames_
wordList regionNames_
Region names.
Definition: solverTemplate.H:87
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::solverTemplate::stIncompressible
@ stIncompressible
Definition: solverTemplate.H:61
dimensionSet.H
dict
dictionary dict
Definition: searchingEngine.H:14
IOobject.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::solverTemplate::fieldTypes
const wordList & fieldTypes(const label regionI) const
Return the field types.
Foam::solverTemplate::nRegion
label nRegion() const
Return the number of regions.
Foam::solverTemplate::setRegionProperties
void setRegionProperties(const dictionary &dict, const word &regionType, const word &regionName, const label regionI)
Set the properties for region with index regionI.
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::solverTemplate::type
word type() const
Solver type name.
Foam::solverTemplate::fieldDimensions_
List< PtrList< dimensionSet > > fieldDimensions_
Field dimensions.
Definition: solverTemplate.H:96
Foam::solverTemplate::multiRegion
bool multiRegion() const
Return the multi-region flag.
Foam::solverTemplate::regionType
const word & regionType(const label regionI) const
Return the region type.
Foam::solverTemplate::regionTypes_
wordList regionTypes_
Region types.
Definition: solverTemplate.H:84
Foam::solverTemplate::fieldTypes_
List< wordList > fieldTypes_
Field types.
Definition: solverTemplate.H:93
Foam::NamedEnum< solverType, 4 >