mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: enable the execution of functions objects in optimisation mode
This commit is contained in:
committed by
Andrew Heather
parent
2ad6c9f5d2
commit
8947735b1d
@ -612,7 +612,7 @@ bool Foam::functionObjectList::start()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::functionObjectList::execute()
|
bool Foam::functionObjectList::execute(bool writeProperties)
|
||||||
{
|
{
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
|
|
||||||
@ -774,7 +774,7 @@ bool Foam::functionObjectList::execute()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Force writing of properties dictionary after function object execution
|
// Force writing of properties dictionary after function object execution
|
||||||
if (time_.writeTime())
|
if (time_.writeTime() && writeProperties)
|
||||||
{
|
{
|
||||||
const auto oldPrecision = IOstream::precision_;
|
const auto oldPrecision = IOstream::precision_;
|
||||||
IOstream::precision_ = 16;
|
IOstream::precision_ = 16;
|
||||||
|
|||||||
@ -335,7 +335,7 @@ public:
|
|||||||
//- Called at each ++ or += of the time-loop.
|
//- Called at each ++ or += of the time-loop.
|
||||||
// postProcess overrides the usual executeControl behaviour and
|
// postProcess overrides the usual executeControl behaviour and
|
||||||
// forces execution (used in post-processing mode)
|
// forces execution (used in post-processing mode)
|
||||||
bool execute();
|
bool execute(bool writeProperties = true);
|
||||||
|
|
||||||
//- Execute function objects using the specified subIndex.
|
//- Execute function objects using the specified subIndex.
|
||||||
// \param subIndex an execution sub-index corresponding to a
|
// \param subIndex an execution sub-index corresponding to a
|
||||||
|
|||||||
@ -244,6 +244,13 @@ void Foam::simple::mainIter()
|
|||||||
|
|
||||||
void Foam::simple::postIter()
|
void Foam::simple::postIter()
|
||||||
{
|
{
|
||||||
|
// Execute function objects in optimisation cases
|
||||||
|
// Disabled in Time since we are subsycling
|
||||||
|
if (managerType_ == "steadyOptimisation")
|
||||||
|
{
|
||||||
|
const_cast<Time&>(mesh_.time()).functionObjects().execute(false);
|
||||||
|
}
|
||||||
|
|
||||||
solverControl_().write();
|
solverControl_().write();
|
||||||
|
|
||||||
// Print objective values to screen and compute mean value
|
// Print objective values to screen and compute mean value
|
||||||
|
|||||||
Reference in New Issue
Block a user