https://mooseframework.inl.gov
Loading...
Searching...
No Matches
DefaultConvergenceBase.h
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#pragma once
11
12#include "Convergence.h"
13#include "Executioner.h"
14
19{
20public:
22
24
25 virtual void initialSetup() override;
26
27protected:
36 template <typename T>
37 const T & getSharedExecutionerParam(const std::string & name);
38
49
50private:
53
55 std::vector<std::string> _duplicate_shared_executioner_params;
56};
57
58template <typename T>
59const T &
61{
62 const auto * executioner = getMooseApp().getExecutioner();
63 if (executioner->isParamSetByUser(param))
64 {
65 if (isParamSetByUser(param))
67 return executioner->getParam<T>(param);
68 }
69 else
70 return getParam<T>(param);
71}
Base class for convergence criteria.
Definition Convergence.h:26
Base class for default convergence criteria.
const T & getSharedExecutionerParam(const std::string &name)
This method is to be used for parameters that are shared with the executioner.
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.
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.
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
Definition MooseApp.C:2015
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
const std::string & name() const
Get the name of the class.
Definition MooseBase.h:103
bool isParamSetByUser(const std::string &name) const
Test if the supplied parameter is set by a user, as opposed to not set or set to default.
Definition MooseBase.h:205
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition MooseBase.h:406
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
Definition MooseBase.h:87