Skip to content

Commit

Permalink
show postprocessor history when the postprocessor is used for Picard …
Browse files Browse the repository at this point in the history
…convergence check idaholab#16940
  • Loading branch information
YaqiWang authored and loganharbour committed Feb 15, 2021
1 parent 63366b1 commit c652c3d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions framework/src/executioners/PicardSolve.C
Expand Up @@ -194,6 +194,7 @@ PicardSolve::solve()
}

Real pp_scaling = 1.0;
std::ostringstream pp_history;

for (_picard_it = 0; _picard_it < _picard_max_its; ++_picard_it)
{
Expand Down Expand Up @@ -248,6 +249,11 @@ PicardSolve::solve()
!getParam<bool>("direct_pp_value"))
pp_scaling = *_picard_custom_pp;
pp_new = *_picard_custom_pp;

auto ppname = getParam<PostprocessorName>("picard_custom_pp");
pp_history << std::setw(2) << _picard_it + 1 << " Picard " << ppname << " = "
<< Console::outputNorm(std::numeric_limits<Real>::max(), pp_new) << "\n";
_console << pp_history.str();
}

if (solve_converged)
Expand Down
1 change: 1 addition & 0 deletions test/tests/multiapps/picard/picard_custom_postprocessor.i
Expand Up @@ -76,6 +76,7 @@
picard_max_its = 30
disable_picard_residual_norm_check = true
picard_custom_pp = unorm_err
nl_abs_tol = 1e-14
[]

[Outputs]
Expand Down
10 changes: 10 additions & 0 deletions test/tests/multiapps/picard/tests
Expand Up @@ -117,4 +117,14 @@
issues = '#14642'
requirement = "The system shall allow convergence check with the convergence of a user defined postprocessor."
[../]
[./postprocessor_convergence_history]
type = 'RunApp'
input = 'picard_custom_postprocessor.i'
cli_args = 'Executioner/direct_pp_value=true Outputs/file_base=picard_custom_pp_history_out'
expect_out = '9 Picard unorm_err'
recover = false
design = 'multiapps/FullSolveMultiApp.md'
issues = '#16940'
requirement = "The system shall show the Picard convergence history of a user defined postprocessor that is used for convergence check."
[../]
[]

0 comments on commit c652c3d

Please sign in to comment.