ENH: Refactored valueAverage FO and average runTimeCondition

This commit is contained in:
Andrew Heather
2022-02-02 13:35:29 +00:00
committed by Mark Olesen
parent bb04f5759d
commit 3d134167dd
10 changed files with 493 additions and 448 deletions

View File

@ -58,6 +58,7 @@ Foam::functionObjects::runTimeControls::runTimeControl::satisfiedActionNames
{ satisfiedAction::SET_TRIGGER, "setTrigger"},
};
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::functionObjects::runTimeControls::runTimeControl::runTimeControl
@ -100,6 +101,8 @@ bool Foam::functionObjects::runTimeControls::runTimeControl::read
if (fvMeshFunctionObject::read(dict))
{
Info<< type() << " " << name() << ":" << nl;
const dictionary& conditionsDict = dict.subDict("conditions");
const wordList conditionNames(conditionsDict.toc());
conditions_.setSize(conditionNames.size());
@ -129,9 +132,7 @@ bool Foam::functionObjects::runTimeControls::runTimeControl::read
// Check that some conditions are set
if (conditions_.empty())
{
Info<< type() << " " << name() << " output:" << nl
<< " No conditions present" << nl
<< endl;
Info<< " No conditions present" << endl;
}
else
{
@ -148,12 +149,12 @@ bool Foam::functionObjects::runTimeControls::runTimeControl::read
if (!check)
{
Info<< type() << " " << name() << " output:" << nl
<< " All conditions are inactive" << nl
<< endl;
Info<< " All conditions are inactive" << endl;
}
}
Info<< endl;
// Set the action to perform when all conditions are satisfied
// - set to end for backwards compatibility with v1806
satisfiedAction_ =