ParsedMaterial

Parsed expression Material.

Sets up a single material property that is computed using a parsed function expression.

A ParsedMaterial object takes the function expression as an input parameter in the form of a Function Parser expression. Parsed materials (unlike ParsedFunctions) can couple to nonlinear variables, material properties and functors. In its configuration block all nonlinear variables the function depends on ("coupled_variables"), as well as constants ("constant_names" and "constant_expressions"), other material properties ("material_property_names"), postprocessors ("postprocessor_names"), and functors ("functor_names" and "functor_symbols") are declared. Constants can be declared as parsed expressions (which can depend on previously defined constants). One application would be the definition of a temperature , the Boltzmann constant , a defect formation energy , and then an equilibrium defect concentration defined using a Boltzmann factor .

Example

The following material object creates a single property for visualization purposes. It will be 0 for phase 1, -1 for phase 2, and 1 for phase 3

  [./phasemap]
    type = ParsedMaterial
    property_name = phase
    coupled_variables = 'eta2 eta3'
    expression = 'if(eta3>0.5,1,0)-if(eta2>0.5,1,0)'
    outputs = exodus
  [../]
(moose/modules/combined/examples/phase_field-mechanics/Pattern1.i)

Input Parameters

  • blockThe list of blocks (ids or names) that this object will be applied

    C++ Type:std::vector<SubdomainName>

    Unit:(no unit assumed)

    Controllable:No

    Description:The list of blocks (ids or names) that this object will be applied

  • boundaryThe list of boundaries (ids or names) from the mesh where this object applies

    C++ Type:std::vector<BoundaryName>

    Unit:(no unit assumed)

    Controllable:No

    Description:The list of boundaries (ids or names) from the mesh where this object applies

  • computeTrueWhen false, MOOSE will not call compute methods on this material. The user must call computeProperties() after retrieving the MaterialBase via MaterialBasePropertyInterface::getMaterialBase(). Non-computed MaterialBases are not sorted for dependencies.

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:When false, MOOSE will not call compute methods on this material. The user must call computeProperties() after retrieving the MaterialBase via MaterialBasePropertyInterface::getMaterialBase(). Non-computed MaterialBases are not sorted for dependencies.

  • constant_expressionsVector of values for the constants in constant_names (can be an FParser expression)

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    Controllable:No

    Description:Vector of values for the constants in constant_names (can be an FParser expression)

  • constant_namesVector of constants used in the parsed function (use this for kB etc.)

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    Controllable:No

    Description:Vector of constants used in the parsed function (use this for kB etc.)

  • constant_onNONEWhen ELEMENT, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps.When SUBDOMAIN, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps. Evaluations on element qps will be skipped

    Default:NONE

    C++ Type:MooseEnum

    Unit:(no unit assumed)

    Options:NONE, ELEMENT, SUBDOMAIN

    Controllable:No

    Description:When ELEMENT, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps.When SUBDOMAIN, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps. Evaluations on element qps will be skipped

  • coupled_variablesVector of variables used in the parsed function

    C++ Type:std::vector<VariableName>

    Unit:(no unit assumed)

    Controllable:No

    Description:Vector of variables used in the parsed function

  • declare_suffixAn optional suffix parameter that can be appended to any declared properties. The suffix will be prepended with a '_' character.

    C++ Type:MaterialPropertyName

    Unit:(no unit assumed)

    Controllable:No

    Description:An optional suffix parameter that can be appended to any declared properties. The suffix will be prepended with a '_' character.

  • epsilon1e-12Fuzzy comparison tolerance

    Default:1e-12

    C++ Type:double

    Unit:(no unit assumed)

    Controllable:No

    Description:Fuzzy comparison tolerance

  • error_on_missing_material_propertiesTrueThrow an error if any explicitly requested material property does not exist. Otherwise assume it to be zero.

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Throw an error if any explicitly requested material property does not exist. Otherwise assume it to be zero.

  • expressionParsed function (see FParser) expression for the parsed material

    C++ Type:FunctionExpression

    Unit:(no unit assumed)

    Controllable:No

    Description:Parsed function (see FParser) expression for the parsed material

  • extra_symbolsSpecial symbols, like point coordinates, time, and timestep size.

    C++ Type:MultiMooseEnum

    Unit:(no unit assumed)

    Options:x, y, z, t, dt

    Controllable:No

    Description:Special symbols, like point coordinates, time, and timestep size.

  • functor_namesFunctors to use in the parsed expression

    C++ Type:std::vector<MooseFunctorName>

    Unit:(no unit assumed)

    Controllable:No

    Description:Functors to use in the parsed expression

  • functor_symbolsSymbolic name to use for each functor in 'functor_names' in the parsed expression. If not provided, then the actual functor names will be used in the parsed expression.

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    Controllable:No

    Description:Symbolic name to use for each functor in 'functor_names' in the parsed expression. If not provided, then the actual functor names will be used in the parsed expression.

  • material_property_namesVector of material properties used in the parsed function

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    Controllable:No

    Description:Vector of material properties used in the parsed function

  • postprocessor_namesVector of postprocessor names used in the parsed function

    C++ Type:std::vector<PostprocessorName>

    Unit:(no unit assumed)

    Controllable:No

    Description:Vector of postprocessor names used in the parsed function

  • prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

    C++ Type:MaterialPropertyName

    Unit:(no unit assumed)

    Controllable:No

    Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

  • property_nameFName of the parsed material property

    Default:F

    C++ Type:std::string

    Unit:(no unit assumed)

    Controllable:No

    Description:Name of the parsed material property

  • tol_namesVector of variable names to be protected from being 0 or 1 within a tolerance (needed for log(c) and log(1-c) terms)

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    Controllable:No

    Description:Vector of variable names to be protected from being 0 or 1 within a tolerance (needed for log(c) and log(1-c) terms)

  • tol_valuesVector of tolerance values for the variables in tol_names

    C++ Type:std::vector<double>

    Unit:(no unit assumed)

    Controllable:No

    Description:Vector of tolerance values for the variables in tol_names

  • upstream_materialsList of upstream material properties that must be evaluated when compute=false

    C++ Type:std::vector<MaterialName>

    Unit:(no unit assumed)

    Controllable:No

    Description:List of upstream material properties that must be evaluated when compute=false

  • use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

