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-2020 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
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 
32 inline 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_.valid())
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_.valid())
90  {
92  << "Region mesh not available" << abort(FatalError);
93  }
94 
95  return *regionMeshPtr_;
96 }
97 
98 
100 {
101  return coeffs_;
102 }
103 
104 
105 inline const Foam::dictionary&
107 {
108  return regionMesh().solutionDict();
109 }
110 
111 
113 {
114  return patchID_;
115 }
116 
117 
118 // ************************************************************************* //
Foam::regionModels::regionFaModel::solution
const dictionary & solution() const
Return the solution dictionary.
Definition: regionFaModelI.H:106
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:77
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::regionModels::regionFaModel::primaryMesh
const fvMesh & primaryMesh() const
Return the reference to the primary mesh database.
Definition: regionFaModelI.H:33
Foam::regionModels::regionFaModel::infoOutput
const Switch & infoOutput() const
Return the information flag.
Definition: regionFaModelI.H:51
Foam::regionModels::regionFaModel::active
const Switch & active() const
Return the active flag.
Definition: regionFaModelI.H:45
Foam::regionModels::regionFaModel::coeffs
const dictionary & coeffs() const
Return the model coefficients dictionary.
Definition: regionFaModelI.H:99
Foam::regionModels::regionFaModel::regionMesh
const faMesh & regionMesh() const
Return the region mesh database.
Definition: regionFaModelI.H:63
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:144
Foam::regionModels::regionFaModel::time
const Time & time() const
Return the reference to the time database.
Definition: regionFaModelI.H:39
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:381
Foam::regionModels::regionFaModel::patchID
label patchID()
Definition: regionFaModelI.H:112
Foam::regionModels::regionFaModel::modelName
const word & modelName() const
Return the model name.
Definition: regionFaModelI.H:57
Foam::faMesh
Finite area mesh. Used for 2-D non-Euclidian finite area method.
Definition: faMesh.H:77
regionFaModel.H
Foam::regionModels::regionFaModel::primaryMesh_
const fvMesh & primaryMesh_
Reference to the primary mesh database.
Definition: regionFaModel.H:129