regionFaModelI.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) 2019-2022 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28#include "regionFaModel.H"
29
30// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31
32inline const Foam::fvMesh&
34{
35 return primaryMesh_;
36}
37
38
40{
41 return time_;
42}
43
44
46{
47 return active_;
48}
49
50
52{
53 return infoOutput_;
54}
55
56
58{
59 return modelName_;
60}
61
62
64{
65 const auto* regionPtr = time_.findObject<faMesh>(regionName_);
66
67 if (regionPtr)
68 {
69 return *regionPtr;
70 }
71 else if (!regionMeshPtr_)
72 {
74 << "Region mesh not available" << abort(FatalError);
75 }
76
77 return *regionMeshPtr_;
78}
79
80
82{
83 auto* regionPtr = time_.getObjectPtr<faMesh>(regionName_);
84
85 if (regionPtr)
86 {
87 return *regionPtr;
88 }
89 else if (!regionMeshPtr_)
90 {
92 << "Region mesh not available" << abort(FatalError);
93 }
94
95 return *regionMeshPtr_;
96}
97
98
100{
101 return coeffs_;
102}
103
104inline const Foam::IOdictionary&
106{
107 if (!outputPropertiesPtr_)
108 {
110 << "outputProperties dictionary not available"
111 << abort(FatalError);
112 }
113 return *outputPropertiesPtr_;
114}
115
116
117inline Foam::IOdictionary&
119{
120 if (!outputPropertiesPtr_)
121 {
123 << "outputProperties dictionary not available"
124 << abort(FatalError);
125 }
126
127 return *outputPropertiesPtr_;
128}
129
130
131inline const Foam::dictionary&
133{
134 return regionMesh().solutionDict();
135}
136
137
139{
140 return patchID_;
141}
142
143
144// ************************************************************************* //
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
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:100
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
const Time & time() const
Return the reference to the time database.
const dictionary & solution() const
Return the solution dictionary.
const dictionary & coeffs() const
Return the model coefficients dictionary.
const fvMesh & primaryMesh() const
Return the reference to the primary mesh database.
label patchID() const
Return patch ID.
const Switch & active() const
Return the active flag.
const fvMesh & primaryMesh_
Reference to the primary mesh database.
const word & modelName() const
Return the model name.
const faMesh & regionMesh() const
Return the region mesh database.
const IOdictionary & outputProperties() const
Return const access to the output properties dictionary.
const Switch & infoOutput() const
Return the information flag.
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