https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Convergence.C
Go to the documentation of this file.
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
17{
23
24 params.addParam<bool>(
25 "verbose",
26 false,
27 "Enable printing of additional information, including convergence and divergence reasons.");
28
29 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 params.suppressParameter<ExecFlagEnum>("execute_on");
34
35 return params;
36}
37
39 : MooseObject(parameters),
40 SetupInterface(this),
44 _perfid_check_convergence(registerTimedSection("checkConvergence", 5, "Checking Convergence")),
45 _tid(getParam<THREAD_ID>("_tid")),
46 _verbose(getParam<bool>("verbose") ? true : getMooseApp().getExecutioner()->verbose())
47{
48}
49
50void
51Convergence::verboseOutput(std::ostringstream & oss)
52{
53 const auto str = oss.str();
54
55 if (str.length() == 0)
56 return;
57
58 if (verbose())
59 _console << name() << ": " << str << std::endl;
60}
unsigned int THREAD_ID
Definition MooseTypes.h:237
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
Convergence(const InputParameters &parameters)
Definition Convergence.C:38
bool verbose() const
Returns whether verbose mode has been enabled.
Definition Convergence.h:71
static InputParameters validParams()
Definition Convergence.C:16
void verboseOutput(std::ostringstream &oss)
Outputs the stream to the console if verbose output is enabled.
Definition Convergence.C:51
A MultiMooseEnum object to hold "execute_on" flags.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void suppressParameter(const std::string &name)
This method suppresses an inherited parameter so that it isn't required or valid in the derived class...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
void registerBase(const std::string &value)
This method must be called from every base "Moose System" to create linkage with the Action System.
const std::string & name() const
Get the name of the class.
Definition MooseBase.h:103
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
static InputParameters validParams()
Definition MooseObject.C:25
Interface for objects interacting with the PerfGraph.
static InputParameters validParams()
Interface class for classes which interact with Postprocessors.
static InputParameters validParams()
static InputParameters validParams()
Interface for objects that needs transient capabilities.
static InputParameters validParams()