Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
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 * * * * * * * * * * * * * //
31inline Foam::scalar Foam::fv::cellSetOption::timeStart() const noexcept
32{
33 return timeStart_;
34}
35
37inline Foam::scalar Foam::fv::cellSetOption::duration() const noexcept
38{
39 return duration_;
40}
41
42
43inline 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
61
62
68
69
74}
75
78{
79 return (selectionNames_.empty() ? wordRe::null : selectionNames_.first());
80}
81
83inline Foam::scalar Foam::fv::cellSetOption::V() const noexcept
84{
85 return V_;
86}
87
90{
91 return cells_;
92}
93
94
95inline Foam::scalar Foam::fv::cellSetOption::timeStart(scalar val) noexcept
97 scalar old(timeStart_);
98 timeStart_ = val;
99 return old;
100}
101
102
103inline 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.
scalar duration() const noexcept
Return const access to the duration.
wordRes selectionNames_
Face selection names (for set or zone selections).
scalar V() const noexcept
Return const access to the total cell volume.
labelList cells_
Set of cells to apply source to.
scalar V_
Sum of cell volumes.
bool useSubMesh() const noexcept
True if sub-selection should be used.
scalar duration_
Duration of fvOption execution starting from timeStart.
scalar timeStart_
Start time of fvOption.
const wordRe & zoneName() const
Return const access to the first set/zone name.
const labelList & cells() const noexcept
Return const access to the cell selection.
selectionModeType selectionMode_
Cell selection mode.
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).
selectionModeType
Enumeration for selection mode types.
bool inTimeLimits(const scalar timeValue) const
True if within time limits.
const fvMesh & mesh_
Reference to the mesh database.
Definition fvOption.H:142
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
Definition wordRe.H:81
static const wordRe null
An empty wordRe.
Definition wordRe.H:97
A List of wordRe with additional matching capabilities.
Definition wordRes.H:56
List< label > labelList
A List of labels.
Definition List.H:62
const direction noexcept
Definition scalarImpl.H:265