Loading...
Searching...
No Matches
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/>.
27\*---------------------------------------------------------------------------*/
28
29#include "regionModel.H"
30
31// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32
34{
35 const fvMesh* regionPtr = time_.getObjectPtr<fvMesh>(regionName_);
36
37 if (!regionPtr)
38 {
40 << "Region mesh not available" << abort(FatalError);
41 }
42
43 return *regionPtr;
44}
45
46
48{
49 fvMesh* regionPtr = time_.getObjectPtr<fvMesh>(regionName_);
50
51 if (!regionPtr)
52 {
54 << "Region mesh not available" << abort(FatalError);
55 }
56
57 return *regionPtr;
58}
59
60
61inline const Foam::dictionary&
63{
64 return regionMesh().solutionDict();
65}
66
67
68inline const Foam::IOdictionary&
70{
71 if (!outputPropertiesPtr_)
72 {
74 << "outputProperties dictionary not available"
75 << abort(FatalError);
76 }
77
78 return *outputPropertiesPtr_;
79}
80
81
84{
85 if (!outputPropertiesPtr_)
86 {
88 << "outputProperties dictionary not available"
89 << abort(FatalError);
90 }
91
92 return *outputPropertiesPtr_;
93}
94
95
96inline const Foam::labelList&
101
102
111(
112 const label regionPatchi
113) const
114{
115 return intCoupledPatchIDs_.found(regionPatchi);
116}
117
118
120(
121 const label primaryPatchi
122) const
123{
124 return primaryPatchIDs_.found(primaryPatchi);
125}
126
127
129(
130 const label primaryPatchi
131) const
132{
133 const label i = primaryPatchIDs_.find(primaryPatchi);
134
135 return (i >= 0 ? intCoupledPatchIDs_[i] : -1);
136}
137
138
139// ************************************************************************* //
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
Type * getObjectPtr(const word &name, const bool recursive=false) const
Return non-const pointer to the object of the given Type, using a const-cast to have it behave like a...
autoPtr< IOdictionary > outputPropertiesPtr_
Dictionary of output properties.
const Time & time_
Reference to the time database.
Definition regionModel.H:97
const dictionary & solution() const
Return the solution dictionary.
const labelList & primaryPatchIDs() const noexcept
List of patch IDs on the primary region coupled to this region.
bool isCoupledPatch(const label regionPatchi) const
True if patchi on the local region is a coupled patch to the primary region.
labelList primaryPatchIDs_
List of patch IDs on the primary region coupled to this region.
const fvMesh & regionMesh() const
Return the region mesh database.
const labelList & intCoupledPatchIDs() const noexcept
List of patch IDs internally coupled with the primary region.
label regionPatchID(const label primaryPatchi) const
Return region ID corresponding to primaryPatch ID.
bool isRegionPatch(const label primaryPatchi) const
True if patchi on the primary region is a coupled patch to the local region.
const IOdictionary & outputProperties() const
Return const access to the output properties dictionary.
labelList intCoupledPatchIDs_
List of patch IDs internally coupled with the primary region.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition error.H:600
List< label > labelList
A List of labels.
Definition List.H:62
errorManip< error > abort(error &err)
Definition errorManip.H:139
const direction noexcept
Definition scalarImpl.H:265
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...