/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see .
\*---------------------------------------------------------------------------*/
#include "stateFunctionObject.H"
#include "Time.H"
const Foam::word Foam::functionObjects::stateFunctionObject::resultsName_ =
"results";
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
const Foam::IOdictionary&
Foam::functionObjects::stateFunctionObject::stateDict() const
{
return time_.functionObjects().stateDict();
}
Foam::IOdictionary& Foam::functionObjects::stateFunctionObject::stateDict()
{
return const_cast(time_.functionObjects().stateDict());
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::functionObjects::stateFunctionObject::stateFunctionObject
(
const word& name,
const Time& runTime
)
:
functionObject(name),
time_(runTime)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::stateFunctionObject::~stateFunctionObject()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::dictionary& Foam::functionObjects::stateFunctionObject::propertyDict()
{
IOdictionary& stateDict = this->stateDict();
if (!stateDict.found(name()))
{
stateDict.add(name(), dictionary());
}
return stateDict.subDict(name());
}
bool Foam::functionObjects::stateFunctionObject::setTrigger
(
const label triggeri
)
{
IOdictionary& stateDict = this->stateDict();
label oldTriggeri =
stateDict.lookupOrDefault