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