Merge branch 'feature-FO_execute_on_end' into 'develop'

ENH: functionObjects: call execute on last time step

- old convention was that on last time step it would only call end()
and not execute()
- however this meant that e.g. the functionObjectProperties file
did not get written
- and almost all functionObjects were doing an execute() inside of end()
- new convention: call execute() on last time step, just before doing end()

See merge request !24
This commit is contained in:
Andrew Heather
2015-12-07 15:26:51 +00:00
32 changed files with 46 additions and 140 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -891,7 +891,10 @@ bool Foam::Time::run() const
// ie, when exiting the control loop
if (!running && timeIndex_ != startTimeIndex_)
{
// Note, end() also calls an indirect start() as required
// Ensure functionObjects execute on last time step
// (and hence write uptodate functionObjectProperties)
functionObjects_.execute();
functionObjects_.end();
}
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -207,14 +207,6 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::end()
ptr_->end();
// Only write if
// - time within timeStart_ and timeEnd_
// - it is an output time
if (active() && outputControl_.output())
{
ptr_->write();
}
if (!storeFilter_)
{
destroyFilter();

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -135,12 +135,12 @@ void Foam::partialWrite::read(const dictionary& dict)
void Foam::partialWrite::execute()
{
// Do nothing - only valid on write
}
void Foam::partialWrite::end()
{
//Pout<< "end at time " << obr_.time().timeName() << endl;
// Do nothing - only valid on write
}

View File

@ -94,7 +94,7 @@ void Foam::removeRegisteredObject::execute()
void Foam::removeRegisteredObject::end()
{
execute();
// Do nothing - only valid on execute
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -195,7 +195,7 @@ void Foam::writeDictionary::execute()
void Foam::writeDictionary::end()
{
execute();
// do nothing
}

View File

@ -288,12 +288,7 @@ void Foam::fieldAverage::execute()
void Foam::fieldAverage::end()
{
if (active_)
{
execute();
}
}
{}
void Foam::fieldAverage::timeSet()

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -118,10 +118,7 @@ void Foam::fieldCoordinateSystemTransform::execute()
void Foam::fieldCoordinateSystemTransform::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -242,10 +242,7 @@ void Foam::fieldValues::fieldValueDelta::execute()
void Foam::fieldValues::fieldValueDelta::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -369,15 +369,7 @@ void Foam::nearWallFields::execute()
void Foam::nearWallFields::end()
{
if (debug)
{
Info<< "nearWallFields:end()" << endl;
}
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -127,10 +127,7 @@ void Foam::processorField::execute()
void Foam::processorField::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -112,10 +112,7 @@ void Foam::readFields::execute()
void Foam::readFields::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -116,10 +116,7 @@ void Foam::surfaceInterpolateFields::execute()
void Foam::surfaceInterpolateFields::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -180,10 +180,7 @@ void Foam::valueAverage::execute()
void Foam::valueAverage::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -424,10 +424,7 @@ void Foam::forceCoeffs::execute()
void Foam::forceCoeffs::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -1037,10 +1037,7 @@ void Foam::forces::execute()
void Foam::forces::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -157,10 +157,7 @@ void Foam::calcFvcDiv::execute()
void Foam::calcFvcDiv::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -119,10 +119,7 @@ void Foam::calcFvcGrad::execute()
void Foam::calcFvcGrad::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -122,10 +122,7 @@ void Foam::calcMag::execute()
void Foam::calcMag::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -236,10 +236,7 @@ void Foam::runTimeControl::execute()
void Foam::runTimeControl::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -167,10 +167,7 @@ void Foam::CourantNo::execute()
void Foam::CourantNo::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -184,10 +184,7 @@ void Foam::DESModelRegions::execute()
void Foam::DESModelRegions::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -156,10 +156,7 @@ void Foam::Lambda2::execute()
void Foam::Lambda2::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -210,10 +210,7 @@ void Foam::Peclet::execute()
void Foam::Peclet::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -149,10 +149,7 @@ void Foam::Q::execute()
void Foam::Q::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -146,12 +146,10 @@ void Foam::blendingFactor::execute()
void Foam::blendingFactor::end()
{
if (active_)
{
execute();
}
// Do nothing
}
void Foam::blendingFactor::timeSet()
{
// Do nothing

View File

@ -343,10 +343,7 @@ void Foam::pressureTools::execute()
void Foam::pressureTools::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -328,10 +328,7 @@ void Foam::scalarTransport::execute()
void Foam::scalarTransport::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -140,10 +140,7 @@ void Foam::timeActivatedFileUpdate::execute()
void Foam::timeActivatedFileUpdate::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -284,12 +284,7 @@ void Foam::turbulenceFields::execute()
void Foam::turbulenceFields::end()
{
if (active_)
{
execute();
}
}
{}
void Foam::turbulenceFields::timeSet()

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -144,10 +144,7 @@ void Foam::vorticity::execute()
void Foam::vorticity::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -274,10 +274,7 @@ void Foam::wallShearStress::execute()
void Foam::wallShearStress::end()
{
if (active_)
{
execute();
}
// Do nothing
}

View File

@ -209,10 +209,7 @@ void Foam::yPlus::execute()
void Foam::yPlus::end()
{
if (active_)
{
execute();
}
// Do nothing
}