ENH: Function objects - first pass at updating read functionality

Note: should be using the result of the parent::read(dict) when
deciding whether to read local entries...
This commit is contained in:
Andrew Heather
2016-09-30 13:24:58 +01:00
parent 839f14afcd
commit 54042b08df
36 changed files with 88 additions and 23 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -114,6 +114,8 @@ Foam::functionObjects::abort::~abort()
bool Foam::functionObjects::abort::read(const dictionary& dict)
{
functionObject::read(dict);
if (dict.found("action"))
{
action_ = actionTypeNames_.read(dict.lookup("action"));

View File

@ -184,6 +184,8 @@ bool Foam::codedFunctionObject::end()
bool Foam::codedFunctionObject::read(const dictionary& dict)
{
functionObject::read(dict);
// Backward compatibility
if (dict.found("redirectType"))
{

View File

@ -72,6 +72,8 @@ Foam::functionObjects::removeRegisteredObject::~removeRegisteredObject()
bool Foam::functionObjects::removeRegisteredObject::read(const dictionary& dict)
{
regionFunctionObject::read(dict);
dict.lookup("objects") >> objectNames_;
return true;

View File

@ -77,6 +77,8 @@ bool Foam::functionObjects::runTimeControls::runTimeControl::read
const dictionary& dict
)
{
fvMeshFunctionObject::read(dict);
const dictionary& conditionsDict = dict.subDict("conditions");
const wordList conditionNames(conditionsDict.toc());
conditions_.setSize(conditionNames.size());

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -92,6 +92,8 @@ bool Foam::functionObjects::setTimeStepFunctionObject::read
const dictionary& dict
)
{
functionObject::read(dict);
timeStepPtr_ = Function1<scalar>::New("deltaT", dict);
// Check that adjustTimeStep is active

View File

@ -74,6 +74,8 @@ Foam::functionObjects::systemCall::~systemCall()
bool Foam::functionObjects::systemCall::read(const dictionary& dict)
{
functionObject::read(dict);
dict.readIfPresent("executeCalls", executeCalls_);
dict.readIfPresent("endCalls", endCalls_);
dict.readIfPresent("writeCalls", writeCalls_);

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -103,6 +103,8 @@ bool Foam::functionObjects::timeActivatedFileUpdate::read
const dictionary& dict
)
{
functionObject::read(dict);
dict.lookup("fileToUpdate") >> fileToUpdate_;
dict.lookup("timeVsFile") >> timeVsFile_;

View File

@ -122,6 +122,8 @@ Foam::functionObjects::writeDictionary::~writeDictionary()
bool Foam::functionObjects::writeDictionary::read(const dictionary& dict)
{
regionFunctionObject::read(dict);
wordList dictNames(dict.lookup("dictNames"));
HashSet<word> uniqueNames(dictNames);
dictNames_ = uniqueNames.toc();

View File

@ -98,6 +98,8 @@ Foam::functionObjects::writeObjects::~writeObjects()
bool Foam::functionObjects::writeObjects::read(const dictionary& dict)
{
functionObject::read(dict);
if (dict.found("field"))
{
objectNames_.setSize(1);