https://mooseframework.inl.gov
Loading...
Searching...
No Matches
DefaultConvergenceBase.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
14{
16 params.addPrivateParam<bool>("added_as_default", false);
17 return params;
18}
19
21 : Convergence(parameters), _added_as_default(getParam<bool>("added_as_default"))
22{
23}
24
25void
31
32void
34{
36 {
37 std::ostringstream oss;
38 oss << "The following parameters were set in both this Convergence object and the "
39 "executioner:\n";
40 for (const auto & param : _duplicate_shared_executioner_params)
41 oss << " " << param << "\n";
42 mooseError(oss.str());
43 }
44}
Base class for convergence criteria.
Definition Convergence.h:26
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job.
Definition Convergence.h:45
static InputParameters validParams()
Definition Convergence.C:16
void checkDuplicateSetSharedExecutionerParams() const
Throws an error if any of the parameters shared with the executioner have been set by the user in bot...
std::vector< std::string > _duplicate_shared_executioner_params
List of shared executioner parameters that have been set by the user in both places.
const bool _added_as_default
True if this object was added as a default instead of by the user.
DefaultConvergenceBase(const InputParameters &parameters)
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job.
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addPrivateParam(const std::string &name, const T &value)
These method add a parameter to the InputParameters object which can be retrieved like any other para...
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition MooseBase.h:271