Skip to content

Commit

Permalink
Fixed a calcObjStd bug that forgot to reset std for every primal call
Browse files Browse the repository at this point in the history
  • Loading branch information
friedenhe authored Apr 10, 2024
1 parent d58cd15 commit b24b19b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/adjoint/DASolver/DASolver.C
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,19 @@ void DASolver::calcObjStd(Time& runTime)
is filled at least once, i.e., runTime.timeIndex() >= steps
*/

if (!primalObjStdActive_ || runTime.timeIndex() < 1)
if (!primalObjStdActive_)
{
return;
}
else if (runTime.timeIndex() < 1)
{
// if primalObjStd is active and timeIndex = 0, we need to reset primalObjStd_ to a large value
// NOTE: we need to reset primalObjStd_ for each primal call!
// Because timeIndex == 0, we don't need to compute the objStd, so we can return
// we will start computing the ojbStd for timeIndex>=1
primalObjStd_ = 999.0;
return;
}

label steps = daOptionPtr_->getSubDictOption<label>("primalObjStdTol", "steps");

Expand Down

0 comments on commit b24b19b

Please sign in to comment.