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-------------------------------------------------------------------------------
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// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
30
32{
33 return (regionType_ == vrtAll);
34}
35
36
39{
40 return regionType_;
41}
42
43
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
59inline 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// ************************************************************************* //
bool useAllCells() const noexcept
Use all cells, not the cellIDs.
Definition: volRegionI.H:31
scalar V() const
Return total volume of the selected region.
Definition: volRegionI.H:59
label nCells() const
Return the total number of cells selected in the region.
Definition: volRegionI.H:44
regionTypes regionType_
Region type.
Definition: volRegion.H:167
regionTypes
Region type enumeration.
Definition: volRegion.H:123
regionTypes regionType() const noexcept
The region type.
Definition: volRegionI.H:38
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
const direction noexcept
Definition: Scalar.H:223
error FatalError
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53