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 
58 {
59  return selectionMode_ != selectionModeType::smAll;
60 }
61 
62 
65 {
66  return selectionMode_;
67 }
68 
69 
70 inline const Foam::wordRes&
72 {
73  return selectionNames_;
74 }
75 
76 
78 {
79  return (selectionNames_.empty() ? wordRe::null : selectionNames_.first());
80 }
81 
82 
83 inline Foam::scalar Foam::fv::cellSetOption::V() const noexcept
84 {
85  return V_;
86 }
87 
88 
90 {
91  return cells_;
92 }
93 
94 
95 inline Foam::scalar Foam::fv::cellSetOption::timeStart(scalar val) noexcept
96 {
97  scalar old(timeStart_);
98  timeStart_ = val;
99  return old;
100 }
101 
102 
103 inline Foam::scalar Foam::fv::cellSetOption::duration(scalar val) noexcept
104 {
105  scalar old(duration_);
106  duration_ = val;
107  return old;
108 }
109 
110 
111 // ************************************************************************* //
scalar timeStart() const noexcept
Return const access to the time start.
const labelList & cells() const noexcept
Return const access to the cell selection.
scalar duration() const noexcept
Return const access to the duration.
scalar V() const noexcept
Return const access to the total cell volume.
const wordRe & zoneName() const
Return const access to the first set/zone name.
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:53
bool inTimeLimits(const scalar timeValue) const
True if within time limits.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings...
Definition: wordRe.H:78
const direction noexcept
Definition: Scalar.H:258
selectionModeType
Enumeration for selection mode types.
selectionModeType selectionMode() const noexcept
Return the cell selection mode.
const wordRes & selectionNames() const noexcept
Return const access to the selection names (set or zone selection)
bool useSubMesh() const noexcept
True if sub-selection should be used.
scalar timeStart_
Start time of fvOption.
static const wordRe null
An empty wordRe.
Definition: wordRe.H:97