www.mooseframework.org
ParsedMaterialBase.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 #include "ParsedMaterialBase.h"
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = emptyInputParameters();
14  params.addCoupledVar("args", "Arguments of F() - use vector coupling");
15 
16  // Constants and their values
17  params.addParam<std::vector<std::string>>(
18  "constant_names",
19  std::vector<std::string>(),
20  "Vector of constants used in the parsed function (use this for kB etc.)");
21  params.addParam<std::vector<std::string>>(
22  "constant_expressions",
23  std::vector<std::string>(),
24  "Vector of values for the constants in constant_names (can be an FParser expression)");
25 
26  // Variables with applied tolerances and their tolerance values
27  params.addParam<std::vector<std::string>>("tol_names",
28  std::vector<std::string>(),
29  "Vector of variable names to be protected from "
30  "being 0 or 1 within a tolerance (needed for log(c) "
31  "and log(1-c) terms)");
32  params.addParam<std::vector<Real>>("tol_values",
33  std::vector<Real>(),
34  "Vector of tolerance values for the variables in tol_names");
35 
36  // Material properties
37  params.addParam<std::vector<std::string>>(
38  "material_property_names",
39  std::vector<std::string>(),
40  "Vector of material properties used in the parsed function");
41 
42  // Function expression
43  params.addRequiredParam<std::string>("function",
44  "FParser function expression for the phase free energy");
45 
46  return params;
47 }
48 
49 ParsedMaterialBase::ParsedMaterialBase(const InputParameters & parameters)
50 {
51  // get function expression
52  _function = parameters.get<std::string>("function");
53 
54  // get constant vectors
55  _constant_names = parameters.get<std::vector<std::string>>("constant_names");
56  _constant_expressions = parameters.get<std::vector<std::string>>("constant_expressions");
57 
58  // get tolerance vectors
59  _tol_names = parameters.get<std::vector<std::string>>("tol_names");
60  _tol_values = parameters.get<std::vector<Real>>("tol_values");
61 }
std::vector< std::string > _constant_expressions
std::vector< std::string > _constant_names
constant vectors
std::string _function
function expression
std::vector< std::string > _tol_names
tolerance vectors
InputParameters validParams< ParsedMaterialBase >()
ParsedMaterialBase(const InputParameters &parameters)
std::vector< Real > _tol_values