www.mooseframework.org
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
InputParameters Class Reference

The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system. More...

#include <InputParameters.h>

Inheritance diagram for InputParameters:
[legend]

Public Member Functions

 InputParameters (const InputParameters &rhs)
 
 InputParameters (const Parameters &rhs)
 
virtual ~InputParameters ()=default
 
virtual void clear () override
 
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. More...
 
std::string getClassDescription () const
 Returns the class description. More...
 
virtual void set_attributes (const std::string &name, bool inserted_only) override
 Override from libMesh to set user-defined attributes on our parameter. More...
 
template<typename T >
T & set (const std::string &name, bool quiet_mode=false)
 Returns a writable reference to the named parameters. More...
 
template<typename T , typename UP_T >
void rangeCheck (const std::string &full_name, const std::string &short_name, InputParameters::Parameter< T > *param, std::ostream &oss=Moose::out)
 Runs a range on the supplied parameter if it exists and throws an error if that check fails. More...
 
template<typename T , typename UP_T >
void rangeCheck (const std::string &full_name, const std::string &short_name, InputParameters::Parameter< std::vector< T >> *param, std::ostream &oss=Moose::out)
 
template<typename T >
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 Verifies that the requested parameter exists and is not NULL and returns it to the caller. More...
 
template<typename T >
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 extracted from the input file. More...
 
template<typename T >
void addRequiredParam (const std::string &name, const T &moose_enum, const std::string &doc_string)
 This version of addRequiredParam is here for a consistent use with MooseEnums. More...
 
template<typename T , typename S >
void addParam (const std::string &name, const S &value, const std::string &doc_string)
 These methods add an option parameter and a documentation string to the InputParameters object. More...
 
template<typename T >
void addParam (const std::string &name, const std::string &doc_string)
 
template<typename T >
void addRequiredRangeCheckedParam (const std::string &name, const std::string &parsed_function, const std::string &doc_string)
 These methods add an range checked parameters. More...
 
