www.mooseframework.org
Classes | 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]

Classes

struct  Metadata
 

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 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...
 
void addCoupledVar (const std::string &name, const std::vector< 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 isParamDeprecated (const std::string &name) const
 Returns True if the parameters is deprecated. 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, std::set< ExecFlagType > execute_flags={})
 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...
 
const std::set< ExecFlagType > & getControllableExecuteOnTypes (const std::string &name)
 Return the allowed execute flags for a controllable parameter. 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...
 
void registerRelationshipManagers (const std::string &names, const std::string &use_as_rm_types="")
 Declares the types of RelationshipManagers that the owning object will either construct (in the case of Actions) or requires (in the case of every other MooseObject). More...
 
const std::vector< std::string > & getBuildableTypes () const
 Returns the list of buildable types as a std::vector<std::string> More...
 
const std::vector< std::pair< std::string, Moose::RelationshipManagerType > > & getBuildableRelationshipManagerTypes () const
 Returns the list of buildable (or required) RelationshipManager object types for this object. More...
 
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, unsigned int i=0) const
 Get the default value for an optionally coupled variable. More...
 
unsigned int numberDefaultCoupledValues (const std::string &coupling_name) const
 Get the number of defaulted coupled value entries. More...
 
void defaultCoupledValue (const std::string &coupling_name, Real value, unsigned int i=0)
 Set the default value for an optionally coupled variable (called by the Parser). More...
 
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...
 
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...
 
