https://mooseframework.inl.gov
PostprocessorConvergence.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 
11 
13 
16 {
18 
19  params.addClassDescription("Compares the absolute value of a post-processor to a tolerance.");
20 
21  params.addRequiredParam<PostprocessorName>("postprocessor",
22  "Post-processor to use for convergence criteria");
23  params.addRequiredParam<Real>("tolerance", "Tolerance to use for convergence criteria");
24 
25  return params;
26 }
27 
29  : IterationCountConvergence(parameters),
30  _postprocessor(getPostprocessorValue("postprocessor")),
31  _tol(getParam<Real>("tolerance"))
32 {
33 }
34 
37 {
39  {
40  std::ostringstream oss;
41  oss << "Converged due to |post-processor| (" << std::abs(_postprocessor) << ") <= tolerance ("
42  << _tol << ").";
43  verboseOutput(oss);
45  }
46  else
48 }
PostprocessorConvergence(const InputParameters &parameters)
MetaPhysicL::DualNumber< V, D, asd > abs(const MetaPhysicL::DualNumber< V, D, asd > &a)
Definition: EigenADReal.h:42
void verboseOutput(std::ostringstream &oss)
Outputs the stream to the console if verbose output is enabled.
Definition: Convergence.C:51
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
static InputParameters validParams()
const Real _tol
Tolerance to which post-processor is compared.
MooseConvergenceStatus
Status returned by calls to checkConvergence.
Definition: Convergence.h:33
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
registerMooseObject("MooseApp", PostprocessorConvergence)
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
const PostprocessorValue & _postprocessor
Post-processor to use for convergence criteria.
Checks convergence based on the iteration count.
virtual MooseConvergenceStatus checkConvergenceInner(unsigned int iter) override
Inner check of convergence.
Compares a post-processor to a tolerance.