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-2016 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  << "Region mesh not available" << abort(FatalError);
71  }
72 
73  return regionMeshPtr_();
74 }
75 
76 
78 {
80  {
81  return const_cast<fvMesh&>
82  (
84  );
85  }
86  else if (!regionMeshPtr_.valid())
87  {
89  << "Region mesh not available" << abort(FatalError);
90  }
91 
92  return regionMeshPtr_();
93 }
94 
95 
97 {
98  return coeffs_;
99 }
100 
101 
102 inline const Foam::dictionary&
104 {
105  return regionMesh().solutionDict();
106 }
107 
108 
109 inline const Foam::IOdictionary&
111 {
112  if (!outputPropertiesPtr_.valid())
113  {
115  << "outputProperties dictionary not available"
116  << abort(FatalError);
117  }
118 
119  return outputPropertiesPtr_();
120 }
121 
122 
123 inline Foam::IOdictionary&
125 {
126  if (!outputPropertiesPtr_.valid())
127  {
129  << "outputProperties dictionary not available"
130  << abort(FatalError);
131  }
132 
133  return outputPropertiesPtr_();
134 }
135 
136 
138 (
139  const label regionPatchi
140 ) const
141 {
143  {
144  if (intCoupledPatchIDs_[i] == regionPatchi)
145  {
146  return true;
147  }
148  }
149 
150  return false;
151 }
152 
153 
155 (
156  const label primaryPatchi
157 ) const
158 {
160  {
161  if (primaryPatchIDs_[i] == primaryPatchi)
162  {
163  return true;
164  }
165  }
166 
167  return false;
168 }
169 
170 
171 inline const Foam::labelList&
173 {
174  return primaryPatchIDs_;
175 }
176 
177 
178 inline const Foam::labelList&
180 {
181  return intCoupledPatchIDs_;
182 }
183 
184 
186 (
187  const label primaryPatchID
188 ) const
189 {
191  {
192  if (primaryPatchIDs_[i] == primaryPatchID)
193  {
194  return intCoupledPatchIDs_[i];
195  }
196  }
197 
198  return -1;
199 }
200 
201 
202 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:428
const fvMesh & primaryMesh_
Reference to the primary mesh database.
Definition: regionModel.H:84
const word modelName_
Model name.
Definition: regionModel.H:96
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
error FatalError
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
bool isRegionPatch(const label primaryPatchi) const
Return true if patchi on the primary region is a coupled.
Definition: regionModelI.H:155
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
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
bool foundObject(const word &name) const
Is the named Type found?
autoPtr< fvMesh > regionMeshPtr_
Pointer to the region mesh database.
Definition: regionModel.H:99
const Time & time() const
Return the reference to the time database.
Definition: regionModelI.H:37
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
autoPtr< IOdictionary > outputPropertiesPtr_
Dictionary of output properties.
Definition: regionModel.H:105
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:52
const word & modelName() const
Return the model name.
Definition: regionModelI.H:55
const fvMesh & primaryMesh() const
Return the reference to the primary mesh database.
Definition: regionModelI.H:31
A class for handling words, derived from string.
Definition: word.H:59
const dictionary & solutionDict() const
Return the selected sub-dictionary of solvers if the "select".
Definition: solution.C:329
bool isCoupledPatch(const label regionPatchi) const
Return true if patchi on the local region is a coupled.
Definition: regionModelI.H:138
const IOdictionary & outputProperties() const
Return const access to the output properties dictionary.
Definition: regionModelI.H:110
const dictionary & solution() const
Return the solution dictionary.
Definition: regionModelI.H:103
label regionPatchID(const label primaryPatchID) const
Return region ID corresponding to primaryPatchID.
Definition: regionModelI.H:186
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:61
Switch infoOutput_
Active information output.
Definition: regionModel.H:93
errorManip< error > abort(error &err)
Definition: errorManip.H:131
const labelList & primaryPatchIDs() const
Return the list of patch IDs on the primary region coupled.
Definition: regionModelI.H:172
Switch active_
Active flag.
Definition: regionModel.H:90
dictionary coeffs_
Model coefficients dictionary.
Definition: regionModel.H:102
const Time & time_
Reference to the time database.
Definition: regionModel.H:87
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const Switch & infoOutput() const
Return the information flag.
Definition: regionModelI.H:49
labelList intCoupledPatchIDs_
List of patch IDs internally coupled with the primary region.
Definition: regionModel.H:114
const labelList & intCoupledPatchIDs() const
Return the list of patch IDs internally coupled with the.
Definition: regionModelI.H:179
const dictionary & coeffs() const
Return the model coefficients dictionary.
Definition: regionModelI.H:96
word regionName_
Region name.
Definition: regionModel.H:118
labelList primaryPatchIDs_
List of patch IDs on the primary region coupled to this region.
Definition: regionModel.H:111
const Switch & active() const
Return the active flag.
Definition: regionModelI.H:43