template<typename T >
void addRangeCheckedParam (const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
 
template<typename T >
void addRangeCheckedParam (const std::string &name, const std::string &parsed_function, const std::string &doc_string)
 
template<typename T >
void addRequiredCustomTypeParam (const std::string &name, const std::string &custom_type, const std::string &doc_string)
 These methods add an option parameter and with a customer type to the InputParameters object. More...
 
template<typename T >
void addCustomTypeParam (const std::string &name, const T &value, const std::string &custom_type, const std::string &doc_string)
 
template<typename T >
void addCustomTypeParam (const std::string &name, const std::string &custom_type, const std::string &doc_string)
 
template<typename T >
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 parameter. More...
 
template<typename T >
void addPrivateParam (const std::string &name)
 
template<typename T >
void addRequiredCommandLineParam (const std::string &name, const std::string &syntax, const std::string &doc_string)
 Add parameters for retrieval from the command line. More...
 
template<typename T >
void addCommandLineParam (const std::string &name, const std::string &syntax, const std::string &doc_string)
 
template<typename T >
void addCommandLineParam (const std::string &name, const std::string &syntax, const T &value, const std::string &doc_string)
 
template<typename T >
void addRequiredDeprecatedParam (const std::string &name, const std::string &doc_string, const std::string &deprecation_message)
 Add and mark a parameter for deprecation. More...
 
template<typename T >
void addDeprecatedParam (const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
 
template<typename T >
void addDeprecatedParam (const std::string &name, const std::string &doc_string, const std::string &deprecation_message)
 
template<typename T >
void checkConsistentType (const std::string &name) const
 This method checks to make sure that we aren't adding a parameter with the same name but a different type. More...
 
std::vector< std::string > getSyntax (const std::string &name)
 Get the syntax for a command-line parameter. More...
 
const std::string & getDescription (const std::string &name)
 Get the documentation string for a parameter. More...
 
void addParamNamesToGroup (const std::string &space_delim_names, const std::string group_name)
 This method takes a space delimited list of parameter names and adds them to the specified group name. More...
 
std::string getGroupName (const std::string &param_name) const
 This method retrieves the group name for the passed parameter name if one exists. More...
 
template<typename T >
void suppressParameter (const std::string &name)
 This method suppresses an inherited parameter so that it isn't required or valid in the derived class. More...
 
template<typename T >
void makeParamRequired (const std::string &name)
 Changes the parameter to be required. More...
 
void addCoupledVar (const std::string &name, const std::string &doc_string)
 This method adds a coupled variable name pair. More...
 
void addCoupledVar (const std::string &name, const Real value, const std::string &doc_string)
 This method adds a coupled variable name pair. More...
 
std::string getMooseType (const std::string &name) const
 Utility functions for retrieving one of the MooseTypes variables into the common "string" base class. More...
 
std::vector< std::string > getVecMooseType (const std::string &name) const
 
void addRequiredCoupledVar (const std::string &name, const std::string &doc_string)
 This method adds a coupled variable name pair. More...
 
std::string getDocString (const std::string &name) const
 Returns the documentation string for the specified parameter name. More...
 
void setDocString (const std::string &name, const std::string &doc)
 Set the doc string of a parameter. More...
 
bool isParamRequired (const std::string &name) const
 Returns a boolean indicating whether the specified parameter is required or not. More...
 
bool isParamValid (const std::string &name) const
 This method returns parameters that have been initialized in one fashion or another, i.e. More...
 
bool isParamSetByAddParam (const std::string &name) const
 Returns whether or not the parameter was set due to addParam. More...
 
bool areAllRequiredParamsValid () const
 This method returns true if all of the parameters in this object are valid (i.e. More...
 
std::string type (const std::string &name)
 Prints the type of the requested parameter by name. More...
 
bool isPrivate (const std::string &name) const
 Returns a Boolean indicating whether the specified parameter is private or not. More...
 
void declareControllable (const std::string &name)
 Declare the given parameters as controllable. More...
 
void markControlled (const std::string &name)
 Marker a parameter that has been changed by the Control system (this is for output purposes) More...
 
bool isControllable (const std::string &name)
 Returns a Boolean indicating whether the specified parameter is controllable. More...
 
void registerBase (const std::string &value)
 This method must be called from every base "Moose System" to create linkage with the Action System. More...
 
void registerBuildableTypes (const std::string &names)
 This method is here to indicate which Moose types a particular Action may build. More...
 
const std::vector< std::string > & getBuildableTypes () const
 Returns the list of buildable types as a std::vector<std::string> More...
 
void collapseSyntaxNesting (bool collapse)
 Mutators for controlling whether or not the outermost level of syntax will be collapsed when printed. More...
 
bool collapseSyntaxNesting () const
 
void mooseObjectSyntaxVisibility (bool visibility)
 Mutators for controlling whether or not the outermost level of syntax will be collapsed when printed. More...
 
bool mooseObjectSyntaxVisibility () const
 
InputParametersoperator= (const InputParameters &rhs)
 
InputParametersoperator+= (const InputParameters &rhs)
 
void checkParams (const std::string &parsing_syntax)
 This function checks parameters stored in the object to make sure they are in the correct state as the user expects: Required parameters are verified as valid meaning that they were either initialized when they were created, or were read from an input file or some other valid source. More...
 
std::set< std::string >::const_iterator coupledVarsBegin () const
 Methods returning iterators to the coupled variables names stored in this InputParameters object. More...
 
std::set< std::string >::const_iterator coupledVarsEnd () const
 
const std::set< std::string > & getCoupledVariableParamNames () const
 Return the coupled variable parameter names. More...
 
bool hasCoupledValue (const std::string &coupling_name) const
 Return whether or not the coupled variable exists. More...
 
bool hasDefaultCoupledValue (const std::string &coupling_name) const
 Return whether or not the requested parameter has a default coupled value. More...
 
Real defaultCoupledValue (const std::string &coupling_name) const
 Get the default value for an optionally coupled variable. More...
 
void defaultCoupledValue (const std::string &coupling_name, Real value)
 Set the default value for an optionally coupled variable (called by the Parser). More...
 
const std::map< std::string, std::pair< std::string, std::string > > & getAutoBuildVectors () const
 Returns the auto build vectors for all parameters. More...
 
const PostprocessorValuegetDefaultPostprocessorValue (const std::string &name, bool suppress_error=false) const
 Get the default value for a postprocessor added with addPostprocessor. More...
 
void setDefaultPostprocessorValue (const std::string &name, const PostprocessorValue &value)
 Set the default value for a postprocessor added with addPostprocessor. More...
 
bool hasDefaultPostprocessorValue (const std::string &name) const
 Returns true if a default PostprocessorValue is defined. More...
 
void applyParameters (const InputParameters &common, std::vector< std::string > exclude=std::vector< std::string >())
 Method for applying common parameters. More...
 
void applySpecificParameters (const InputParameters &common, const std::vector< std::string > &include)
 Method for applying common parameters. More...
 
void applyParameter (const InputParameters &common, const std::string &common_name)
 Apply values from a single parameter in common, to a single parameter stored in this object. More...
 
void applyCoupledVar (const InputParameters &common, const std::string &var_name)
 Apply properties of a single coupled variable in common, to a single coupled variable stored in this object. More...
 
bool paramSetByUser (const std::string &name) const
 Deprecated method. More...
 
bool isParamSetByUser (const std::string &name) const
 Method returns true if the parameter was by the user. More...
 
const std::set< std::string > & getControllableParameters () const
 Return list of controllable parameters. More...
 
void setReservedValues (const std::string &name, const std::set< std::string > &reserved)
 Provide a set of reserved values for a parameter. More...
 
std::set< std::string > reservedValues (const std::string &name) const
 Get a set of reserved parameter values. More...
 
template<>
void addRequiredParam (const std::string &name, const MooseEnum &moose_enum, const std::string &doc_string)
 
template<>
void addRequiredParam (const std::string &name, const MultiMooseEnum &moose_enum, const std::string &doc_string)
 
template<>
void addParam (const std::string &, const std::string &)
 
template<>
void addParam (const std::string &, const std::string &)
 
template<>
void addDeprecatedParam (const std::string &name, const std::string &doc_string, const std::string &deprecation_message)
 
template<>
void addDeprecatedParam (const std::string &name, const std::string &doc_string, const std::string &deprecation_message)
 
template<>
const MooseEnumgetParamHelper (const std::string &name, const InputParameters &pars, const MooseEnum *)
 
template<>
const MultiMooseEnumgetParamHelper (const std::string &name, const InputParameters &pars, const MultiMooseEnum *)
 
template<>
void addRequiredParam (const std::string &name, const MooseEnum &moose_enum, const std::string &doc_string)
 
template<>
void addRequiredParam (const std::string &name, const MultiMooseEnum &moose_enum, const std::string &doc_string)
 
template<>
void addParam (const std::string &, const std::string &)
 
template<>
void addParam (const std::string &, const std::string &)
 
template<>
void addDeprecatedParam (const std::string &, const std::string &, const std::string &)
 
template<>
void addDeprecatedParam (const std::string &, const std::string &, const std::string &)
 
template<>
const MooseEnumgetParamHelper (const std::string &name, const InputParameters &pars, const MooseEnum *)
 
template<>
const MultiMooseEnumgetParamHelper (const std::string &name, const InputParameters &pars, const MultiMooseEnum *)
 
void addCoupledVarWithAutoBuild (const std::string &name, const std::string &base_name, const std::string &num_name, const std::string &doc_string)
 These methods add a coupled variable name pair. More...
 
void addRequiredCoupledVarWithAutoBuild (const std::string &name, const std::string &base_name, const std::string &num_name, const std::string &doc_string)
 

Static Public Member Functions

template<typename T >
static const T & getParamHelper (const std::string &name, const InputParameters &pars, const T *the_type)
 
template<typename T >
static const std::vector< T > & getParamHelper (const std::string &name, const InputParameters &pars, const std::vector< T > *the_type)
 

Private Member Functions

 InputParameters ()
 
void allowCopy (bool status)
 Toggle the availability of the copy constructor. More...
 
void checkParamName (const std::string &name) const
 Make sure the parameter name doesn't have any invalid characters. More...
 
template<typename T , typename S >
void setParamHelper (const std::string &name, T &l_value, const S &r_value)
 This method is called when adding a Parameter with a default value, can be specialized for non-matching types. More...
 
template<>
void setParamHelper (const std::string &name, PostprocessorName &l_value, const Real &r_value)
 
template<>
void setParamHelper (const std::string &name, PostprocessorName &l_value, const int &r_value)
 
template<>
void setParamHelper (const std::string &, FunctionName &l_value, const Real &r_value)
 
template<>
void setParamHelper (const std::string &, FunctionName &l_value, const int &r_value)
 
template<>
void setParamHelper (const std::string &, MaterialPropertyName &l_value, const Real &r_value)
 
template<>
void setParamHelper (const std::string &, MaterialPropertyName &l_value, const int &r_value)
 
template<>
void setParamHelper (const std::string &name, PostprocessorName &l_value, const Real &r_value)
 
template<>
void setParamHelper (const std::string &name, PostprocessorName &l_value, const int &r_value)
 
template<>
void setParamHelper (const std::string &, FunctionName &l_value, const Real &r_value)
 
template<>
void setParamHelper (const std::string &, FunctionName &l_value, const int &r_value)
 
template<>
void setParamHelper (const std::string &, MaterialPropertyName &l_value, const Real &r_value)
 
template<>
void setParamHelper (const std::string &, MaterialPropertyName &l_value, const int &r_value)
 

Private Attributes

std::map< std::string, std::string > _doc_string
 The documentation strings for each parameter. More...
 
std::map< std::string, std::string > _custom_type
 The custom type that will be printed in the YAML dump for a parameter if supplied. More...
 
std::map< std::string, std::vector< std::string > > _syntax
 Syntax for command-line parameters. More...
 
std::map< std::string, std::string > _group
 The names of the parameters organized into groups. More...
 
std::map< std::string, std::string > _range_functions
 The map of functions used for range checked parameters. More...
 
std::map< std::string, std::pair< std::string, std::string > > _auto_build_vectors
 The map of auto build vectors (base_, 5 -> "base_0 base_1 base_2 base_3 base_4") More...
 
std::vector< std::string > _buildable_types
 The parameter is used to restrict types that can be built. More...
 
bool _collapse_nesting
 This parameter collapses one level of nesting in the syntax blocks. More...
 
bool _moose_object_syntax_visibility
 This parameter hides derived MOOSE object types from appearing in syntax dumps. More...
 
std::set< std::string > _required_params
 The set of parameters that are required (i.e. will cause an abort if not supplied) More...
 
std::set< std::string > _valid_params
 The set of parameters either explicitly set or provided a default value when added Note: We do not store MooseEnum names in valid params, instead we ask MooseEnums whether they are valid or not. More...
 
std::set< std::string > _private_params
 The set of parameters that will NOT appear in the the dump of the parser tree. More...
 
std::set< std::string > _coupled_vars
 The coupled variables set. More...
 
std::map< std::string, std::string > _deprecated_params
 The list of deprecated params. More...
 
std::map< std::string, Real > _default_coupled_value
 The default value for optionally coupled variables. More...
 
std::map< std::string, PostprocessorValue_default_postprocessor_value
 The default value for postprocessors. More...
 
std::set< std::string > _set_by_add_param
 If a parameters value was set by addParam, and not set again, it will appear in this list (see applyParameters) More...
 
std::set< std::string > _controllable_params
 A list of parameters declared as controllable. More...
 
std::map< std::string, std::set< std::string > > _reserved_values
 The reserved option names for a parameter. More...
 
bool _show_deprecated_message
 Flag for disabling deprecated parameters message, this is used by applyParameters to avoid dumping messages. More...
 
bool _allow_copy
 A flag for toggling the error message in the copy constructor. More...
 

Friends

class InputParameterWarehouse
 
InputParameters validParams ()
 This is the templated validParams() function that every MooseObject-derived class is required to specialize. More...
 
InputParameters validParams ()
 This is the templated validParams() function that every MooseObject-derived class is required to specialize. More...
 
InputParameters validParams ()
 This is the templated validParams() function that every MooseObject-derived class is required to specialize. More...
 
InputParameters emptyInputParameters ()
 
InputParameters validParams ()
 This is the templated validParams() function that every MooseObject-derived class is required to specialize. More...
 

Detailed Description

The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.

Definition at line 55 of file InputParameters.h.

Constructor & Destructor Documentation

InputParameters::InputParameters ( const InputParameters rhs)

Definition at line 43 of file InputParameters.C.

44  : Parameters(), _show_deprecated_message(true), _allow_copy(true)
45 
46 {
47  *this = rhs;
48 }
bool _allow_copy
A flag for toggling the error message in the copy constructor.
bool _show_deprecated_message
Flag for disabling deprecated parameters message, this is used by applyParameters to avoid dumping me...
InputParameters::InputParameters ( const Parameters &  rhs)

Definition at line 50 of file InputParameters.C.

52 {
53  Parameters::operator=(rhs);
54  _collapse_nesting = false;
56 }
bool _allow_copy
A flag for toggling the error message in the copy constructor.
bool _show_deprecated_message
Flag for disabling deprecated parameters message, this is used by applyParameters to avoid dumping me...
bool _collapse_nesting
This parameter collapses one level of nesting in the syntax blocks.
bool _moose_object_syntax_visibility
This parameter hides derived MOOSE object types from appearing in syntax dumps.
virtual InputParameters::~InputParameters ( )
virtualdefault
InputParameters::InputParameters ( )
private

Definition at line 34 of file InputParameters.C.

35  : Parameters(),
36  _collapse_nesting(false),
39  _allow_copy(true)
40 {
41 }
bool _allow_copy
A flag for toggling the error message in the copy constructor.
bool _show_deprecated_message
Flag for disabling deprecated parameters message, this is used by applyParameters to avoid dumping me...
bool _collapse_nesting
This parameter collapses one level of nesting in the syntax blocks.
bool _moose_object_syntax_visibility
This parameter hides derived MOOSE object types from appearing in syntax dumps.

Member Function Documentation

void InputParameters::addClassDescription ( const std::string &  doc_string)

This method adds a description of the class that will be displayed in the input file syntax dump.

Definition at line 81 of file InputParameters.C.

Referenced by MaterialDerivativeTestKernelBase< T >::validParams(), validParams< AddSideSetsFromBoundingBox >(), validParams< AnisotropicDiffusion >(), validParams< AnnularMesh >(), validParams< Axisymmetric2D3DSolutionFunction >(), validParams< AxisymmetricCenterlineAverageValue >(), validParams< BlockDeleter >(), validParams< BodyForce >(), validParams< BoundingBoxNodeSet >(), validParams< BoxMarker >(), validParams< BreakBoundaryOnSubdomain >(), validParams< ComboMarker >(), validParams< CompositeFunction >(), validParams< ConservativeAdvection >(), validParams< ConstantAux >(), validParams< ConstantDT >(), validParams< ConvectiveFluxBC >(), validParams< CoupledForce >(), validParams< CoupledTimeDerivative >(), validParams< CSVReader >(), validParams< CSVTimeSequenceStepper >(), validParams< DGConvection >(), validParams< Diffusion >(), validParams< DiffusionFluxAux >(), validParams< DiffusionFluxBC >(), validParams< DirichletBC >(), validParams< Eigenvalue >(), validParams< ElementalVariableValue >(), validParams< ElementH1ErrorFunctionAux >(), validParams< ElementL2ErrorFunctionAux >(), validParams< ElementLengthAux >(), validParams< ElementLpNormAux >(), validParams< ErrorFractionMarker >(), validParams< ErrorToleranceMarker >(), validParams< ExodusTimeSequenceStepper >(), validParams< FileMesh >(), validParams< FindValueOnLine >(), validParams< FunctionAux >(), validParams< FunctionDirichletBC >(), validParams< FunctionDT >(), validParams< FunctionNeumannBC >(), validParams< FunctionPresetBC >(), validParams< GeneratedMesh >(), validParams< GeometryBase >(), validParams< GeometrySphere >(), validParams< GMVOutput >(), validParams< ImageFunction >(), validParams< ImageMesh >(), validParams< ImageSubdomain >(), validParams< IterationAdaptiveDT >(), validParams< LeastSquaresFit >(), validParams< LinearCombinationFunction >(), validParams< LogConstantDT >(), validParams< MassEigenKernel >(), validParams< MassLumpedTimeDerivative >(), validParams< MatchedValueBC >(), validParams< MaterialDerivativeRankFourTestKernel >(), validParams< MaterialDerivativeRankTwoTestKernel >(), validParams< MaterialDerivativeTestKernel >(), validParams< MaterialRealAux >(), validParams< MaterialStdVectorAux >(), validParams< MaterialStdVectorRealGradientAux >(), validParams< MemoryUsage >(), validParams< MeshExtruder >(), validParams< MeshSideSet >(), validParams< MultiAppCopyTransfer >(), validParams< MultiAppInterpolationTransfer >(), validParams< NearestNodeDistanceAux >(), validParams< NearestNodeValueAux >(), validParams< NeumannBC >(), validParams< NodalVariableValue >(), validParams< NullKernel >(), validParams< NumNonlinearIterations >(), validParams< ParsedAux >(), validParams< ParsedODEKernel >(), validParams< PatternedMesh >(), validParams< PenaltyDirichletBC >(), validParams< PenetrationAux >(), validParams< PerflogDumper >(), validParams< PiecewiseBilinear >(), validParams< PiecewiseConstant >(), validParams< PiecewiseLinear >(), validParams< PiecewiseLinearInterpolationMaterial >(), validParams< PiecewiseMultilinear >(), validParams< PresetBC >(), validParams< ProcessorIDAux >(), validParams< QuotientAux >(), validParams< Reaction >(), validParams< RealFunctionControl >(), validParams< RelativeDifferencePostprocessor >(), validParams< RenameBlock >(), validParams< Sampler >(), validParams< SideAverageValue >(), validParams< SideFluxIntegral >(), validParams< SideSetsAroundSubdomain >(), validParams< SideSetsFromNormals >(), validParams< SideSetsFromPoints >(), validParams< SinDirichletBC >(), validParams< SinNeumannBC >(), validParams< SolutionAux >(), validParams< SolutionUserObject >(), validParams< StitchedMesh >(), validParams< SubdomainBoundingBox >(), validParams< Tecplot >(), validParams< TiledMesh >(), validParams< TimeDerivative >(), validParams< TimeExtremeValue >(), validParams< TimePeriod >(), validParams< TimeSequenceStepper >(), validParams< TimestepSize >(), validParams< Transform >(), validParams< UniformMarker >(), validParams< ValueRangeMarker >(), validParams< ValueThresholdMarker >(), validParams< VariableGradientComponent >(), validParams< VectorMagnitudeAux >(), validParams< VectorNeumannBC >(), validParams< VectorOfPostprocessors >(), validParams< WeakGradientBC >(), and validParams< XDA >().

82 {
83  _doc_string["_class"] = doc_string;
84 }
std::map< std::string, std::string > _doc_string
The documentation strings for each parameter.
template<typename T >
void InputParameters::addCommandLineParam ( const std::string &  name,
const std::string &  syntax,
const std::string &  doc_string 
)

Definition at line 1111 of file InputParameters.h.

Referenced by validParams< MooseApp >().

1114 {
1115  addParam<T>(name, doc_string);
1116  MooseUtils::tokenize(syntax, _syntax[name], 1, " \t\n\v\f\r");
1117 }
void tokenize(const std::string &str, std::vector< T > &elements, unsigned int min_len=1, const std::string &delims="/")
This function will split the passed in string on a set of delimiters appending the substrings to the ...
Definition: MooseUtils.h:350
std::map< std::string, std::vector< std::string > > _syntax
Syntax for command-line parameters.
template<typename T >
void InputParameters::addCommandLineParam ( const std::string &  name,
const std::string &  syntax,
const T &  value,
const std::string &  doc_string 
)

Definition at line 1121 of file InputParameters.h.

1125 {
1126  addParam<T>(name, value, doc_string);
1127  MooseUtils::tokenize(syntax, _syntax[name], 1, " \t\n\v\f\r");
1128 }
void tokenize(const std::string &str, std::vector< T > &elements, unsigned int min_len=1, const std::string &delims="/")
This function will split the passed in string on a set of delimiters appending the substrings to the ...
Definition: MooseUtils.h:350
std::map< std::string, std::vector< std::string > > _syntax
Syntax for command-line parameters.
void InputParameters::addCoupledVar ( const std::string &  name,
const std::string &  doc_string 
)

This method adds a coupled variable name pair.

The parser will look for variable name pair in the input file and can return a reference to the storage location for the coupled variable if found

Definition at line 205 of file InputParameters.C.

Referenced by applyCoupledVar(), validParams< ElementVectorL2Error >(), validParams< FindValueOnLine >(), validParams< NodalNormalBC >(), validParams< QuotientAux >(), validParams< QuotientScalarAux >(), validParams< SphericalAverage >(), validParams< VectorMagnitudeAux >(), and validParams< VolumeHistogram >().

206 {
207  addParam<std::vector<VariableName>>(name, doc_string);
208  _coupled_vars.insert(name);
209 }
std::set< std::string > _coupled_vars
The coupled variables set.
void InputParameters::addCoupledVar ( const std::string &  name,
const Real  value,
const std::string &  doc_string 
)

This method adds a coupled variable name pair.

The parser will look for variable name pair in the input file and can return a reference to the storage location for the coupled variable if found

Also - you can provide a default value for this variable in the case that an actual variable is not provided.

Definition at line 196 of file InputParameters.C.

197 {
198  // std::vector<VariableName>(1, Moose::stringify(value)),
199  addParam<std::vector<VariableName>>(name, doc_string);
200  _coupled_vars.insert(name);
201  _default_coupled_value[name] = value;
202 }
std::map< std::string, Real > _default_coupled_value
The default value for optionally coupled variables.
std::set< std::string > _coupled_vars
The coupled variables set.
void InputParameters::addCoupledVarWithAutoBuild ( const std::string &  name,
const std::string &  base_name,
const std::string &  num_name,
const std::string &  doc_string 
)

These methods add a coupled variable name pair.

The parser will look for variable name pair in the input file and can return a reference to the storage location for the coupled variable if found.

This version of the method will build a vector if the given the base_name and num_name parameters exist in the input file: e.g. [./foo] ... some_base = base_ some_num = 5 [../]

The coupling parameter will be passed this vector: "base_0 base_1 base_2 base_3 base_4"

Definition at line 212 of file InputParameters.C.

Referenced by addRequiredCoupledVarWithAutoBuild().

216 {
217  addParam<std::vector<VariableName>>(name, doc_string);
218  _coupled_vars.insert(name);
219  _auto_build_vectors[name] = std::make_pair(base_name, num_name);
220 
221  // Additionally there are two more parameters that need to be added:
222  addParam<std::string>(base_name, doc_string + " (base_name)");
223  addParam<unsigned int>(num_name, doc_string + " (num_name)");
224 }
std::map< std::string, std::pair< std::string, std::string > > _auto_build_vectors
The map of auto build vectors (base_, 5 -> "base_0 base_1 base_2 base_3 base_4")
std::set< std::string > _coupled_vars
The coupled variables set.
template<typename T >
void InputParameters::addCustomTypeParam ( const std::string &  name,
const T &  value,
const std::string &  custom_type,
const std::string &  doc_string 
)

Definition at line 1057 of file InputParameters.h.

1061 {
1062  addParam<T>(name, value, doc_string);
1063  _custom_type[name] = custom_type;
1064 }
std::map< std::string, std::string > _custom_type
The custom type that will be printed in the YAML dump for a parameter if supplied.
template<typename T >
void InputParameters::addCustomTypeParam ( const std::string &  name,
const std::string &  custom_type,
const std::string &  doc_string 
)

Definition at line 1068 of file InputParameters.h.

1071 {
1072  addParam<T>(name, doc_string);
1073  _custom_type[name] = custom_type;
1074 }
std::map< std::string, std::string > _custom_type
The custom type that will be printed in the YAML dump for a parameter if supplied.
template<typename T >
void InputParameters::addDeprecatedParam ( const std::string &  name,
const T &  value,
const std::string &  doc_string,
const std::string &  deprecation_message 
)
Parameters
nameThe name of the parameter
valueThe default value of this parameter if it requires one
doc_stringDocumentation. This will be shown for –help
deprecation_messageThe message that will will print about why this param was deprecated. It might mention the "new way".

Definition at line 1172 of file InputParameters.h.

Referenced by validParams< AdaptivityAction >(), validParams< Executioner >(), validParams< GenericFunctionMaterial >(), validParams< OversampleOutput >(), and validParams< PetscOutput >().

1176 {
1177  _show_deprecated_message = false;
1178  addParam<T>(name, value, doc_string);
1179 
1180  _deprecated_params.insert(std::make_pair(name, deprecation_message));
1181  _show_deprecated_message = true;
1182 }
std::map< std::string, std::string > _deprecated_params
The list of deprecated params.
bool _show_deprecated_message
Flag for disabling deprecated parameters message, this is used by applyParameters to avoid dumping me...
template<typename T >
void InputParameters::addDeprecatedParam ( const std::string &  name,
const std::string &  doc_string,
const std::string &  deprecation_message 
)

Definition at line 1186 of file InputParameters.h.

1189 {
1190  _show_deprecated_message = false;
1191  addParam<T>(name, doc_string);
1192 
1193  _deprecated_params.insert(std::make_pair(name, deprecation_message));
1194  _show_deprecated_message = true;
1195 }
std::map< std::string, std::string > _deprecated_params
The list of deprecated params.
bool _show_deprecated_message
Flag for disabling deprecated parameters message, this is used by applyParameters to avoid dumping me...
template<>
void InputParameters::addDeprecatedParam ( const std::string &  ,
const std::string &  ,
const std::string &   
)

Definition at line 850 of file InputParameters.C.

853 {
854  mooseError("You must supply a MooseEnum object and the deprecation string when using "
855  "addDeprecatedParam, even if the parameter is not required!");
856 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
template<>
void InputParameters::addDeprecatedParam ( const std::string &  ,
const std::string &  ,
const std::string &   
)

Definition at line 860 of file InputParameters.C.

863 {
864  mooseError("You must supply a MultiMooseEnum object and the deprecation string when using "
865  "addDeprecatedParam, even if the parameter is not required!");
866 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
template<>
void InputParameters::addDeprecatedParam ( const std::string &  name,
const std::string &  doc_string,
const std::string &  deprecation_message 
)
template<>
void InputParameters::addDeprecatedParam ( const std::string &  name,
const std::string &  doc_string,
const std::string &  deprecation_message 
)
template<typename T , typename S >
void InputParameters::addParam ( const std::string &  name,
const S &  value,
const std::string &  doc_string 
)

These methods add an option parameter and a documentation string to the InputParameters object.

The first version of this function takes a default value which is used if the parameter is not found in the input file. The second method will leave the parameter uninitialized but can be checked with "isParamValid" before use

Definition at line 979 of file InputParameters.h.

Referenced by AdvancedOutput::addValidParams(), Moose::PetscSupport::getPetscValidParams(), Moose::SlepcSupport::getSlepcEigenProblemValidParams(), MaterialDerivativeTestKernelBase< T >::validParams(), ShapeUserObject< T >::validParams(), validParams< AB2PredictorCorrector >(), validParams< Action >(), validParams< AdamsPredictor >(), validParams< AdaptivityAction >(), validParams< AddAuxVariableAction >(), validParams< AddElementalFieldAction >(), validParams< AddExtraNodeset >(), validParams< AddFieldSplitAction >(), validParams< AddNodalNormalsAction >(), validParams< AddPeriodicBCAction >(), validParams< AddSideSetsBase >(), validParams< AddSideSetsFromBoundingBox >(), validParams< AddVariableAction >(), validParams< AnnularMesh >(), validParams< AssignElementSubdomainID >(), validParams< AStableDirk4 >(), validParams< Axisymmetric2D3DSolutionFunction >(), validParams< BicubicSplineFunction >(), validParams< BlockRestrictable >(), validParams< BodyForce >(), validParams< BoundaryRestrictable >(), validParams< BoundingBoxIC >(), validParams< BoundingBoxNodeSet >(), validParams< BoundingValueElementDamper >(), validParams< BoundingValueNodalDamper >(), validParams< BoundsAux >(), validParams< BreakBoundaryOnSubdomain >(), validParams< ChangeOverTimestepPostprocessor >(), validParams< Checkpoint >(), validParams< CommonOutputAction >(), validParams< CompositeFunction >(), validParams< ConstantAux >(), validParams< ConstantFunction >(), validParams< ControlOutput >(), validParams< CopyNodalVarsAction >(), validParams< CoupledForce >(), validParams< CoupledTiedValueConstraint >(), validParams< CreateDisplacedProblemAction >(), validParams< CreateProblemAction >(), validParams< CSV >(), validParams< CSVReader >(), validParams< CSVTimeSequenceStepper >(), validParams< Damper >(), validParams< DeprecatedBlockAction >(), validParams< DGDiffusion >(), validParams< DGFunctionDiffusionDirichletBC >(), validParams< DOFMapOutput >(), validParams< DT2 >(), validParams< DynamicObjectRegistrationAction >(), validParams< EigenExecutionerBase >(), validParams< EigenKernel >(), validParams< ElemElemConstraint >(), validParams< ElementDeleterBase >(), validParams< ElementExtremeValue >(), validParams< ElementVariablesDifferenceMax >(), validParams< ElementVectorL2Error >(), validParams< EqualValueBoundaryConstraint >(), validParams< ErrorFractionMarker >(), validParams< ErrorToleranceMarker >(), validParams< Executioner >(), validParams< FaceFaceConstraint >(), validParams< FEProblemBase >(), validParams< FieldSplitPreconditioner >(), validParams< FileOutput >(), validParams< FileRangeBuilder >(), validParams< FindValueOnLine >(), validParams< FiniteDifferencePreconditioner >(), validParams< FunctionDT >(), validParams< FunctionParserUtils >(), validParams< FunctionSideIntegral >(), validParams< FunctionValuePostprocessor >(), validParams< GapValueAux >(), validParams< GeneratedMesh >(), validParams< GenericConstantMaterial >(), validParams< GenericFunctionMaterial >(), validParams< GeometryBase >(), validParams< GeometrySphere >(), validParams< GMVOutput >(), validParams< Gnuplot >(), validParams< ImageSampler >(), validParams< Indicator >(), validParams< IntegratedBC >(), validParams< InternalSideIndicator >(), validParams< InversePowerMethod >(), validParams< IterationAdaptiveDT >(), validParams< LayeredBase >(), validParams< LeastSquaresFit >(), validParams< LibmeshPartitioner >(), validParams< LinearCombinationPostprocessor >(), validParams< LinearNodalConstraint >(), validParams< Marker >(), validParams< Material >(), validParams< MaterialAuxBase<> >(), validParams< MaterialDerivativeTestAction >(), validParams< MaterialRealDenseMatrixAux >(), validParams< MaterialRealTensorValueAux >(), validParams< MaterialRealVectorValueAux >(), validParams< MaterialStdVectorAux >(), validParams< MaterialStdVectorAuxBase<> >(), validParams< MaterialStdVectorRealGradientAux >(), validParams< MemoryUsage >(), validParams< MeshExtruder >(), validParams< MeshModifier >(), validParams< MeshSideSet >(), validParams< MooseMesh >(), validParams< MooseObject >(), validParams< MooseObjectAction >(), validParams< MooseParsedFunctionBase >(), validParams< MooseParsedGradFunction >(), validParams< MooseParsedVectorFunction >(), validParams< MoosePreconditioner >(), validParams< MultiApp >(), validParams< MultiAppInterpolationTransfer >(), validParams< MultiAppMeshFunctionTransfer >(), validParams< MultiAppNearestNodeTransfer >(), validParams< MultiAppPostprocessorInterpolationTransfer >(), validParams< MultiAppPostprocessorTransfer >(), validParams< MultiAppProjectionTransfer >(), validParams< MultiAppTransfer >(), validParams< MultiAppUserObjectTransfer >(), validParams< NeumannBC >(), validParams< NodalBC >(), validParams< NodalConstraint >(), validParams< NodalExtremeValue >(), validParams< NodalNormalsPreprocessor >(), validParams< NodalUserObject >(), validParams< NodalVariableValue >(), validParams< NodeFaceConstraint >(), validParams< NonlinearEigen >(), validParams< NormalizationAux >(), validParams< NullKernel >(), validParams< NumDOFs >(), validParams< NumElems >(), validParams< NumNonlinearIterations >(), validParams< NumVars >(), validParams< Output >(), validParams< OutputInterface >(), validParams< OversampleOutput >(), validParams< PatternedMesh >(), validParams< PenaltyDirichletBC >(), validParams< PenetrationAux >(), validParams< PerflogDumper >(), validParams< PerformanceData >(), validParams< PetscOutput >(), validParams< PhysicsBasedPreconditioner >(), validParams< Piecewise >(), validParams< PiecewiseBilinear >(), validParams< PiecewiseConstant >(), validParams< PiecewiseLinearInterpolationMaterial >(), validParams< PiecewiseMultilinear >(), validParams< PostprocessorDT >(), validParams< PostprocessorNeumannBC >(), validParams< Predictor >(), validParams< RandomIC >(), validParams< RandomInterface >(), validParams< Receiver >(), validParams< RenameBlock >(), validParams< Residual >(), validParams< ScalarInitialCondition >(), validParams< ScalarVariable >(), validParams< ScalePostprocessor >(), validParams< SetAdaptivityOptionsAction >(), validParams< SetupDebugAction >(), validParams< SetupInterface >(), validParams< SetupMeshAction >(), validParams< SetupQuadratureAction >(), validParams< SetupResidualDebugAction >(), validParams< SideSetsAroundSubdomain >(), validParams< SingleMatrixPreconditioner >(), validParams< SinNeumannBC >(), validParams< SolutionAux >(), validParams< SolutionFunction >(), validParams< SolutionTimeAdaptiveDT >(), validParams< SolutionUserObject >(), validParams< SphericalAverage >(), validParams< SplineFunction >(), validParams< Split >(), validParams< StitchedMesh >(), validParams< SubdomainBoundingBox >(), validParams< Tecplot >(), validParams< TiedValueConstraint >(), validParams< TiledMesh >(), validParams< TimeDerivative >(), validParams< TimeExtremeValue >(), validParams< TimePeriod >(), validParams< TimeStepper >(), validParams< TopResidualDebugOutput >(), validParams< TotalVariableValue >(), validParams< Transfer >(), validParams< Transient >(), validParams< TransientInterface >(), validParams< TransientMultiApp >(), validParams< VacuumBC >(), validParams< ValueRangeMarker >(), validParams< ValueThresholdMarker >(), validParams< VariableGradientComponent >(), validParams< VariableTimeIntegrationAux >(), validParams< VectorNeumannBC >(), validParams< VolumeHistogram >(), and validParams< VTKOutput >().

980 {
981  checkParamName(name);
982  checkConsistentType<T>(name);
983 
984  T & l_value = InputParameters::set<T>(name);
985  _doc_string[name] = doc_string;
986 
987  // Set the parameter now
988  setParamHelper(name, l_value, value);
989 
990  /* Indicate the default value, as set via addParam, is being used. The parameter is removed from
991  the list whenever
992  it changes, see set_attributes */
993  _set_by_add_param.insert(name);
994 }
std::map< std::string, std::string > _doc_string
The documentation strings for each parameter.
void checkParamName(const std::string &name) const
Make sure the parameter name doesn&#39;t have any invalid characters.
void setParamHelper(const std::string &name, T &l_value, const S &r_value)
This method is called when adding a Parameter with a default value, can be specialized for non-matchi...
std::set< std::string > _set_by_add_param
If a parameters value was set by addParam, and not set again, it will appear in this list (see applyP...
template<typename T >
void InputParameters::addParam ( const std::string &  name,
const std::string &  doc_string 
)

Definition at line 998 of file InputParameters.h.

999 {
1000  checkParamName(name);
1001  checkConsistentType<T>(name);
1002 
1003  InputParameters::insert<T>(name);
1004  _doc_string[name] = doc_string;
1005 }
std::map< std::string, std::string > _doc_string
The documentation strings for each parameter.
void checkParamName(const std::string &name) const
Make sure the parameter name doesn&#39;t have any invalid characters.
template<>
void InputParameters::addParam ( const std::string &  ,
const std::string &   
)

Definition at line 823 of file InputParameters.C.

825 {
826  mooseError("You must supply a MooseEnum object when using addParam, even if the parameter is not "
827  "required!");
828 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
template<>
void InputParameters::addParam ( const std::string &  ,
const std::string &   
)

Definition at line 832 of file InputParameters.C.

834 {
835  mooseError("You must supply a MultiMooseEnum object when using addParam, even if the parameter "
836  "is not required!");
837 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
template<>
void InputParameters::addParam ( const std::string &  ,
const std::string &   
)
template<>
void InputParameters::addParam ( const std::string &  ,
const std::string &   
)
void InputParameters::addParamNamesToGroup ( const std::string &  space_delim_names,
const std::string  group_name 
)

This method takes a space delimited list of parameter names and adds them to the specified group name.

This information is used in the GUI to group parameters into logical sections.

Definition at line 569 of file InputParameters.C.

Referenced by AdvancedOutput::addValidParams(), ShapeUserObject< T >::validParams(), validParams< Checkpoint >(), validParams< CopyNodalVarsAction >(), validParams< EigenExecutionerBase >(), validParams< Executioner >(), validParams< FileOutput >(), validParams< FunctionParserUtils >(), validParams< GeneratedMesh >(), validParams< GMVOutput >(), validParams< ImageSampler >(), validParams< MaterialStdVectorAux >(), validParams< MooseMesh >(), validParams< MooseObject >(), validParams< Output >(), validParams< OutputInterface >(), validParams< OversampleOutput >(), validParams< PetscOutput >(), validParams< Postprocessor >(), validParams< RandomInterface >(), validParams< SetupMeshAction >(), validParams< Tecplot >(), validParams< Transient >(), validParams< TransientInterface >(), validParams< VectorPostprocessor >(), and validParams< VTKOutput >().

571 {
572  std::vector<std::string> elements;
573  MooseUtils::tokenize(space_delim_names, elements, 1, " \t\n\v\f\r"); // tokenize on whitespace
574 
575  // Since we don't require types (templates) for this method, we need
576  // to get a raw list of parameter names to compare against.
577  std::set<std::string> param_names;
578  for (const auto & it : *this)
579  param_names.insert(it.first);
580 
581  for (const auto & param_name : elements)
582  if (param_names.find(param_name) != param_names.end())
583  _group[param_name] = group_name;
584  else
585  mooseError("Unable to find a parameter with name: ",
586  param_name,
587  " when adding to group ",
588  group_name,
589  '.');
590 }
void tokenize(const std::string &str, std::vector< T > &elements, unsigned int min_len=1, const std::string &delims="/")
This function will split the passed in string on a set of delimiters appending the substrings to the ...
Definition: MooseUtils.h:350
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::map< std::string, std::string > _group
The names of the parameters organized into groups.
template<typename T >
void InputParameters::addPrivateParam ( const std::string &  name,
const T &  value 
)

These method add a parameter to the InputParameters object which can be retrieved like any other parameter.

This parameter however is not printed in the Input file syntax dump or web page dump so does not take a documentation string. The first version of this function takes an optional default value.

Definition at line 1089 of file InputParameters.h.

Referenced by AddOutputAction::act(), AddControlAction::act(), ActionFactory::create(), ActionFactory::getValidParams(), Factory::getValidParams(), MooseObjectAction::MooseObjectAction(), validParams< Action >(), validParams< BlockRestrictable >(), validParams< BoundaryRestrictable >(), validParams< BoundaryRestrictableRequired >(), validParams< DisplacedProblem >(), validParams< EigenExecutionerBase >(), validParams< Eigenvalue >(), validParams< ExecutionerAttributeReporter >(), validParams< FEProblemBase >(), validParams< GlobalParamsAction >(), validParams< InternalSideIndicator >(), validParams< MaterialPropertyInterface >(), validParams< MooseApp >(), validParams< MooseObject >(), validParams< MoosePreconditioner >(), validParams< NodalNormalsPreprocessor >(), validParams< Output >(), validParams< SetupInterface >(), and validParams< XDA >().

1090 {
1091  checkParamName(name);
1092  checkConsistentType<T>(name);
1093 
1094  InputParameters::set<T>(name) = value;
1095  _private_params.insert(name);
1096  _set_by_add_param.insert(name);
1097 }
void checkParamName(const std::string &name) const
Make sure the parameter name doesn&#39;t have any invalid characters.
std::set< std::string > _private_params
The set of parameters that will NOT appear in the the dump of the parser tree.
std::set< std::string > _set_by_add_param
If a parameters value was set by addParam, and not set again, it will appear in this list (see applyP...
template<typename T >
void InputParameters::addPrivateParam ( const std::string &  name)

Definition at line 1078 of file InputParameters.h.

1079 {
1080  checkParamName(name);
1081  checkConsistentType<T>(name);
1082 
1083  InputParameters::insert<T>(name);
1084  _private_params.insert(name);
1085 }
void checkParamName(const std::string &name) const
Make sure the parameter name doesn&#39;t have any invalid characters.
std::set< std::string > _private_params
The set of parameters that will NOT appear in the the dump of the parser tree.
template<typename T >
void InputParameters::addRangeCheckedParam ( const std::string &  name,
const T &  value,
const std::string &  parsed_function,
const std::string &  doc_string 
)

Definition at line 1026 of file InputParameters.h.

Referenced by validParams< AdaptivityAction >(), validParams< AnnularMesh >(), validParams< ConstantDT >(), validParams< ElementLpNormAux >(), validParams< ElementW1pError >(), validParams< ErrorFractionMarker >(), validParams< GeneratedMesh >(), validParams< LogConstantDT >(), validParams< PatternedMesh >(), and validParams< SideSetsAroundSubdomain >().

1030 {
1031  addParam<T>(name, value, doc_string);
1032  _range_functions[name] = parsed_function;
1033 }
std::map< std::string, std::string > _range_functions
The map of functions used for range checked parameters.
template<typename T >
void InputParameters::addRangeCheckedParam ( const std::string &  name,
const std::string &  parsed_function,
const std::string &  doc_string 
)

Definition at line 1037 of file InputParameters.h.

1040 {
1041  addParam<T>(name, doc_string);
1042  _range_functions[name] = parsed_function;
1043 }
std::map< std::string, std::string > _range_functions
The map of functions used for range checked parameters.
template<typename T >
void InputParameters::addRequiredCommandLineParam ( const std::string &  name,
const std::string &  syntax,
const std::string &  doc_string 
)

Add parameters for retrieval from the command line.

NOTE: This ONLY works for App objects! This is not valid for normal MOOSE objects!

Parameters
nameThe name of the parameter
syntaxSpace separated list of command-line switch syntax that can set this option
doc_stringDocumentation. This will be shown for –help

Definition at line 1101 of file InputParameters.h.

1104 {
1105  addRequiredParam<T>(name, doc_string);
1106  MooseUtils::tokenize(syntax, _syntax[name], 1, " \t\n\v\f\r");
1107 }
void tokenize(const std::string &str, std::vector< T > &elements, unsigned int min_len=1, const std::string &delims="/")
This function will split the passed in string on a set of delimiters appending the substrings to the ...
Definition: MooseUtils.h:350
std::map< std::string, std::vector< std::string > > _syntax
Syntax for command-line parameters.
void InputParameters::addRequiredCoupledVar ( const std::string &  name,
const std::string &  doc_string 
)

This method adds a coupled variable name pair.

The parser will look for variable name pair in the input file and can return a reference to the storage location for the coupled variable. If the coupled variable is not supplied in the input file, and error is thrown.

Version 2: An auto built vector will be built from the base_name and num_name param. See addCoupledVar for an example

Definition at line 238 of file InputParameters.C.

Referenced by CompositeTensorBase< T, U >::validParams(), MaterialDerivativeTestKernelBase< T >::validParams(), validParams< BoundsAux >(), validParams< CoupledForce >(), validParams< CoupledODETimeDerivative >(), validParams< CoupledTimeDerivative >(), validParams< DiffusionFluxAux >(), validParams< ElementIntegralVariablePostprocessor >(), validParams< ElementIntegralVariableUserObject >(), validParams< ElementL2Difference >(), validParams< ElementLpNormAux >(), validParams< ElementVariablePostprocessor >(), validParams< ElementVariablesDifferenceMax >(), validParams< ElementVectorL2Error >(), validParams< MatchedValueBC >(), validParams< NearestNodeValueAux >(), validParams< NodalEqualValueConstraint >(), validParams< NodalVariablePostprocessor >(), validParams< NodalVariableVectorPostprocessor >(), validParams< NodeFaceConstraint >(), validParams< NormalizationAux >(), validParams< OneDEqualValueConstraintBC >(), validParams< PiecewiseLinearInterpolationMaterial >(), validParams< PointSamplerBase >(), validParams< SideIntegralVariablePostprocessor >(), validParams< SideIntegralVariableUserObject >(), validParams< SideValueSampler >(), validParams< ValueRangeMarker >(), validParams< ValueThresholdMarker >(), validParams< VariableGradientComponent >(), validParams< VariableInnerProduct >(), validParams< VariableTimeIntegrationAux >(), and validParams< VectorMagnitudeAux >().

239 {
240  addRequiredParam<std::vector<VariableName>>(name, doc_string);
241  _coupled_vars.insert(name);
242 }
std::set< std::string > _coupled_vars
The coupled variables set.
void InputParameters::addRequiredCoupledVarWithAutoBuild ( const std::string &  name,
const std::string &  base_name,
const std::string &  num_name,
const std::string &  doc_string 
)

Definition at line 227 of file InputParameters.C.

231 {
232  addRequiredParam<std::vector<VariableName>>(name, doc_string);
233 
234  addCoupledVarWithAutoBuild(name, base_name, num_name, doc_string);
235 }
void addCoupledVarWithAutoBuild(const std::string &name, const std::string &base_name, const std::string &num_name, const std::string &doc_string)
These methods add a coupled variable name pair.
template<typename T >
void InputParameters::addRequiredCustomTypeParam ( const std::string &  name,
const std::string &  custom_type,
const std::string &  doc_string 
)

These methods add an option parameter and with a customer type to the InputParameters object.

The custom type will be output in YAML dumps and can be used within the GUI application.

Definition at line 1047 of file InputParameters.h.

Referenced by validParams< MooseParsedFunction >(), and validParams< Terminator >().

1050 {
1051  addRequiredParam<T>(name, doc_string);
1052  _custom_type[name] = custom_type;
1053 }
std::map< std::string, std::string > _custom_type
The custom type that will be printed in the YAML dump for a parameter if supplied.
template<typename T >
void InputParameters::addRequiredDeprecatedParam ( const std::string &  name,
const std::string &  doc_string,
const std::string &  deprecation_message 
)

Add and mark a parameter for deprecation.

This will allow us to assist users as API changes are made. If the user supplies a value or even uses the default, a warning will be printed.

Parameters
nameThe name of the parameter
doc_stringDocumentation. This will be shown for –help
deprecation_messageThe message that will will print about why this param was deprecated. It might mention the "new way".

Definition at line 1159 of file InputParameters.h.

1162 {
1163  _show_deprecated_message = false;
1164  addRequiredParam<T>(name, doc_string);
1165 
1166  _deprecated_params.insert(std::make_pair(name, deprecation_message));
1167  _show_deprecated_message = true;
1168 }
std::map< std::string, std::string > _deprecated_params
The list of deprecated params.
bool _show_deprecated_message
Flag for disabling deprecated parameters message, this is used by applyParameters to avoid dumping me...
template<typename T >
void InputParameters::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 extracted from the input file.

If the parameter is missing in the input file, and error will be thrown

Definition at line 957 of file InputParameters.h.

Referenced by nearestPointBaseValidParams(), CompositeTensorBase< T, U >::validParams(), MaterialDerivativeTestKernelBase< T >::validParams(), validParams< AB2PredictorCorrector >(), validParams< AddExtraNodeset >(), validParams< AddMortarInterfaceAction >(), validParams< AddSideSetsFromBoundingBox >(), validParams< AnalyticalIndicator >(), validParams< AnisotropicDiffusion >(), validParams< AnnularMesh >(), validParams< AssignElementSubdomainID >(), validParams< AssignSubdomainID >(), validParams< AuxKernel >(), validParams< AuxNodalScalarKernel >(), validParams< AuxScalarKernel >(), validParams< Axisymmetric2D3DSolutionFunction >(), validParams< BicubicSplineFunction >(), validParams< BlockDeleter >(), validParams< BoundaryCondition >(), validParams< BoundaryRestrictableRequired >(), validParams< BoundingBoxIC >(), validParams< BoundingBoxNodeSet >(), validParams< BoxMarker >(), validParams< ChangeOverTimestepPostprocessor >(), validParams< ComboMarker >(), validParams< ConservativeAdvection >(), validParams< ConstantDamper >(), validParams< ConstantDT >(), validParams< ConstantIC >(), validParams< ConstantPointSource >(), validParams< ConstantRate >(), validParams< ConstantScalarAux >(), validParams< ConstantVectorPostprocessor >(), validParams< Constraint >(), validParams< CSVReader >(), validParams< CSVTimeSequenceStepper >(), validParams< CumulativeValuePostprocessor >(), validParams< DebugResidualAux >(), validParams< DGConvection >(), validParams< DGDiffusion >(), validParams< DGFunctionDiffusionDirichletBC >(), validParams< DGKernel >(), validParams< DifferencePostprocessor >(), validParams< DiffusionFluxAux >(), validParams< DiracKernel >(), validParams< DirichletBC >(), validParams< DT2 >(), validParams< EigenExecutionerBase >(), validParams< ElementalVariableValue >(), validParams< ElementDamper >(), validParams< ElementH1SemiError >(), validParams< ElementIndicator >(), validParams< ElementIntegralMaterialProperty >(), validParams< ElementL2Error >(), validParams< ElementL2ErrorFunctionAux >(), validParams< ElementLengthAux >(), validParams< ElementsAlongLine >(), validParams< ElementsAlongPlane >(), validParams< ElementVectorL2Error >(), validParams< ElementW1pError >(), validParams< EqualGradientConstraint >(), validParams< EqualValueBoundaryConstraint >(), validParams< ExodusTimeSequenceStepper >(), validParams< FaceFaceConstraint >(), validParams< FieldSplitPreconditioner >(), validParams< FileMesh >(), validParams< FunctionAux >(), validParams< FunctionDiracSource >(), validParams< FunctionDirichletBC >(), validParams< FunctionDT >(), validParams< FunctionIC >(), validParams< FunctionNeumannBC >(), validParams< FunctionPenaltyDirichletBC >(), validParams< FunctionPresetBC >(), validParams< FunctionScalarAux >(), validParams< FunctionScalarIC >(), validParams< FunctionValuePostprocessor >(), validParams< GapValueAux >(), validParams< GeneratedMesh >(), validParams< GenericConstantRankTwoTensor >(), validParams< IndicatorMarker >(), validParams< InitialCondition >(), validParams< InterfaceKernel >(), validParams< InternalSideIndicator >(), validParams< IntersectionPointsAlongLine >(), validParams< IterationAdaptiveDT >(), validParams< KernelBase >(), validParams< LayeredBase >(), validParams< LayeredSideFluxAverage >(), validParams< LeastSquaresFit >(), validParams< LibmeshPartitioner >(), validParams< LinearCombinationFunction >(), validParams< LinearCombinationPostprocessor >(), validParams< LinearNodalConstraint >(), validParams< LineFunctionSampler >(), validParams< LineMaterialSamplerBase< Real > >(), validParams< LineValueSampler >(), validParams< MaterialAuxBase<> >(), validParams< MaterialDerivativeRankFourTestKernel >(), validParams< MaterialDerivativeRankTwoTestKernel >(), validParams< MaterialDerivativeTestAction >(), validParams< MaterialVectorPostprocessor >(), validParams< MaxIncrement >(), validParams< MeshExtruder >(), validParams< MeshSideSet >(), validParams< MooseObjectAction >(), validParams< MultiAppCopyTransfer >(), validParams< MultiAppDTKInterpolationTransfer >(), validParams< MultiAppDTKUserObjectTransfer >(), validParams< MultiAppInterpolationTransfer >(), validParams< MultiAppMeshFunctionTransfer >(), validParams< MultiAppNearestNodeTransfer >(), validParams< MultiAppPostprocessorInterpolationTransfer >(), validParams< MultiAppPostprocessorToAuxScalarTransfer >(), validParams< MultiAppPostprocessorTransfer >(), validParams< MultiAppProjectionTransfer >(), validParams< MultiAppScalarToAuxScalarTransfer >(), validParams< MultiAppTransfer >(), validParams< MultiAppUserObjectTransfer >(), validParams< MultiAppVariableValueSamplePostprocessorTransfer >(), validParams< MultiAppVariableValueSampleTransfer >(), validParams< NearestNodeDistanceAux >(), validParams< NearestNodeValueAux >(), validParams< NodalDamper >(), validParams< NodalKernel >(), validParams< NodalL2Error >(), validParams< NodalNormalsCorner >(), validParams< NodalNormalsPreprocessor >(), validParams< NodalScalarKernel >(), validParams< NodalVariableValue >(), validParams< NodeFaceConstraint >(), validParams< NormalizationAux >(), validParams< OneDEqualValueConstraintBC >(), validParams< OrientedBoxInterface >(), validParams< ParsedAddSideset >(), validParams< ParsedSubdomainMeshModifier >(), validParams< PatternedMesh >(), validParams< PenaltyDirichletBC >(), validParams< PenetrationAux >(), validParams< PercentChangePostprocessor >(), validParams< PerformanceData >(), validParams< PhysicsBasedPreconditioner >(), validParams< PiecewiseLinearInterpolationMaterial >(), validParams< PointValue >(), validParams< PointValueSampler >(), validParams< PostprocessorDirichletBC >(), validParams< PostprocessorDT >(), validParams< Predictor >(), validParams< PresetBC >(), validParams< RealFunctionControl >(), validParams< RelativeDifferencePostprocessor >(), validParams< SamplerBase >(), validParams< ScalarComponentIC >(), validParams< ScalarKernel >(), validParams< ScalarL2Error >(), validParams< ScalarVariable >(), validParams< ScalePostprocessor >(), validParams< SideFluxIntegral >(), validParams< SideSetsAroundSubdomain >(), validParams< SideSetsBetweenSubdomains >(), validParams< SideSetsFromNormals >(), validParams< SideSetsFromPoints >(), validParams< SolutionAux >(), validParams< SolutionFunction >(), validParams< SolutionTimeAdaptiveDT >(), validParams< SolutionUserObject >(), validParams< SpatialUserObjectAux >(), validParams< SphericalAverage >(), validParams< SplineFunction >(), validParams< StitchedMesh >(), validParams< SubdomainBoundingBox >(), validParams< TestSetupPostprocessorDataActionFunction >(), validParams< TiledMesh >(), validParams< TimeExtremeValue >(), validParams< TimeSequenceStepper >(), validParams< Transform >(), validParams< UniformMarker >(), validParams< UserForcingFunctionNodalKernel >(), validParams< ValueRangeMarker >(), validParams< VariableResidual >(), validParams< VectorOfPostprocessors >(), validParams< VectorPostprocessorFunction >(), and validParams< VolumeHistogram >().

958 {
959  checkParamName(name);
960  checkConsistentType<T>(name);
961 
962  InputParameters::insert<T>(name);
963  _required_params.insert(name);
964  _doc_string[name] = doc_string;
965 }
std::map< std::string, std::string > _doc_string
The documentation strings for each parameter.
std::set< std::string > _required_params
The set of parameters that are required (i.e. will cause an abort if not supplied) ...
void checkParamName(const std::string &name) const
Make sure the parameter name doesn&#39;t have any invalid characters.
template<typename T >
void InputParameters::addRequiredParam ( const std::string &  name,
const T &  moose_enum,
const std::string &  doc_string 
)

This version of addRequiredParam is here for a consistent use with MooseEnums.

Use of this function for any other type will throw an error.

Definition at line 969 of file InputParameters.h.

972 {
973  mooseError("You cannot call addRequiredParam and supply a default value for this type, please "
974  "use addParam instead");
975 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
template<>
void InputParameters::addRequiredParam ( const std::string &  name,
const MooseEnum moose_enum,
const std::string &  doc_string 
)

Definition at line 787 of file InputParameters.C.

790 {
791  InputParameters::set<MooseEnum>(name) = moose_enum; // valid parameter is set by set_attributes
792  _required_params.insert(name);
793  _doc_string[name] = doc_string;
794 }
std::map< std::string, std::string > _doc_string
The documentation strings for each parameter.
std::set< std::string > _required_params
The set of parameters that are required (i.e. will cause an abort if not supplied) ...
template<>
void InputParameters::addRequiredParam ( const std::string &  name,
const MultiMooseEnum moose_enum,
const std::string &  doc_string 
)

Definition at line 798 of file InputParameters.C.

801 {
802  InputParameters::set<MultiMooseEnum>(name) =
803  moose_enum; // valid parameter is set by set_attributes
804  _required_params.insert(name);
805  _doc_string[name] = doc_string;
806 }
std::map< std::string, std::string > _doc_string
The documentation strings for each parameter.
std::set< std::string > _required_params
The set of parameters that are required (i.e. will cause an abort if not supplied) ...
template<>
void InputParameters::addRequiredParam ( const std::string &  name,
const MooseEnum moose_enum,
const std::string &  doc_string 
)
template<>
void InputParameters::addRequiredParam ( const std::string &  name,
const MultiMooseEnum moose_enum,
const std::string &  doc_string 
)
template<typename T >
void InputParameters::addRequiredRangeCheckedParam ( const std::string &  name,
const std::string &  parsed_function,
const std::string &  doc_string 
)

These methods add an range checked parameters.

A lower and upper bound can be supplied and the supplied parameter will be checked to fall within that range.

Definition at line 1016 of file InputParameters.h.

Referenced by validParams< AnnularMesh >(), validParams< LogConstantDT >(), and validParams< VectorPostprocessorFunction >().

1019 {
1020  addRequiredParam<T>(name, doc_string);
1021  _range_functions[name] = parsed_function;
1022 }
std::map< std::string, std::string > _range_functions
The map of functions used for range checked parameters.
void InputParameters::allowCopy ( bool  status)
inlineprivate

Toggle the availability of the copy constructor.

When MooseObject is created via the Factory this flag is set to false, so when a MooseObject is created if the constructor is not a const reference an error is produced. This method allows the InputParameterWarehouse to disable copying.

Definition at line 681 of file InputParameters.h.

681 { _allow_copy = status; }
bool _allow_copy
A flag for toggling the error message in the copy constructor.
void InputParameters::applyCoupledVar ( const InputParameters common,
const std::string &  var_name 
)

Apply properties of a single coupled variable in common, to a single coupled variable stored in this object.

Parameters
commonThe set of InputParameters from which to extract the coupled variable's properties
var_nameThe name of the coupled variable whose properties are to be applied

In order to apply the properties, both the local parameters and the common parameters must have a coupled variable with name var_name

Definition at line 702 of file InputParameters.C.

Referenced by applyParameters(), and applySpecificParameters().

703 {
704  // Disable the display of deprecated message when applying common parameters, this avoids a dump
705  // of messages
706  _show_deprecated_message = false;
707 
708  // If the local parameters has a coupled variable, populate it with the value from the common
709  // parameters, if the common parameters has the coupled variable too
710  if (hasCoupledValue(var_name))
711  {
712  if (common.hasDefaultCoupledValue(var_name))
713  addCoupledVar(var_name, common.defaultCoupledValue(var_name), common.getDocString(var_name));
714  else if (common.hasCoupledValue(var_name))
715  addCoupledVar(var_name, common.getDocString(var_name));
716  }
717 
718  // Enable deprecated message printing
720 }
bool hasCoupledValue(const std::string &coupling_name) const
Return whether or not the coupled variable exists.
std::string getDocString(const std::string &name) const
Returns the documentation string for the specified parameter name.
bool _show_deprecated_message
Flag for disabling deprecated parameters message, this is used by applyParameters to avoid dumping me...
void addCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
Real defaultCoupledValue(const std::string &coupling_name) const
Get the default value for an optionally coupled variable.
bool hasDefaultCoupledValue(const std::string &coupling_name) const
Return whether or not the requested parameter has a default coupled value.
void InputParameters::applyParameter ( const InputParameters common,
const std::string &  common_name 
)

Apply values from a single parameter in common, to a single parameter stored in this object.

Parameters
commonThe set of InputParameters from which to extract parameters from
common_nameThe name within common from which to get the parameter values

In order to apply common parameter 4 statements must be satisfied (1) A local parameter must exist with the same name as common parameter (2) Common parameter must valid (3) Local parameter must be invalid OR not have been set from its default (4) Both cannot be private

Definition at line 723 of file InputParameters.C.

Referenced by applyParameters(), and applySpecificParameters().

724 {
725  // Disable the display of deprecated message when applying common parameters, this avoids a dump
726  // of messages
727  _show_deprecated_message = false;
728 
729  // Extract the properties from the local parameter for the current common parameter name
730  const bool local_exist = _values.find(common_name) != _values.end();
731  const bool local_set = _set_by_add_param.find(common_name) == _set_by_add_param.end();
732  const bool local_priv = isPrivate(common_name);
733  const bool local_valid = isParamValid(common_name);
734 
735  // Extract the properties from the common parameter
736  const bool common_exist = common._values.find(common_name) != common._values.end();
737  const bool common_priv = common.isPrivate(common_name);
738  const bool common_valid = common.isParamValid(common_name);
739 
740  /* In order to apply common parameter 4 statements must be satisfied
741  * (1) A local parameter must exist with the same name as common parameter
742  * (2) Common parameter must valid and exist
743  * (3) Local parameter must be invalid OR not have been set from its default
744  * (4) Both cannot be private
745  */
746  if (local_exist && common_exist && common_valid && (!local_valid || !local_set) &&
747  (!common_priv || !local_priv))
748  {
749  delete _values[common_name];
750  _values[common_name] = common._values.find(common_name)->second->clone();
751  set_attributes(common_name, false);
752  }
753 
754  // Enable deprecated message printing
756 }
bool _show_deprecated_message
Flag for disabling deprecated parameters message, this is used by applyParameters to avoid dumping me...
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
bool isPrivate(const std::string &name) const
Returns a Boolean indicating whether the specified parameter is private or not.
virtual void set_attributes(const std::string &name, bool inserted_only) override
Override from libMesh to set user-defined attributes on our parameter.
std::set< std::string > _set_by_add_param
If a parameters value was set by addParam, and not set again, it will appear in this list (see applyP...
void InputParameters::applyParameters ( const InputParameters common,
std::vector< std::string >  exclude = std::vector<std::string>() 
)

Method for applying common parameters.

Parameters
commonThe set of parameters to apply to the parameters stored in this object
excludeA vector of parameters to exclude

In order to apply common parameter 4 statements must be satisfied (1) A local parameter must exist with the same name as common parameter (2) Common parameter must valid (3) Local parameter must be invalid OR not have been set from its default (4) Both cannot be private

Output objects have a set of common parameters that are passed down to each of the output objects created. This method is used for applying those common parameters.

See also
CommonOutputAction AddOutputAction

Definition at line 636 of file InputParameters.C.

Referenced by AddOutputAction::act().

638 {
639  // Loop through the common parameters
640  for (const auto & it : common)
641  {
642  // Common parameter name
643  const std::string & common_name = it.first;
644 
645  // Continue to next parameter, if the current is in list of excluded parameters
646  if (std::find(exclude.begin(), exclude.end(), common_name) != exclude.end())
647  continue;
648 
649  applyParameter(common, common_name);
650  }
651 
652  // Loop through the coupled variables
653  for (std::set<std::string>::const_iterator it = common.coupledVarsBegin();
654  it != common.coupledVarsEnd();
655  ++it)
656  {
657  // Variable name
658  const std::string var_name = *it;
659 
660  // Continue to next variable, if the current is in list of excluded parameters
661  if (std::find(exclude.begin(), exclude.end(), var_name) != exclude.end())
662  continue;
663 
664  applyCoupledVar(common, var_name);
665  }
666 }
void applyParameter(const InputParameters &common, const std::string &common_name)
Apply values from a single parameter in common, to a single parameter stored in this object...
void applyCoupledVar(const InputParameters &common, const std::string &var_name)
Apply properties of a single coupled variable in common, to a single coupled variable stored in this ...
void InputParameters::applySpecificParameters ( const InputParameters common,
const std::vector< std::string > &  include 
)

Method for applying common parameters.

Parameters
commonThe set of parameters to apply to the parameters stored in this object
includeA vector of parameters to apply

In order to apply common parameter 4 statements must be satisfied (1) A local parameter must exist with the same name as common parameter (2) Common parameter must valid (3) Local parameter must be invalid OR not have been set from its default (4) Both cannot be private

Output objects have a set of common parameters that are passed down to each of the output objects created. This method is used for applying those common parameters.

See also
CommonOutputAction AddOutputAction

Definition at line 669 of file InputParameters.C.

671 {
672  // Loop through the common parameters
673  for (const auto & it : common)
674  {
675  // Common parameter name
676  const std::string & common_name = it.first;
677 
678  // Continue to next parameter, if the current is not in list of included parameters
679  if (std::find(include.begin(), include.end(), common_name) == include.end())
680  continue;
681 
682  applyParameter(common, common_name);
683  }
684 
685  // Loop through the coupled variables
686  for (std::set<std::string>::const_iterator it = common.coupledVarsBegin();
687  it != common.coupledVarsEnd();
688  ++it)
689  {
690  // Variable name
691  const std::string var_name = *it;
692 
693  // Continue to next variable, if the current is not in list of included parameters
694  if (std::find(include.begin(), include.end(), var_name) == include.end())
695  continue;
696 
697  applyCoupledVar(common, var_name);
698  }
699 }
void applyParameter(const InputParameters &common, const std::string &common_name)
Apply values from a single parameter in common, to a single parameter stored in this object...
void applyCoupledVar(const InputParameters &common, const std::string &var_name)
Apply properties of a single coupled variable in common, to a single coupled variable stored in this ...
bool InputParameters::areAllRequiredParamsValid ( ) const

This method returns true if all of the parameters in this object are valid (i.e.

isParamValid(name) == true - for all parameters)

Definition at line 297 of file InputParameters.C.

Referenced by ActionWarehouse::buildBuildableActions().

298 {
299  for (const auto & it : *this)
300  if (isParamRequired(it.first) && !isParamValid(it.first))
301  return false;
302  return true;
303 }
bool isParamRequired(const std::string &name) const
Returns a boolean indicating whether the specified parameter is required or not.
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
template<typename T >
void InputParameters::checkConsistentType ( const std::string &  name) const

This method checks to make sure that we aren't adding a parameter with the same name but a different type.

It throws a MooseError if an inconsistent type is detected. While this state is supported by libMesh it brings nothing but blood and tears for those who try ;)

Parameters
namethe name of the parameter

Definition at line 1132 of file InputParameters.h.

1133 {
1134  // Do we have a paremeter with the same name but a different type?
1135  InputParameters::const_iterator it = _values.find(name);
1136  if (it != _values.end() && dynamic_cast<const Parameter<T> *>(it->second) == NULL)
1137  mooseError("Attempting to set parameter \"",
1138  name,
1139  "\" with type (",
1140  demangle(typeid(T).name()),
1141  ")\nbut the parameter already exists as type (",
1142  it->second->type(),
1143  ")");
1144 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
void InputParameters::checkParamName ( const std::string &  name) const
private

Make sure the parameter name doesn't have any invalid characters.

Definition at line 992 of file InputParameters.C.

993 {
994  const static pcrecpp::RE valid("[\\w:/]+");
995  if (!valid.FullMatch(name))
996  mooseError("Invalid parameter name: '", name, "'");
997 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
void InputParameters::checkParams ( const std::string &  parsing_syntax)

This function checks parameters stored in the object to make sure they are in the correct state as the user expects: Required parameters are verified as valid meaning that they were either initialized when they were created, or were read from an input file or some other valid source.

Definition at line 391 of file InputParameters.C.

Referenced by FEProblemBase::addInitialCondition(), ActionFactory::create(), AppFactory::create(), and Factory::create().

392 {
393  std::string l_prefix = this->have_parameter<std::string>("parser_syntax")
394  ? this->get<std::string>("parser_syntax")
395  : parsing_syntax;
396 
397  std::ostringstream oss;
398  // Required parameters
399  for (const auto & it : *this)
400  {
401  if (!isParamValid(it.first) && isParamRequired(it.first))
402  {
403  // The parameter is required but missing
404  if (oss.str().empty())
405  oss << "The following required parameters are missing:" << std::endl;
406  oss << l_prefix << "/" << it.first << std::endl;
407  oss << "\tDoc String: \"" + getDocString(it.first) + "\"" << std::endl;
408  }
409  }
410 
411  // Range checked parameters
412  for (const auto & it : *this)
413  {
414  std::string long_name(l_prefix + "/" + it.first);
415 
416  dynamicCastRangeCheck(Real, Real, long_name, it.first, it.second, oss);
417  dynamicCastRangeCheck(int, long, long_name, it.first, it.second, oss);
418  dynamicCastRangeCheck(long, long, long_name, it.first, it.second, oss);
419  dynamicCastRangeCheck(unsigned int, long, long_name, it.first, it.second, oss);
420  }
421 
422  if (!oss.str().empty())
423  mooseError(oss.str());
424 
425  // Controllable parameters
426  for (const auto & param_name : _controllable_params)
427  {
428  // Check that parameter is valid
429  if (!isParamValid(param_name))
430  mooseError("The parameter '",
431  param_name,
432  "' is not a valid parameter for the object ",
433  l_prefix,
434  " thus cannot be marked as controllable.");
435 
436  if (isPrivate(param_name))
437  mooseError("The parameter, '",
438  param_name,
439  "', in ",
440  l_prefix,
441  " is a private parameter and cannot be marked as controllable");
442 
443  checkMooseType(NonlinearVariableName, param_name);
444  checkMooseType(AuxVariableName, param_name);
445  checkMooseType(VariableName, param_name);
446  checkMooseType(BoundaryName, param_name);
447  checkMooseType(SubdomainName, param_name);
448  checkMooseType(PostprocessorName, param_name);
449  checkMooseType(VectorPostprocessorName, param_name);
450  checkMooseType(UserObjectName, param_name);
451  checkMooseType(MaterialPropertyName, param_name);
452  }
453 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
bool isParamRequired(const std::string &name) const
Returns a boolean indicating whether the specified parameter is required or not.
std::string getDocString(const std::string &name) const
Returns the documentation string for the specified parameter name.
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
bool isPrivate(const std::string &name) const
Returns a Boolean indicating whether the specified parameter is private or not.
std::set< std::string > _controllable_params
A list of parameters declared as controllable.
void InputParameters::clear ( )
overridevirtual

Definition at line 59 of file InputParameters.C.

60 {
61  Parameters::clear();
62  _doc_string.clear();
63  _custom_type.clear();
64  _group.clear();
65  _range_functions.clear();
66  _auto_build_vectors.clear();
67  _required_params.clear();
68  _valid_params.clear();
69  _private_params.clear();
70  _coupled_vars.clear();
71  _syntax.clear();
72  _default_coupled_value.clear();
74  _collapse_nesting = false;
77  _allow_copy = true;
78 }
bool _allow_copy
A flag for toggling the error message in the copy constructor.
std::map< std::string, std::string > _custom_type
The custom type that will be printed in the YAML dump for a parameter if supplied.
std::map< std::string, std::string > _doc_string
The documentation strings for each parameter.
std::map< std::string, std::string > _range_functions
The map of functions used for range checked parameters.
std::set< std::string > _required_params
The set of parameters that are required (i.e. will cause an abort if not supplied) ...
std::map< std::string, std::string > _group
The names of the parameters organized into groups.
std::set< std::string > _private_params
The set of parameters that will NOT appear in the the dump of the parser tree.
std::map< std::string, Real > _default_coupled_value
The default value for optionally coupled variables.
bool _show_deprecated_message
Flag for disabling deprecated parameters message, this is used by applyParameters to avoid dumping me...
bool _collapse_nesting
This parameter collapses one level of nesting in the syntax blocks.
std::map< std::string, std::pair< std::string, std::string > > _auto_build_vectors
The map of auto build vectors (base_, 5 -> "base_0 base_1 base_2 base_3 base_4")
std::map< std::string, PostprocessorValue > _default_postprocessor_value
The default value for postprocessors.
std::set< std::string > _valid_params
The set of parameters either explicitly set or provided a default value when added Note: We do not st...
std::set< std::string > _coupled_vars
The coupled variables set.
bool _moose_object_syntax_visibility
This parameter hides derived MOOSE object types from appearing in syntax dumps.
std::map< std::string, std::vector< std::string > > _syntax
Syntax for command-line parameters.
void InputParameters::collapseSyntaxNesting ( bool  collapse)

Mutators for controlling whether or not the outermost level of syntax will be collapsed when printed.

Definition at line 346 of file InputParameters.C.

Referenced by Parser::buildFullTree(), and Parser::buildJsonSyntaxTree().

347 {
348  _collapse_nesting = collapse;
349 }
bool _collapse_nesting
This parameter collapses one level of nesting in the syntax blocks.
bool InputParameters::collapseSyntaxNesting ( ) const

Definition at line 352 of file InputParameters.C.

353 {
354  return _collapse_nesting;
355 }
bool _collapse_nesting
This parameter collapses one level of nesting in the syntax blocks.
std::set<std::string>::const_iterator InputParameters::coupledVarsBegin ( ) const
inline

Methods returning iterators to the coupled variables names stored in this InputParameters object.

Definition at line 488 of file InputParameters.h.

Referenced by Coupleable::Coupleable(), and ScalarCoupleable::ScalarCoupleable().

489  {
490  return _coupled_vars.begin();
491  }
std::set< std::string > _coupled_vars
The coupled variables set.
std::set<std::string>::const_iterator InputParameters::coupledVarsEnd ( ) const
inline

Definition at line 492 of file InputParameters.h.

Referenced by Coupleable::Coupleable(), and ScalarCoupleable::ScalarCoupleable().

493  {
494  return _coupled_vars.end();
495  }
std::set< std::string > _coupled_vars
The coupled variables set.
void InputParameters::declareControllable ( const std::string &  name)

Declare the given parameters as controllable.

Definition at line 312 of file InputParameters.C.

Referenced by validParams< BodyForce >(), validParams< ConstantAux >(), validParams< ConstantFunction >(), validParams< ConstantPointSource >(), validParams< ConstantRate >(), validParams< ConstantScalarAux >(), validParams< Damper >(), validParams< DirichletBC >(), validParams< FunctionValuePostprocessor >(), validParams< NeumannBC >(), validParams< Output >(), validParams< PenaltyDirichletBC >(), and validParams< PresetBC >().

313 {
314  std::vector<std::string> names;
315  MooseUtils::tokenize<std::string>(input_names, names, 1, " ");
316  _controllable_params.insert(names.begin(), names.end());
317 }
std::set< std::string > _controllable_params
A list of parameters declared as controllable.
Real InputParameters::defaultCoupledValue ( const std::string &  coupling_name) const

Get the default value for an optionally coupled variable.

Parameters
coupling_nameThe name of the coupling parameter to get the default value for.

Definition at line 474 of file InputParameters.C.

Referenced by applyCoupledVar(), ScalarCoupleable::getDefaultValue(), Coupleable::getDefaultValue(), and Parser::setVectorParameter().

475 {
476  std::map<std::string, Real>::const_iterator value_it = _default_coupled_value.find(coupling_name);
477 
478  if (value_it == _default_coupled_value.end())
479  mooseError("Attempted to retrieve default value for coupled variable '",
480  coupling_name,
481  "' when none was provided. \n\nThere are three reasons why this may have "
482  "occurred:\n 1. The other version of params.addCoupledVar() should be used in order "
483  "to provide a default value. \n 2. This should have been a required coupled "
484  "variable added with params.addRequiredCoupledVar() \n 3. The call to get the "
485  "coupled value should have been properly guarded with isCoupled()\n");
486 
487  return value_it->second;
488 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::map< std::string, Real > _default_coupled_value
The default value for optionally coupled variables.
void InputParameters::defaultCoupledValue ( const std::string &  coupling_name,
Real  value 
)

Set the default value for an optionally coupled variable (called by the Parser).

Parameters
coupling_nameThe name of the coupling parameter to get the default value for.
valueDefault value to set.

Definition at line 468 of file InputParameters.C.

469 {
470  _default_coupled_value[coupling_name] = value;
471 }
std::map< std::string, Real > _default_coupled_value
The default value for optionally coupled variables.
const std::map< std::string, std::pair< std::string, std::string > > & InputParameters::getAutoBuildVectors ( ) const

Returns the auto build vectors for all parameters.

Definition at line 491 of file InputParameters.C.

492 {
493  return _auto_build_vectors;
494 }
std::map< std::string, std::pair< std::string, std::string > > _auto_build_vectors
The map of auto build vectors (base_, 5 -> "base_0 base_1 base_2 base_3 base_4")
const std::vector< std::string > & InputParameters::getBuildableTypes ( ) const

Returns the list of buildable types as a std::vector<std::string>

Definition at line 340 of file InputParameters.C.

Referenced by Parser::buildFullTree(), and Parser::buildJsonSyntaxTree().

341 {
342  return _buildable_types;
343 }
std::vector< std::string > _buildable_types
The parameter is used to restrict types that can be built.
template<typename T >
T InputParameters::getCheckedPointerParam ( const std::string &  name,
const std::string &  error_string = "" 
) const

Verifies that the requested parameter exists and is not NULL and returns it to the caller.

The template parameter must be a pointer or an error will be thrown.

Definition at line 943 of file InputParameters.h.

Referenced by Executioner::addAttributeReporter().

945 {
946  T param = this->get<T>(name);
947 
948  // Note: You will receive a compile error on this line if you attempt to pass a non-pointer
949  // template type to this method
950  if (param == NULL)
951  mooseError("Parameter ", name, " is NULL.\n", error_string);
952  return this->get<T>(name);
953 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string InputParameters::getClassDescription ( ) const

Returns the class description.

Definition at line 115 of file InputParameters.C.

Referenced by JsonSyntaxTree::addParameters().

116 {
117  std::map<std::string, std::string>::const_iterator pos = _doc_string.find("_class");
118  if (pos != _doc_string.end())
119  return pos->second;
120  else
121  return std::string();
122 }
std::map< std::string, std::string > _doc_string
The documentation strings for each parameter.
const std::set<std::string>& InputParameters::getControllableParameters ( ) const
inline

Return list of controllable parameters.

Definition at line 654 of file InputParameters.h.

654 { return _controllable_params; }
std::set< std::string > _controllable_params
A list of parameters declared as controllable.
const std::set<std::string>& InputParameters::getCoupledVariableParamNames ( ) const
inline

Return the coupled variable parameter names.

Definition at line 500 of file InputParameters.h.

500 { return _coupled_vars; }
std::set< std::string > _coupled_vars
The coupled variables set.
const PostprocessorValue & InputParameters::getDefaultPostprocessorValue ( const std::string &  name,
bool  suppress_error = false 
) const

Get the default value for a postprocessor added with addPostprocessor.

Parameters
nameThe name of the postprocessor
suppress_errorIf true, the error check is suppressed
Returns
The default value for the postprocessor

Definition at line 610 of file InputParameters.C.

Referenced by PostprocessorInterface::getDefaultPostprocessorValue(), PostprocessorInterface::getPostprocessorValue(), PostprocessorInterface::getPostprocessorValueOld(), and PostprocessorInterface::getPostprocessorValueOlder().

611 {
612  // Check that a default exists, error if it does not
613  std::map<std::string, PostprocessorValue>::const_iterator it =
614  _default_postprocessor_value.find(name);
615  if (!(suppress_error || it != _default_postprocessor_value.end()))
616  mooseError("A default PostprcessorValue does not exist for the given name: ", name);
617 
618  // Return the value
619  return it->second;
620 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::map< std::string, PostprocessorValue > _default_postprocessor_value
The default value for postprocessors.
const std::string & InputParameters::getDescription ( const std::string &  name)

Get the documentation string for a parameter.

Definition at line 778 of file InputParameters.C.

779 {
780  if (_doc_string.find(name) == _doc_string.end())
781  mooseError("No parameter exists with the name ", name);
782  return _doc_string[name];
783 }
std::map< std::string, std::string > _doc_string
The documentation strings for each parameter.
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string InputParameters::getDocString ( const std::string &  name) const

Returns the documentation string for the specified parameter name.

Definition at line 245 of file InputParameters.C.

Referenced by applyCoupledVar(), and checkParams().

246 {
247  std::string doc_string;
248  std::map<std::string, std::string>::const_iterator doc_string_it = _doc_string.find(name);
249  if (doc_string_it != _doc_string.end())
250  for (const auto & ch : doc_string_it->second)
251  {
252  if (ch == '\n')
253  doc_string += " ... ";
254  else
255  doc_string += ch;
256  }
257 
258  return doc_string;
259 }
std::map< std::string, std::string > _doc_string
The documentation strings for each parameter.
std::string InputParameters::getGroupName ( const std::string &  param_name) const

This method retrieves the group name for the passed parameter name if one exists.

Otherwise an empty string is returned.

Definition at line 599 of file InputParameters.C.

600 {
601  std::map<std::string, std::string>::const_iterator it = _group.find(param_name);
602 
603  if (it != _group.end())
604  return it->second;
605  else
606  return std::string();
607 }
std::map< std::string, std::string > _group
The names of the parameters organized into groups.
std::string InputParameters::getMooseType ( const std::string &  name) const

Utility functions for retrieving one of the MooseTypes variables into the common "string" base class.

Scalar and Vector versions are supplied

Definition at line 508 of file InputParameters.C.

Referenced by BlockRestrictable::initializeBlockRestrictable(), and MooseVariableInterface::MooseVariableInterface().

509 {
510  std::string var;
511 
512  if (have_parameter<VariableName>(name))
513  var = get<VariableName>(name);
514  else if (have_parameter<NonlinearVariableName>(name))
515  var = get<NonlinearVariableName>(name);
516  else if (have_parameter<AuxVariableName>(name))
517  var = get<AuxVariableName>(name);
518  else if (have_parameter<PostprocessorName>(name))
519  var = get<PostprocessorName>(name);
520  else if (have_parameter<VectorPostprocessorName>(name))
521  var = get<VectorPostprocessorName>(name);
522  else if (have_parameter<FunctionName>(name))
523  var = get<FunctionName>(name);
524  else if (have_parameter<UserObjectName>(name))
525  var = get<UserObjectName>(name);
526  else if (have_parameter<MaterialPropertyName>(name))
527  var = get<MaterialPropertyName>(name);
528  else if (have_parameter<std::string>(name))
529  var = get<std::string>(name);
530 
531  return var;
532 }
template<typename T >
const T & InputParameters::getParamHelper ( const std::string &  name,
const InputParameters pars,
const T *  the_type 
)
static

Definition at line 1275 of file InputParameters.h.

Referenced by MooseObject::getParam(), Action::getParam(), and MooseApp::getParam().

1276 {
1277  if (!pars.isParamValid(name))
1278  mooseError("The parameter \"", name, "\" is being retrieved before being set.\n");
1279  return pars.get<T>(name);
1280 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
template<typename T >
const std::vector< T > & InputParameters::getParamHelper ( const std::string &  name,
const InputParameters pars,
const std::vector< T > *  the_type 
)
static

Definition at line 1297 of file InputParameters.h.

1300 {
1301  return pars.get<std::vector<T>>(name);
1302 }
template<>
const MooseEnum& InputParameters::getParamHelper ( const std::string &  name,
const InputParameters pars,
const MooseEnum  
)

Definition at line 959 of file InputParameters.C.

962 {
963  return pars.get<MooseEnum>(name);
964 }
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:37
template<>
const MultiMooseEnum& InputParameters::getParamHelper ( const std::string &  name,
const InputParameters pars,
const MultiMooseEnum  
)

Definition at line 968 of file InputParameters.C.

971 {
972  return pars.get<MultiMooseEnum>(name);
973 }
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
template<>
const MooseEnum& InputParameters::getParamHelper ( const std::string &  name,
const InputParameters pars,
const MooseEnum  
)
template<>
const MultiMooseEnum& InputParameters::getParamHelper ( const std::string &  name,
const InputParameters pars,
const MultiMooseEnum  
)
std::vector< std::string > InputParameters::getSyntax ( const std::string &  name)

Get the syntax for a command-line parameter.

Definition at line 593 of file InputParameters.C.

594 {
595  return _syntax[name];
596 }
std::map< std::string, std::vector< std::string > > _syntax
Syntax for command-line parameters.
std::vector< std::string > InputParameters::getVecMooseType ( const std::string &  name) const

Definition at line 535 of file InputParameters.C.

Referenced by Coupleable::Coupleable(), MooseVariableInterface::MooseVariableInterface(), and ScalarCoupleable::ScalarCoupleable().

536 {
537  std::vector<std::string> svars;
538 
539  if (have_parameter<std::vector<VariableName>>(name))
540  {
541  std::vector<VariableName> vars = get<std::vector<VariableName>>(name);
542  std::copy(vars.begin(), vars.end(), std::back_inserter(svars));
543  }
544  else if (have_parameter<std::vector<NonlinearVariableName>>(name))
545  {
546  std::vector<NonlinearVariableName> vars = get<std::vector<NonlinearVariableName>>(name);
547  std::copy(vars.begin(), vars.end(), std::back_inserter(svars));
548  }
549  else if (have_parameter<std::vector<AuxVariableName>>(name))
550  {
551  std::vector<AuxVariableName> vars = get<std::vector<AuxVariableName>>(name);
552  std::copy(vars.begin(), vars.end(), std::back_inserter(svars));
553  }
554  else if (have_parameter<std::vector<MaterialPropertyName>>(name))
555  {
556  std::vector<MaterialPropertyName> vars = get<std::vector<MaterialPropertyName>>(name);
557  std::copy(vars.begin(), vars.end(), std::back_inserter(svars));
558  }
559  else if (have_parameter<std::vector<std::string>>(name))
560  {
561  std::vector<std::string> vars = get<std::vector<std::string>>(name);
562  std::copy(vars.begin(), vars.end(), std::back_inserter(svars));
563  }
564 
565  return svars;
566 }
bool InputParameters::hasCoupledValue ( const std::string &  coupling_name) const

Return whether or not the coupled variable exists.

Parameters
coupling_nameThe name of the coupled variable to test for
Returns
True if the variable exists in the coupled variables for this InputParameters object

Definition at line 456 of file InputParameters.C.

Referenced by applyCoupledVar(), Coupleable::isCoupled(), and ScalarCoupleable::isCoupledScalar().

457 {
458  return _coupled_vars.find(coupling_name) != _coupled_vars.end();
459 }
std::set< std::string > _coupled_vars
The coupled variables set.
bool InputParameters::hasDefaultCoupledValue ( const std::string &  coupling_name) const

Return whether or not the requested parameter has a default coupled value.

Parameters
coupling_nameThe name of the coupling parameter to get the default value for.

Definition at line 462 of file InputParameters.C.

Referenced by applyCoupledVar().

463 {
464  return _default_coupled_value.find(coupling_name) != _default_coupled_value.end();
465 }
std::map< std::string, Real > _default_coupled_value
The default value for optionally coupled variables.
bool InputParameters::hasDefaultPostprocessorValue ( const std::string &  name) const

Returns true if a default PostprocessorValue is defined.

Parameters
nameThe name of the postprocessor
Returns
True if a default value exists

Definition at line 630 of file InputParameters.C.

Referenced by PostprocessorInterface::getPostprocessorValue(), PostprocessorInterface::getPostprocessorValueOld(), and PostprocessorInterface::getPostprocessorValueOlder().

631 {
633 }
std::map< std::string, PostprocessorValue > _default_postprocessor_value
The default value for postprocessors.
bool InputParameters::isControllable ( const std::string &  name)

Returns a Boolean indicating whether the specified parameter is controllable.

Definition at line 320 of file InputParameters.C.

321 {
322  return _controllable_params.find(name) != _controllable_params.end();
323 }
std::set< std::string > _controllable_params
A list of parameters declared as controllable.
bool InputParameters::isParamRequired ( const std::string &  name) const

Returns a boolean indicating whether the specified parameter is required or not.

Definition at line 274 of file InputParameters.C.

Referenced by areAllRequiredParamsValid(), and checkParams().

275 {
276  return _required_params.find(name) != _required_params.end();
277 }
std::set< std::string > _required_params
The set of parameters that are required (i.e. will cause an abort if not supplied) ...
bool InputParameters::isParamSetByAddParam ( const std::string &  name) const

Returns whether or not the parameter was set due to addParam.

If not then it was either set programmatically or was read through the input file.

Definition at line 291 of file InputParameters.C.

Referenced by Transient::init().

292 {
293  return _set_by_add_param.find(name) != _set_by_add_param.end();
294 }
std::set< std::string > _set_by_add_param
If a parameters value was set by addParam, and not set again, it will appear in this list (see applyP...
bool InputParameters::isParamSetByUser ( const std::string &  name) const

Method returns true if the parameter was by the user.

Parameters
nameThe parameter name

Definition at line 767 of file InputParameters.C.

Referenced by Console::Console(), Console::initialSetup(), InterfaceKernel::InterfaceKernel(), paramSetByUser(), Transient::setupTimeIntegrator(), and Transient::Transient().

768 {
769  if (!isParamValid(name))
770  // if the parameter is invalid, it is for sure not set by the user
771  return false;
772  else
773  // If the parameters is not located in the list, then it was set by the user
774  return _set_by_add_param.find(name) == _set_by_add_param.end();
775 }
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
std::set< std::string > _set_by_add_param
If a parameters value was set by addParam, and not set again, it will appear in this list (see applyP...
bool InputParameters::isParamValid ( const std::string &  name) const

This method returns parameters that have been initialized in one fashion or another, i.e.

The value was supplied as a default argument or read and properly converted from the input file

Definition at line 280 of file InputParameters.C.

Referenced by DetermineSystemType::act(), AddPeriodicBCAction::act(), JsonSyntaxTree::addParameters(), applyParameter(), areAllRequiredParamsValid(), BoundsAux::BoundsAux(), checkParams(), AppFactory::create(), FileRangeBuilder::FileRangeBuilder(), GapValueAux::GapValueAux(), MooseApp::getCheckpointFiles(), getParamHelper(), InterfaceKernel::InterfaceKernel(), isParamSetByUser(), MooseObject::isParamValid(), Action::isParamValid(), MooseApp::isParamValid(), LayeredBase::LayeredBase(), MaterialPropertyInterface::MaterialPropertyInterface(), AddExtraNodeset::modify(), NodeFaceConstraint::NodeFaceConstraint(), PenetrationAux::PenetrationAux(), PiecewiseBilinear::PiecewiseBilinear(), PiecewiseLinearInterpolationMaterial::PiecewiseLinearInterpolationMaterial(), Restartable::Restartable(), ImageSampler::setupImageSampler(), SetupMeshAction::setupMesh(), Moose::PetscSupport::storePetscOptions(), Moose::SlepcSupport::storeSlepcOptions(), validParams< BlockRestrictable >(), validParams< BoundaryRestrictable >(), validParams< BoundaryRestrictableRequired >(), ImageSampler::vtkMagnitude(), and ImageSampler::vtkThreshold().

281 {
282  if (have_parameter<MooseEnum>(name))
283  return get<MooseEnum>(name).isValid();
284  else if (have_parameter<MultiMooseEnum>(name))
285  return get<MultiMooseEnum>(name).isValid();
286  else
287  return _valid_params.find(name) != _valid_params.end();
288 }
std::set< std::string > _valid_params
The set of parameters either explicitly set or provided a default value when added Note: We do not st...
bool InputParameters::isPrivate ( const std::string &  name) const

Returns a Boolean indicating whether the specified parameter is private or not.

Definition at line 306 of file InputParameters.C.

Referenced by applyParameter(), and checkParams().

307 {
308  return _private_params.find(name) != _private_params.end();
309 }
std::set< std::string > _private_params
The set of parameters that will NOT appear in the the dump of the parser tree.
template<typename T >
void InputParameters::makeParamRequired ( const std::string &  name)

Changes the parameter to be required.

Parameters
nameThe parameter name
void InputParameters::markControlled ( const std::string &  name)

Marker a parameter that has been changed by the Control system (this is for output purposes)

void InputParameters::mooseObjectSyntaxVisibility ( bool  visibility)

Mutators for controlling whether or not the outermost level of syntax will be collapsed when printed.

Definition at line 358 of file InputParameters.C.

Referenced by Parser::buildFullTree(), Parser::buildJsonSyntaxTree(), and validParams< DetermineSystemType >().

359 {
360  _moose_object_syntax_visibility = visibility;
361 }
bool _moose_object_syntax_visibility
This parameter hides derived MOOSE object types from appearing in syntax dumps.
bool InputParameters::mooseObjectSyntaxVisibility ( ) const

Definition at line 364 of file InputParameters.C.

365 {
367 }
bool _moose_object_syntax_visibility
This parameter hides derived MOOSE object types from appearing in syntax dumps.
InputParameters & InputParameters::operator+= ( const InputParameters rhs)

Definition at line 168 of file InputParameters.C.

169 {
170  Parameters::operator+=(rhs);
171 
172  _doc_string.insert(rhs._doc_string.begin(), rhs._doc_string.end());
173  _custom_type.insert(rhs._custom_type.begin(), rhs._custom_type.end());
174  _group.insert(rhs._group.begin(), rhs._group.end());
175  _range_functions.insert(rhs._range_functions.begin(), rhs._range_functions.end());
176  _auto_build_vectors.insert(rhs._auto_build_vectors.begin(), rhs._auto_build_vectors.end());
177  _buildable_types.insert(
178  _buildable_types.end(), rhs._buildable_types.begin(), rhs._buildable_types.end());
179  // Collapse nesting and moose object syntax hiding are not modified with +=
180  _required_params.insert(rhs._required_params.begin(), rhs._required_params.end());
181  _private_params.insert(rhs._private_params.begin(), rhs._private_params.end());
182  _valid_params.insert(rhs._valid_params.begin(), rhs._valid_params.end());
183  _coupled_vars.insert(rhs._coupled_vars.begin(), rhs._coupled_vars.end());
184  _syntax.insert(rhs._syntax.begin(), rhs._syntax.end());
186  rhs._default_coupled_value.end());
188  rhs._default_postprocessor_value.end());
189  _set_by_add_param.insert(rhs._set_by_add_param.begin(), rhs._set_by_add_param.end());
190  _controllable_params.insert(rhs._controllable_params.begin(), rhs._controllable_params.end());
191  _reserved_values.insert(rhs._reserved_values.begin(), rhs._reserved_values.end());
192  return *this;
193 }
std::map< std::string, std::string > _custom_type
The custom type that will be printed in the YAML dump for a parameter if supplied.
std::map< std::string, std::string > _doc_string
The documentation strings for each parameter.
std::map< std::string, std::string > _range_functions
The map of functions used for range checked parameters.
std::set< std::string > _required_params
The set of parameters that are required (i.e. will cause an abort if not supplied) ...
std::map< std::string, std::string > _group
The names of the parameters organized into groups.
std::set< std::string > _private_params
The set of parameters that will NOT appear in the the dump of the parser tree.
std::map< std::string, Real > _default_coupled_value
The default value for optionally coupled variables.
std::map< std::string, std::pair< std::string, std::string > > _auto_build_vectors
The map of auto build vectors (base_, 5 -> "base_0 base_1 base_2 base_3 base_4")
std::map< std::string, PostprocessorValue > _default_postprocessor_value
The default value for postprocessors.
std::set< std::string > _valid_params
The set of parameters either explicitly set or provided a default value when added Note: We do not st...
std::set< std::string > _coupled_vars
The coupled variables set.
std::set< std::string > _controllable_params
A list of parameters declared as controllable.
std::vector< std::string > _buildable_types
The parameter is used to restrict types that can be built.
std::map< std::string, std::set< std::string > > _reserved_values
The reserved option names for a parameter.
std::map< std::string, std::vector< std::string > > _syntax
Syntax for command-line parameters.
std::set< std::string > _set_by_add_param
If a parameters value was set by addParam, and not set again, it will appear in this list (see applyP...
InputParameters & InputParameters::operator= ( const InputParameters rhs)

Definition at line 125 of file InputParameters.C.

126 {
127  // An error to help minimize the segmentation faults that occure when MooseObjects do not have the
128  // correct constructor
129  if (!rhs._allow_copy)
130  {
131  const std::string & name =
132  rhs.get<std::string>("_object_name"); // If _allow_parameter_copy is set then so is name
133  // (see InputParameterWarehouse::addInputParameters)
134  mooseError("Copying of the InputParameters object for the ",
135  name,
136  " object is not allowed.\n\nThe likely cause for this error ",
137  "is having a constructor that does not use a const reference, all constructors\nfor "
138  "MooseObject based classes should be as follows:\n\n",
139  " MyObject::MyObject(const InputParameters & parameters);");
140  }
141 
142  Parameters::operator=(rhs);
143 
144  _doc_string = rhs._doc_string;
146  _group = rhs._group;
156  _syntax = rhs._syntax;
160  _allow_copy = rhs._allow_copy;
163 
164  return *this;
165 }
bool _allow_copy
A flag for toggling the error message in the copy constructor.
std::map< std::string, std::string > _custom_type
The custom type that will be printed in the YAML dump for a parameter if supplied.
std::map< std::string, std::string > _doc_string
The documentation strings for each parameter.
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::map< std::string, std::string > _range_functions
The map of functions used for range checked parameters.
std::set< std::string > _required_params
The set of parameters that are required (i.e. will cause an abort if not supplied) ...
std::map< std::string, std::string > _group
The names of the parameters organized into groups.
std::set< std::string > _private_params
The set of parameters that will NOT appear in the the dump of the parser tree.
std::map< std::string, Real > _default_coupled_value
The default value for optionally coupled variables.
bool _collapse_nesting
This parameter collapses one level of nesting in the syntax blocks.
std::map< std::string, std::pair< std::string, std::string > > _auto_build_vectors
The map of auto build vectors (base_, 5 -> "base_0 base_1 base_2 base_3 base_4")
std::map< std::string, PostprocessorValue > _default_postprocessor_value
The default value for postprocessors.
std::set< std::string > _valid_params
The set of parameters either explicitly set or provided a default value when added Note: We do not st...
std::set< std::string > _coupled_vars
The coupled variables set.
std::set< std::string > _controllable_params
A list of parameters declared as controllable.
std::vector< std::string > _buildable_types
The parameter is used to restrict types that can be built.
bool _moose_object_syntax_visibility
This parameter hides derived MOOSE object types from appearing in syntax dumps.
std::map< std::string, std::set< std::string > > _reserved_values
The reserved option names for a parameter.
std::map< std::string, std::vector< std::string > > _syntax
Syntax for command-line parameters.
std::set< std::string > _set_by_add_param
If a parameters value was set by addParam, and not set again, it will appear in this list (see applyP...
bool InputParameters::paramSetByUser ( const std::string &  name) const

Deprecated method.

Use isParamSetByUser() instead.

Definition at line 760 of file InputParameters.C.

761 {
762  mooseDeprecated("paramSetByUser() is deprecated. Use isParamSetByUser() instead.");
763  return isParamSetByUser(name);
764 }
bool isParamSetByUser(const std::string &name) const
Method returns true if the parameter was by the user.
void mooseDeprecated(Args &&...args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:202
template<typename T , typename UP_T >
void InputParameters::rangeCheck ( const std::string &  full_name,
const std::string &  short_name,
InputParameters::Parameter< T > *  param,
std::ostream &  oss = Moose::out 
)

Runs a range on the supplied parameter if it exists and throws an error if that check fails.

Returns
Boolean indicating whether range check exists

Definition at line 902 of file InputParameters.h.

Referenced by Parser::setScalarValueTypeParameter().

906 {
907  mooseAssert(param, "Parameter is NULL");
908 
909  if (_range_functions.find(short_name) == _range_functions.end() || !isParamValid(short_name))
910  return;
911 
912  // Parse the expression
914  if (fp.Parse(_range_functions[short_name], short_name) != -1) // -1 for success
915  {
916  oss << "Error parsing expression: " << _range_functions[short_name] << '\n';
917  return;
918  }
919 
920  // ensure range-checked input file parameter comparison functions
921  // do absolute floating point comparisons instead of using a default epsilon.
922  auto tmp_eps = fp.epsilon();
923  fp.setEpsilon(0);
924  // We require a non-const value for the implicit upscaling of the parameter type
925  std::vector<UP_T> value(1, param->set());
926  UP_T result = fp.Eval(&value[0]);
927  fp.setEpsilon(tmp_eps);
928 
929  if (fp.EvalError())
930  {
931  oss << "Error evaluating expression: " << _range_functions[short_name]
932  << "\nPerhaps you used the wrong variable name?\n";
933  return;
934  }
935 
936  if (!result)
937  oss << "Range check failed for parameter " << full_name
938  << "\n\tExpression: " << _range_functions[short_name] << "\n\tValue: " << value[0] << '\n';
939 }
std::map< std::string, std::string > _range_functions
The map of functions used for range checked parameters.
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
template<typename T , typename UP_T >
void InputParameters::rangeCheck ( const std::string &  full_name,
const std::string &  short_name,
InputParameters::Parameter< std::vector< T >> *  param,
std::ostream &  oss = Moose::out 
)

Automatically detect the variables used in the range checking expression. We allow the following variables (where snam is the short_name of the parameter)

snam : tests every component in the vector 'snam > 0' snam_size : the size of the vector 'snam_size = 5' snam_i : where i is a number from 0 to sname_size-1 tests a specific component 'snam_0 > snam_1'

Definition at line 789 of file InputParameters.h.

793 {
794  mooseAssert(param, "Parameter is NULL");
795 
796  if (_range_functions.count(short_name) == 0 || !isParamValid(short_name))
797  return;
798 
811  std::vector<std::string> vars;
812  if (fp.ParseAndDeduceVariables(_range_functions[short_name], vars) != -1) // -1 for success
813  {
814  oss << "Error parsing expression: " << _range_functions[short_name] << '\n';
815  return;
816  }
817 
818  // Fparser parameter buffer
819  std::vector<UP_T> parbuf(vars.size());
820 
821  // parameter vector
822  const std::vector<T> & value = param->set();
823 
824  // iterate over all vector values (maybe ;)
825  bool need_to_iterate = false;
826  unsigned int i = 0;
827  do
828  {
829  // set parameters
830  for (unsigned int j = 0; j < vars.size(); j++)
831  {
832  if (vars[j] == short_name)
833  {
834  if (value.size() == 0)
835  {
836  oss << "Range checking empty vector: " << _range_functions[short_name] << '\n';
837  return;
838  }
839 
840  parbuf[j] = value[i];
841  need_to_iterate = true;
842  }
843  else if (vars[j] == short_name + "_size")
844  parbuf[j] = value.size();
845  else
846  {
847  if (vars[j].substr(0, short_name.size() + 1) != short_name + "_")
848  {
849  oss << "Error parsing expression: " << _range_functions[short_name] << '\n';
850  return;
851  }
852  std::istringstream iss(vars[j]);
853  iss.seekg(short_name.size() + 1);
854 
855  size_t index;
856  if (iss >> index && iss.eof())
857  {
858  if (index >= value.size())
859  {
860  oss << "Error parsing expression: " << _range_functions[short_name]
861  << "\nOut of range variable " << vars[j] << '\n';
862  return;
863  }
864  parbuf[j] = value[index];
865  }
866  else
867  {
868  oss << "Error parsing expression: " << _range_functions[short_name]
869  << "\nInvalid variable " << vars[j] << '\n';
870  return;
871  }
872  }
873  }
874 
875  // ensure range-checked input file parameter comparison functions
876  // do absolute floating point comparisons instead of using a default epsilon.
877  auto tmp_eps = fp.epsilon();
878  fp.setEpsilon(0);
879  UP_T result = fp.Eval(&parbuf[0]);
880  fp.setEpsilon(tmp_eps);
881 
882  // test function using the parameters determined above
883  if (fp.EvalError())
884  {
885  oss << "Error evaluating expression: " << _range_functions[short_name] << '\n';
886  return;
887  }
888 
889  if (!result)
890  {
891  oss << "Range check failed for parameter " << full_name
892  << "\n\tExpression: " << _range_functions[short_name] << "\n";
893  if (need_to_iterate)
894  oss << "\t Component: " << i << '\n';
895  }
896 
897  } while (need_to_iterate && ++i < value.size());
898 }
std::map< std::string, std::string > _range_functions
The map of functions used for range checked parameters.
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
void InputParameters::registerBase ( const std::string &  value)

This method must be called from every base "Moose System" to create linkage with the Action System.

See "Moose.C" for the registerMooseObjectTask() calls.

Definition at line 326 of file InputParameters.C.

Referenced by validParams< Control >(), validParams< Damper >(), validParams< Distribution >(), validParams< EigenKernel >(), validParams< Executioner >(), validParams< Function >(), validParams< Kernel >(), validParams< MeshModifier >(), validParams< MooseMesh >(), validParams< MoosePartitioner >(), validParams< MoosePreconditioner >(), validParams< Output >(), validParams< Predictor >(), validParams< Problem >(), validParams< ScalarInitialCondition >(), validParams< Split >(), validParams< TimeIntegrator >(), and validParams< TimeStepper >().

327 {
328  InputParameters::set<std::string>("_moose_base") = value;
329  _private_params.insert("_moose_base");
330 }
std::set< std::string > _private_params
The set of parameters that will NOT appear in the the dump of the parser tree.
void InputParameters::registerBuildableTypes ( const std::string &  names)

This method is here to indicate which Moose types a particular Action may build.

It takes a space delimited list of registered MooseObjects. TODO: For now we aren't actually checking this list when we build objects. Since individual actions can do whatever they want it's not exactly trivial to check this without changing the user API. This function properly restricts the syntax and yaml dumps.

Definition at line 333 of file InputParameters.C.

334 {
335  _buildable_types.clear();
336  MooseUtils::tokenize(names, _buildable_types, 1, " \t\n\v\f\r"); // tokenize on whitespace
337 }
void tokenize(const std::string &str, std::vector< T > &elements, unsigned int min_len=1, const std::string &delims="/")
This function will split the passed in string on a set of delimiters appending the substrings to the ...
Definition: MooseUtils.h:350
std::vector< std::string > _buildable_types
The parameter is used to restrict types that can be built.
std::set< std::string > InputParameters::reservedValues ( const std::string &  name) const

Get a set of reserved parameter values.

Returns a set by value since we can return an empty set.

Definition at line 982 of file InputParameters.C.

983 {
984  auto it = _reserved_values.find(name);
985  if (it == _reserved_values.end())
986  return std::set<std::string>();
987  else
988  return it->second;
989 }
std::map< std::string, std::set< std::string > > _reserved_values
The reserved option names for a parameter.
template<typename T >
T & InputParameters::set ( const std::string &  name,
bool  quiet_mode = false 
)

Returns a writable reference to the named parameters.

Note: This is not a virtual function! Use caution when comparing to the parent class implementation

Parameters
nameThe name of the parameter to set
quiet_modeWhen true the parameter is not removed from the _set_by_add_param list, this is generally not needed.

"quite_mode" returns a writable reference to the named parameter, without removing it from the _set_by_add_param list. Using this method of set will make the parameter to continue to behave if its value where set ONLY by addParam and not by any other method.

This was added for handling parameters in the Output objects that have behavior dependent on whether the user modified the parameters.

Definition at line 771 of file InputParameters.h.

Referenced by AB2PredictorCorrector::AB2PredictorCorrector(), AddICAction::act(), CreateExecutionerAction::act(), PartitionerAction::act(), AddFieldSplitAction::act(), AddMeshModifierAction::act(), CreateProblemAction::act(), CreateDisplacedProblemAction::act(), SetupPreconditionerAction::act(), SetupPredictorAction::act(), SetupTimeStepperAction::act(), SetupResidualDebugAction::act(), MaterialDerivativeTestAction::act(), SetupDebugAction::act(), AddOutputAction::act(), CommonOutputAction::act(), AddNodalNormalsAction::act(), Executioner::addAttributeReporter(), FEProblemBase::addAuxKernel(), FEProblemBase::addAuxScalarKernel(), FEProblemBase::addBoundaryCondition(), FEProblemBase::addConstraint(), FEProblemBase::addDamper(), FEProblemBase::addDGKernel(), FEProblemBase::addDiracKernel(), FEProblemBase::addDistribution(), FEProblemBase::addFunction(), FEProblemBase::addIndicator(), FEProblemBase::addInitialCondition(), FEProblemBase::addInterfaceKernel(), MooseEigenSystem::addKernel(), AuxiliarySystem::addKernel(), FEProblemBase::addKernel(), FEProblemBase::addMarker(), FEProblemBase::addMaterial(), FEProblemBase::addMultiApp(), FEProblemBase::addNodalKernel(), FEProblemBase::addPredictor(), FEProblemBase::addScalarKernel(), AuxiliarySystem::addTimeIntegrator(), NonlinearSystemBase::addTimeIntegrator(), FEProblemBase::addTimeIntegrator(), FEProblemBase::addTransfer(), FEProblemBase::addUserObject(), AStableDirk4::AStableDirk4(), ActionWarehouse::buildBuildableActions(), Parser::buildFullTree(), Parser::buildJsonSyntaxTree(), OversampleOutput::cloneMesh(), CommonOutputAction::create(), ActionFactory::create(), AppFactory::create(), MaterialOutputAction::createAction(), AppFactory::createApp(), MultiApp::createApp(), AddVariableAction::createInitialConditionAction(), MooseApp::createMinimalApp(), SetupDebugAction::createOutputAction(), FEProblemBase::getFunction(), Moose::SlepcSupport::getSlepcValidParams(), Transient::init(), MultiAppProjectionTransfer::projectSolution(), removeSpecialOption(), GlobalParamsAction::setDoubleIndexParam(), Parser::setFilePathParam(), FEProblem::setInputParametersFEProblem(), FEProblemBase::setInputParametersFEProblem(), GlobalParamsAction::setScalarParam(), SetupDebugAction::SetupDebugAction(), MooseApp::setupOptions(), Parser::setVectorFilePathParam(), GlobalParamsAction::setVectorParam(), validParams< ControlOutput >(), validParams< ConvectiveFluxBC >(), validParams< CoupledTiedValueConstraint >(), validParams< CreateProblemAction >(), validParams< CSVReader >(), validParams< DiscreteElementUserObject >(), validParams< DOFMapOutput >(), validParams< GapValueAux >(), validParams< MultiAppTransfer >(), validParams< NearestNodeDistanceAux >(), validParams< NearestNodeValueAux >(), validParams< NodalL2Norm >(), validParams< NodalNormalBC >(), validParams< NodalNormalsEvaluator >(), validParams< NodalSum >(), validParams< PenetrationAux >(), validParams< PerflogDumper >(), validParams< ScalarConstantIC >(), validParams< SetupMeshAction >(), validParams< SinDirichletBC >(), validParams< TiedValueConstraint >(), validParams< TopResidualDebugOutput >(), validParams< Transfer >(), validParams< TwoMaterialPropertyInterface >(), validParams< UserObject >(), validParams< VariableResidualNormsDebugOutput >(), validParams< VTKOutput >(), and Parser::walkRaw().

772 {
773  checkParamName(name);
774  checkConsistentType<T>(name);
775 
776  if (!this->have_parameter<T>(name))
777  _values[name] = new Parameter<T>;
778 
779  set_attributes(name, false);
780 
781  if (quiet_mode)
782  _set_by_add_param.insert(name);
783 
784  return cast_ptr<Parameter<T> *>(_values[name])->set();
785 }
void checkParamName(const std::string &name) const
Make sure the parameter name doesn&#39;t have any invalid characters.
virtual void set_attributes(const std::string &name, bool inserted_only) override
Override from libMesh to set user-defined attributes on our parameter.
std::set< std::string > _set_by_add_param
If a parameters value was set by addParam, and not set again, it will appear in this list (see applyP...
void InputParameters::set_attributes ( const std::string &  name,
bool  inserted_only 
)
overridevirtual

Override from libMesh to set user-defined attributes on our parameter.

"_set_by_add_param" and "_deprecated_params" are not populated until after the default value has already been set in libMesh (first callback to this method). Therefore if a variable is in/not in one of these sets, you can be assured it was put there outside of the "addParam*()" calls.

Definition at line 87 of file InputParameters.C.

Referenced by applyParameter().

88 {
89  if (!inserted_only)
90  {
97  _set_by_add_param.erase(name);
98 
99  // valid_params don't make sense for MooseEnums
100  if (!have_parameter<MooseEnum>(name) && !have_parameter<MultiMooseEnum>(name))
101  _valid_params.insert(name);
102 
104  {
105  std::map<std::string, std::string>::const_iterator pos = _deprecated_params.find(name);
106  if (pos != _deprecated_params.end())
107  {
108  mooseDeprecated("The parameter ", name, " is deprecated.\n", pos->second);
109  }
110  }
111  }
112 }
std::map< std::string, std::string > _deprecated_params
The list of deprecated params.
void mooseDeprecated(Args &&...args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:202
bool _show_deprecated_message
Flag for disabling deprecated parameters message, this is used by applyParameters to avoid dumping me...
std::set< std::string > _valid_params
The set of parameters either explicitly set or provided a default value when added Note: We do not st...
std::set< std::string > _set_by_add_param
If a parameters value was set by addParam, and not set again, it will appear in this list (see applyP...
void InputParameters::setDefaultPostprocessorValue ( const std::string &  name,
const PostprocessorValue value 
)

Set the default value for a postprocessor added with addPostprocessor.

Parameters
nameThe name of the postprocessor value The value of the postprocessor default to set

Definition at line 623 of file InputParameters.C.

Referenced by Parser::setScalarParameter().

625 {
626  _default_postprocessor_value[name] = value;
627 }
std::map< std::string, PostprocessorValue > _default_postprocessor_value
The default value for postprocessors.
void InputParameters::setDocString ( const std::string &  name,
const std::string &  doc 
)

Set the doc string of a parameter.

This method is generally used from within the validParams function to modify the documentation for an existing parameter, such as a parameter that is supplied from an interface class.

Definition at line 262 of file InputParameters.C.

Referenced by Moose::SlepcSupport::getSlepcValidParams().

263 {
264  std::map<std::string, std::string>::iterator doc_string_it = _doc_string.find(name);
265  if (doc_string_it == _doc_string.end())
266  mooseError("Unable to set the documentation string (using setDocString) for the \"",
267  name,
268  "\" parameter, the parameter does not exist.");
269  else
270  doc_string_it->second = doc;
271 }
std::map< std::string, std::string > _doc_string
The documentation strings for each parameter.
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
template<typename T , typename S >
void InputParameters::setParamHelper ( const std::string &  name,
T &  l_value,
const S &  r_value 
)
private

This method is called when adding a Parameter with a default value, can be specialized for non-matching types.

Definition at line 1009 of file InputParameters.h.

1010 {
1011  l_value = r_value;
1012 }
template<>
void InputParameters::setParamHelper ( const std::string &  name,
PostprocessorName &  l_value,
const Real &  r_value 
)
private

Definition at line 881 of file InputParameters.C.

884 {
885  // Store the default value
886  _default_postprocessor_value[name] = r_value;
887 
888  // Assign the default value so that it appears in the dump
889  std::ostringstream oss;
890  oss << r_value;
891  l_value = oss.str();
892 }
std::map< std::string, PostprocessorValue > _default_postprocessor_value
The default value for postprocessors.
template<>
void InputParameters::setParamHelper ( const std::string &  name,
PostprocessorName &  l_value,
const int &  r_value 
)
private

Definition at line 896 of file InputParameters.C.

899 {
900  // Store the default value
901  _default_postprocessor_value[name] = r_value;
902 
903  // Assign the default value so that it appears in the dump
904  std::ostringstream oss;
905  oss << r_value;
906  l_value = oss.str();
907 }
std::map< std::string, PostprocessorValue > _default_postprocessor_value
The default value for postprocessors.
template<>
void InputParameters::setParamHelper ( const std::string &  ,
FunctionName &  l_value,
const Real &  r_value 
)
private

Definition at line 911 of file InputParameters.C.

914 {
915  // Assign the default value so that it appears in the dump
916  std::ostringstream oss;
917  oss << r_value;
918  l_value = oss.str();
919 }
template<>
void InputParameters::setParamHelper ( const std::string &  ,
FunctionName &  l_value,
const int &  r_value 
)
private

Definition at line 923 of file InputParameters.C.

926 {
927  // Assign the default value so that it appears in the dump
928  std::ostringstream oss;
929  oss << r_value;
930  l_value = oss.str();
931 }
template<>
void InputParameters::setParamHelper ( const std::string &  ,
MaterialPropertyName &  l_value,
const Real &  r_value 
)
private

Definition at line 935 of file InputParameters.C.

938 {
939  // Assign the default value so that it appears in the dump
940  std::ostringstream oss;
941  oss << r_value;
942  l_value = oss.str();
943 }
template<>
void InputParameters::setParamHelper ( const std::string &  ,
MaterialPropertyName &  l_value,
const int &  r_value 
)
private

Definition at line 947 of file InputParameters.C.

950 {
951  // Assign the default value so that it appears in the dump
952  std::ostringstream oss;
953  oss << r_value;
954  l_value = oss.str();
955 }
template<>
void InputParameters::setParamHelper ( const std::string &  name,
PostprocessorName &  l_value,
const Real &  r_value 
)
private
template<>
void InputParameters::setParamHelper ( const std::string &  name,
PostprocessorName &  l_value,
const int &  r_value 
)
private
template<>
void InputParameters::setParamHelper ( const std::string &  ,
FunctionName &  l_value,
const Real &  r_value 
)
private
template<>
void InputParameters::setParamHelper ( const std::string &  ,
FunctionName &  l_value,
const int &  r_value 
)
private
template<>
void InputParameters::setParamHelper ( const std::string &  ,
MaterialPropertyName &  l_value,
const Real &  r_value 
)
private
template<>
void InputParameters::setParamHelper ( const std::string &  ,
MaterialPropertyName &  l_value,
const int &  r_value 
)
private
void InputParameters::setReservedValues ( const std::string &  name,
const std::set< std::string > &  reserved 
)

Provide a set of reserved values for a parameter.

These are values that are in addition to the normal set of values the parameter can take.

Definition at line 976 of file InputParameters.C.

Referenced by validParams< OutputInterface >().

977 {
978  _reserved_values.insert(std::make_pair(name, reserved));
979 }
std::map< std::string, std::set< std::string > > _reserved_values
The reserved option names for a parameter.
template<typename T >
void InputParameters::suppressParameter ( const std::string &  name)

This method suppresses an inherited parameter so that it isn't required or valid in the derived class.

The parameter is added to the private parameter list. Suppressing a parameter can have dire consequences. Use at your own risk!

Definition at line 1148 of file InputParameters.h.

Referenced by validParams< AutoPositionsMultiApp >(), validParams< CSV >(), validParams< DiscreteElementUserObject >(), and validParams< MaterialPropertyDebugOutput >().

1149 {
1150  if (!this->have_parameter<T>(name))
1151  mooseError("Unable to suppress nonexistent parameter: ", name);
1152 
1153  _required_params.erase(name);
1154  _private_params.insert(name);
1155 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::set< std::string > _required_params
The set of parameters that are required (i.e. will cause an abort if not supplied) ...
std::set< std::string > _private_params
The set of parameters that will NOT appear in the the dump of the parser tree.
std::string InputParameters::type ( const std::string &  name)

Prints the type of the requested parameter by name.

Definition at line 497 of file InputParameters.C.

498 {
499  if (_coupled_vars.find(name) != _coupled_vars.end())
500  return "std::vector<VariableName>";
501  else if (_custom_type.find(name) != _custom_type.end())
502  return _custom_type[name];
503  else
504  return _values[name]->type();
505 }
std::map< std::string, std::string > _custom_type
The custom type that will be printed in the YAML dump for a parameter if supplied.
std::set< std::string > _coupled_vars
The coupled variables set.

Friends And Related Function Documentation

InputParameters emptyInputParameters ( )
friend

Definition at line 28 of file InputParameters.C.

29 {
30  InputParameters params;
31  return params;
32 }
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
friend class InputParameterWarehouse
friend

Definition at line 765 of file InputParameters.h.

InputParameters validParams ( )
friend

This is the templated validParams() function that every MooseObject-derived class is required to specialize.

InputParameters validParams ( )
friend

This is the templated validParams() function that every MooseObject-derived class is required to specialize.

InputParameters validParams ( )
friend

This is the templated validParams() function that every MooseObject-derived class is required to specialize.

InputParameters validParams ( )
friend

This is the templated validParams() function that every MooseObject-derived class is required to specialize.

Member Data Documentation

bool InputParameters::_allow_copy
private

A flag for toggling the error message in the copy constructor.

Definition at line 757 of file InputParameters.h.

Referenced by clear(), and operator=().

std::map<std::string, std::pair<std::string, std::string> > InputParameters::_auto_build_vectors
private

The map of auto build vectors (base_, 5 -> "base_0 base_1 base_2 base_3 base_4")

Definition at line 706 of file InputParameters.h.

Referenced by addCoupledVarWithAutoBuild(), clear(), getAutoBuildVectors(), operator+=(), and operator=().

std::vector<std::string> InputParameters::_buildable_types
private

The parameter is used to restrict types that can be built.

Typically this is used for MooseObjectAction derived Actions.

Definition at line 710 of file InputParameters.h.

Referenced by getBuildableTypes(), operator+=(), operator=(), and registerBuildableTypes().

bool InputParameters::_collapse_nesting
private

This parameter collapses one level of nesting in the syntax blocks.

It is used in conjunction with MooseObjectAction derived Actions.

Definition at line 714 of file InputParameters.h.

Referenced by clear(), collapseSyntaxNesting(), InputParameters(), and operator=().

std::set<std::string> InputParameters::_controllable_params
private

A list of parameters declared as controllable.

Definition at line 748 of file InputParameters.h.

Referenced by checkParams(), declareControllable(), isControllable(), operator+=(), and operator=().

std::set<std::string> InputParameters::_coupled_vars
private
std::map<std::string, std::string> InputParameters::_custom_type
private

The custom type that will be printed in the YAML dump for a parameter if supplied.

Definition at line 694 of file InputParameters.h.

Referenced by clear(), operator+=(), operator=(), and type().

std::map<std::string, Real> InputParameters::_default_coupled_value
private

The default value for optionally coupled variables.

Definition at line 739 of file InputParameters.h.

Referenced by addCoupledVar(), clear(), defaultCoupledValue(), hasDefaultCoupledValue(), operator+=(), and operator=().

std::map<std::string, PostprocessorValue> InputParameters::_default_postprocessor_value
private
std::map<std::string, std::string> InputParameters::_deprecated_params
private

The list of deprecated params.

Definition at line 736 of file InputParameters.h.

Referenced by set_attributes().

std::map<std::string, std::string> InputParameters::_doc_string
private
std::map<std::string, std::string> InputParameters::_group
private

The names of the parameters organized into groups.

Definition at line 700 of file InputParameters.h.

Referenced by addParamNamesToGroup(), clear(), getGroupName(), operator+=(), and operator=().

bool InputParameters::_moose_object_syntax_visibility
private

This parameter hides derived MOOSE object types from appearing in syntax dumps.

Definition at line 717 of file InputParameters.h.

Referenced by clear(), InputParameters(), mooseObjectSyntaxVisibility(), and operator=().

std::set<std::string> InputParameters::_private_params
private

The set of parameters that will NOT appear in the the dump of the parser tree.

Definition at line 730 of file InputParameters.h.

Referenced by clear(), isPrivate(), operator+=(), operator=(), and registerBase().

std::map<std::string, std::string> InputParameters::_range_functions
private

The map of functions used for range checked parameters.

Definition at line 703 of file InputParameters.h.

Referenced by clear(), operator+=(), and operator=().

std::set<std::string> InputParameters::_required_params
private

The set of parameters that are required (i.e. will cause an abort if not supplied)

Definition at line 720 of file InputParameters.h.

Referenced by addRequiredParam(), clear(), InputParameters::addRequiredParam< std::vector< MooseEnum > >(), isParamRequired(), operator+=(), and operator=().

std::map<std::string, std::set<std::string> > InputParameters::_reserved_values
private

The reserved option names for a parameter.

Definition at line 751 of file InputParameters.h.

Referenced by operator+=(), operator=(), reservedValues(), and setReservedValues().

std::set<std::string> InputParameters::_set_by_add_param
private

If a parameters value was set by addParam, and not set again, it will appear in this list (see applyParameters)

Definition at line 745 of file InputParameters.h.

Referenced by applyParameter(), isParamSetByAddParam(), isParamSetByUser(), operator+=(), operator=(), and set_attributes().

bool InputParameters::_show_deprecated_message
private

Flag for disabling deprecated parameters message, this is used by applyParameters to avoid dumping messages.

Definition at line 754 of file InputParameters.h.

Referenced by applyCoupledVar(), applyParameter(), clear(), and set_attributes().

std::map<std::string, std::vector<std::string> > InputParameters::_syntax
private

Syntax for command-line parameters.

Definition at line 697 of file InputParameters.h.

Referenced by clear(), getSyntax(), operator+=(), and operator=().

std::set<std::string> InputParameters::_valid_params
private

The set of parameters either explicitly set or provided a default value when added Note: We do not store MooseEnum names in valid params, instead we ask MooseEnums whether they are valid or not.

Definition at line 727 of file InputParameters.h.

Referenced by clear(), isParamValid(), operator+=(), operator=(), and set_attributes().


The documentation for this class was generated from the following files: