regionModelI.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) 2011-2013 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 \*---------------------------------------------------------------------------*/
25 
26 #include "regionModel.H"
27 
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 
30 inline const Foam::fvMesh&
32 {
33  return primaryMesh_;
34 }
35 
36 
38 {
39  return time_;
40 }
41 
42 
44 {
45  return active_;
46 }
47 
48 
50 {
51  return infoOutput_;
52 }
53 
54 
56 {
57  return modelName_;
58 }
59 
60 
62 {
64  {
66  }
67  else if (!regionMeshPtr_.valid())
68  {
70  (
71  "inline const Foam::fvMesh&"
72  "Foam::regionModels::regionModel::regionMesh() const"
73  )<< "Region mesh not available" << abort(FatalError);
74  }
75 
76  return regionMeshPtr_();
77 }
78 
79 
81 {
83  {
84  return const_cast<fvMesh&>
85  (
87  );
88  }
89  else if (!regionMeshPtr_.valid())
90  {
92  (
93  "inline Foam::fvMesh&"
94  "Foam::regionModels::regionModel::regionMesh()"
95  )<< "Region mesh not available" << abort(FatalError);
96  }
97 
98  return regionMeshPtr_();
99 }
100 
101 
103 {
104  return coeffs_;
105 }
106 
107 
108 inline const Foam::dictionary&
110 {
111  return regionMesh().solutionDict();
112 }
113 
114 
115 inline const Foam::IOdictionary&
117 {
118  if (!outputPropertiesPtr_.valid())
119  {
121  (
122  "inline const Foam::IOdictionary& "
123  "Foam::regionModels::regionModel::outputProperties() const"
124  )
125  << "outputProperties dictionary not available"
126  << abort(FatalError);
127  }
128 
129  return outputPropertiesPtr_();
130 }
131 
132 
133 inline Foam::IOdictionary&
135 {
136  if (!outputPropertiesPtr_.valid())
137  {
139  (
140  "inline Foam::IOdictionary& "
141  "Foam::regionModels::regionModel::outputProperties()"
142  )
143  << "outputProperties dictionary not available"
144  << abort(FatalError);
145  }
146 
147  return outputPropertiesPtr_();
148 }
149 
150 
152 (
153  const label regionPatchI
154 ) const
155 {
157  {
158  if (intCoupledPatchIDs_[i] == regionPatchI)
159  {
160  return true;
161  }
162  }
163 
164  return false;
165 }
166 
167 
169 (
170  const label primaryPatchI
171 ) const
172 {
174  {
175  if (primaryPatchIDs_[i] == primaryPatchI)
176  {
177  return true;
178  }
179  }
180 
181  return false;
182 }
183 
184 
185 inline const Foam::labelList&
187 {
188  return primaryPatchIDs_;
189 }
190 
191 
192 inline const Foam::labelList&
194 {
195  return intCoupledPatchIDs_;
196 }
197 
198 
200 (
201  const label primaryPatchID
202 ) const
203 {
205  {
206  if (primaryPatchIDs_[i] == primaryPatchID)
207  {
208  return intCoupledPatchIDs_[i];
209  }
210  }
211 
212  return -1;
213 }
214 
215 
216 // ************************************************************************* //
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const labelList & intCoupledPatchIDs() const
Return the list of patch IDs internally coupled with the.
Definition: regionModelI.H:193
const labelList & primaryPatchIDs() const
Return the list of patch IDs on the primary region coupled.
Definition: regionModelI.H:186
bool foundObject(const word &name) const
Is the named Type found?
const IOdictionary & outputProperties() const
Return const access to the output properties dictionary.
Definition: regionModelI.H:116
Switch active_
Active flag.
Definition: regionModel.H:93
const Switch & infoOutput() const
Return the information flag.
Definition: regionModelI.H:49
labelList primaryPatchIDs_
List of patch IDs on the primary region coupled to this region.
Definition: regionModel.H:114
A class for handling words, derived from string.
Definition: word.H:59
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
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:61
const Time & time() const
Return the reference to the time database.
Definition: regionModelI.H:37
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none.
Definition: Switch.H:60
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
word regionName_
Region name.
Definition: regionModel.H:121
labelList intCoupledPatchIDs_
List of patch IDs internally coupled with the primary region.
Definition: regionModel.H:117
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
label regionPatchID(const label primaryPatchID) const
Return region ID corresponding to primaryPatchID.
Definition: regionModelI.H:200
const word modelName_
Model name.
Definition: regionModel.H:99
#define forAll(list, i)
Definition: UList.H:421
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
dictionary coeffs_
Model coefficients dictionary.
Definition: regionModel.H:105
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
errorManip< error > abort(error &err)
Definition: errorManip.H:131
const dictionary & solution() const
Return the solution dictionary.
Definition: regionModelI.H:109
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Definition: error.H:314
const dictionary & coeffs() const
Return the model coefficients dictionary.
Definition: regionModelI.H:102
const Switch & active() const
Return the active flag.
Definition: regionModelI.H:43
const fvMesh & primaryMesh() const
Return the reference to the primary mesh database.
Definition: regionModelI.H:31
error FatalError
const fvMesh & primaryMesh_
Reference to the primary mesh database.
Definition: regionModel.H:87
bool isRegionPatch(const label primaryPatchI) const
Return true if patchI on the primary region is a coupled.
Definition: regionModelI.H:169
const dictionary & solutionDict() const
Return the selected sub-dictionary of solvers if the "select".
Definition: solution.C:352
const Time & time_
Reference to the time database.
Definition: regionModel.H:90
bool isCoupledPatch(const label regionPatchI) const
Return true if patchI on the local region is a coupled.
Definition: regionModelI.H:152
autoPtr< fvMesh > regionMeshPtr_
Pointer to the region mesh database.
Definition: regionModel.H:102
autoPtr< IOdictionary > outputPropertiesPtr_
Dictionary of output properties.
Definition: regionModel.H:108
const word & modelName() const
Return the model name.
Definition: regionModelI.H:55
Switch infoOutput_
Active information output.
Definition: regionModel.H:96