functionObject: Added executeAtStart
By default most functionObjects now execute and write at the start-time except those that perform averaging (fieldAverage, dsmcFields) which cannot be executed until the end of the first time-step. There is also a new optional functionObject dictionary entry "executeAtStart" which defaults to true but can be set false if the execution and results of the functionObject are not required or appropriate at the start-time. A result of this change is that time logs of forces, sampling etc. now include a values for time 0.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -44,7 +44,8 @@ bool Foam::functionObject::postProcess(false);
|
||||
Foam::functionObject::functionObject(const word& name)
|
||||
:
|
||||
name_(name),
|
||||
log(postProcess)
|
||||
log(false),
|
||||
executeAtStart_(true)
|
||||
{}
|
||||
|
||||
|
||||
@ -128,12 +129,19 @@ bool Foam::functionObject::read(const dictionary& dict)
|
||||
if (!postProcess)
|
||||
{
|
||||
log = dict.lookupOrDefault<Switch>("log", true);
|
||||
executeAtStart_ = dict.lookupOrDefault<Switch>("executeAtStart", true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObject::executeAtStart() const
|
||||
{
|
||||
return executeAtStart_;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObject::end()
|
||||
{
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user