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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29#include "regionModel.H"
30
31// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32
33inline const Foam::fvMesh&
35{
36 return primaryMesh_;
37}
38
39
41{
42 return time_;
43}
44
45
47{
48 return active_;
49}
50
51
53{
54 return infoOutput_;
55}
56
57
59{
60 return modelName_;
61}
62
63
65{
66 const fvMesh* regionPtr = time_.getObjectPtr<fvMesh>(regionName_);
67
68 if (!regionPtr)
69 {
71 << "Region mesh not available" << abort(FatalError);
72 }
73
74 return *regionPtr;
75}
76
77
79{
80 fvMesh* regionPtr = time_.getObjectPtr<fvMesh>(regionName_);
81
82 if (!regionPtr)
83 {
85 << "Region mesh not available" << abort(FatalError);
86 }
87
88 return *regionPtr;
89}
90
91
93{
94 return coeffs_;
95}
96
97
98inline const Foam::dictionary&
100{
101 return regionMesh().solutionDict();
102}
103
104
105inline const Foam::IOdictionary&
107{
108 if (!outputPropertiesPtr_)
109 {
111 << "outputProperties dictionary not available"
112 << abort(FatalError);
113 }
114
115 return *outputPropertiesPtr_;
116}
117
118
119inline Foam::IOdictionary&
121{
122 if (!outputPropertiesPtr_)
123 {
125 << "outputProperties dictionary not available"
126 << abort(FatalError);
127 }
128
129 return *outputPropertiesPtr_;
130}
131
132
134(
135 const label regionPatchi
136) const
137{
138 forAll(intCoupledPatchIDs_, i)
139 {
140 if (intCoupledPatchIDs_[i] == regionPatchi)
141 {
142 return true;
143 }
144 }
145
146 return false;
147}
148
149
151(
152 const label primaryPatchi
153) const
154{
155 forAll(primaryPatchIDs_, i)
156 {
157 if (primaryPatchIDs_[i] == primaryPatchi)
158 {
159 return true;
160 }
161 }
162
163 return false;
164}
165
166
167inline const Foam::labelList&
169{
170 return primaryPatchIDs_;
171}
172
173
174inline const Foam::labelList&
176{
177 return intCoupledPatchIDs_;
178}
179
180
182(
183 const label primaryPatchID
184) const
185{
186 forAll(primaryPatchIDs_, i)
187 {
188 if (primaryPatchIDs_[i] == primaryPatchID)
189 {
190 return intCoupledPatchIDs_[i];
191 }
192 }
193
194 return -1;
195}
196
197
198// ************************************************************************* //
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:78
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
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Type * getObjectPtr(const word &name, const bool recursive=false) const
const Time & time() const
Return the reference to the time database.
Definition: regionModelI.H:40
const dictionary & solution() const
Return the solution dictionary.
Definition: regionModelI.H:99
bool isCoupledPatch(const label regionPatchi) const
Return true if patchi on the local region is a coupled.
Definition: regionModelI.H:134
const dictionary & coeffs() const
Return the model coefficients dictionary.
Definition: regionModelI.H:92
const fvMesh & primaryMesh() const
Return the reference to the primary mesh database.
Definition: regionModelI.H:34
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:64
const fvMesh & primaryMesh_
Reference to the primary mesh database.
Definition: regionModel.H:87
label regionPatchID(const label primaryPatchID) const
Return region ID corresponding to primaryPatchID.
Definition: regionModelI.H:182
Switch infoOutput() const
Return the information flag.
Definition: regionModelI.H:52
bool isRegionPatch(const label primaryPatchi) const
Return true if patchi on the primary region is a coupled.
Definition: regionModelI.H:151
const word & modelName() const
Return the model name.
Definition: regionModelI.H:58
const IOdictionary & outputProperties() const
Return const access to the output properties dictionary.
Definition: regionModelI.H:106
const labelList & primaryPatchIDs() const
Return the list of patch IDs on the primary region coupled.
Definition: regionModelI.H:168
const labelList & intCoupledPatchIDs() const
Return the list of patch IDs internally coupled with the.
Definition: regionModelI.H:175
Switch active() const
Return the active flag.
Definition: regionModelI.H:46
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
errorManip< error > abort(error &err)
Definition: errorManip.H:144
error FatalError
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333