cellSetOptionI.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-2015 OpenFOAM Foundation
9  Copyright (C) 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 
31 inline Foam::scalar Foam::fv::cellSetOption::timeStart() const noexcept
32 {
33  return timeStart_;
34 }
35 
36 
37 inline Foam::scalar Foam::fv::cellSetOption::duration() const noexcept
38 {
39  return duration_;
40 }
41 
42 
43 inline bool Foam::fv::cellSetOption::inTimeLimits(const scalar timeValue) const
44 {
45  return
46  (
47  (timeStart_ < 0)
48  ||
49  (
50  (mesh_.time().value() >= timeStart_)
51  && (mesh_.time().value() <= (timeStart_ + duration_))
52  )
53  );
54 }
55 
56 
59 {
60  return selectionMode_;
61 }
62 
63 
64 inline bool Foam::fv::cellSetOption::useSubMesh() const noexcept
65 {
66  return selectionMode_ != selectionModeType::smAll;
67 }
68 
69 
70 inline const Foam::word& Foam::fv::cellSetOption::cellSetName() const noexcept
71 {
72  return cellSetName_;
73 }
74 
75 
76 inline Foam::scalar Foam::fv::cellSetOption::V() const noexcept
77 {
78  return V_;
79 }
80 
81 
82 inline const Foam::labelList& Foam::fv::cellSetOption::cells() const noexcept
83 {
84  return cells_;
85 }
86 
87 
88 inline Foam::scalar Foam::fv::cellSetOption::timeStart(scalar val) noexcept
89 {
90  scalar old(timeStart_);
91  timeStart_ = val;
92  return old;
93 }
94 
95 
96 inline Foam::scalar Foam::fv::cellSetOption::duration(scalar val) noexcept
97 {
98  scalar old(duration_);
99  duration_ = val;
100  return old;
101 }
102 
103 
104 // ************************************************************************* //
Foam::fv::cellSetOption::cells
const labelList & cells() const noexcept
Return const access to the cell selection.
Definition: cellSetOptionI.H:82
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fv::cellSetOption::inTimeLimits
bool inTimeLimits(const scalar timeValue) const
True if within time limits.
Definition: cellSetOptionI.H:43
Foam::fv::cellSetOption::V
scalar V() const noexcept
Return const access to the total cell volume.
Definition: cellSetOptionI.H:76
Foam::fv::cellSetOption::useSubMesh
bool useSubMesh() const noexcept
True if sub-selection should be used.
Definition: cellSetOptionI.H:64
Foam::fv::cellSetOption::selectionModeType
selectionModeType
Enumeration for selection mode types.
Definition: cellSetOption.H:172
Foam::fv::cellSetOption::duration
scalar duration() const noexcept
Return const access to the duration.
Definition: cellSetOptionI.H:37
Foam::fv::cellSetOption::selectionMode
selectionModeType selectionMode() const noexcept
Return the cell selection mode.
Definition: cellSetOptionI.H:58
Foam::fv::cellSetOption::cellSetName
const word & cellSetName() const noexcept
Definition: cellSetOptionI.H:70
Foam::List< label >
Foam::fv::cellSetOption::timeStart
scalar timeStart() const noexcept
Return const access to the time start.
Definition: cellSetOptionI.H:31
Foam::fv::cellSetOption::timeStart_
scalar timeStart_
Start time of fvOption.
Definition: cellSetOption.H:189