ENH: enable the execution of functions objects in optimisation mode
This commit is contained in:
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;
|
||||
|
||||
@ -774,7 +774,7 @@ bool Foam::functionObjectList::execute()
|
||||
}
|
||||
|
||||
// Force writing of properties dictionary after function object execution
|
||||
if (time_.writeTime())
|
||||
if (time_.writeTime() && writeProperties)
|
||||
{
|
||||
const auto oldPrecision = IOstream::precision_;
|
||||
IOstream::precision_ = 16;
|
||||
|
@ -335,7 +335,7 @@ public:
|
||||
//- Called at each ++ or += of the time-loop.
|
||||
// postProcess overrides the usual executeControl behaviour and
|
||||
// forces execution (used in post-processing mode)
|
||||
bool execute();
|
||||
bool execute(bool writeProperties = true);
|
||||
|
||||
//- Execute function objects using the specified subIndex.
|
||||
// \param subIndex an execution sub-index corresponding to a
|
||||
|
@ -244,6 +244,13 @@ void Foam::simple::mainIter()
|
||||
|
||||
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();
|
||||
|
||||
// Print objective values to screen and compute mean value
|
||||
|
Loading…
Reference in New Issue
Block a user