std::string & blockLocation ()
 Get/set a string representing the location (i.e. More...
 
std::string & rawParamVal (const std::string &param)
 Get/set a string representing the raw, unmodified token text for the given param. 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 addPrivateParam (const std::string &)
 
template<>
void addPrivateParam (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 addPrivateParam (const std::string &)
 
template<>
void addPrivateParam (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)
 
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)
 
std::string & blockFullpath ()
 Get/set a string representing the full HIT parameter path from the input file (e.g. More...
 
const std::string & blockFullpath () const
 
const std::string & inputLocation (const std::string &param) const
 Get/set a string representing the location in the input text the parameter originated from (i.e. More...
 
std::string & inputLocation (const std::string &param)
 
const std::string & paramFullpath (const std::string &param) const
 Get/set a string representing the full HIT parameter path from the input file (e.g. More...
 
std::string & paramFullpath (const std::string &param)
 

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 ()
 
Metadataat (const std::string &param)
 
const Metadataat (const std::string &param) const
 
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::string _block_location
 original location of input block (i.e. filename,linenum) - used for nice error messages. More...
 
std::string _block_fullpath
 full HIT path of the block from the input file - used for nice error messages. More...
 
std::map< std::string, Metadata_params
 The actual parameter data. More...
 
std::set< std::string > _coupled_vars
 The coupled variables set. More...
 
std::string _class_description
 The class description for the owning object. More...
 
std::vector< std::string > _buildable_types
 The parameter is used to restrict types that can be built. More...
 
std::vector< std::pair< std::string, Moose::RelationshipManagerType > > _buildable_rm_types
 The RelationshipManagers that this object may either build or require. 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...
 
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 emptyInputParameters ()
 

Detailed Description

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

Definition at line 52 of file InputParameters.h.

Constructor & Destructor Documentation

◆ InputParameters() [1/3]

InputParameters::InputParameters ( const InputParameters rhs)

Definition at line 39 of file InputParameters.C.

40  : Parameters(), _show_deprecated_message(true), _allow_copy(true)
41 
42 {
43  *this = rhs;
44 }
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() [2/3]

InputParameters::InputParameters ( const Parameters &  rhs)

Definition at line 46 of file InputParameters.C.

48 {
49  _params.clear();
50  Parameters::operator=(rhs);
51  _collapse_nesting = false;
53 }
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.
std::map< std::string, Metadata > _params
The actual parameter data.

◆ ~InputParameters()

virtual InputParameters::~InputParameters ( )
virtualdefault

◆ InputParameters() [3/3]

InputParameters::InputParameters ( )
private

Definition at line 30 of file InputParameters.C.

31  : Parameters(),
32  _collapse_nesting(false),
35  _allow_copy(true)
36 {
37 }
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

◆ addClassDescription()

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 70 of file InputParameters.C.

Referenced by MaterialDerivativeTestKernelBase< Real >::validParams(), validParams< ActuallyExplicitEuler >(), validParams< AddADBCAction >(), validParams< AddADKernelAction >(), validParams< AddADMaterialAction >(), validParams< AddSideSetsFromBoundingBox >(), validParams< AnisotropicDiffusion >(), validParams< AnnularMesh >(), validParams< AnnularMeshGenerator >(), validParams< AreaPostprocessor >(), validParams< Axisymmetric2D3DSolutionFunction >(), validParams< AxisymmetricCenterlineAverageValue >(), validParams< BlockDeleter >(), validParams< BlockDeletionGenerator >(), validParams< BodyForce >(), validParams< BoundingBoxIC >(), validParams< BoundingBoxNodeSet >(), validParams< BoundingBoxNodeSetGenerator >(), validParams< BoxMarker >(), validParams< BreakBoundaryOnSubdomain >(), validParams< BreakBoundaryOnSubdomainGenerator >(), validParams< BreakMeshByBlock >(), validParams< BreakMeshByBlockBase >(), validParams< BreakMeshByBlockGenerator >(), validParams< BreakMeshByBlockGeneratorBase >(), validParams< CartesianMeshGenerator >(), validParams< ChangeOverTimePostprocessor >(), validParams< ComboMarker >(), validParams< CompositeFunction >(), validParams< ConcentricCircleMesh >(), validParams< ConcentricCircleMeshGenerator >(), validParams< ConservativeAdvection >(), validParams< ConstantAux >(), validParams< ConstantDT >(), validParams< ConstantIC >(), validParams< ConvectiveFluxBC >(), validParams< CoupledForce >(), validParams< CoupledTimeDerivative >(), validParams< CSVReader >(), validParams< CSVTimeSequenceStepper >(), validParams< DerivativeFunctionMaterialBase >(), validParams< DerivativeParsedMaterial >(), validParams< DerivativeParsedMaterialHelper >(), validParams< DerivativeSumMaterial >(), validParams< DGConvection >(), validParams< Diffusion >(), validParams< DiffusionFluxAux >(), validParams< DiffusionFluxBC >(), validParams< DirichletBC >(), validParams< DistributedGeneratedMesh >(), validParams< DumpObjectsProblem >(), validParams< EigenDirichletBC >(), validParams< Eigenvalue >(), validParams< ElementalVariableValue >(), validParams< ElementAverageSecondTimeDerivative >(), validParams< ElementH1ErrorFunctionAux >(), validParams< ElementL2ErrorFunctionAux >(), validParams< ElementLengthAux >(), validParams< ElementLpNormAux >(), validParams< ElementQualityAux >(), validParams< ElementQualityChecker >(), validParams< ElementsAlongLine >(), validParams< ElementsAlongPlane >(), validParams< ElementValueSampler >(), validParams< EqualValueEmbeddedConstraint >(), validParams< ErrorFractionMarker >(), validParams< ErrorToleranceMarker >(), validParams< ExodusTimeSequenceStepper >(), validParams< ExternalProblem >(), validParams< FileMesh >(), validParams< FindValueOnLine >(), validParams< FunctionAux >(), validParams< FunctionDirichletBC >(), validParams< FunctionDT >(), validParams< FunctionIC >(), validParams< FunctionMaterialBase >(), validParams< FunctionNeumannBC >(), validParams< FunctionPresetBC >(), validParams< GeneratedMesh >(), validParams< GeneratedMeshGenerator >(), validParams< GeometryBase >(), validParams< GeometrySphere >(), validParams< GMVOutput >(), validParams< HistogramVectorPostprocessor >(), validParams< ImageFunction >(), validParams< ImageMesh >(), validParams< ImageMeshGenerator >(), validParams< ImageSubdomain >(), validParams< ImageSubdomainGenerator >(), validParams< IterationAdaptiveDT >(), validParams< LagrangeVecDirichletBC >(), validParams< LagrangeVecFunctionDirichletBC >(), validParams< LeastSquaresFit >(), validParams< LeastSquaresFitHistory >(), validParams< LinearCombinationFunction >(), validParams< LinearNodalConstraint >(), validParams< LogConstantDT >(), validParams< LowerDBlockFromSideset >(), validParams< LowerDBlockFromSidesetGenerator >(), validParams< MassEigenKernel >(), validParams< MassLumpedTimeDerivative >(), validParams< MatchedValueBC >(), validParams< MatDiffusion >(), validParams< MaterialDerivativeRankFourTestKernel >(), validParams< MaterialDerivativeRankTwoTestKernel >(), validParams< MaterialDerivativeTestKernel >(), validParams< MaterialRankFourTensorAux >(), validParams< MaterialRankTwoTensorAux >(), validParams< MaterialRealAux >(), validParams< MaterialStdVectorAux >(), validParams< MaterialStdVectorRealGradientAux >(), validParams< MemoryUsage >(), validParams< MeshExtruder >(), validParams< MeshExtruderGenerator >(), validParams< MeshSideSet >(), validParams< MeshSideSetGenerator >(), validParams< MultiAppCopyTransfer >(), validParams< MultiAppInterpolationTransfer >(), validParams< MultiAppVectorPostprocessorTransfer >(), validParams< NearestNodeDistanceAux >(), validParams< NearestNodeValueAux >(), validParams< NeumannBC >(), validParams< NewmarkBeta >(), validParams< NodalValueSampler >(), validParams< NodalVariableValue >(), validParams< NullKernel >(), validParams< NumDOFs >(), validParams< NumElems >(), validParams< NumNodes >(), validParams< NumNonlinearIterations >(), validParams< NumVars >(), validParams< ParsedAux >(), validParams< ParsedMaterial >(), validParams< ParsedMaterialHelper >(), validParams< ParsedODEKernel >(), validParams< PatternedMesh >(), validParams< PatternedMeshGenerator >(), validParams< PenaltyDirichletBC >(), validParams< PenetrationAux >(), validParams< PerfGraphData >(), validParams< PerfGraphOutput >(), validParams< PerformanceData >(), validParams< PetscExternalPartitioner >(), validParams< PiecewiseBilinear >(), validParams< PiecewiseConstant >(), validParams< PiecewiseLinear >(), validParams< PiecewiseLinearInterpolationMaterial >(), validParams< PiecewiseMulticonstant >(), validParams< PiecewiseMultilinear >(), validParams< PostprocessorComparison >(), validParams< PresetBC >(), validParams< ProcessorIDAux >(), validParams< QuotientAux >(), validParams< RandomICBase >(), validParams< Reaction >(), validParams< RealFunctionControl >(), validParams< RelativeDifferencePostprocessor >(), validParams< RenameBlock >(), validParams< RenameBlockGenerator >(), validParams< RenameBoundaryGenerator >(), validParams< RinglebMesh >(), validParams< RinglebMeshGenerator >(), validParams< Sampler >(), validParams< ScalarTagMatrixAux >(), validParams< ScalarTagVectorAux >(), validParams< SetupDebugAction >(), validParams< SideAverageValue >(), validParams< SideFluxIntegral >(), validParams< SideSetsAroundSubdomain >(), validParams< SideSetsAroundSubdomainGenerator >(), validParams< SideSetsFromBoundingBoxGenerator >(), validParams< SideSetsFromNormals >(), validParams< SideSetsFromNormalsGenerator >(), validParams< SideSetsFromPoints >(), validParams< SideSetsFromPointsGenerator >(), validParams< SinDirichletBC >(), validParams< SinNeumannBC >(), validParams< SmoothMesh >(), validParams< SmoothMeshGenerator >(), validParams< SolutionAux >(), validParams< SolutionUserObject >(), validParams< SpiralAnnularMesh >(), validParams< SpiralAnnularMeshGenerator >(), validParams< StackGenerator >(), validParams< StatisticsVectorPostprocessor >(), validParams< StitchedMesh >(), validParams< SubdomainBoundingBox >(), validParams< SubdomainBoundingBoxGenerator >(), validParams< TagMatrixAux >(), validParams< TagVectorAux >(), validParams< Tecplot >(), validParams< TiledMesh >(), validParams< TiledMeshGenerator >(), validParams< TimeDerivative >(), validParams< TimeExtremeValue >(), validParams< TimePeriod >(), validParams< TimeSequenceStepper >(), validParams< TimestepSize >(), validParams< Transform >(), validParams< TransformGenerator >(), validParams< UniformMarker >(), validParams< ValueRangeMarker >(), validParams< ValueThresholdMarker >(), validParams< VariableGradientComponent >(), validParams< VectorBodyForce >(), validParams< VectorConstantIC >(), validParams< VectorDiffusion >(), validParams< VectorMagnitudeAux >(), validParams< VectorMemoryUsage >(), validParams< VectorNeumannBC >(), validParams< VectorOfPostprocessors >(), validParams< VectorPostprocessorComparison >(), validParams< VectorPostprocessorVisualizationAux >(), validParams< WeakGradientBC >(), validParams< WorkBalance >(), and validParams< XDA >().

71 {
72  _class_description = doc_string;
73 }
std::string _class_description
The class description for the owning object.

◆ addCommandLineParam() [1/2]

template<typename T >
void InputParameters::addCommandLineParam ( const std::string &  name,
const std::string &  syntax,
const std::string &  doc_string 
)

Definition at line 1231 of file InputParameters.h.

Referenced by validParams< MooseApp >().

1234 {
1235  addParam<T>(name, doc_string);
1236  MooseUtils::tokenize(syntax, _params[name]._cli_flag_names, 1, " \t\n\v\f\r");
1237 }
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:429
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addCommandLineParam() [2/2]

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 1241 of file InputParameters.h.

1245 {
1246  addParam<T>(name, value, doc_string);
1247  MooseUtils::tokenize(syntax, _params[name]._cli_flag_names, 1, " \t\n\v\f\r");
1248 }
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:429
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addCoupledVar() [1/3]

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 183 of file InputParameters.C.

Referenced by applyCoupledVar(), MatDiffusionBase< Real >::validParams(), validParams< DerivativeSumMaterial >(), validParams< ElementVectorL2Error >(), validParams< FindValueOnLine >(), validParams< NodalNormalBC >(), validParams< ParsedMaterialBase >(), validParams< QuotientAux >(), validParams< QuotientScalarAux >(), validParams< SphericalAverage >(), validParams< VectorMagnitudeAux >(), and validParams< VolumeHistogram >().

184 {
185  addParam<std::vector<VariableName>>(name, doc_string);
186  _coupled_vars.insert(name);
187 }
std::set< std::string > _coupled_vars
The coupled variables set.

◆ addCoupledVar() [2/3]

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 162 of file InputParameters.C.

163 {
164  addParam<std::vector<VariableName>>(name, doc_string);
165  _coupled_vars.insert(name);
166  _params[name]._coupled_default.assign(1, value);
167  _params[name]._have_coupled_default = true;
168 }
std::set< std::string > _coupled_vars
The coupled variables set.
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addCoupledVar() [3/3]

void InputParameters::addCoupledVar ( const std::string &  name,
const std::vector< 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 vector of values for this variable in the case that an actual variable is not provided.

Definition at line 171 of file InputParameters.C.

174 {
175  // std::vector<VariableName>(1, Moose::stringify(value)),
176  addParam<std::vector<VariableName>>(name, doc_string);
177  _coupled_vars.insert(name);
178  _params[name]._coupled_default = value;
179  _params[name]._have_coupled_default = true;
180 }
std::set< std::string > _coupled_vars
The coupled variables set.
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addCoupledVarWithAutoBuild()

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 190 of file InputParameters.C.

Referenced by addRequiredCoupledVarWithAutoBuild().

194 {
195  addParam<std::vector<VariableName>>(name, doc_string);
196  _coupled_vars.insert(name);
197  _params[name]._autobuild_vecs = std::make_pair(base_name, num_name);
198 
199  // Additionally there are two more parameters that need to be added:
200  addParam<std::string>(base_name, doc_string + " (base_name)");
201  addParam<unsigned int>(num_name, doc_string + " (num_name)");
202 }
std::set< std::string > _coupled_vars
The coupled variables set.
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addCustomTypeParam() [1/2]

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 1177 of file InputParameters.h.

1181 {
1182  addParam<T>(name, value, doc_string);
1183  _params[name]._custom_type = custom_type;
1184 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addCustomTypeParam() [2/2]

template<typename T >
void InputParameters::addCustomTypeParam ( const std::string &  name,
const std::string &  custom_type,
const std::string &  doc_string 
)

Definition at line 1188 of file InputParameters.h.

1191 {
1192  addParam<T>(name, doc_string);
1193  _params[name]._custom_type = custom_type;
1194 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addDeprecatedParam() [1/6]

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 1289 of file InputParameters.h.

Referenced by validParams< AdaptivityAction >(), validParams< CommonOutputAction >(), validParams< DerivativeFunctionMaterialBase >(), validParams< DerivativeParsedMaterialHelper >(), validParams< Executioner >(), validParams< GenericFunctionMaterial >(), validParams< OversampleOutput >(), validParams< PetscOutput >(), and validParams< Transient >().

1293 {
1294  _show_deprecated_message = false;
1295  addParam<T>(name, value, doc_string);
1296 
1297  _params[name]._deprecation_message = deprecation_message;
1298  _show_deprecated_message = true;
1299 }
bool _show_deprecated_message
Flag for disabling deprecated parameters message, this is used by applyParameters to avoid dumping me...
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addDeprecatedParam() [2/6]

template<typename T >
void InputParameters::addDeprecatedParam ( const std::string &  name,
const std::string &  doc_string,
const std::string &  deprecation_message 
)

Definition at line 1303 of file InputParameters.h.

1306 {
1307  _show_deprecated_message = false;
1308  addParam<T>(name, doc_string);
1309 
1310  _params[name]._deprecation_message = deprecation_message;
1311  _show_deprecated_message = true;
1312 }
bool _show_deprecated_message
Flag for disabling deprecated parameters message, this is used by applyParameters to avoid dumping me...
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addDeprecatedParam() [3/6]

template<>
void InputParameters::addDeprecatedParam ( const std::string &  ,
const std::string &  ,
const std::string &   
)

Definition at line 902 of file InputParameters.C.

905 {
906  mooseError("You must supply a MooseEnum object and the deprecation string when using "
907  "addDeprecatedParam, even if the parameter is not required!");
908 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ addDeprecatedParam() [4/6]

template<>
void InputParameters::addDeprecatedParam ( const std::string &  ,
const std::string &  ,
const std::string &   
)

Definition at line 912 of file InputParameters.C.

915 {
916  mooseError("You must supply a MultiMooseEnum object and the deprecation string when using "
917  "addDeprecatedParam, even if the parameter is not required!");
918 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ addDeprecatedParam() [5/6]

template<>
void InputParameters::addDeprecatedParam ( const std::string &  name,
const std::string &  doc_string,
const std::string &  deprecation_message 
)

◆ addDeprecatedParam() [6/6]

template<>
void InputParameters::addDeprecatedParam ( const std::string &  name,
const std::string &  doc_string,
const std::string &  deprecation_message 
)

◆ addParam() [1/6]

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 1099 of file InputParameters.h.

Referenced by AdvancedOutput::addValidParams(), Moose::PetscSupport::getPetscValidParams(), Moose::SlepcSupport::getSlepcEigenProblemValidParams(), nearestPointBaseValidParams(), MaterialDerivativeTestKernelBase< Real >::validParams(), MatDiffusionBase< Real >::validParams(), ShapeUserObject< SideUserObject >::validParams(), validParams< AB2PredictorCorrector >(), validParams< Action >(), validParams< ActuallyExplicitEuler >(), 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< AnnularMeshGenerator >(), validParams< AssignElementSubdomainID >(), validParams< AStableDirk4 >(), validParams< Axisymmetric2D3DSolutionFunction >(), validParams< BicubicSplineFunction >(), validParams< BlockRestrictable >(), validParams< BodyForce >(), validParams< BoundaryRestrictable >(), validParams< BoundingBoxIC >(), validParams< BoundingBoxNodeSet >(), validParams< BoundingBoxNodeSetGenerator >(), validParams< BoundingValueElementDamper >(), validParams< BoundingValueNodalDamper >(), validParams< BoundsAux >(), validParams< BreakBoundaryOnSubdomain >(), validParams< BreakBoundaryOnSubdomainGenerator >(), validParams< BreakMeshByBlockBase >(), validParams< BreakMeshByBlockGeneratorBase >(), validParams< CartesianMeshGenerator >(), validParams< ChangeOverTimePostprocessor >(), validParams< Checkpoint >(), validParams< CoefTimeDerivative >(), validParams< CommonOutputAction >(), validParams< ComparisonPostprocessor >(), validParams< CompositeFunction >(), validParams< ConcentricCircleMesh >(), validParams< ConcentricCircleMeshGenerator >(), validParams< ConservativeAdvection >(), 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< DerivativeParsedMaterialHelper >(), validParams< DerivativeSumMaterial >(), validParams< DGDiffusion >(), validParams< DGFunctionDiffusionDirichletBC >(), validParams< DistributedGeneratedMesh >(), validParams< DOFMapOutput >(), validParams< DT2 >(), validParams< DynamicObjectRegistrationAction >(), validParams< EigenExecutionerBase >(), validParams< EigenKernel >(), validParams< ElemElemConstraint >(), validParams< ElementDeleterBase >(), validParams< ElementDeletionGeneratorBase >(), validParams< ElementExtremeValue >(), validParams< ElementGenerator >(), validParams< ElementQualityChecker >(), validParams< ElementSubdomainIDGenerator >(), validParams< ElementVariablesDifferenceMax >(), validParams< ElementVectorL2Error >(), validParams< EqualValueBoundaryConstraint >(), validParams< EqualValueEmbeddedConstraint >(), validParams< ErrorFractionMarker >(), validParams< ErrorToleranceMarker >(), validParams< Executioner >(), validParams< ExtraNodesetGenerator >(), validParams< FEProblemBase >(), validParams< FieldSplitPreconditioner >(), validParams< FileOutput >(), validParams< FileRangeBuilder >(), validParams< FindValueOnLine >(), validParams< FiniteDifferencePreconditioner >(), validParams< FunctionDT >(), validParams< FunctionMaterialBase >(), validParams< FunctionParserUtils >(), validParams< FunctionSideIntegral >(), validParams< FunctionValuePostprocessor >(), validParams< GapValueAux >(), validParams< GeneralUserObject >(), validParams< GeneratedMesh >(), validParams< GeneratedMeshGenerator >(), validParams< GenericConstantMaterial >(), validParams< GenericFunctionMaterial >(), validParams< GeometryBase >(), validParams< GeometrySphere >(), validParams< GMVOutput >(), validParams< Gnuplot >(), validParams< ImageSampler >(), validParams< Indicator >(), validParams< IntegratedBCBase >(), validParams< InternalSideIndicator >(), validParams< InversePowerMethod >(), validParams< IterationAdaptiveDT >(), validParams< LagrangeVecFunctionDirichletBC >(), validParams< LayeredBase >(), validParams< LeastSquaresFit >(), validParams< LeastSquaresFitHistory >(), validParams< LibmeshPartitioner >(), validParams< LinearCombinationPostprocessor >(), validParams< LinearNodalConstraint >(), validParams< LowerDBlockFromSideset >(), validParams< LowerDBlockFromSidesetGenerator >(), validParams< Material >(), validParams< MaterialAuxBase<> >(), validParams< MaterialDerivativeTestAction >(), validParams< MaterialRealDenseMatrixAux >(), validParams< MaterialRealTensorValueAux >(), validParams< MaterialRealVectorValueAux >(), validParams< MaterialStdVectorAux >(), validParams< MaterialStdVectorAuxBase<> >(), validParams< MaterialStdVectorRealGradientAux >(), validParams< MaxIncrement >(), validParams< MemoryUsage >(), validParams< MeshBaseImageSampler >(), validParams< MeshExtruder >(), validParams< MeshExtruderGenerator >(), validParams< MeshModifier >(), validParams< MeshSideSet >(), validParams< MeshSideSetGenerator >(), validParams< MooseADObjectAction >(), validParams< MooseMesh >(), validParams< MooseObject >(), validParams< MooseObjectAction >(), validParams< MooseParsedFunctionBase >(), validParams< MooseParsedGradFunction >(), validParams< MooseParsedVectorFunction >(), validParams< MoosePreconditioner >(), validParams< MortarConstraint >(), validParams< MultiApp >(), validParams< MultiAppInterpolationTransfer >(), validParams< MultiAppMeshFunctionTransfer >(), validParams< MultiAppNearestNodeTransfer >(), validParams< MultiAppPostprocessorInterpolationTransfer >(), validParams< MultiAppPostprocessorTransfer >(), validParams< MultiAppProjectionTransfer >(), validParams< MultiAppTransfer >(), validParams< MultiAppUserObjectTransfer >(), validParams< NeumannBC >(), validParams< NodalBCBase >(), validParams< NodalConstraint >(), validParams< NodalExtremeValue >(), validParams< NodalNormalsPreprocessor >(), validParams< NodalPatchRecovery >(), validParams< NodalScalarKernel >(), 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< ParsedMaterialBase >(), validParams< PatternedMesh >(), validParams< PatternedMeshGenerator >(), validParams< PenaltyDirichletBC >(), validParams< PenetrationAux >(), validParams< PerfGraphOutput >(), validParams< PerformanceData >(), validParams< PetscExternalPartitioner >(), validParams< PetscOutput >(), validParams< PhysicsBasedPreconditioner >(), validParams< Piecewise >(), validParams< PiecewiseBase >(), validParams< PiecewiseBilinear >(), validParams< PiecewiseConstant >(), validParams< PiecewiseLinearInterpolationMaterial >(), validParams< PiecewiseMulticonstant >(), validParams< PiecewiseMultiInterpolation >(), validParams< PostprocessorDT >(), validParams< PostprocessorNeumannBC >(), validParams< Predictor >(), validParams< RandomIC >(), validParams< RandomICBase >(), validParams< RandomInterface >(), validParams< Receiver >(), validParams< RenameBlock >(), validParams< RenameBlockGenerator >(), validParams< RenameBoundaryGenerator >(), validParams< Residual >(), validParams< RinglebMesh >(), validParams< RinglebMeshGenerator >(), validParams< ScalarInitialCondition >(), validParams< ScalarTagMatrixAux >(), validParams< ScalarTagVectorAux >(), validParams< ScalarVariable >(), validParams< ScalePostprocessor >(), validParams< SetAdaptivityOptionsAction >(), validParams< SetupDebugAction >(), validParams< SetupInterface >(), validParams< SetupMeshAction >(), validParams< SetupQuadratureAction >(), validParams< SetupResidualDebugAction >(), validParams< SideSetsAroundSubdomain >(), validParams< SideSetsAroundSubdomainGenerator >(), validParams< SideSetsFromBoundingBoxGenerator >(), validParams< SideSetsGeneratorBase >(), validParams< SingleMatrixPreconditioner >(), validParams< SinNeumannBC >(), validParams< SmoothMesh >(), validParams< SmoothMeshGenerator >(), validParams< SolutionAux >(), validParams< SolutionFunction >(), validParams< SolutionTimeAdaptiveDT >(), validParams< SolutionUserObject >(), validParams< SphericalAverage >(), validParams< SpiralAnnularMesh >(), validParams< SpiralAnnularMeshGenerator >(), validParams< SplineFunction >(), validParams< Split >(), validParams< StackGenerator >(), validParams< StitchedMesh >(), validParams< StitchedMeshGenerator >(), validParams< SubdomainBoundingBox >(), validParams< SubdomainBoundingBoxGenerator >(), validParams< TaggingInterface >(), validParams< TagMatrixAux >(), validParams< TagVectorAux >(), validParams< Tecplot >(), validParams< TiedValueConstraint >(), validParams< TiledMesh >(), validParams< TiledMeshGenerator >(), 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< VectorBodyForce >(), validParams< VectorConstantIC >(), validParams< VectorMemoryUsage >(), validParams< VectorNeumannBC >(), validParams< VectorPostprocessor >(), validParams< VectorPostprocessorVisualizationAux >(), validParams< VolumeHistogram >(), validParams< VTKOutput >(), and validParams< WorkBalance >().

1100 {
1101  checkParamName(name);
1102  checkConsistentType<T>(name);
1103 
1104  T & l_value = InputParameters::set<T>(name);
1105  _params[name]._doc_string = doc_string;
1106 
1107  // Set the parameter now
1108  setParamHelper(name, l_value, value);
1109 
1110  /* Indicate the default value, as set via addParam, is being used. The parameter is removed from
1111  the list whenever
1112  it changes, see set_attributes */
1113  _params[name]._set_by_add_param = true;
1114 }
void checkParamName(const std::string &name) const
Make sure the parameter name doesn&#39;t have any invalid characters.
std::map< std::string, Metadata > _params
The actual parameter data.
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...

◆ addParam() [2/6]

template<typename T >
void InputParameters::addParam ( const std::string &  name,
const std::string &  doc_string 
)

Definition at line 1118 of file InputParameters.h.

1119 {
1120  checkParamName(name);
1121  checkConsistentType<T>(name);
1122 
1123  InputParameters::insert<T>(name);
1124  _params[name]._doc_string = doc_string;
1125 }
void checkParamName(const std::string &name) const
Make sure the parameter name doesn&#39;t have any invalid characters.
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addParam() [3/6]

template<>
void InputParameters::addParam ( const std::string &  ,
const std::string &   
)

Definition at line 859 of file InputParameters.C.

861 {
862  mooseError("You must supply a MooseEnum object when using addParam, even if the parameter is not "
863  "required!");
864 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ addParam() [4/6]

template<>
void InputParameters::addParam ( const std::string &  ,
const std::string &   
)

Definition at line 868 of file InputParameters.C.

870 {
871  mooseError("You must supply a MultiMooseEnum object when using addParam, even if the parameter "
872  "is not required!");
873 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ addParam() [5/6]

template<>
void InputParameters::addParam ( const std::string &  ,
const std::string &   
)

◆ addParam() [6/6]

template<>
void InputParameters::addParam ( const std::string &  ,
const std::string &   
)

◆ addParamNamesToGroup()

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 601 of file InputParameters.C.

Referenced by AdvancedOutput::addValidParams(), ShapeUserObject< SideUserObject >::validParams(), validParams< CartesianMeshGenerator >(), validParams< Checkpoint >(), validParams< CopyNodalVarsAction >(), validParams< DerivativeSumMaterial >(), validParams< DistributedGeneratedMesh >(), validParams< EigenExecutionerBase >(), validParams< Executioner >(), validParams< FileOutput >(), validParams< FunctionParserUtils >(), validParams< GeneratedMesh >(), validParams< GeneratedMeshGenerator >(), validParams< GMVOutput >(), validParams< ImageSampler >(), validParams< LeastSquaresFitHistory >(), validParams< MaterialStdVectorAux >(), validParams< MeshBaseImageSampler >(), validParams< MooseMesh >(), validParams< MooseObject >(), validParams< NodalPatchRecovery >(), validParams< OutputInterface >(), validParams< OversampleOutput >(), validParams< PetscOutput >(), validParams< Postprocessor >(), validParams< RandomInterface >(), validParams< SetupMeshAction >(), validParams< TaggingInterface >(), validParams< Tecplot >(), validParams< Transient >(), validParams< TransientInterface >(), and validParams< VTKOutput >().

603 {
604  std::vector<std::string> elements;
605  MooseUtils::tokenize(space_delim_names, elements, 1, " \t\n\v\f\r"); // tokenize on whitespace
606 
607  // Since we don't require types (templates) for this method, we need
608  // to get a raw list of parameter names to compare against.
609  std::set<std::string> param_names;
610  for (const auto & it : *this)
611  param_names.insert(it.first);
612 
613  for (const auto & param_name : elements)
614  if (_params.count(param_name) > 0)
615  _params[param_name]._group = group_name;
616  else
617  mooseError("Unable to find a parameter with name: ",
618  param_name,
619  " when adding to group ",
620  group_name,
621  '.');
622 }
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:429
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addPrivateParam() [1/6]

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 1209 of file InputParameters.h.

Referenced by AddControlAction::act(), FEProblemBase::addOutput(), ActionFactory::create(), ActionFactory::getValidParams(), Factory::getValidParams(), validParams< Action >(), validParams< BlockRestrictable >(), validParams< BoundaryRestrictable >(), validParams< BoundaryRestrictableRequired >(), validParams< CreateProblemDefaultAction >(), validParams< DisplacedProblem >(), validParams< EigenExecutionerBase >(), validParams< Eigenvalue >(), validParams< ExecutionerAttributeReporter >(), validParams< GlobalParamsAction >(), validParams< InternalSideIndicator >(), validParams< MaterialPropertyInterface >(), validParams< MeshModifier >(), validParams< MooseApp >(), validParams< MooseObject >(), validParams< MoosePartitioner >(), validParams< MoosePreconditioner >(), validParams< NodalNormalsPreprocessor >(), validParams< RelationshipManager >(), validParams< SubProblem >(), and validParams< XDA >().

1210 {
1211  checkParamName(name);
1212  checkConsistentType<T>(name);
1213 
1214  InputParameters::set<T>(name) = value;
1215  _params[name]._is_private = true;
1216  _params[name]._set_by_add_param = true;
1217 }
void checkParamName(const std::string &name) const
Make sure the parameter name doesn&#39;t have any invalid characters.
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addPrivateParam() [2/6]

template<typename T >
void InputParameters::addPrivateParam ( const std::string &  name)

Definition at line 1198 of file InputParameters.h.

1199 {
1200  checkParamName(name);
1201  checkConsistentType<T>(name);
1202 
1203  InputParameters::insert<T>(name);
1204  _params[name]._is_private = true;
1205 }
void checkParamName(const std::string &name) const
Make sure the parameter name doesn&#39;t have any invalid characters.
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addPrivateParam() [3/6]

template<>
void InputParameters::addPrivateParam ( const std::string &  )

Definition at line 886 of file InputParameters.C.

887 {
888  mooseError("You must supply a MooseEnum object when using addPrivateParam, even if the parameter "
889  "is not required!");
890 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ addPrivateParam() [4/6]

template<>
void InputParameters::addPrivateParam ( const std::string &  )

Definition at line 894 of file InputParameters.C.

895 {
896  mooseError("You must supply a MultiMooseEnum object when using addPrivateParam, even if the "
897  "parameter is not required!");
898 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ addPrivateParam() [5/6]

template<>
void InputParameters::addPrivateParam ( const std::string &  )

◆ addPrivateParam() [6/6]

template<>
void InputParameters::addPrivateParam ( const std::string &  )

◆ addRangeCheckedParam() [1/2]

template<typename T >
void InputParameters::addRangeCheckedParam ( const std::string &  name,
const T &  value,
const std::string &  parsed_function,
const std::string &  doc_string 
)

◆ addRangeCheckedParam() [2/2]

template<typename T >
void InputParameters::addRangeCheckedParam ( const std::string &  name,
const std::string &  parsed_function,
const std::string &  doc_string 
)

Definition at line 1157 of file InputParameters.h.

1160 {
1161  addParam<T>(name, doc_string);
1162  _params[name]._range_function = parsed_function;
1163 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addRequiredCommandLineParam()

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 1221 of file InputParameters.h.

1224 {
1225  addRequiredParam<T>(name, doc_string);
1226  MooseUtils::tokenize(syntax, _params[name]._cli_flag_names, 1, " \t\n\v\f\r");
1227 }
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:429
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addRequiredCoupledVar()

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 216 of file InputParameters.C.

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

217 {
218  addRequiredParam<std::vector<VariableName>>(name, doc_string);
219  _coupled_vars.insert(name);
220 }
std::set< std::string > _coupled_vars
The coupled variables set.

◆ addRequiredCoupledVarWithAutoBuild()

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 205 of file InputParameters.C.

209 {
210  addRequiredParam<std::vector<VariableName>>(name, doc_string);
211 
212  addCoupledVarWithAutoBuild(name, base_name, num_name, doc_string);
213 }
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.

◆ addRequiredCustomTypeParam()

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 1167 of file InputParameters.h.

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

1170 {
1171  addRequiredParam<T>(name, doc_string);
1172  _params[name]._custom_type = custom_type;
1173 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addRequiredParam() [1/6]

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 1077 of file InputParameters.h.

Referenced by DerivativeKernelInterface< T >::validParams(), MaterialDerivativeTestKernelBase< Real >::validParams(), CompositeTensorBase< T, U >::validParams(), validParams< AB2PredictorCorrector >(), validParams< AddExtraNodeset >(), validParams< AddMortarInterfaceAction >(), validParams< AddSideSetsFromBoundingBox >(), validParams< AllSideSetsByNormalsGenerator >(), validParams< AnalyticalIndicator >(), validParams< AnisotropicDiffusion >(), validParams< AnnularMesh >(), validParams< AnnularMeshGenerator >(), validParams< AssignElementSubdomainID >(), validParams< AssignSubdomainID >(), validParams< AuxNodalScalarKernel >(), validParams< AuxScalarKernel >(), validParams< Axisymmetric2D3DSolutionFunction >(), validParams< BicubicSplineFunction >(), validParams< BlockDeleter >(), validParams< BlockDeletionGenerator >(), validParams< BoundaryCondition >(), validParams< BoundaryRestrictableRequired >(), validParams< BoundingBoxIC >(), validParams< BoundingBoxNodeSet >(), validParams< BoundingBoxNodeSetGenerator >(), validParams< BoxMarker >(), validParams< BreakBoundaryOnSubdomainGenerator >(), validParams< BreakMeshByBlockGenerator >(), validParams< CartesianMeshGenerator >(), validParams< ChangeOverTimePostprocessor >(), validParams< ComboMarker >(), validParams< ComparisonPostprocessor >(), validParams< ConcentricCircleMesh >(), validParams< ConcentricCircleMeshGenerator >(), 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< DistributedGeneratedMesh >(), validParams< Distribution >(), validParams< DT2 >(), validParams< DumpObjectsProblem >(), validParams< EigenExecutionerBase >(), validParams< ElementalVariableValue >(), validParams< ElementDamper >(), validParams< ElementDeletionGeneratorBase >(), validParams< ElementGenerator >(), validParams< ElementH1SemiError >(), validParams< ElementIndicator >(), validParams< ElementIntegralMaterialProperty >(), validParams< ElementL2Error >(), validParams< ElementL2ErrorFunctionAux >(), validParams< ElementLengthAux >(), validParams< ElementQualityAux >(), validParams< ElementQualityChecker >(), validParams< ElementsAlongLine >(), validParams< ElementsAlongPlane >(), validParams< ElementSubdomainIDGenerator >(), validParams< ElementVectorL2Error >(), validParams< ElementW1pError >(), validParams< EqualGradientConstraint >(), validParams< EqualValueBoundaryConstraint >(), validParams< EqualValueEmbeddedConstraint >(), validParams< ExodusTimeSequenceStepper >(), validParams< ExtraNodesetGenerator >(), validParams< FieldSplitPreconditioner >(), validParams< FileMesh >(), validParams< FileMeshGenerator >(), validParams< FunctionAux >(), validParams< FunctionDiracSource >(), validParams< FunctionDirichletBC >(), validParams< FunctionIC >(), validParams< FunctionNeumannBC >(), validParams< FunctionPenaltyDirichletBC >(), validParams< FunctionPresetBC >(), validParams< FunctionScalarAux >(), validParams< FunctionScalarIC >(), validParams< FunctionValuePostprocessor >(), validParams< GapValueAux >(), validParams< GeneratedMesh >(), validParams< GeneratedMeshGenerator >(), validParams< GenericConstantRankTwoTensor >(), validParams< HistogramVectorPostprocessor >(), validParams< ImageSubdomainGenerator >(), validParams< IndicatorMarker >(), validParams< InitialConditionBase >(), validParams< InterfaceKernel >(), validParams< InternalSideIndicator >(), validParams< IntersectionPointsAlongLine >(), validParams< IterationAdaptiveDT >(), validParams< KernelBase >(), validParams< LagrangeVecDirichletBC >(), validParams< LayeredBase >(), validParams< LayeredSideFluxAverage >(), validParams< LeastSquaresFit >(), validParams< LeastSquaresFitHistory >(), validParams< LibmeshPartitioner >(), validParams< LinearCombinationFunction >(), validParams< LinearCombinationPostprocessor >(), validParams< LinearNodalConstraint >(), validParams< LineFunctionSampler >(), validParams< LineMaterialSamplerBase< Real > >(), validParams< LineValueSampler >(), validParams< LowerDBlockFromSideset >(), validParams< LowerDBlockFromSidesetGenerator >(), validParams< MaterialAuxBase<> >(), validParams< MaterialDerivativeRankFourTestKernel >(), validParams< MaterialDerivativeRankTwoTestKernel >(), validParams< MaterialDerivativeTestAction >(), validParams< MaterialRankFourTensorAux >(), validParams< MaterialRankTwoTensorAux >(), validParams< MaterialVectorPostprocessor >(), validParams< MeshExtruder >(), validParams< MeshExtruderGenerator >(), validParams< MeshSideSet >(), validParams< MeshSideSetGenerator >(), validParams< MooseADObjectAction >(), validParams< MooseObjectAction >(), validParams< MortarConstraint >(), 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< MultiAppVectorPostprocessorTransfer >(), validParams< NearestNodeDistanceAux >(), validParams< NearestNodeValueAux >(), validParams< NodalDamper >(), validParams< NodalKernel >(), validParams< NodalL2Error >(), validParams< NodalNormalsCorner >(), validParams< NodalNormalsPreprocessor >(), validParams< NodalVariableValue >(), validParams< NodeElemConstraint >(), validParams< NodeFaceConstraint >(), validParams< OneDEqualValueConstraintBC >(), validParams< OrientedBoxInterface >(), validParams< ParsedAddSideset >(), validParams< ParsedGenerateSideset >(), validParams< ParsedMaterialBase >(), validParams< ParsedSubdomainMeshGenerator >(), validParams< ParsedSubdomainMeshModifier >(), validParams< PatternedMesh >(), validParams< PatternedMeshGenerator >(), validParams< PenaltyDirichletBC >(), validParams< PenetrationAux >(), validParams< PercentChangePostprocessor >(), validParams< PerfGraphData >(), validParams< PerformanceData >(), validParams< PhysicsBasedPreconditioner >(), validParams< PiecewiseLinearInterpolationMaterial >(), validParams< PointValue >(), validParams< PointValueSampler >(), validParams< PostprocessorComparison >(), validParams< PostprocessorDirichletBC >(), validParams< PostprocessorDT >(), validParams< Predictor >(), validParams< PresetBC >(), validParams< RealFunctionControl >(), validParams< RelativeDifferencePostprocessor >(), validParams< RenameBlockGenerator >(), validParams< RenameBoundaryGenerator >(), validParams< RinglebMesh >(), validParams< RinglebMeshGenerator >(), validParams< SamplerBase >(), validParams< ScalarComponentIC >(), validParams< ScalarKernel >(), validParams< ScalarL2Error >(), validParams< ScalarVariable >(), validParams< ScalePostprocessor >(), validParams< SideFluxIntegral >(), validParams< SideSetsAroundSubdomain >(), validParams< SideSetsAroundSubdomainGenerator >(), validParams< SideSetsBetweenSubdomains >(), validParams< SideSetsBetweenSubdomainsGenerator >(), validParams< SideSetsFromBoundingBoxGenerator >(), validParams< SideSetsFromNormals >(), validParams< SideSetsFromNormalsGenerator >(), validParams< SideSetsFromPoints >(), validParams< SideSetsFromPointsGenerator >(), validParams< SmoothMeshGenerator >(), validParams< SolutionAux >(), validParams< SolutionFunction >(), validParams< SolutionTimeAdaptiveDT >(), validParams< SolutionUserObject >(), validParams< SpatialUserObjectAux >(), validParams< SphericalAverage >(), validParams< SplineFunction >(), validParams< StackGenerator >(), validParams< StatisticsVectorPostprocessor >(), validParams< StitchedMesh >(), validParams< StitchedMeshGenerator >(), validParams< SubdomainBoundingBox >(), validParams< SubdomainBoundingBoxGenerator >(), validParams< SubdomainIDGenerator >(), validParams< TestSetupPostprocessorDataActionFunction >(), validParams< TiledMesh >(), validParams< TiledMeshGenerator >(), validParams< TimeExtremeValue >(), validParams< TimeSequenceStepper >(), validParams< Transform >(), validParams< TransformGenerator >(), validParams< UniformMarker >(), validParams< UserForcingFunctionNodalKernel >(), validParams< ValueRangeMarker >(), validParams< VariableResidual >(), validParams< VectorConstantIC >(), validParams< VectorOfPostprocessors >(), validParams< VectorPostprocessorComparison >(), validParams< VectorPostprocessorFunction >(), validParams< VectorPostprocessorVisualizationAux >(), and validParams< VolumeHistogram >().

1078 {
1079  checkParamName(name);
1080  checkConsistentType<T>(name);
1081 
1082  InputParameters::insert<T>(name);
1083  _params[name]._required = true;
1084  _params[name]._doc_string = doc_string;
1085 }
void checkParamName(const std::string &name) const
Make sure the parameter name doesn&#39;t have any invalid characters.
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addRequiredParam() [2/6]

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 1089 of file InputParameters.h.

1092 {
1093  mooseError("You cannot call addRequiredParam and supply a default value for this type, please "
1094  "use addParam instead");
1095 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ addRequiredParam() [3/6]

template<>
void InputParameters::addRequiredParam ( const std::string &  name,
const MooseEnum moose_enum,
const std::string &  doc_string 
)

Definition at line 823 of file InputParameters.C.

826 {
827  InputParameters::set<MooseEnum>(name) = moose_enum; // valid parameter is set by set_attributes
828  _params[name]._required = true;
829  _params[name]._doc_string = doc_string;
830 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addRequiredParam() [4/6]

template<>
void InputParameters::addRequiredParam ( const std::string &  name,
const MultiMooseEnum moose_enum,
const std::string &  doc_string 
)

Definition at line 834 of file InputParameters.C.

837 {
838  InputParameters::set<MultiMooseEnum>(name) =
839  moose_enum; // valid parameter is set by set_attributes
840  _params[name]._required = true;
841  _params[name]._doc_string = doc_string;
842 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ addRequiredParam() [5/6]

template<>
void InputParameters::addRequiredParam ( const std::string &  name,
const MooseEnum moose_enum,
const std::string &  doc_string 
)

◆ addRequiredParam() [6/6]

template<>
void InputParameters::addRequiredParam ( const std::string &  name,
const MultiMooseEnum moose_enum,
const std::string &  doc_string 
)

◆ addRequiredRangeCheckedParam()

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 1136 of file InputParameters.h.

Referenced by validParams< AnnularMesh >(), validParams< AnnularMeshGenerator >(), validParams< LogConstantDT >(), validParams< MaxIncrement >(), validParams< SpiralAnnularMesh >(), validParams< SpiralAnnularMeshGenerator >(), and validParams< VectorPostprocessorFunction >().

1139 {
1140  addRequiredParam<T>(name, doc_string);
1141  _params[name]._range_function = parsed_function;
1142 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ allowCopy()

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 827 of file InputParameters.h.

827 { _allow_copy = status; }
bool _allow_copy
A flag for toggling the error message in the copy constructor.

◆ applyCoupledVar()

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 732 of file InputParameters.C.

Referenced by applyParameters(), and applySpecificParameters().

733 {
734  // Disable the display of deprecated message when applying common parameters, this avoids a dump
735  // of messages
736  _show_deprecated_message = false;
737 
738  // If the local parameters has a coupled variable, populate it with the value from the common
739  // parameters, if the common parameters has the coupled variable too
740  if (hasCoupledValue(var_name))
741  {
742  if (common.hasDefaultCoupledValue(var_name))
743  {
744  // prepare a vector of default coupled values
745  std::vector<Real> defaults(common.numberDefaultCoupledValues(var_name));
746  for (unsigned int j = 0; j < common.numberDefaultCoupledValues(var_name); ++j)
747  defaults[j] = common.defaultCoupledValue(var_name, j);
748  addCoupledVar(var_name, defaults, common.getDocString(var_name));
749  }
750  else if (common.hasCoupledValue(var_name))
751  addCoupledVar(var_name, common.getDocString(var_name));
752  }
753 
754  // Enable deprecated message printing
756 }
bool hasCoupledValue(const std::string &coupling_name) const
Return whether or not the coupled variable exists.
unsigned int numberDefaultCoupledValues(const std::string &coupling_name) const
Get the number of defaulted coupled value entries.
bool _show_deprecated_message
Flag for disabling deprecated parameters message, this is used by applyParameters to avoid dumping me...
std::string getDocString(const std::string &name) const
Returns the documentation string for the specified parameter name.
bool hasDefaultCoupledValue(const std::string &coupling_name) const
Return whether or not the requested parameter has a default coupled value.
Real defaultCoupledValue(const std::string &coupling_name, unsigned int i=0) const
Get the default value for an optionally coupled variable.
void addCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.

◆ applyParameter()

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 759 of file InputParameters.C.

Referenced by applyParameters(), and applySpecificParameters().

760 {
761  // Disable the display of deprecated message when applying common parameters, this avoids a dump
762  // of messages
763  _show_deprecated_message = false;
764 
765  // Extract the properties from the local parameter for the current common parameter name
766  const bool local_exist = _values.find(common_name) != _values.end();
767  const bool local_set = _params.count(common_name) > 0 && !_params[common_name]._set_by_add_param;
768  const bool local_priv = isPrivate(common_name);
769  const bool local_valid = isParamValid(common_name);
770 
771  // Extract the properties from the common parameter
772  const bool common_exist = common._values.find(common_name) != common._values.end();
773  const bool common_priv = common.isPrivate(common_name);
774  const bool common_valid = common.isParamValid(common_name);
775 
776  /* In order to apply common parameter 4 statements must be satisfied
777  * (1) A local parameter must exist with the same name as common parameter
778  * (2) Common parameter must valid and exist
779  * (3) Local parameter must be invalid OR not have been set from its default
780  * (4) Both cannot be private
781  */
782  if (local_exist && common_exist && common_valid && (!local_valid || !local_set) &&
783  (!common_priv || !local_priv))
784  {
785  delete _values[common_name];
786  _values[common_name] = common._values.find(common_name)->second->clone();
787  set_attributes(common_name, false);
788  }
789 
790  // Enable deprecated message printing
792 }
bool isPrivate(const std::string &name) const
Returns a Boolean indicating whether the specified parameter is private or not.
bool _show_deprecated_message
Flag for disabling deprecated parameters message, this is used by applyParameters to avoid dumping me...
std::map< std::string, Metadata > _params
The actual parameter data.
virtual void set_attributes(const std::string &name, bool inserted_only) override
Override from libMesh to set user-defined attributes on our parameter.
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ applyParameters()

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 665 of file InputParameters.C.

Referenced by SetupMeshAction::act(), FEProblemBase::addOutput(), MooseADObjectAction::addRelationshipManagers(), and MooseObjectAction::addRelationshipManagers().

667 {
668  // Loop through the common parameters
669  for (const auto & it : common)
670  {
671  // Common parameter name
672  const std::string & common_name = it.first;
673 
674  // Continue to next parameter, if the current is in list of excluded parameters
675  if (std::find(exclude.begin(), exclude.end(), common_name) != exclude.end())
676  continue;
677 
678  applyParameter(common, common_name);
679  }
680 
681  // Loop through the coupled variables
682  for (std::set<std::string>::const_iterator it = common.coupledVarsBegin();
683  it != common.coupledVarsEnd();
684  ++it)
685  {
686  // Variable name
687  const std::string var_name = *it;
688 
689  // Continue to next variable, if the current is in list of excluded parameters
690  if (std::find(exclude.begin(), exclude.end(), var_name) != exclude.end())
691  continue;
692 
693  applyCoupledVar(common, var_name);
694  }
695 }
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 ...

◆ applySpecificParameters()

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 698 of file InputParameters.C.

700 {
701  // Loop through the common parameters
702  for (const auto & it : common)
703  {
704 
705  // Common parameter name
706  const std::string & common_name = it.first;
707 
708  // Continue to next parameter, if the current is not in list of included parameters
709  if (std::find(include.begin(), include.end(), common_name) == include.end())
710  continue;
711 
712  applyParameter(common, common_name);
713  }
714 
715  // Loop through the coupled variables
716  for (std::set<std::string>::const_iterator it = common.coupledVarsBegin();
717  it != common.coupledVarsEnd();
718  ++it)
719  {
720  // Variable name
721  const std::string var_name = *it;
722 
723  // Continue to next variable, if the current is not in list of included parameters
724  if (std::find(include.begin(), include.end(), var_name) == include.end())
725  continue;
726 
727  applyCoupledVar(common, var_name);
728  }
729 }
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 ...

◆ areAllRequiredParamsValid()

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 282 of file InputParameters.C.

Referenced by ActionWarehouse::buildBuildableActions().

283 {
284  for (const auto & it : *this)
285  if (isParamRequired(it.first) && !isParamValid(it.first))
286  return false;
287  return true;
288 }
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.

◆ at() [1/2]

Metadata& InputParameters::at ( const std::string &  param)
inlineprivate

Definition at line 805 of file InputParameters.h.

Referenced by inputLocation(), and paramFullpath().

806  {
807  if (_params.count(param) == 0)
808  mooseError("param '", param, "' not present in InputParams");
809  return _params[param];
810  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, Metadata > _params
The actual parameter data.

◆ at() [2/2]

const Metadata& InputParameters::at ( const std::string &  param) const
inlineprivate

Definition at line 811 of file InputParameters.h.

812  {
813  if (_params.count(param) == 0)
814  mooseError("param '", param, "' not present in InputParams");
815  return _params.at(param);
816  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, Metadata > _params
The actual parameter data.

◆ blockFullpath() [1/2]

std::string& InputParameters::blockFullpath ( )
inline

Get/set a string representing the full HIT parameter path from the input file (e.g.

"Mesh/foo") for the block containing parameters for this object.

Definition at line 722 of file InputParameters.h.

Referenced by AddICAction::act(), checkParams(), MooseADObjectAction::MooseADObjectAction(), and MooseObjectAction::MooseObjectAction().

722 { return _block_fullpath; }
std::string _block_fullpath
full HIT path of the block from the input file - used for nice error messages.

◆ blockFullpath() [2/2]

const std::string& InputParameters::blockFullpath ( ) const
inline

Definition at line 723 of file InputParameters.h.

723 { return _block_fullpath; }
std::string _block_fullpath
full HIT path of the block from the input file - used for nice error messages.

◆ blockLocation()

std::string& InputParameters::blockLocation ( )
inline

Get/set a string representing the location (i.e.

filename,linenum) in the input text for the block containing parameters for this object.

Definition at line 715 of file InputParameters.h.

Referenced by checkParams(), and Parser::walkRaw().

715 { return _block_location; };
std::string _block_location
original location of input block (i.e. filename,linenum) - used for nice error messages.

◆ checkConsistentType()

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 1252 of file InputParameters.h.

1253 {
1254  // Do we have a paremeter with the same name but a different type?
1255  InputParameters::const_iterator it = _values.find(name);
1256  if (it != _values.end() && dynamic_cast<const Parameter<T> *>(it->second) == NULL)
1257  mooseError("Attempting to set parameter \"",
1258  name,
1259  "\" with type (",
1260  demangle(typeid(T).name()),
1261  ")\nbut the parameter already exists as type (",
1262  it->second->type(),
1263  ")");
1264 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ checkParamName()

void InputParameters::checkParamName ( const std::string &  name) const
private

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

Definition at line 1045 of file InputParameters.C.

Referenced by addParam(), addPrivateParam(), addRequiredParam(), and set().

1046 {
1047  const static pcrecpp::RE valid("[\\w:/]+");
1048  if (!valid.FullMatch(name))
1049  mooseError("Invalid parameter name: '", name, "'");
1050 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ checkParams()

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 420 of file InputParameters.C.

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

421 {
422  std::string parampath = blockFullpath() != "" ? blockFullpath() : parsing_syntax;
423  std::ostringstream oss;
424  // Required parameters
425  for (const auto & it : *this)
426  {
427  if (!isParamValid(it.first) && isParamRequired(it.first))
428  {
429  oss << blockLocation() << ": missing required parameter '" << parampath + "/" + it.first
430  << "'\n";
431  oss << "\tDoc String: \"" + getDocString(it.first) + "\"" << std::endl;
432  }
433  }
434 
435  // Range checked parameters
436  for (const auto & it : *this)
437  {
438  std::string long_name(parampath + "/" + it.first);
439 
440  dynamicCastRangeCheck(Real, Real, long_name, it.first, it.second, oss);
441  dynamicCastRangeCheck(int, long, long_name, it.first, it.second, oss);
442  dynamicCastRangeCheck(long, long, long_name, it.first, it.second, oss);
443  dynamicCastRangeCheck(unsigned int, long, long_name, it.first, it.second, oss);
444  }
445 
446  // Controllable parameters
447  for (const auto & param_name : getControllableParameters())
448  {
449  if (isPrivate(param_name))
450  oss << inputLocation(param_name) << ": private parameter '" << paramFullpath(param_name)
451  << "' marked controllable";
452 
453  checkMooseType(NonlinearVariableName, param_name);
454  checkMooseType(AuxVariableName, param_name);
455  checkMooseType(VariableName, param_name);
456  checkMooseType(BoundaryName, param_name);
457  checkMooseType(SubdomainName, param_name);
458  checkMooseType(PostprocessorName, param_name);
459  checkMooseType(VectorPostprocessorName, param_name);
460  checkMooseType(UserObjectName, param_name);
461  checkMooseType(MaterialPropertyName, param_name);
462  }
463 
464  if (!oss.str().empty())
465  mooseError(oss.str());
466 }
std::set< std::string > getControllableParameters() const
Return list of controllable parameters.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
bool isPrivate(const std::string &name) const
Returns a Boolean indicating whether the specified parameter is private or not.
std::string getDocString(const std::string &name) const
Returns the documentation string for the specified parameter name.
const std::string & inputLocation(const std::string &param) const
Get/set a string representing the location in the input text the parameter originated from (i...
std::string & blockFullpath()
Get/set a string representing the full HIT parameter path from the input file (e.g.
bool isParamRequired(const std::string &name) const
Returns a boolean indicating whether the specified parameter is required or not.
std::string & blockLocation()
Get/set a string representing the location (i.e.
const std::string & paramFullpath(const std::string &param) const
Get/set a string representing the full HIT parameter path from the input file (e.g.
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ clear()

void InputParameters::clear ( )
overridevirtual

Definition at line 56 of file InputParameters.C.

57 {
58  Parameters::clear();
59  _params.clear();
60  _coupled_vars.clear();
61  _collapse_nesting = false;
64  _allow_copy = true;
65  _block_fullpath = "";
66  _block_location = "";
67 }
bool _allow_copy
A flag for toggling the error message in the copy constructor.
std::string _block_location
original location of input block (i.e. filename,linenum) - used for nice error messages.
std::string _block_fullpath
full HIT path of the block from the input file - used for nice error messages.
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::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, Metadata > _params
The actual parameter data.

◆ collapseSyntaxNesting() [1/2]

void InputParameters::collapseSyntaxNesting ( bool  collapse)

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

Definition at line 378 of file InputParameters.C.

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

379 {
380  _collapse_nesting = collapse;
381 }
bool _collapse_nesting
This parameter collapses one level of nesting in the syntax blocks.

◆ collapseSyntaxNesting() [2/2]

bool InputParameters::collapseSyntaxNesting ( ) const

Definition at line 384 of file InputParameters.C.

385 {
386  return _collapse_nesting;
387 }
bool _collapse_nesting
This parameter collapses one level of nesting in the syntax blocks.

◆ coupledVarsBegin()

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 515 of file InputParameters.h.

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

516  {
517  return _coupled_vars.begin();
518  }
std::set< std::string > _coupled_vars
The coupled variables set.

◆ coupledVarsEnd()

std::set<std::string>::const_iterator InputParameters::coupledVarsEnd ( ) const
inline

Definition at line 519 of file InputParameters.h.

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

520  {
521  return _coupled_vars.end();
522  }
std::set< std::string > _coupled_vars
The coupled variables set.

◆ declareControllable()

void InputParameters::declareControllable ( const std::string &  name,
std::set< ExecFlagType execute_flags = {} 
)

Declare the given parameters as controllable.

Definition at line 297 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< GenericConstantMaterial >(), validParams< IterationAdaptiveDT >(), validParams< LagrangeVecDirichletBC >(), validParams< NeumannBC >(), validParams< PenaltyDirichletBC >(), validParams< PresetBC >(), and validParams< VectorBodyForce >().

299 {
300  std::vector<std::string> names;
301  MooseUtils::tokenize<std::string>(input_names, names, 1, " ");
302  for (auto & name : names)
303  {
304  auto map_iter = _params.find(name);
305  if (map_iter != _params.end()) // error is handled by checkParams method
306  {
307  map_iter->second._controllable = true;
308  map_iter->second._controllable_flags = execute_flags;
309  }
310  else
311  mooseError("The input parameter '",
312  name,
313  "' does not exist, thus cannot be marked as controllable.");
314  }
315 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, Metadata > _params
The actual parameter data.
ExecFlagEnum execute_flags
Storage for the registered execute flags.

◆ defaultCoupledValue() [1/2]

Real InputParameters::defaultCoupledValue ( const std::string &  coupling_name,
unsigned int  i = 0 
) const

Get the default value for an optionally coupled variable.

Parameters
coupling_nameThe name of the coupling parameter to get the default value for.
iBy default 0, in general the index of the requested coupled default value.

Definition at line 490 of file InputParameters.C.

Referenced by applyCoupledVar(), ParsedMaterialHelper::functionParse(), Coupleable::getADDefaultValue(), Coupleable::getADDefaultVectorValue(), ScalarCoupleable::getDefaultValue(), Coupleable::getDefaultValue(), and Coupleable::getDefaultVectorValue().

491 {
492  auto value_it = _params.find(coupling_name);
493 
494  if (value_it == _params.end() || !value_it->second._have_coupled_default)
495  mooseError("Attempted to retrieve default value for coupled variable '",
496  coupling_name,
497  "' when none was provided. \n\nThere are three reasons why this may have "
498  "occurred:\n 1. The other version of params.addCoupledVar() should be used in order "
499  "to provide a default value. \n 2. This should have been a required coupled "
500  "variable added with params.addRequiredCoupledVar() \n 3. The call to get the "
501  "coupled value should have been properly guarded with isCoupled()\n");
502 
503  return value_it->second._coupled_default.at(i);
504 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, Metadata > _params
The actual parameter data.

◆ defaultCoupledValue() [2/2]

void InputParameters::defaultCoupledValue ( const std::string &  coupling_name,
Real  value,
unsigned int  i = 0 
)

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.
iBy default 0, in general the index of the requested coupled default value.

Definition at line 482 of file InputParameters.C.

483 {
484  _params[coupling_name]._coupled_default.resize(i + 1);
485  _params[coupling_name]._coupled_default[i] = value;
486  _params[coupling_name]._have_coupled_default = true;
487 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ getAutoBuildVectors()

std::map< std::string, std::pair< std::string, std::string > > InputParameters::getAutoBuildVectors ( ) const

Returns the auto build vectors for all parameters.

Definition at line 518 of file InputParameters.C.

519 {
520  std::map<std::string, std::pair<std::string, std::string>> abv;
521  for (auto it = _params.begin(); it != _params.end(); ++it)
522  {
523  if (!it->second._autobuild_vecs.first.empty())
524  abv[it->first] = it->second._autobuild_vecs;
525  }
526  return abv;
527 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ getBuildableRelationshipManagerTypes()

const std::vector< std::pair< std::string, Moose::RelationshipManagerType > > & InputParameters::getBuildableRelationshipManagerTypes ( ) const

Returns the list of buildable (or required) RelationshipManager object types for this object.

Definition at line 372 of file InputParameters.C.

Referenced by MooseADObjectAction::addRelationshipManagers(), and MooseObjectAction::addRelationshipManagers().

373 {
374  return _buildable_rm_types;
375 }
std::vector< std::pair< std::string, Moose::RelationshipManagerType > > _buildable_rm_types
The RelationshipManagers that this object may either build or require.

◆ getBuildableTypes()

const std::vector< std::string > & InputParameters::getBuildableTypes ( ) const

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

Definition at line 366 of file InputParameters.C.

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

367 {
368  return _buildable_types;
369 }
std::vector< std::string > _buildable_types
The parameter is used to restrict types that can be built.

◆ getCheckedPointerParam()

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 1063 of file InputParameters.h.

Referenced by Coupleable::Coupleable(), MooseObject::getCheckedPointerParam(), Action::getCheckedPointerParam(), MooseVariableInterface< Real >::MooseVariableInterface(), and ScalarCoupleable::ScalarCoupleable().

1065 {
1066  T param = this->get<T>(name);
1067 
1068  // Note: You will receive a compile error on this line if you attempt to pass a non-pointer
1069  // template type to this method
1070  if (param == NULL)
1071  mooseError("Parameter ", name, " is NULL.\n", error_string);
1072  return this->get<T>(name);
1073 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ getClassDescription()

std::string InputParameters::getClassDescription ( ) const

Returns the class description.

Definition at line 102 of file InputParameters.C.

Referenced by JsonSyntaxTree::addParameters().

103 {
104  return _class_description;
105 }
std::string _class_description
The class description for the owning object.

◆ getControllableExecuteOnTypes()

const std::set< ExecFlagType > & InputParameters::getControllableExecuteOnTypes ( const std::string &  name)

Return the allowed execute flags for a controllable parameter.

Definition at line 324 of file InputParameters.C.

325 {
326  return _params[name]._controllable_flags;
327 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ getControllableParameters()

std::set<std::string> InputParameters::getControllableParameters ( ) const
inline

Return list of controllable parameters.

Definition at line 690 of file InputParameters.h.

Referenced by checkParams().

691  {
692  std::set<std::string> controllable;
693  for (auto it = _params.begin(); it != _params.end(); ++it)
694  if (it->second._controllable)
695  controllable.insert(it->first);
696  return controllable;
697  }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ getCoupledVariableParamNames()

const std::set<std::string>& InputParameters::getCoupledVariableParamNames ( ) const
inline

Return the coupled variable parameter names.

Definition at line 527 of file InputParameters.h.

527 { return _coupled_vars; }
std::set< std::string > _coupled_vars
The coupled variables set.

◆ getDefaultPostprocessorValue()

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 640 of file InputParameters.C.

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

641 {
642  // Check that a default exists, error if it does not
643  auto it = _params.find(name);
644  if (!suppress_error && (it == _params.end() || !it->second._have_default_postprocessor_val))
645  mooseError("A default PostprcessorValue does not exist for the given name: ", name);
646 
647  return it->second._default_postprocessor_val;
648 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, Metadata > _params
The actual parameter data.

◆ getDescription()

const std::string & InputParameters::getDescription ( const std::string &  name)

Get the documentation string for a parameter.

Definition at line 814 of file InputParameters.C.

815 {
816  if (_params.count(name) == 0)
817  mooseError("No parameter exists with the name ", name);
818  return _params[name]._doc_string;
819 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, Metadata > _params
The actual parameter data.

◆ getDocString()

std::string InputParameters::getDocString ( const std::string &  name) const

Returns the documentation string for the specified parameter name.

Definition at line 223 of file InputParameters.C.

Referenced by applyCoupledVar(), and checkParams().

224 {
225  std::string doc_string;
226  auto it = _params.find(name);
227  if (it != _params.end())
228  for (const auto & ch : it->second._doc_string)
229  {
230  if (ch == '\n')
231  doc_string += " ... ";
232  else
233  doc_string += ch;
234  }
235 
236  return doc_string;
237 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ getGroupName()

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 631 of file InputParameters.C.

632 {
633  auto it = _params.find(param_name);
634  if (it != _params.end())
635  return it->second._group;
636  return std::string();
637 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ getMooseType()

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 540 of file InputParameters.C.

Referenced by MooseObjectWarehouseBase< Indicator >::addObject(), BlockRestrictable::initializeBlockRestrictable(), isValid(), and MooseVariableInterface< Real >::MooseVariableInterface().

541 {
542  std::string var;
543 
544  if (have_parameter<VariableName>(name))
545  var = get<VariableName>(name);
546  else if (have_parameter<NonlinearVariableName>(name))
547  var = get<NonlinearVariableName>(name);
548  else if (have_parameter<AuxVariableName>(name))
549  var = get<AuxVariableName>(name);
550  else if (have_parameter<PostprocessorName>(name))
551  var = get<PostprocessorName>(name);
552  else if (have_parameter<VectorPostprocessorName>(name))
553  var = get<VectorPostprocessorName>(name);
554  else if (have_parameter<FunctionName>(name))
555  var = get<FunctionName>(name);
556  else if (have_parameter<UserObjectName>(name))
557  var = get<UserObjectName>(name);
558  else if (have_parameter<MaterialPropertyName>(name))
559  var = get<MaterialPropertyName>(name);
560  else if (have_parameter<std::string>(name))
561  var = get<std::string>(name);
562 
563  return var;
564 }

◆ getParamHelper() [1/6]

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

Definition at line 1398 of file InputParameters.h.

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

1399 {
1400  if (!pars.isParamValid(name))
1401  mooseError("The parameter \"", name, "\" is being retrieved before being set.\n");
1402 
1403  return pars.get<T>(name);
1404 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ getParamHelper() [2/6]

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 1421 of file InputParameters.h.

1424 {
1425  return pars.get<std::vector<T>>(name);
1426 }

◆ getParamHelper() [3/6]

template<>
const MooseEnum& InputParameters::getParamHelper ( const std::string &  name,
const InputParameters pars,
const MooseEnum  
)

Definition at line 1013 of file InputParameters.C.

1016 {
1017  return pars.get<MooseEnum>(name);
1018 }
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:32

◆ getParamHelper() [4/6]

template<>
const MultiMooseEnum& InputParameters::getParamHelper ( const std::string &  name,
const InputParameters pars,
const MultiMooseEnum  
)

Definition at line 1022 of file InputParameters.C.

1025 {
1026  return pars.get<MultiMooseEnum>(name);
1027 }
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...

◆ getParamHelper() [5/6]

template<>
const MooseEnum& InputParameters::getParamHelper ( const std::string &  name,
const InputParameters pars,
const MooseEnum  
)

◆ getParamHelper() [6/6]

template<>
const MultiMooseEnum& InputParameters::getParamHelper ( const std::string &  name,
const InputParameters pars,
const MultiMooseEnum  
)

◆ getSyntax()

std::vector< std::string > InputParameters::getSyntax ( const std::string &  name)

Get the syntax for a command-line parameter.

Definition at line 625 of file InputParameters.C.

626 {
627  return _params[name]._cli_flag_names;
628 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ getVecMooseType()

std::vector< std::string > InputParameters::getVecMooseType ( const std::string &  name) const

Definition at line 567 of file InputParameters.C.

Referenced by MooseObjectWarehouseBase< Indicator >::addObject(), Coupleable::Coupleable(), isValid(), MooseVariableInterface< Real >::MooseVariableInterface(), and ScalarCoupleable::ScalarCoupleable().

568 {
569  std::vector<std::string> svars;
570 
571  if (have_parameter<std::vector<VariableName>>(name))
572  {
573  std::vector<VariableName> vars = get<std::vector<VariableName>>(name);
574  std::copy(vars.begin(), vars.end(), std::back_inserter(svars));
575  }
576  else if (have_parameter<std::vector<NonlinearVariableName>>(name))
577  {
578  std::vector<NonlinearVariableName> vars = get<std::vector<NonlinearVariableName>>(name);
579  std::copy(vars.begin(), vars.end(), std::back_inserter(svars));
580  }
581  else if (have_parameter<std::vector<AuxVariableName>>(name))
582  {
583  std::vector<AuxVariableName> vars = get<std::vector<AuxVariableName>>(name);
584  std::copy(vars.begin(), vars.end(), std::back_inserter(svars));
585  }
586  else if (have_parameter<std::vector<MaterialPropertyName>>(name))
587  {
588  std::vector<MaterialPropertyName> vars = get<std::vector<MaterialPropertyName>>(name);
589  std::copy(vars.begin(), vars.end(), std::back_inserter(svars));
590  }
591  else if (have_parameter<std::vector<std::string>>(name))
592  {
593  std::vector<std::string> vars = get<std::vector<std::string>>(name);
594  std::copy(vars.begin(), vars.end(), std::back_inserter(svars));
595  }
596 
597  return svars;
598 }

◆ hasCoupledValue()

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 469 of file InputParameters.C.

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

470 {
471  return _coupled_vars.find(coupling_name) != _coupled_vars.end();
472 }
std::set< std::string > _coupled_vars
The coupled variables set.

◆ hasDefaultCoupledValue()

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 475 of file InputParameters.C.

Referenced by applyCoupledVar(), Coupleable::coupledComponents(), and FunctionMaterialBase::FunctionMaterialBase().

476 {
477  return _params.count(coupling_name) > 0 && _params.at(coupling_name)._have_coupled_default &&
478  _coupled_vars.count(coupling_name) > 0;
479 }
std::set< std::string > _coupled_vars
The coupled variables set.
std::map< std::string, Metadata > _params
The actual parameter data.

◆ hasDefaultPostprocessorValue()

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 659 of file InputParameters.C.

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

660 {
661  return _params.count(name) > 0 && _params.at(name)._have_default_postprocessor_val;
662 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ inputLocation() [1/2]

const std::string& InputParameters::inputLocation ( const std::string &  param) const
inline

Get/set a string representing the location in the input text the parameter originated from (i.e.

filename,linenum) for the given param.

Definition at line 731 of file InputParameters.h.

Referenced by checkParams(), MooseObject::paramError(), Action::paramError(), MooseObject::paramInfo(), Action::paramInfo(), MooseObject::paramWarning(), and Action::paramWarning().

732  {
733  return at(param)._input_location;
734  };
std::string _input_location
original location of parameter (i.e. filename,linenum) - used for nice error messages.
Metadata & at(const std::string &param)

◆ inputLocation() [2/2]

std::string& InputParameters::inputLocation ( const std::string &  param)
inline

Definition at line 735 of file InputParameters.h.

735 { return at(param)._input_location; };
std::string _input_location
original location of parameter (i.e. filename,linenum) - used for nice error messages.
Metadata & at(const std::string &param)

◆ isControllable()

bool InputParameters::isControllable ( const std::string &  name)

Returns a Boolean indicating whether the specified parameter is controllable.

Definition at line 318 of file InputParameters.C.

319 {
320  return _params.count(name) > 0 && _params[name]._controllable;
321 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ isParamDeprecated()

bool InputParameters::isParamDeprecated ( const std::string &  name) const

Returns True if the parameters is deprecated.

Definition at line 276 of file InputParameters.C.

277 {
278  return _params.count(name) > 0 && !_params.at(name)._deprecation_message.empty();
279 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ isParamRequired()

bool InputParameters::isParamRequired ( const std::string &  name) const

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

Definition at line 251 of file InputParameters.C.

Referenced by areAllRequiredParamsValid(), and checkParams().

252 {
253  return _params.count(name) > 0 && _params.at(name)._required;
254 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ isParamSetByAddParam()

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 270 of file InputParameters.C.

Referenced by Transient::init(), MooseApp::MooseApp(), and Transient::Transient().

271 {
272  return _params.count(name) > 0 && _params.at(name)._set_by_add_param;
273 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ isParamSetByUser()

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 803 of file InputParameters.C.

Referenced by CreateProblemAction::act(), CreateProblemDefaultAction::act(), BreakMeshByBlockGeneratorBase::BreakMeshByBlockGeneratorBase(), BreakMeshByBlockBase::checkInputParameter(), Console::Console(), Executioner::Executioner(), Exodus::Exodus(), Console::initialSetup(), InterfaceKernel::InterfaceKernel(), paramSetByUser(), RandomIC::RandomIC(), Transient::setupTimeIntegrator(), and Transient::Transient().

804 {
805  if (!isParamValid(name))
806  // if the parameter is invalid, it is for sure not set by the user
807  return false;
808  else
809  // If the parameters is not located in the list, then it was set by the user
810  return _params.count(name) > 0 && !_params.at(name)._set_by_add_param;
811 }
std::map< std::string, Metadata > _params
The actual parameter data.
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ isParamValid()

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 257 of file InputParameters.C.

Referenced by AddPeriodicBCAction::act(), MaterialOutputAction::act(), FEProblem::addLineSearch(), MooseObjectWarehouseBase< Indicator >::addObject(), JsonSyntaxTree::addParameters(), applyParameter(), areAllRequiredParamsValid(), BoundsAux::BoundsAux(), checkParams(), AppFactory::createShared(), FileRangeBuilder::FileRangeBuilder(), GapValueAux::GapValueAux(), ExtraNodesetGenerator::generate(), MooseApp::getCheckpointDirectories(), getParamHelper(), InterfaceKernel::InterfaceKernel(), isParamSetByUser(), MooseObject::isParamValid(), Action::isParamValid(), MooseApp::isParamValid(), isValid(), LayeredBase::LayeredBase(), LayeredSideIntegral::LayeredSideIntegral(), MaterialPropertyInterface::MaterialPropertyInterface(), AddExtraNodeset::modify(), NodeFaceConstraint::NodeFaceConstraint(), PenetrationAux::PenetrationAux(), PiecewiseBilinear::PiecewiseBilinear(), PiecewiseLinearInterpolationMaterial::PiecewiseLinearInterpolationMaterial(), rangeCheck(), MeshBaseImageSampler::setupImageSampler(), ImageSampler::setupImageSampler(), SetupMeshAction::setupMesh(), Moose::PetscSupport::storePetscOptions(), Moose::SlepcSupport::storeSlepcOptions(), DumpObjectsProblem::stringifyParameters(), validParams< BlockRestrictable >(), validParams< BoundaryRestrictable >(), validParams< BoundaryRestrictableRequired >(), MeshBaseImageSampler::vtkMagnitude(), ImageSampler::vtkMagnitude(), ImageSampler::vtkThreshold(), and MeshBaseImageSampler::vtkThreshold().

258 {
259  if (have_parameter<MooseEnum>(name))
260  return get<MooseEnum>(name).isValid();
261  else if (have_parameter<MultiMooseEnum>(name))
262  return get<MultiMooseEnum>(name).isValid();
263  else if (have_parameter<ExecFlagEnum>(name))
264  return get<ExecFlagEnum>(name).isValid();
265  else
266  return _params.count(name) > 0 && _params.at(name)._valid;
267 }
void isValid(MooseObject *obj)
Definition: TheWarehouse.C:249
std::map< std::string, Metadata > _params
The actual parameter data.

◆ isPrivate()

bool InputParameters::isPrivate ( const std::string &  name) const

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

Definition at line 291 of file InputParameters.C.

Referenced by applyParameter(), checkParams(), and DumpObjectsProblem::stringifyParameters().

292 {
293  return _params.count(name) > 0 && _params.at(name)._is_private;
294 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ makeParamRequired()

template<typename T >
void InputParameters::makeParamRequired ( const std::string &  name)

Changes the parameter to be required.

Parameters
nameThe parameter name

Definition at line 1279 of file InputParameters.h.

1280 {
1281  if (!this->have_parameter<T>(name))
1282  mooseError("Unable to require nonexistent parameter: ", name);
1283 
1284  _params[name]._required = true;
1285 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, Metadata > _params
The actual parameter data.

◆ markControlled()

void InputParameters::markControlled ( const std::string &  name)

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

◆ mooseObjectSyntaxVisibility() [1/2]

void InputParameters::mooseObjectSyntaxVisibility ( bool  visibility)

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

Definition at line 390 of file InputParameters.C.

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

391 {
392  _moose_object_syntax_visibility = visibility;
393 }
bool _moose_object_syntax_visibility
This parameter hides derived MOOSE object types from appearing in syntax dumps.

◆ mooseObjectSyntaxVisibility() [2/2]

bool InputParameters::mooseObjectSyntaxVisibility ( ) const

Definition at line 396 of file InputParameters.C.

397 {
399 }
bool _moose_object_syntax_visibility
This parameter hides derived MOOSE object types from appearing in syntax dumps.

◆ numberDefaultCoupledValues()

unsigned int InputParameters::numberDefaultCoupledValues ( const std::string &  coupling_name) const

Get the number of defaulted coupled value entries.

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

Definition at line 507 of file InputParameters.C.

Referenced by applyCoupledVar(), Coupleable::Coupleable(), Coupleable::coupledComponents(), Coupleable::getADDefaultVectorValue(), and Coupleable::getDefaultValue().

508 {
509  auto value_it = _params.find(coupling_name);
510  if (value_it == _params.end())
511  mooseError("Attempted to retrieve default value for coupled variable '",
512  coupling_name,
513  "' when none was provided.");
514  return value_it->second._coupled_default.size();
515 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, Metadata > _params
The actual parameter data.

◆ operator+=()

InputParameters & InputParameters::operator+= ( const InputParameters rhs)

Definition at line 142 of file InputParameters.C.

143 {
144  Parameters::operator+=(rhs);
145 
146  // TODO: this is not a proper merge - if a particular parameter exists in both this and rhs,
147  // then we should actually smartly merge both metadata structs before storing in this.
148  for (auto it = rhs._params.begin(); it != rhs._params.end(); ++it)
149  _params[it->first] = it->second;
150 
151  _buildable_types.insert(
152  _buildable_types.end(), rhs._buildable_types.begin(), rhs._buildable_types.end());
153  _buildable_rm_types.insert(
154  _buildable_rm_types.end(), rhs._buildable_rm_types.begin(), rhs._buildable_rm_types.end());
155 
156  // Collapse nesting and moose object syntax hiding are not modified with +=
157  _coupled_vars.insert(rhs._coupled_vars.begin(), rhs._coupled_vars.end());
158  return *this;
159 }
std::set< std::string > _coupled_vars
The coupled variables set.
std::vector< std::string > _buildable_types
The parameter is used to restrict types that can be built.
std::map< std::string, Metadata > _params
The actual parameter data.
std::vector< std::pair< std::string, Moose::RelationshipManagerType > > _buildable_rm_types
The RelationshipManagers that this object may either build or require.

◆ operator=()

InputParameters & InputParameters::operator= ( const InputParameters rhs)

Definition at line 108 of file InputParameters.C.

109 {
110  // An error to help minimize the segmentation faults that occure when MooseObjects do not have the
111  // correct constructor
112  if (!rhs._allow_copy)
113  {
114  const std::string & name =
115  rhs.get<std::string>("_object_name"); // If _allow_parameter_copy is set then so is name
116  // (see InputParameterWarehouse::addInputParameters)
117  mooseError("Copying of the InputParameters object for the ",
118  name,
119  " object is not allowed.\n\nThe likely cause for this error ",
120  "is having a constructor that does not use a const reference, all constructors\nfor "
121  "MooseObject based classes should be as follows:\n\n",
122  " MyObject::MyObject(const InputParameters & parameters);");
123  }
124 
125  Parameters::operator=(rhs);
126 
127  _params = rhs._params;
128 
134  _allow_copy = rhs._allow_copy;
137 
138  return *this;
139 }
bool _allow_copy
A flag for toggling the error message in the copy constructor.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::string _block_location
original location of input block (i.e. filename,linenum) - used for nice error messages.
std::string _block_fullpath
full HIT path of the block from the input file - used for nice error messages.
bool _collapse_nesting
This parameter collapses one level of nesting in the syntax blocks.
std::set< std::string > _coupled_vars
The coupled variables set.
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, Metadata > _params
The actual parameter data.
std::vector< std::pair< std::string, Moose::RelationshipManagerType > > _buildable_rm_types
The RelationshipManagers that this object may either build or require.

◆ paramFullpath() [1/2]

const std::string& InputParameters::paramFullpath ( const std::string &  param) const
inline

Get/set a string representing the full HIT parameter path from the input file (e.g.

"Mesh/foo/bar" for param "bar") for the given param.

Definition at line 743 of file InputParameters.h.

Referenced by checkParams(), MooseObject::paramError(), Action::paramError(), MooseObject::paramInfo(), Action::paramInfo(), MooseObject::paramWarning(), and Action::paramWarning().

744  {
745  return at(param)._param_fullpath;
746  };
std::string _param_fullpath
full HIT path of the parameter from the input file - used for nice error messages.
Metadata & at(const std::string &param)

◆ paramFullpath() [2/2]

std::string& InputParameters::paramFullpath ( const std::string &  param)
inline

Definition at line 747 of file InputParameters.h.

747 { return at(param)._param_fullpath; };
std::string _param_fullpath
full HIT path of the parameter from the input file - used for nice error messages.
Metadata & at(const std::string &param)

◆ paramSetByUser()

bool InputParameters::paramSetByUser ( const std::string &  name) const

Deprecated method.

Use isParamSetByUser() instead.

Definition at line 796 of file InputParameters.C.

797 {
798  mooseDeprecated("paramSetByUser() is deprecated. Use isParamSetByUser() instead.");
799  return isParamSetByUser(name);
800 }
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:237
bool isParamSetByUser(const std::string &name) const
Method returns true if the parameter was by the user.

◆ rangeCheck() [1/2]

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 1021 of file InputParameters.h.

Referenced by Parser::setScalarValueTypeParameter().

1025 {
1026  mooseAssert(param, "Parameter is NULL");
1027 
1028  if (!isParamValid(short_name) || _params[short_name]._range_function.empty())
1029  return;
1030 
1031  // Parse the expression
1033  if (fp.Parse(_params[short_name]._range_function, short_name) != -1) // -1 for success
1034  {
1035  oss << "Error parsing expression: " << _params[short_name]._range_function << '\n';
1036  return;
1037  }
1038 
1039  // ensure range-checked input file parameter comparison functions
1040  // do absolute floating point comparisons instead of using a default epsilon.
1041  auto tmp_eps = fp.epsilon();
1042  fp.setEpsilon(0);
1043  // We require a non-const value for the implicit upscaling of the parameter type
1044  std::vector<UP_T> value(1, param->set());
1045  UP_T result = fp.Eval(&value[0]);
1046  fp.setEpsilon(tmp_eps);
1047 
1048  if (fp.EvalError())
1049  {
1050  oss << "Error evaluating expression: " << _params[short_name]._range_function
1051  << "\nPerhaps you used the wrong variable name?\n";
1052  return;
1053  }
1054 
1055  if (!result)
1056  oss << "Range check failed for parameter " << full_name
1057  << "\n\tExpression: " << _params[short_name]._range_function << "\n\tValue: " << value[0]
1058  << '\n';
1059 }
std::map< std::string, Metadata > _params
The actual parameter data.
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ rangeCheck() [2/2]

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 908 of file InputParameters.h.

912 {
913  mooseAssert(param, "Parameter is NULL");
914 
915  if (!isParamValid(short_name) || _params[short_name]._range_function.empty())
916  return;
917 
930  std::vector<std::string> vars;
931  if (fp.ParseAndDeduceVariables(_params[short_name]._range_function, vars) != -1) // -1 for success
932  {
933  oss << "Error parsing expression: " << _params[short_name]._range_function << '\n';
934  return;
935  }
936 
937  // Fparser parameter buffer
938  std::vector<UP_T> parbuf(vars.size());
939 
940  // parameter vector
941  const std::vector<T> & value = param->set();
942 
943  // iterate over all vector values (maybe ;)
944  bool need_to_iterate = false;
945  unsigned int i = 0;
946  do
947  {
948  // set parameters
949  for (unsigned int j = 0; j < vars.size(); j++)
950  {
951  if (vars[j] == short_name)
952  {
953  if (value.size() == 0)
954  {
955  oss << "Range checking empty vector: " << _params[short_name]._range_function << '\n';
956  return;
957  }
958 
959  parbuf[j] = value[i];
960  need_to_iterate = true;
961  }
962  else if (vars[j] == short_name + "_size")
963  parbuf[j] = value.size();
964  else
965  {
966  if (vars[j].substr(0, short_name.size() + 1) != short_name + "_")
967  {
968  oss << "Error parsing expression: " << _params[short_name]._range_function << '\n';
969  return;
970  }
971  std::istringstream iss(vars[j]);
972  iss.seekg(short_name.size() + 1);
973 
974  size_t index;
975  if (iss >> index && iss.eof())
976  {
977  if (index >= value.size())
978  {
979  oss << "Error parsing expression: " << _params[short_name]._range_function
980  << "\nOut of range variable " << vars[j] << '\n';
981  return;
982  }
983  parbuf[j] = value[index];
984  }
985  else
986  {
987  oss << "Error parsing expression: " << _params[short_name]._range_function
988  << "\nInvalid variable " << vars[j] << '\n';
989  return;
990  }
991  }
992  }
993 
994  // ensure range-checked input file parameter comparison functions
995  // do absolute floating point comparisons instead of using a default epsilon.
996  auto tmp_eps = fp.epsilon();
997  fp.setEpsilon(0);
998  UP_T result = fp.Eval(&parbuf[0]);
999  fp.setEpsilon(tmp_eps);
1000 
1001  // test function using the parameters determined above
1002  if (fp.EvalError())
1003  {
1004  oss << "Error evaluating expression: " << _params[short_name]._range_function << '\n';
1005  return;
1006  }
1007 
1008  if (!result)
1009  {
1010  oss << "Range check failed for parameter " << full_name
1011  << "\n\tExpression: " << _params[short_name]._range_function << "\n";
1012  if (need_to_iterate)
1013  oss << "\t Component: " << i << '\n';
1014  }
1015 
1016  } while (need_to_iterate && ++i < value.size());
1017 }
std::map< std::string, Metadata > _params
The actual parameter data.
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ rawParamVal()

std::string& InputParameters::rawParamVal ( const std::string &  param)
inline

Get/set a string representing the raw, unmodified token text for the given param.

This is usually only set/useable for file-path type parameters.

Definition at line 754 of file InputParameters.h.

Referenced by Parser::setFilePathParam(), and Parser::setVectorFilePathParam().

754 { return _params[param]._raw_val; };
std::map< std::string, Metadata > _params
The actual parameter data.

◆ registerBase()

void InputParameters::registerBase ( const std::string &  value)

◆ registerBuildableTypes()

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 337 of file InputParameters.C.

338 {
339  _buildable_types.clear();
340  MooseUtils::tokenize(names, _buildable_types, 1, " \t\n\v\f\r"); // tokenize on whitespace
341 }
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:429
std::vector< std::string > _buildable_types
The parameter is used to restrict types that can be built.

◆ registerRelationshipManagers()

void InputParameters::registerRelationshipManagers ( const std::string &  names,
const std::string &  use_as_rm_types = "" 
)

Declares the types of RelationshipManagers that the owning object will either construct (in the case of Actions) or requires (in the case of every other MooseObject).

With normal MooseObject-derived types built by MooseObjectAction, MOOSE will attempt to use the InputParameters available to it to construct the required RelationshipManager automatically. Actions may run custom logic to create RelationshipManagers. The names and rm_type lists must have the same number of entries.

Parameters
namesA space delimited list of RelationshipMangers that may be built by this object.

Definition at line 344 of file InputParameters.C.

346 {
347  _buildable_rm_types.clear();
348 
349  std::vector<std::string> buildable_rm_types;
350  MooseUtils::tokenize(names, buildable_rm_types, 1, " \t\n\v\f\r"); // tokenize on whitespace
351 
352  std::vector<std::string> use_as_rm_type_strings;
353  MooseUtils::tokenize(use_as_rm_types, use_as_rm_type_strings, 1, " \t\n\v\f\r");
354 
355  for (std::size_t i = 0; i < buildable_rm_types.size(); ++i)
356  {
358  if (i < use_as_rm_type_strings.size())
359  use_as_type = Moose::stringToEnum<Moose::RelationshipManagerType>(use_as_rm_type_strings[i]);
360 
361  _buildable_rm_types.emplace_back(std::make_pair(buildable_rm_types[i], use_as_type));
362  }
363 }
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:429
RelationshipManagerType
Main types of Relationship Managers.
Definition: MooseTypes.h:659
std::vector< std::pair< std::string, Moose::RelationshipManagerType > > _buildable_rm_types
The RelationshipManagers that this object may either build or require.

◆ reservedValues()

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 1036 of file InputParameters.C.

1037 {
1038  auto it = _params.find(name);
1039  if (it == _params.end())
1040  return std::set<std::string>();
1041  return it->second._reserved_values;
1042 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ set()

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 kept with set_by_add_param=true, this is generally not needed.

"quite_mode" returns a writable reference to the named parameter, without setting set_by_add_param to false. 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 890 of file InputParameters.h.

Referenced by AB2PredictorCorrector::AB2PredictorCorrector(), CreateExecutionerAction::act(), PartitionerAction::act(), AddICAction::act(), AddMeshModifierAction::act(), CreateProblemAction::act(), SetupDebugAction::act(), SetupMeshAction::act(), CreateDisplacedProblemAction::act(), SetupPredictorAction::act(), SetupTimeStepperAction::act(), SetupResidualDebugAction::act(), MaterialDerivativeTestAction::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(), FEProblem::addLineSearch(), FEProblemBase::addMarker(), FEProblemBase::addMaterialHelper(), FEProblemBase::addMultiApp(), FEProblemBase::addNodalKernel(), FEProblemBase::addOutput(), FEProblemBase::addPredictor(), FEProblemBase::addScalarKernel(), AuxiliarySystem::addTimeIntegrator(), NonlinearSystemBase::addTimeIntegrator(), FEProblemBase::addTimeIntegrator(), FEProblemBase::addTransfer(), FEProblemBase::addUserObject(), AStableDirk4::AStableDirk4(), ActionWarehouse::buildBuildableActions(), Parser::buildFullTree(), Parser::buildJsonSyntaxTree(), MooseObjectUnitTest::buildObjects(), OversampleOutput::cloneMesh(), CommonOutputAction::create(), ActionFactory::create(), Factory::create(), MultiApp::createApp(), AppFactory::createAppShared(), AddVariableAction::createInitialConditionAction(), MooseApp::createMinimalApp(), AppFactory::createShared(), FEProblemBase::getFunction(), MaterialOutputAction::getParams(), Moose::SlepcSupport::getSlepcValidParams(), Transient::init(), NearestPointBase< LayeredAverage >::NearestPointBase(), MultiAppProjectionTransfer::projectSolution(), GlobalParamsAction::setDoubleIndexParam(), FEProblem::setInputParametersFEProblem(), FEProblemBase::setInputParametersFEProblem(), GlobalParamsAction::setScalarParam(), MooseApp::setupOptions(), GlobalParamsAction::setVectorParam(), validParams< AlgebraicRelationshipManager >(), validParams< ControlOutput >(), validParams< ConvectiveFluxBC >(), validParams< CoupledTiedValueConstraint >(), validParams< CSVReader >(), validParams< DiscreteElementUserObject >(), validParams< DistributedGeneratedMesh >(), validParams< DOFMapOutput >(), validParams< EigenDirichletBC >(), validParams< ElementQualityChecker >(), validParams< ElementVariablesDifferenceMax >(), validParams< EqualValueEmbeddedConstraint >(), validParams< ExternalProblem >(), validParams< GapValueAux >(), validParams< GeometricRelationshipManager >(), validParams< InterfaceTimeKernel >(), validParams< LeastSquaresFitHistory >(), validParams< Marker >(), validParams< Material >(), validParams< MultiAppTransfer >(), validParams< NearestNodeDistanceAux >(), validParams< NearestNodeValueAux >(), validParams< NodalL2Norm >(), validParams< NodalNormalBC >(), validParams< NodalNormalsEvaluator >(), validParams< NodalSum >(), validParams< ODETimeKernel >(), validParams< PenetrationAux >(), validParams< PerfGraphOutput >(), validParams< SamplerBase >(), validParams< ScalarConstantIC >(), validParams< SetupMeshAction >(), validParams< SinDirichletBC >(), validParams< TiedValueConstraint >(), validParams< TimeKernel >(), validParams< TimeNodalKernel >(), validParams< TopResidualDebugOutput >(), validParams< Transfer >(), validParams< TwoMaterialPropertyInterface >(), validParams< UserObject >(), validParams< VariableResidualNormsDebugOutput >(), validParams< VectorOfPostprocessors >(), validParams< VTKOutput >(), and Parser::walkRaw().

891 {
892  checkParamName(name);
893  checkConsistentType<T>(name);
894 
895  if (!this->have_parameter<T>(name))
896  _values[name] = new Parameter<T>;
897 
898  set_attributes(name, false);
899 
900  if (quiet_mode)
901  _params[name]._set_by_add_param = true;
902 
903  return cast_ptr<Parameter<T> *>(_values[name])->set();
904 }
void checkParamName(const std::string &name) const
Make sure the parameter name doesn&#39;t have any invalid characters.
std::map< std::string, Metadata > _params
The actual parameter data.
virtual void set_attributes(const std::string &name, bool inserted_only) override
Override from libMesh to set user-defined attributes on our parameter.

◆ set_attributes()

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 76 of file InputParameters.C.

Referenced by applyParameter(), and set().

77 {
78  if (!inserted_only)
79  {
86  _params[name]._set_by_add_param = false;
87 
88  // valid_params don't make sense for MooseEnums
89  if (!have_parameter<MooseEnum>(name) && !have_parameter<MultiMooseEnum>(name))
90  _params[name]._valid = true;
91 
93  {
94  if (_params.count(name) && !_params[name]._deprecation_message.empty())
96  "The parameter ", name, " is deprecated.\n", _params[name]._deprecation_message);
97  }
98  }
99 }
bool _show_deprecated_message
Flag for disabling deprecated parameters message, this is used by applyParameters to avoid dumping me...
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:237
std::map< std::string, Metadata > _params
The actual parameter data.

◆ setDefaultPostprocessorValue()

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 651 of file InputParameters.C.

653 {
654  _params[name]._default_postprocessor_val = value;
655  _params[name]._have_default_postprocessor_val = true;
656 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ setDocString()

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 240 of file InputParameters.C.

Referenced by Moose::SlepcSupport::getSlepcValidParams(), and validParams< MultiAppTransfer >().

241 {
242  auto it = _params.find(name);
243  if (it == _params.end())
244  mooseError("Unable to set the documentation string (using setDocString) for the \"",
245  name,
246  "\" parameter, the parameter does not exist.");
247  it->second._doc_string = doc;
248 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, Metadata > _params
The actual parameter data.

◆ setParamHelper() [1/13]

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 1129 of file InputParameters.h.

Referenced by addParam().

1130 {
1131  l_value = r_value;
1132 }

◆ setParamHelper() [2/13]

template<>
void InputParameters::setParamHelper ( const std::string &  name,
PostprocessorName &  l_value,
const Real &  r_value 
)
private

Definition at line 933 of file InputParameters.C.

936 {
937  // Store the default value
938  _params[name]._default_postprocessor_val = r_value;
939  _params[name]._have_default_postprocessor_val = true;
940 
941  // Assign the default value so that it appears in the dump
942  std::ostringstream oss;
943  oss << r_value;
944  l_value = oss.str();
945 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ setParamHelper() [3/13]

template<>
void InputParameters::setParamHelper ( const std::string &  name,
PostprocessorName &  l_value,
const int &  r_value 
)
private

Definition at line 949 of file InputParameters.C.

952 {
953  // Store the default value
954  _params[name]._default_postprocessor_val = r_value;
955  _params[name]._have_default_postprocessor_val = true;
956 
957  // Assign the default value so that it appears in the dump
958  std::ostringstream oss;
959  oss << r_value;
960  l_value = oss.str();
961 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ setParamHelper() [4/13]

template<>
void InputParameters::setParamHelper ( const std::string &  ,
FunctionName &  l_value,
const Real &  r_value 
)
private

Definition at line 965 of file InputParameters.C.

968 {
969  // Assign the default value so that it appears in the dump
970  std::ostringstream oss;
971  oss << r_value;
972  l_value = oss.str();
973 }

◆ setParamHelper() [5/13]

template<>
void InputParameters::setParamHelper ( const std::string &  ,
FunctionName &  l_value,
const int &  r_value 
)
private

Definition at line 977 of file InputParameters.C.

980 {
981  // Assign the default value so that it appears in the dump
982  std::ostringstream oss;
983  oss << r_value;
984  l_value = oss.str();
985 }

◆ setParamHelper() [6/13]

template<>
void InputParameters::setParamHelper ( const std::string &  ,
MaterialPropertyName &  l_value,
const Real &  r_value 
)
private

Definition at line 989 of file InputParameters.C.

992 {
993  // Assign the default value so that it appears in the dump
994  std::ostringstream oss;
995  oss << r_value;
996  l_value = oss.str();
997 }

◆ setParamHelper() [7/13]

template<>
void InputParameters::setParamHelper ( const std::string &  ,
MaterialPropertyName &  l_value,
const int &  r_value 
)
private

Definition at line 1001 of file InputParameters.C.

1004 {
1005  // Assign the default value so that it appears in the dump
1006  std::ostringstream oss;
1007  oss << r_value;
1008  l_value = oss.str();
1009 }

◆ setParamHelper() [8/13]

template<>
void InputParameters::setParamHelper ( const std::string &  name,
PostprocessorName &  l_value,
const Real &  r_value 
)
private

◆ setParamHelper() [9/13]

template<>
void InputParameters::setParamHelper ( const std::string &  name,
PostprocessorName &  l_value,
const int &  r_value 
)
private

◆ setParamHelper() [10/13]

template<>
void InputParameters::setParamHelper ( const std::string &  ,
FunctionName &  l_value,
const Real &  r_value 
)
private

◆ setParamHelper() [11/13]

template<>
void InputParameters::setParamHelper ( const std::string &  ,
FunctionName &  l_value,
const int &  r_value 
)
private

◆ setParamHelper() [12/13]

template<>
void InputParameters::setParamHelper ( const std::string &  ,
MaterialPropertyName &  l_value,
const Real &  r_value 
)
private

◆ setParamHelper() [13/13]

template<>
void InputParameters::setParamHelper ( const std::string &  ,
MaterialPropertyName &  l_value,
const int &  r_value 
)
private

◆ setReservedValues()

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 1030 of file InputParameters.C.

Referenced by validParams< OutputInterface >().

1031 {
1032  _params[name]._reserved_values = reserved;
1033 }
std::map< std::string, Metadata > _params
The actual parameter data.

◆ suppressParameter()

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 1268 of file InputParameters.h.

Referenced by validParams< CentroidMultiApp >(), validParams< CSV >(), validParams< DiscreteElementUserObject >(), validParams< GridPartitioner >(), validParams< MaterialPropertyDebugOutput >(), and validParams< VariableResidualNormsDebugOutput >().

1269 {
1270  if (!this->have_parameter<T>(name))
1271  mooseError("Unable to suppress nonexistent parameter: ", name);
1272 
1273  _params[name]._required = false;
1274  _params[name]._is_private = true;
1275 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, Metadata > _params
The actual parameter data.

◆ type()

std::string InputParameters::type ( const std::string &  name)

Prints the type of the requested parameter by name.

Definition at line 530 of file InputParameters.C.

531 {
532  if (_coupled_vars.find(name) != _coupled_vars.end())
533  return "std::vector<VariableName>";
534  else if (_params.count(name) > 0 && !_params[name]._custom_type.empty())
535  return _params[name]._custom_type;
536  return _values[name]->type();
537 }
std::set< std::string > _coupled_vars
The coupled variables set.
std::map< std::string, Metadata > _params
The actual parameter data.

Friends And Related Function Documentation

◆ emptyInputParameters

InputParameters emptyInputParameters ( )
friend

Definition at line 24 of file InputParameters.C.

25 {
26  InputParameters params;
27  return params;
28 }
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...

◆ InputParameterWarehouse

friend class InputParameterWarehouse
friend

Definition at line 884 of file InputParameters.h.

Member Data Documentation

◆ _allow_copy

bool InputParameters::_allow_copy
private

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

Definition at line 880 of file InputParameters.h.

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

◆ _block_fullpath

std::string InputParameters::_block_fullpath
private

full HIT path of the block from the input file - used for nice error messages.

Definition at line 845 of file InputParameters.h.

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

◆ _block_location

std::string InputParameters::_block_location
private

original location of input block (i.e. filename,linenum) - used for nice error messages.

Definition at line 842 of file InputParameters.h.

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

◆ _buildable_rm_types

std::vector<std::pair<std::string, Moose::RelationshipManagerType> > InputParameters::_buildable_rm_types
private

The RelationshipManagers that this object may either build or require.

The optional second argument may be supplied to "downgrade" the functionality of the corresponding relationship manager (e.g. An AlgebraicRelationshipManager could be only used as a GeometricRelationshipManager for a given simulation).

Definition at line 866 of file InputParameters.h.

Referenced by getBuildableRelationshipManagerTypes(), operator+=(), operator=(), and registerRelationshipManagers().

◆ _buildable_types

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 860 of file InputParameters.h.

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

◆ _class_description

std::string InputParameters::_class_description
private

The class description for the owning object.

This string is used in many places including mouse-over events, and external documentation produced from the source code.

Definition at line 856 of file InputParameters.h.

Referenced by addClassDescription(), and getClassDescription().

◆ _collapse_nesting

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 870 of file InputParameters.h.

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

◆ _coupled_vars

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

◆ _moose_object_syntax_visibility

bool InputParameters::_moose_object_syntax_visibility
private

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

Definition at line 873 of file InputParameters.h.

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

◆ _params

std::map<std::string, Metadata> InputParameters::_params
private

◆ _show_deprecated_message

bool InputParameters::_show_deprecated_message
private

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

Definition at line 877 of file InputParameters.h.

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


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