Optional Parameters

  • control_tagsAdds user-defined labels for accessing object parameters via control logic.

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    Controllable:No

    Description:Adds user-defined labels for accessing object parameters via control logic.

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:Yes

    Description:Set the enabled status of the MooseObject.

  • implicitTrueDetermines whether this object is calculated using an implicit or explicit form

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Determines whether this object is calculated using an implicit or explicit form

  • seed0The seed for the master random number generator

    Default:0

    C++ Type:unsigned int

    Unit:(no unit assumed)

    Controllable:No

    Description:The seed for the master random number generator

  • use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

Advanced Parameters

  • disable_fpoptimizerFalseDisable the function parser algebraic optimizer

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Disable the function parser algebraic optimizer

  • enable_ad_cacheTrueEnable caching of function derivatives for faster startup time

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Enable caching of function derivatives for faster startup time

  • enable_auto_optimizeTrueEnable automatic immediate optimization of derivatives

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Enable automatic immediate optimization of derivatives

  • enable_jitTrueEnable just-in-time compilation of function expressions for faster evaluation

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Enable just-in-time compilation of function expressions for faster evaluation

  • evalerror_behaviornanWhat to do if evaluation error occurs. Options are to pass a nan, pass a nan with a warning, throw a error, or throw an exception

    Default:nan

    C++ Type:MooseEnum

    Unit:(no unit assumed)

    Options:nan, nan_warning, error, exception

    Controllable:No

    Description:What to do if evaluation error occurs. Options are to pass a nan, pass a nan with a warning, throw a error, or throw an exception

Parsed Expression Advanced Parameters

  • output_propertiesList of material properties, from this material, to output (outputs must also be defined to an output type)

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    Controllable:No

    Description:List of material properties, from this material, to output (outputs must also be defined to an output type)

  • outputsnone Vector of output names where you would like to restrict the output of variables(s) associated with this object

    Default:none

    C++ Type:std::vector<OutputName>

    Unit:(no unit assumed)

    Controllable:No

    Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object

Outputs Parameters