- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.2k
 
Added diverging iterations feature to PostprocessorConvergence #31706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
      
          
      
      
            joshuahansel
  
      
      
      commented
        Oct 10, 2025 
      
    
  
- Added some colors to verbose Convergence messages
 - Added a link from test harness page to capabilities page
 - Added diverging iterations feature to PostprocessorConvergence (see Add diverging iterations parameters to PostprocessorConvergence #31703)
 
| 
           Job Documentation, step Docs: sync website on f8ed4a2 wanted to post the following: View the site here This comment will be updated on new commits.  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
early review as I m looking for PRs we could process soon
| The parameter [!param](/Convergence/PostprocessorConvergence/max_diverging_iterations) may be used to diverge after the specified number of consecutive iterations for which the post-processor/error value is "diverging". By default, "diverging" means the error value is getting larger, but the parameter [!param](/Convergence/PostprocessorConvergence/diverging_iteration_rel_reduction) can be used to specify some minimum reduction value $\tau_\text{reduction,min}$ such that the "diverging" condition is the following: | ||
| 
               | 
          ||
| !equation | ||
| \frac{|y_{\ell-1}| - |y_\ell|}{|y_{\ell-1}|} < \tau_\text{reduction,min} | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe > ?
seems like reduction is good for convergence
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was intentional, but on second look, I need to think more about it. Basically I'm trying to capture when convergence is stagnating (converging too slowly), but the same might be used for a convergence criteria... I guess this divergence criteria only makes sense if you are NOT using any sort of step convergence criteria, only an absolute criteria (like a residual).
Do you think it would be better if this feature were its own Convergence object (maybe it's more clear that way? SlowProgressDivergence).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically I'm trying to capture when convergence is stagnating (converging too slowly)
the text is not clear then. You say . By default, "diverging" means the error value is getting larger,  and then talk about it getting reduced by a factor and I did not catch it on first read
Maybe make bullet points
Do you think it would be better if this feature were its own Convergence object (maybe it's more clear that way? SlowProgressDivergence).
SlowProgress could be anything though. it d need to be a 'PostprocessorConvergence' still in the name.
At the end of the day you are hard coding that you want at least linear convergence. If you were to generalize to make a more self-standing object you'd want to make it about the order of convergence
| { | ||
| oss << "Converged due to iterations (" << iter << ") >= max iterations (" | ||
| << _max_iterations << ") and 'converge_at_max_iterations' = 'true'."; | ||
| oss << COLOR_GREEN << "Converged due to iterations (" << iter << ") >= max iterations (" | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was some argument about setting colors directly in ActionWarehouse.C line 268
  /**
   * Note: This routine uses the XTerm colors directly which is not advised for general purpose
   * output coloring.
   * Most users should prefer using Problem::colorText() which respects the "color_output" option
   * for terminals
   * that do not support coloring.  Since this routine is intended for debugging only and runs
   * before several
   * objects exist i
@permcody you wrote that do we still care?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only see "colorText" for python, not C.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might have been an old routine
| params.addRequiredParam<Real>("tolerance", "Absolute tolerance to use for convergence criteria"); | ||
| params.addParam<unsigned int>("max_diverging_iterations", | ||
| std::numeric_limits<unsigned int>::max(), | ||
| "Number of consecutive iterations of the error getting worse at " | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"error" is not really well defined here. We refer to the PP and a tolerance but not necessarily an error
| } | ||
| else | ||
| { | ||
| std::ostringstream oss; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you want to reset _diverging_iterations = 0 in that case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I'll put it in the "else" condition for if (rel_reduction < _div_rel_reduction)
98d4245    to
    f8ed4a2      
    Compare
  
    | 
           Job Test, step Results summary on f8ed4a2 wanted to post the following: Framework test summaryCompared against bb0a08b in job civet.inl.gov/job/3353620. Removed testsAdded tests
 Run time changesModules test summaryCompared against bb0a08b in job civet.inl.gov/job/3353620. Removed testsAdded testsRun time changes | 
    
| 
           Job Coverage, step Generate coverage on f8ed4a2 wanted to post the following: Framework coverage
 Modules coverageCoverage did not change Full coverage reportsReports
 This comment will be updated on new commits.  | 
    ||||||||||||||||||||||||||