Skip to content
Snippets Groups Projects
Commit 0cdd0347 authored by Andrew Heather's avatar Andrew Heather
Browse files

Revert "ENH: ensure written and evaluated values correspond (issue #311)"

This reverts commit cf9000df.

Functionality available in more general change in commit bf11ec43
parent bf11ec43
No related branches found
No related tags found
1 merge request!79Function objects - ensure objects are up-to-date when writing
...@@ -112,7 +112,6 @@ Foam::functionObjects::ddt2::ddt2 ...@@ -112,7 +112,6 @@ Foam::functionObjects::ddt2::ddt2
) )
: :
fvMeshFunctionObject(name, runTime, dict), fvMeshFunctionObject(name, runTime, dict),
prevTimeIndex_(-1),
selectFields_(), selectFields_(),
resultName_(word::null), resultName_(word::null),
blacklist_(), blacklist_(),
...@@ -218,20 +217,12 @@ bool Foam::functionObjects::ddt2::execute() ...@@ -218,20 +217,12 @@ bool Foam::functionObjects::ddt2::execute()
<< "Unprocessed field " << ignored << endl; << "Unprocessed field " << ignored << endl;
} }
// Update time index
prevTimeIndex_ = obr_.time().timeIndex();
return true; return true;
} }
bool Foam::functionObjects::ddt2::write() bool Foam::functionObjects::ddt2::write()
{ {
if (prevTimeIndex_ < obr_.time().timeIndex())
{
// Ensure written results reflect the current state
execute();
}
if (results_.size()) if (results_.size())
{ {
Log << type() << ' ' << name() << " write:" << endl; Log << type() << ' ' << name() << " write:" << endl;
......
...@@ -101,9 +101,6 @@ class ddt2 ...@@ -101,9 +101,6 @@ class ddt2
{ {
// Private data // Private data
//- Time at last execute, ensures write uses up-to-date values
label prevTimeIndex_;
//- Name of fields to process //- Name of fields to process
wordReList selectFields_; wordReList selectFields_;
......
...@@ -100,7 +100,6 @@ Foam::functionObjects::zeroGradient::zeroGradient ...@@ -100,7 +100,6 @@ Foam::functionObjects::zeroGradient::zeroGradient
) )
: :
fvMeshFunctionObject(name, runTime, dict), fvMeshFunctionObject(name, runTime, dict),
prevTimeIndex_(-1),
selectFields_(), selectFields_(),
resultName_(string::null), resultName_(string::null),
results_() results_()
...@@ -175,20 +174,12 @@ bool Foam::functionObjects::zeroGradient::execute() ...@@ -175,20 +174,12 @@ bool Foam::functionObjects::zeroGradient::execute()
<< "Unprocessed field " << ignored << endl; << "Unprocessed field " << ignored << endl;
} }
// Update time index
prevTimeIndex_ = obr_.time().timeIndex();
return true; return true;
} }
bool Foam::functionObjects::zeroGradient::write() bool Foam::functionObjects::zeroGradient::write()
{ {
if (prevTimeIndex_ < obr_.time().timeIndex())
{
// Ensure written results reflect the current state
execute();
}
if (results_.size()) if (results_.size())
{ {
Log << type() << ' ' << name() << " write:" << endl; Log << type() << ' ' << name() << " write:" << endl;
......
...@@ -95,9 +95,6 @@ class zeroGradient ...@@ -95,9 +95,6 @@ class zeroGradient
{ {
// Private data // Private data
//- Time at last execute, ensures write uses up-to-date values
label prevTimeIndex_;
//- Name of fields to process //- Name of fields to process
wordReList selectFields_; wordReList selectFields_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment