diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C index baafa87b74..879d6bbd79 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C @@ -458,6 +458,15 @@ Foam::autoPtr Foam::functionObjectList::New // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +Foam::label Foam::functionObjectList::triggerIndex() const +{ + label triggeri = labelMin; + stateDict().readIfPresent("triggerIndex", triggeri); + + return triggeri; +} + + void Foam::functionObjectList::resetState() { // Reset (re-read) the state dictionary diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H index 6be997b516..5cb135612f 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H @@ -174,6 +174,9 @@ public: //- Access to the functionObjects using PtrList::operator[]; + //- Return the current trigger index (read from the stateDict) + label triggerIndex() const; + //- Reset/read state dictionary for current time void resetState(); diff --git a/src/OpenFOAM/db/functionObjects/stateFunctionObject/stateFunctionObject.C b/src/OpenFOAM/db/functionObjects/stateFunctionObject/stateFunctionObject.C index 1bfe099f0a..04768c89eb 100644 --- a/src/OpenFOAM/db/functionObjects/stateFunctionObject/stateFunctionObject.C +++ b/src/OpenFOAM/db/functionObjects/stateFunctionObject/stateFunctionObject.C @@ -78,6 +78,34 @@ Foam::dictionary& Foam::functionObjects::stateFunctionObject::propertyDict() } +bool Foam::functionObjects::stateFunctionObject::setTrigger +( + const label triggeri +) +{ + IOdictionary& stateDict = this->stateDict(); + + label oldTriggeri = + stateDict.lookupOrDefault