Commit 54042b08 authored by Andrew Heather's avatar Andrew Heather
Browse files

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...
parent 839f14af
......@@ -110,6 +110,7 @@ Foam::functionObjects::DESModelRegions::~DESModelRegions()
bool Foam::functionObjects::DESModelRegions::read(const dictionary& dict)
{
fvMeshFunctionObject::read(dict);
writeFile::read(dict);
dict.readIfPresent("resultName", resultName_);
......
......@@ -144,6 +144,7 @@ Foam::functionObjects::PecletNo::PecletNo
rhoName_("rho")
{
setResultName("Pe", "phi");
read(dict);
}
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -63,6 +63,12 @@ Foam::functionObjects::XiReactionRate::~XiReactionRate()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::functionObjects::XiReactionRate::read(const dictionary& dict)
{
return fvMeshFunctionObject::read(dict);
}
bool Foam::functionObjects::XiReactionRate::execute()
{
return true;
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -107,10 +107,13 @@ public:
// Member Functions
//- Read the reaction rate data
virtual bool read(const dictionary&);
//- Do nothing
virtual bool execute();
//- Write the cell-centre fields
//- Write the reaction rate fields
virtual bool write();
};
......
......@@ -63,9 +63,7 @@ Foam::functionObjects::components::components
)
:
fieldExpression(name, runTime, dict)
{
read(dict);
}
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
......
......@@ -196,6 +196,8 @@ Foam::functionObjects::ddt2::~ddt2()
bool Foam::functionObjects::ddt2::read(const dictionary& dict)
{
fvMeshFunctionObject::read(dict);
if (word(mesh_.ddtScheme("default")) == "steadyState")
{
WarningInFunction
......
......@@ -854,6 +854,8 @@ bool Foam::functionObjects::externalCoupled::end()
bool Foam::functionObjects::externalCoupled::read(const dictionary& dict)
{
functionObject::read(dict);
dict.readIfPresent("enabled", enabled_);
if (!enabled_)
......
......@@ -619,6 +619,7 @@ Foam::functionObjects::fluxSummary::~fluxSummary()
bool Foam::functionObjects::fluxSummary::read(const dictionary& dict)
{
fvMeshFunctionObject::read(dict);
writeFile::read(dict);
mode_ = modeTypeNames_.read(dict.lookup("mode"));
......
......@@ -61,9 +61,7 @@ Foam::functionObjects::grad::grad
)
:
fieldExpression(name, runTime, dict)
{
read(dict);
}
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
......
......@@ -92,6 +92,8 @@ Foam::functionObjects::histogram::~histogram()
bool Foam::functionObjects::histogram::read(const dictionary& dict)
{
fvMeshFunctionObject::read(dict);
dict.lookup("field") >> fieldName_;
dict.lookup("max") >> max_;
min_ = dict.lookupOrDefault<scalar>("min", 0);
......
......@@ -64,9 +64,7 @@ Foam::functionObjects::mag::mag
)
:
fieldExpression(name, runTime, dict)
{
read(dict);
}
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
......
......@@ -64,9 +64,7 @@ Foam::functionObjects::magSqr::magSqr
)
:
fieldExpression(name, runTime, dict)
{
read(dict);
}
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
......
......@@ -166,6 +166,8 @@ Foam::functionObjects::mapFields::~mapFields()
bool Foam::functionObjects::mapFields::read(const dictionary& dict)
{
fvMeshFunctionObject::read(dict);
dict.lookup("fields") >> fieldNames_;
createInterpolation(dict);
return true;
......
......@@ -230,6 +230,8 @@ Foam::functionObjects::pressure::~pressure()
bool Foam::functionObjects::pressure::read(const dictionary& dict)
{
fieldExpression::read(dict);
dict.readIfPresent("U", UName_);
dict.readIfPresent("rho", rhoName_);
......
......@@ -267,6 +267,7 @@ bool Foam::functionObjects::reactionsSensitivityAnalysis<chemistryType>::read
const dictionary& dict
)
{
fvMeshFunctionObject::read(dict);
writeFile::read(dict);
return true;
}
......
......@@ -353,6 +353,8 @@ Foam::functionObjects::regionSizeDistribution::~regionSizeDistribution()
bool Foam::functionObjects::regionSizeDistribution::read(const dictionary& dict)
{
fvMeshFunctionObject::read(dict);
dict.lookup("field") >> alphaName_;
dict.lookup("patches") >> patchNames_;
dict.lookup("threshold") >> threshold_;
......
......@@ -507,6 +507,8 @@ Foam::functionObjects::streamLineBase::~streamLineBase()
bool Foam::functionObjects::streamLineBase::read(const dictionary& dict)
{
fvMeshFunctionObject::read(dict);
Info<< type() << " " << name() << ":" << nl;
dict.lookup("fields") >> fields_;
......
......@@ -74,6 +74,8 @@ bool Foam::functionObjects::surfaceInterpolate::read
const dictionary& dict
)
{
fvMeshFunctionObject::read(dict);
dict.lookup("fields") >> fieldSet_;
return true;
......
......@@ -146,6 +146,8 @@ Foam::functionObjects::turbulenceFields::~turbulenceFields()
bool Foam::functionObjects::turbulenceFields::read(const dictionary& dict)
{
fvMeshFunctionObject::read(dict);
if (dict.found("field"))
{
fieldSet_.insert(word(dict.lookup("field")));
......
......@@ -106,6 +106,7 @@ Foam::functionObjects::valueAverage::~valueAverage()
bool Foam::functionObjects::valueAverage::read(const dictionary& dict)
{
regionFunctionObject::read(dict);
writeFile::read(dict);
dict.lookup("functionObjectName") >> functionObjectName_;
......
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