LCOV - code coverage report
Current view: top level - src/convergence - Convergence.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #31405 (292dce) with base fef103 Lines: 23 24 95.8 %
Date: 2025-09-04 07:52:05 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : #include "Convergence.h"
      11             : #include "MooseApp.h"
      12             : #include "Executioner.h"
      13             : #include "MooseUtils.h"
      14             : 
      15             : InputParameters
      16      443767 : Convergence::validParams()
      17             : {
      18      443767 :   InputParameters params = MooseObject::validParams();
      19      443767 :   params += SetupInterface::validParams();
      20      443767 :   params += PostprocessorInterface::validParams();
      21      443767 :   params += PerfGraphInterface::validParams();
      22      443767 :   params += TransientInterface::validParams();
      23             : 
      24     1331301 :   params.addParam<bool>(
      25             :       "verbose",
      26      887534 :       false,
      27             :       "Enable printing of additional information, including convergence and divergence reasons.");
      28             : 
      29      887534 :   params.registerBase("Convergence");
      30             : 
      31             :   // This parameter is present because of SetupInterface, which is a requirement
      32             :   // of MooseObjectWarehouse, but it should not be used.
      33      443767 :   params.suppressParameter<ExecFlagEnum>("execute_on");
      34             : 
      35      443767 :   return params;
      36           0 : }
      37             : 
      38      171930 : Convergence::Convergence(const InputParameters & parameters)
      39             :   : MooseObject(parameters),
      40             :     SetupInterface(this),
      41             :     PostprocessorInterface(this),
      42             :     PerfGraphInterface(this),
      43             :     TransientInterface(this),
      44      515790 :     _perfid_check_convergence(registerTimedSection("checkConvergence", 5, "Checking Convergence")),
      45      343860 :     _tid(getParam<THREAD_ID>("_tid")),
      46      515790 :     _verbose(getParam<bool>("verbose") ? true : getMooseApp().getExecutioner()->verbose())
      47             : {
      48      171930 : }
      49             : 
      50             : void
      51      820156 : Convergence::verboseOutput(std::ostringstream & oss)
      52             : {
      53      820156 :   const auto str = oss.str();
      54             : 
      55      820156 :   if (str.length() == 0)
      56      508368 :     return;
      57             : 
      58      311788 :   if (verbose())
      59       18159 :     _console << name() << ": " << MooseUtils::trim(str) << std::endl;
      60      820156 : }

Generated by: LCOV version 1.14