https://mooseframework.inl.gov
ReferenceResidualProblem.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 
12 
13 using namespace libMesh;
14 
16 
19 {
22 
23  params.addClassDescription("Problem that checks for convergence relative to "
24  "a user-supplied reference quantity rather than "
25  "the initial residual");
26 
27  return params;
28 }
29 
31  : FEProblem(params), ReferenceResidualInterface(this)
32 {
33 }
34 
35 void
37 {
38  const std::string class_name = "ReferenceResidualConvergence";
39  InputParameters params = _factory.getValidParams(class_name);
40  params.applyParameters(params_to_apply);
41  params.applyParameters(parameters());
42  params.set<bool>("added_as_default") = true;
43  for (const auto & conv_name : getNonlinearConvergenceNames())
44  addConvergence(class_name, conv_name, params);
45 }
const std::vector< ConvergenceName > & getNonlinearConvergenceNames() const
Gets the nonlinear system convergence object name(s).
static InputParameters validParams()
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:1047
Interface class shared between ReferenceResidualProblem and ReferenceResidualConvergence.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Definition: FEProblem.h:20
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void applyParameters(const InputParameters &common, const std::vector< std::string > &exclude={}, const bool allow_private=false)
Method for applying common parameters.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
virtual void addDefaultNonlinearConvergence(const InputParameters &params) override
Adds the default nonlinear Convergence associated with the problem.
static InputParameters validParams()
registerMooseObject("MooseApp", ReferenceResidualProblem)
static InputParameters validParams()
Definition: FEProblem.C:26
virtual void addConvergence(const std::string &type, const std::string &name, InputParameters &parameters)
Adds a Convergence object.
Problem that checks for convergence relative to a user-supplied reference quantity rather than the in...
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 InputParameters & parameters() const
Get the parameters of the object.
ReferenceResidualProblem(const InputParameters &params)