runTimeCondition.C
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) 2015 OpenFOAM Foundation
9 Copyright (C) 2016-2020 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#include "runTimeCondition.H"
30
31// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32
33namespace Foam
34{
35namespace functionObjects
36{
37namespace runTimeControls
38{
41}
42}
43}
44
45// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
46
49{
50 dictionary& propertyDict = state_.propertyDict();
51
52 if (!propertyDict.found(name_))
53 {
54 propertyDict.add(name_, dictionary());
55 }
56
57 return propertyDict.subDict(name_);
58}
59
60
63{
64 return conditionDict_;
65}
66
67
70{
71 return conditionDict_;
72}
73
74
75// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
76
78(
79 const word& name,
80 const objectRegistry& obr,
81 const dictionary& dict,
83)
84:
85 name_(name),
86 obr_(obr),
87 state_(state),
88 active_(dict.getOrDefault("active", true)),
89 conditionDict_(setConditionDict()),
90 groupID_(dict.getOrDefault("groupID", -1)),
91 log(dict.getOrDefault("log", true))
92{}
93
94
95// * * * * * * * * * * * * * * Public Member Functions * * * * * * * * * * * //
96
97const Foam::word&
99{
100 return name_;
101}
102
103
105{
106 return active_;
107}
108
109
110Foam::label
112{
113 return groupID_;
114}
115
116
117// ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Definition: dictionary.C:460
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
Definition: dictionaryI.H:87
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
Definition: dictionary.C:640
Computes the natural logarithm of an input volScalarField.
Definition: log.H:230
dictionary & setConditionDict()
Set the condition dictionary (create if necessary)
virtual label groupID() const
Return the group index.
const dictionary & conditionDict() const
Return const access to the conditions dictionary.
virtual bool active() const
Return the active flag.
virtual const word & name() const
Return the condition name.
Base class for function objects, adding functionality to read/write state information (data required ...
dictionary & propertyDict()
Return access to the property dictionary.
Registry of regIOobjects.
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
dictionary dict