www.mooseframework.org
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ParsedMaterialBase Class Reference

Helper class for ParsedMaterial and DerivativeParsedMaterial to declare and read the input parameters. More...

#include <ParsedMaterialBase.h>

Inheritance diagram for ParsedMaterialBase:
[legend]

Public Member Functions

 ParsedMaterialBase (const InputParameters &parameters)
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Attributes

std::string _function
 function expression More...
 
std::vector< std::string > _constant_names
 constant vectors More...
 
std::vector< std::string > _constant_expressions
 
std::vector< std::string > _tol_names
 tolerance vectors More...
 
std::vector< Real_tol_values
 

Detailed Description

Helper class for ParsedMaterial and DerivativeParsedMaterial to declare and read the input parameters.

Definition at line 18 of file ParsedMaterialBase.h.

Constructor & Destructor Documentation

◆ ParsedMaterialBase()

ParsedMaterialBase::ParsedMaterialBase ( const InputParameters parameters)

Definition at line 66 of file ParsedMaterialBase.C.

67 {
68  // get function expression
69  _function = parameters.isParamValid("function") ? parameters.get<std::string>("function")
70  : parameters.get<std::string>("expression");
71 
72  // get constant vectors
73  _constant_names = parameters.get<std::vector<std::string>>("constant_names");
74  _constant_expressions = parameters.get<std::vector<std::string>>("constant_expressions");
75 
76  // get tolerance vectors
77  _tol_names = parameters.get<std::vector<std::string>>("tol_names");
78  _tol_values = parameters.get<std::vector<Real>>("tol_values");
79 }
std::vector< std::string > _constant_expressions
std::vector< std::string > _constant_names
constant vectors
std::string _function
function expression
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
std::vector< std::string > _tol_names
tolerance vectors
std::vector< Real > _tol_values
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

Member Function Documentation

◆ validParams()

InputParameters ParsedMaterialBase::validParams ( )
static

Definition at line 13 of file ParsedMaterialBase.C.

Referenced by DerivativeParsedMaterialTempl< is_ad >::validParams(), and ParsedMaterialTempl< is_ad >::validParams().

14 {
16  params.addCoupledVar("args", "Vector of variables used in the parsed function");
17  params.deprecateCoupledVar("args", "coupled_variables", "02/07/2024");
18 
19  // Constants and their values
20  params.addParam<std::vector<std::string>>(
21  "constant_names",
22  std::vector<std::string>(),
23  "Vector of constants used in the parsed function (use this for kB etc.)");
24  params.addParam<std::vector<std::string>>(
25  "constant_expressions",
26  std::vector<std::string>(),
27  "Vector of values for the constants in constant_names (can be an FParser expression)");
28 
29  // Variables with applied tolerances and their tolerance values
30  params.addParam<std::vector<std::string>>("tol_names",
31  std::vector<std::string>(),
32  "Vector of variable names to be protected from "
33  "being 0 or 1 within a tolerance (needed for log(c) "
34  "and log(1-c) terms)");
35  params.addParam<std::vector<Real>>("tol_values",
36  std::vector<Real>(),
37  "Vector of tolerance values for the variables in tol_names");
38 
39  // Material properties
40  params.addParam<std::vector<std::string>>(
41  "material_property_names",
42  std::vector<std::string>(),
43  "Vector of material properties used in the parsed function");
44 
45  // Postprocessors
46  params.addParam<std::vector<PostprocessorName>>(
47  "postprocessor_names",
48  std::vector<PostprocessorName>(),
49  "Vector of postprocessor names used in the parsed function");
50 
51  // Function expression
52  params.addDeprecatedCustomTypeParam<std::string>(
53  "function",
54  "FunctionExpression",
55  "Parsed function (see FParser) expression for the parsed material",
56  "'function' is deprecated, use 'expression' instead");
57  // TODO Make required once deprecation is handled, see #19119
58  params.addCustomTypeParam<std::string>(
59  "expression",
60  "FunctionExpression",
61  "Parsed function (see FParser) expression for the parsed material");
62 
63  return params;
64 }
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters emptyInputParameters()
void deprecateCoupledVar(const std::string &old_name, const std::string &new_name, const std::string &removal_date)
void addCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
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...

Member Data Documentation

◆ _constant_expressions

std::vector<std::string> ParsedMaterialBase::_constant_expressions
protected

◆ _constant_names

std::vector<std::string> ParsedMaterialBase::_constant_names
protected

◆ _function

std::string ParsedMaterialBase::_function
protected

◆ _tol_names

std::vector<std::string> ParsedMaterialBase::_tol_names
protected

◆ _tol_values

std::vector<Real> ParsedMaterialBase::_tol_values
protected

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