Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
1910ebc0
Commit
1910ebc0
authored
Jan 24, 2019
by
Mark OLESEN
Browse files
STYLE: used guarded read in runTimeControl
parent
1c85c649
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.C
View file @
1910ebc0
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2017
-2019
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -64,7 +64,7 @@ void Foam::functionObjects::timeControl::readControls()
if
(
dict_
.
readIfPresent
(
"triggerStart"
,
triggerStart_
))
{
dict_
.
readIfPresent
(
"triggerEnd"
,
triggerEnd_
);
controlMode_
=
controlModeNames_
.
read
(
dict_
.
lookup
(
"controlMode"
)
);
controlMode_
=
controlModeNames_
.
get
(
"controlMode"
,
dict_
);
}
deltaTCoeff_
=
GREAT
;
...
...
src/functionObjects/utilities/runTimeControl/runTimeCondition/averageCondition/averageCondition.C
View file @
1910ebc0
...
...
@@ -70,9 +70,9 @@ Foam::functionObjects::runTimeControls::averageCondition::averageCondition
window_
(
dict
.
lookupOrDefault
<
scalar
>
(
"window"
,
-
1
)),
windowType_
(
window_
>
0
?
windowTypeNames
.
read
(
dict
.
lookup
(
"windowType"
)
)
:
windowType
::
NONE
window_
>
0
?
windowTypeNames
.
get
(
"windowType"
,
dict
)
:
windowType
::
NONE
),
totalTime_
(
fieldNames_
.
size
(),
scalar
(
0
)),
resetOnRestart_
(
dict
.
lookupOrDefault
<
bool
>
(
"resetOnRestart"
,
false
)),
...
...
src/functionObjects/utilities/runTimeControl/runTimeControl.C
View file @
1910ebc0
...
...
@@ -150,7 +150,7 @@ bool Foam::functionObjects::runTimeControls::runTimeControl::read
}
// Set the action to perform when all conditions are satisfied
// - set to end f
r
o backwards compatibility with v1806
// - set to end fo
r
backwards compatibility with v1806
satisfiedAction_
=
satisfiedActionNames
.
lookupOrDefault
(
...
...
@@ -161,7 +161,7 @@ bool Foam::functionObjects::runTimeControls::runTimeControl::read
if
(
satisfiedAction_
==
satisfiedAction
::
SET_TRIGGER
)
{
triggerIndex_
=
readLabel
(
dict
.
lookup
(
"trigger"
)
)
;
triggerIndex_
=
dict
.
get
<
label
>
(
"trigger"
);
}
return
true
;
...
...
src/functionObjects/utilities/setTimeStep/setTimeStepFunctionObject.C
View file @
1910ebc0
...
...
@@ -105,18 +105,12 @@ bool Foam::functionObjects::setTimeStepFunctionObject::read
timeStepPtr_
=
Function1
<
scalar
>::
New
(
"deltaT"
,
dict
);
// Check that adjustTimeStep is active
const
dictionary
&
controlDict
=
time_
.
controlDict
();
Switch
adjust
;
if
(
!
controlDict
.
readIfPresent
<
Switch
>
(
"adjustTimeStep"
,
adjust
)
||
!
adjust
)
// Ensure that adjustTimeStep is active
if
(
!
time_
.
controlDict
().
lookupOrDefault
<
bool
>
(
"adjustTimeStep"
,
false
))
{
FatalIOErrorInFunction
(
dict
)
<<
"Need to set 'adjustTimeStep' true to allow timestep control"
<<
nl
<<
exit
(
FatalIOError
);
}
...
...
src/functionObjects/utilities/setTimeStep/setTimeStepFunctionObject.H
View file @
1910ebc0
...
...
@@ -71,7 +71,6 @@ SourceFiles
#include
"functionObject.H"
#include
"Function1.H"
#include
"Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -136,15 +135,12 @@ public:
virtual
bool
adjustTimeStep
();
//- Read and set the function object if its data have changed
virtual
bool
read
(
const
dictionary
&
);
virtual
bool
read
(
const
dictionary
&
dict
);
//- Called at each ++ or += of the time-loop.
// postProcess overrides the usual executeControl behaviour and
// forces execution (used in post-processing mode)
//- Execute does nothing
virtual
bool
execute
();
//- Called at each ++ or += of the time-loop.
// postProcess overrides the usual writeControl behaviour and
// forces writing always (used in post-processing mode)
//- Write does nothing
virtual
bool
write
();
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment