Commit 549b6cbe authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: readFields function object - added flag to read fields on construction

parent 9710719f
......@@ -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) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -50,9 +50,15 @@ Foam::functionObjects::readFields::readFields
)
:
fvMeshFunctionObject(name, runTime, dict),
fieldSet_()
fieldSet_(),
readOnStart_(true)
{
read(dict);
if (readOnStart_)
{
execute();
}
}
......@@ -69,6 +75,7 @@ bool Foam::functionObjects::readFields::read(const dictionary& dict)
fvMeshFunctionObject::read(dict);
dict.lookup("fields") >> fieldSet_;
dict.readIfPresent("readOnStart", readOnStart_);
return true;
}
......
......@@ -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-2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -48,6 +48,7 @@ Usage
Property | Description | Required | Default value
type | type name: readFields | yes |
fields | list of fields to read | no |
readOnStart | flag to start reading on start-up | no | yes
log | Log to standard output | no | yes
\endtable
......@@ -88,6 +89,9 @@ protected:
//- Fields to load
wordList fieldSet_;
//- Flag to read on construction
bool readOnStart_;
// Protected Member Functions
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment