regionModelI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2022 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 infoOutput_;
46 }
47 
48 
50 {
51  return modelName_;
52 }
53 
54 
56 {
58  {
60  }
61  else if (!regionMeshPtr_.valid())
62  {
64  << "Region mesh not available" << abort(FatalError);
65  }
66 
67  return regionMeshPtr_();
68 }
69 
70 
72 {
74  {
75  return const_cast<fvMesh&>
76  (
78  );
79  }
80  else if (!regionMeshPtr_.valid())
81  {
83  << "Region mesh not available" << abort(FatalError);
84  }
85 
86  return regionMeshPtr_();
87 }
88 
89 
91 {
92  return coeffs_;
93 }
94 
95 
96 inline const Foam::dictionary&
98 {
99  return regionMesh().solution().dict();
100 }
101 
102 
103 inline const Foam::IOdictionary&
105 {
106  if (!outputPropertiesPtr_.valid())
107  {
109  << "outputProperties dictionary not available"
110  << abort(FatalError);
111  }
112 
113  return outputPropertiesPtr_();
114 }
115 
116 
117 inline Foam::IOdictionary&
119 {
120  if (!outputPropertiesPtr_.valid())
121  {
123  << "outputProperties dictionary not available"
124  << abort(FatalError);
125  }
126 
127  return outputPropertiesPtr_();
128 }
129 
130 
132 (
133  const label regionPatchi
134 ) const
135 {
137  {
138  if (intCoupledPatchIDs_[i] == regionPatchi)
139  {
140  return true;
141  }
142  }
143 
144  return false;
145 }
146 
147 
149 (
150  const label primaryPatchi
151 ) const
152 {
154  {
155  if (primaryPatchIDs_[i] == primaryPatchi)
156  {
157  return true;
158  }
159  }
160 
161  return false;
162 }
163 
164 
165 inline const Foam::labelList&
167 {
168  return primaryPatchIDs_;
169 }
170 
171 
172 inline const Foam::labelList&
174 {
175  return intCoupledPatchIDs_;
176 }
177 
178 
180 (
181  const label primaryPatchID
182 ) const
183 {
185  {
186  if (primaryPatchIDs_[i] == primaryPatchID)
187  {
188  return intCoupledPatchIDs_[i];
189  }
190  }
191 
192  return -1;
193 }
194 
195 
196 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
const fvMesh & primaryMesh_
Reference to the primary mesh database.
Definition: regionModel.H:79
const word modelName_
Model name.
Definition: regionModel.H:88
error FatalError
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
bool isRegionPatch(const label primaryPatchi) const
Return true if patchi on the primary region is a coupled.
Definition: regionModelI.H:149
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:306
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/any.
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:91
const fvSolution & solution() const
Return the fvSchemes.
Definition: fvMesh.C:1683
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:69
autoPtr< IOdictionary > outputPropertiesPtr_
Dictionary of output properties.
Definition: regionModel.H:97
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
const word & modelName() const
Return the model name.
Definition: regionModelI.H:49
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
bool isCoupledPatch(const label regionPatchi) const
Return true if patchi on the local region is a coupled.
Definition: regionModelI.H:132
const IOdictionary & outputProperties() const
Return const access to the output properties dictionary.
Definition: regionModelI.H:104
const dictionary & solution() const
Return the solution dictionary.
Definition: regionModelI.H:97
label regionPatchID(const label primaryPatchID) const
Return region ID corresponding to primaryPatchID.
Definition: regionModelI.H:180
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:55
Switch infoOutput_
Information output.
Definition: regionModel.H:85
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:166
dictionary coeffs_
Model coefficients dictionary.
Definition: regionModel.H:94
const Time & time_
Reference to the time database.
Definition: regionModel.H:82
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
const Switch & infoOutput() const
Return the information flag.
Definition: regionModelI.H:43
labelList intCoupledPatchIDs_
List of patch IDs internally coupled with the primary region.
Definition: regionModel.H:106
const labelList & intCoupledPatchIDs() const
Return the list of patch IDs internally coupled with the.
Definition: regionModelI.H:173
const dictionary & coeffs() const
Return the model coefficients dictionary.
Definition: regionModelI.H:90
word regionName_
Region name.
Definition: regionModel.H:110
labelList primaryPatchIDs_
List of patch IDs on the primary region coupled to this region.
Definition: regionModel.H:103
const dictionary & dict() const
Return the selected sub-dictionary of solvers if the "select".
Definition: solution.C:316