https://mooseframework.inl.gov
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 
10 #include "DefaultConvergenceBase.h"
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 
25 void
27 {
30 }
31 
32 void
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 }
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
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job...
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...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
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.
DefaultConvergenceBase(const InputParameters &parameters)
Base class for convergence criteria.
Definition: Convergence.h:21
const bool _added_as_default
True if this object was added as a default instead of by the user.
static InputParameters validParams()
Definition: Convergence.C:16
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
static InputParameters validParams()