volRegionI.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) 2016 OpenFOAM Foundation
9  Copyright (C) 2019-2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
30 
32 {
33  return (regionType_ == vrtAll);
34 }
35 
36 
39 {
40  return regionType_;
41 }
42 
43 
44 inline Foam::label Foam::functionObjects::volRegion::nCells() const
45 {
46  #ifdef FULLDEBUG
47  if (requireUpdate_)
48  {
50  << "Retrieving cached values that are not up-to-date" << nl
51  << exit(FatalError);
52  }
53  #endif
54 
55  return nCells_;
56 }
57 
58 
59 inline Foam::scalar Foam::functionObjects::volRegion::V() const
60 {
61  #ifdef FULLDEBUG
62  if (requireUpdate_)
63  {
65  << "Retrieving cached values that are not up-to-date" << nl
66  << exit(FatalError);
67  }
68  #endif
69 
70  return V_;
71 }
72 
73 
74 // ************************************************************************* //
Foam::functionObjects::volRegion::vrtAll
All cells.
Definition: volRegion.H:147
Foam::functionObjects::volRegion::regionTypes
regionTypes
Region type enumeration.
Definition: volRegion.H:145
Foam::functionObjects::volRegion::regionType_
regionTypes regionType_
Region type.
Definition: volRegion.H:161
Foam::functionObjects::volRegion::nCells
label nCells() const
Return the total number of cells selected in the region.
Definition: volRegionI.H:44
Foam::FatalError
error FatalError
Foam::functionObjects::volRegion::useAllCells
bool useAllCells() const noexcept
Use all cells, not the cellIDs.
Definition: volRegionI.H:31
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Foam::nl
constexpr char nl
Definition: Ostream.H:404
Foam::functionObjects::volRegion::regionType
regionTypes regionType() const noexcept
The region type.
Definition: volRegionI.H:38
Foam::functionObjects::volRegion::V
scalar V() const
Return total volume of the selected region.
Definition: volRegionI.H:59