Skip to content

Commit

Permalink
reworked ies term to be ignored if any reinflation is being used - it…
Browse files Browse the repository at this point in the history
…s too hard to decide what to do otherwise
  • Loading branch information
jtwhite79 committed Dec 12, 2024
1 parent 3d2b992 commit a42d9a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/libs/pestpp_common/EnsembleMethodUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4319,8 +4319,8 @@ bool EnsembleMethod::should_terminate(int current_n_iter_mean)
message(1, "nphinored (also used for consecutive bad lambda cycles): ", nphinored);
//int n_mean_iter = pest_scenario.get_pestpp_options().get_ies_n_iter_mean();
vector<double>::iterator begin_idx = best_mean_phis.begin();
if ((current_n_iter_mean > 0) && (best_mean_phis.size() > current_n_iter_mean))
begin_idx = best_mean_phis.end() - (current_n_iter_mean+1); //bc of prior phi and then adding the mean shift to the list
//if ((current_n_iter_mean > 0) && (best_mean_phis.size() > current_n_iter_mean))
// begin_idx = best_mean_phis.end() - (current_n_iter_mean+1); //bc of prior phi and then adding the mean shift to the list
if (best_mean_phis.size() > 0)
{

Expand All @@ -4341,7 +4341,8 @@ bool EnsembleMethod::should_terminate(int current_n_iter_mean)
for (auto& phi : best_mean_phis)
{
ratio = (phi - best_phi_yet) / phi;
if ((i>=(iter - current_n_iter_mean)) && (ratio <= phiredstp))
//if ((i>=(iter - current_n_iter_mean)) && (ratio <= phiredstp))
if (ratio <= phiredstp)
count++;
i++;
}
Expand Down
7 changes: 3 additions & 4 deletions src/libs/pestpp_common/EnsembleSmoother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,27 +78,26 @@ void IterEnsembleSmoother::iterate_2_solution()

//if ((n_iter_mean > 0) && (solution_iter % n_iter_mean == 0))
iters_since_reinflate++;
if ((current_n_iter_mean > 0) && (iters_since_reinflate >= current_n_iter_mean))
if ((current_n_iter_mean != 0) && (iters_since_reinflate >= current_n_iter_mean))
{
iter++;
reset_par_ensemble_to_prior_mean();
iters_since_reinflate = 0;
n_iter_mean_idx++;
if (n_iter_mean.size() > n_iter_mean_idx)
{

current_n_iter_mean = n_iter_mean[n_iter_mean_idx];
}
}

if (should_terminate(current_n_iter_mean))
{
//if (iter > pest_scenario.get_pestpp_options().get_ies_n_iter_mean()) {
if (iter > current_n_iter_mean) {
if (current_n_iter_mean == 0) {
break;
}
else{
message(1,"continuing iterations to satisfy ies_n_iter_mean");
message(1,"continuing iterations because reinflation is in use");
}
}

Expand Down

0 comments on commit a42d9a2

Please sign in to comment.