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

Material class that provides the free energy of an ideal gas with the expression builder and uses automatic differentiation to get the derivatives. More...

#include <GasFreeEnergyBase.h>

Inheritance diagram for GasFreeEnergyBase:
[legend]

Public Types

enum  VariableNameMappingMode { USE_MOOSE_NAMES, USE_PARAM_NAMES }
 
typedef std::vector< EBTermEBTermList
 
typedef std::vector< EBTermNode * > EBTermNodeList
 
typedef std::vector< const EBSubstitutionRule * > EBSubstitutionRuleList
 

Public Member Functions

 GasFreeEnergyBase (const InputParameters &parameters)
 
void functionParse (const std::string &function_expression)
 
void functionParse (const std::string &function_expression, const std::vector< std::string > &constant_names, const std::vector< std::string > &constant_expressions)
 
void functionParse (const std::string &function_expression, const std::vector< std::string > &constant_names, const std::vector< std::string > &constant_expressions, const std::vector< std::string > &mat_prop_names, const std::vector< std::string > &tol_names, const std::vector< Real > &tol_values)
 
 BINARYFUNC_OP_IMPLEMENT (+, ADD) BINARYFUNC_OP_IMPLEMENT(-
 
SUB BINARYFUNC_OP_IMPLEMENT MUL BINARYFUNC_OP_IMPLEMENT (/, DIV) BINARYFUNC_OP_IMPLEMENT(%
 
SUB BINARYFUNC_OP_IMPLEMENT MUL MOD BINARYFUNC_OP_IMPLEMENT (<, LESS) BINARYFUNC_OP_IMPLEMENT(>
 
SUB BINARYFUNC_OP_IMPLEMENT MUL MOD GREATER BINARYFUNC_OP_IMPLEMENT (<=, LESSEQ) BINARYFUNC_OP_IMPLEMENT(>
 
SUB BINARYFUNC_OP_IMPLEMENT MUL MOD GREATER GREATEREQ BINARYFUNC_OP_IMPLEMENT (==, EQ) BINARYFUNC_OP_IMPLEMENT(!
 

Protected Types

typedef std::vector< FunctionMaterialPropertyDescriptorMatPropDescriptorList
 convenience typedef for the material property descriptors More...
 

Protected Member Functions

virtual void computeProperties ()
 
virtual void functionsPostParse ()
 
void assembleDerivatives ()
 Perform a breadth first construction of all requested derivatives. More...
 
MatPropDescriptorList::iterator findMatPropDerivative (const FunctionMaterialPropertyDescriptor &)
 
virtual void functionsOptimize ()
 
unsigned int argIndex (unsigned int i_var) const
 FunctionMaterialBase keeps an internal list of all the variables the derivatives are taken w.r.t. More...
 

Protected Attributes

const EBTerm _T
 Coupled variable value for the Temperature. More...
 
const EBTerm _c
 Coupled variable value for the concentration \( c \). More...
 
const Real _omega
 lattice site volume More...
 
const Real _m
 gas molecule mass in eV*s^2/Ang^2 More...
 
const EBTerm _n
 gas number density n = N/V = c/Omega (where Omega is the lattice site volume) More...
 
const EBTerm _nq
 quantum concentration More...
 
std::vector< Derivative_derivatives
 The requested derivatives of the free energy. More...
 
const std::string _dmatvar_base
 variable base name for the dynamically material property derivatives More...
 
unsigned int _dmatvar_index
 next available variable number for automatically created material property derivative variables More...
 
unsigned int _derivative_order
 maximum derivative order More...
 
ADFunctionPtr _func_F
 The undiffed free energy function parser object. More...
 
std::vector< std::string > _variable_names
 variable names used in the expression (depends on the map_mode) More...
 
MatPropDescriptorList _mat_prop_descriptors
 Material property descriptors (obtained by parsing _mat_prop_expressions) More...
 
std::vector< Real > _tol
 Tolerance values for all arguments (to protect from log(0)). More...
 
const VariableNameMappingMode _map_mode
 Flag to indicate if MOOSE nonlinear variable names should be used as FParser variable names. More...
 
std::vector< const VariableValue * > _args
 Coupled variables for function arguments. More...
 
std::string _F_name
 Name of the function value material property and used as a base name to concatenate the material property names for the derivatives. More...
 
bool _mapping_is_unique
 Flag that indicates if exactly one linear variable is coupled per input file coupling parameter. More...
 
unsigned int _nargs
 Number of coupled arguments. More...
 
std::vector< std::string > _arg_names
 String vector of all argument names. More...
 
std::vector< unsigned int > _arg_numbers
 Vector of all argument MOOSE variable numbers. More...
 
std::vector< std::string > _arg_param_names
 String vector of the input file coupling parameter name for each argument. More...
 
std::vector< std::string > _arg_constant_defaults
 coupled variables with default values More...
 
bool _third_derivatives
 Calculate (and allocate memory for) the third derivatives of the free energy. More...
 
MaterialProperty< Real > * _prop_F
 Material property to store the function value. More...
 
const Real _h
 physical constants More...
 
const Real _kB
 

Detailed Description

Material class that provides the free energy of an ideal gas with the expression builder and uses automatic differentiation to get the derivatives.

Definition at line 23 of file GasFreeEnergyBase.h.

Member Typedef Documentation

typedef std::vector<const EBSubstitutionRule *> ExpressionBuilder::EBSubstitutionRuleList
inherited

Definition at line 57 of file ExpressionBuilder.h.

typedef std::vector<EBTerm> ExpressionBuilder::EBTermList
inherited

Definition at line 54 of file ExpressionBuilder.h.

typedef std::vector<EBTermNode *> ExpressionBuilder::EBTermNodeList
inherited

Definition at line 56 of file ExpressionBuilder.h.

convenience typedef for the material property descriptors

Definition at line 64 of file ParsedMaterialHelper.h.

Member Enumeration Documentation

Enumerator
USE_MOOSE_NAMES 
USE_PARAM_NAMES 

Definition at line 29 of file ParsedMaterialHelper.h.

Constructor & Destructor Documentation

GasFreeEnergyBase::GasFreeEnergyBase ( const InputParameters &  parameters)

Definition at line 35 of file GasFreeEnergyBase.C.

36  : DerivativeParsedMaterialHelper(parameters),
37  _T("T"),
38  _c("c"),
39  _omega(getParam<Real>("omega")),
40  _m(getParam<Real>("m") * getParam<Real>("mass_unit_conversion")),
41  _h(getParam<Real>("h")),
42  _kB(getParam<Real>("kB")),
43  _n(_c / _omega),
44  _nq(pow(2.0 * libMesh::pi * _m * _kB * _T / (_h * _h), 3.0 / 2.0))
45 {
46 }
const EBTerm _n
gas number density n = N/V = c/Omega (where Omega is the lattice site volume)
const Real _h
physical constants
DerivativeParsedMaterialHelper(const InputParameters &parameters, VariableNameMappingMode map_mode=USE_PARAM_NAMES)
const Real _omega
lattice site volume
const Real _m
gas molecule mass in eV*s^2/Ang^2
const EBTerm _nq
quantum concentration
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const EBTerm _T
Coupled variable value for the Temperature.
const EBTerm _c
Coupled variable value for the concentration .

Member Function Documentation

unsigned int FunctionMaterialBase::argIndex ( unsigned int  i_var) const
inlineprotectedinherited

FunctionMaterialBase keeps an internal list of all the variables the derivatives are taken w.r.t.

We provide the MOOSE variable bames in _arg_names, the libMesh variable numbers in _arg_numbers, and the input file parameter names in _arg_param_names. All are indexed by the argument index. This method returns the argument index for a given the libMesh variable number.

This mapping is necessary for internal classes which maintain lists of derivatives indexed by argument index and need to pull from those lists from the computeDF, computeD2F, and computeD3F methods, which receive libMesh variable numbers as parameters.

Definition at line 43 of file FunctionMaterialBase.h.

Referenced by DerivativeMultiPhaseMaterial::computeD2F(), ElasticEnergyMaterial::computeD2F(), DerivativeTwoPhaseMaterial::computeD2F(), DerivativeMultiPhaseMaterial::computeD3F(), DerivativeTwoPhaseMaterial::computeD3F(), DerivativeMultiPhaseMaterial::computeDF(), ElasticEnergyMaterial::computeDF(), DerivativeTwoPhaseMaterial::computeDF(), DerivativeMultiPhaseBase::DerivativeMultiPhaseBase(), and DiscreteNucleation::DiscreteNucleation().

44  {
45  const unsigned int idx = libMeshVarNumberRemap(i_var);
46  mooseAssert(idx < _arg_index.size() && _arg_numbers[_arg_index[idx]] == i_var,
47  "Requesting argIndex() for a derivative w.r.t. a variable not coupled to.");
48  return _arg_index[idx];
49  }
std::vector< unsigned int > _arg_index
Vector to look up the internal coupled variable index into arg* through the libMesh variable number...
unsigned int libMeshVarNumberRemap(unsigned int var) const
map the variable numbers to an even/odd interspersed pattern
std::vector< unsigned int > _arg_numbers
Vector of all argument MOOSE variable numbers.
void DerivativeParsedMaterialHelper::assembleDerivatives ( )
protectedinherited

Perform a breadth first construction of all requested derivatives.

Definition at line 73 of file DerivativeParsedMaterialHelper.C.

Referenced by DerivativeParsedMaterialHelper::functionsPostParse().

74 {
75  // need to check for zero derivatives here, otherwise at least one order is generated
76  if (_derivative_order < 1)
77  return;
78 
79  // if we are not on thread 0 we fetch all data from the thread 0 copy that already did all the
80  // work
81  if (_tid > 0)
82  {
83  // get the master object from thread 0
84  const MaterialWarehouse & material_warehouse = _fe_problem.getMaterialWarehouse();
85  const MooseObjectWarehouse<Material> & warehouse = material_warehouse[_material_data_type];
86 
87  MooseSharedPointer<DerivativeParsedMaterialHelper> master =
88  MooseSharedNamespace::dynamic_pointer_cast<DerivativeParsedMaterialHelper>(
89  warehouse.getActiveObject(name()));
90 
91  // copy parsers and declare properties
92  for (unsigned int i = 0; i < master->_derivatives.size(); ++i)
93  {
94  Derivative newderivative;
95  newderivative.first =
96  &declarePropertyDerivative<Real>(_F_name, master->_derivatives[i].darg_names);
97  newderivative.second = ADFunctionPtr(new ADFunction(*master->_derivatives[i].second));
98  _derivatives.push_back(newderivative);
99  }
100 
101  // copy coupled material properties
102  for (unsigned int i = 0; i < master->_mat_prop_descriptors.size(); ++i)
103  {
104  FunctionMaterialPropertyDescriptor newdescriptor(master->_mat_prop_descriptors[i]);
105  _mat_prop_descriptors.push_back(newdescriptor);
106  }
107 
108  // size parameter buffer
109  _func_params.resize(master->_func_params.size());
110  }
111 
112  // set up job queue. We need a deque here to be able to iterate over the currently queued items.
113  std::deque<QueueItem> queue;
114  queue.push_back(QueueItem(_func_F));
115 
116  // generate derivatives until the queue is exhausted
117  while (!queue.empty())
118  {
119  QueueItem current = queue.front();
120 
121  // all permutations of one set of derivatives are equal, so we make sure to generate only one
122  // each
123  unsigned int first = current._dargs.empty() ? 0 : current._dargs.back();
124 
125  // add necessary derivative steps
126  for (unsigned int i = first; i < _nargs; ++i)
127  {
128  // go through list of material properties and check if derivatives are needed
129  unsigned int ndesc = _mat_prop_descriptors.size();
130  for (unsigned int jj = 0; jj < ndesc; ++jj)
131  {
133 
134  // take a property descriptor and check if it depends on the current derivative variable
135  if (j->dependsOn(_arg_names[i]))
136  {
137  FunctionMaterialPropertyDescriptor matderivative(*j);
138  matderivative.addDerivative(_arg_names[i]);
139 
140  // search if this new derivative is not yet in the list of material properties
141  MatPropDescriptorList::iterator m = findMatPropDerivative(matderivative);
142  if (m == _mat_prop_descriptors.end())
143  {
144  // construct new variable name for the material property derivative as base name +
145  // number
146  std::string newvarname = _dmatvar_base + Moose::stringify(_dmatvar_index++);
147  matderivative.setSymbolName(newvarname);
148 
149  // loop over all queue items to register the new dmatvar variable (includes 'current'
150  // which is popped below)
151  for (std::deque<QueueItem>::iterator k = queue.begin(); k != queue.end(); ++k)
152  {
153  k->_F->AddVariable(newvarname);
154  k->_F->RegisterDerivative(j->getSymbolName(), _arg_names[i], newvarname);
155  }
156 
157  _mat_prop_descriptors.push_back(matderivative);
158  }
159  }
160  }
161 
162  // construct new derivative
163  QueueItem newitem = current;
164  newitem._dargs.push_back(i);
165 
166  // build derivative
167  newitem._F = ADFunctionPtr(new ADFunction(*current._F));
168  if (newitem._F->AutoDiff(_variable_names[i]) != -1)
169  mooseError(
170  "Failed to take order ", newitem._dargs.size(), " derivative in material ", _name);
171 
172  // optimize and compile
173  if (!_disable_fpoptimizer)
174  newitem._F->Optimize();
175  if (_enable_jit && !newitem._F->JITCompile())
176  mooseInfo("Failed to JIT compile expression, falling back to byte code interpretation.");
177 
178  // generate material property argument vector
179  std::vector<VariableName> darg_names(0);
180  for (unsigned int j = 0; j < newitem._dargs.size(); ++j)
181  darg_names.push_back(_arg_names[newitem._dargs[j]]);
182 
183  // append to list of derivatives if the derivative is non-vanishing
184  if (!newitem._F->isZero())
185  {
186  Derivative newderivative;
187  newderivative.first = &declarePropertyDerivative<Real>(_F_name, darg_names);
188  newderivative.second = newitem._F;
189  newderivative.darg_names = darg_names;
190  _derivatives.push_back(newderivative);
191  }
192 
193  // push item to queue if further differentiation is required
194  if (newitem._dargs.size() < _derivative_order)
195  queue.push_back(newitem);
196  }
197 
198  // remove the 'current' element from the queue
199  queue.pop_front();
200  }
201 
202  // increase the parameter buffer to provide storage for the material property derivatives
203  _func_params.resize(_nargs + _mat_prop_descriptors.size());
204 }
Helper class to perform the auto derivative taking.
std::vector< std::string > _variable_names
variable names used in the expression (depends on the map_mode)
Material properties get fully described using this structure, including their dependent variables and...
MatPropDescriptorList::iterator findMatPropDerivative(const FunctionMaterialPropertyDescriptor &)
const std::string _dmatvar_base
variable base name for the dynamically material property derivatives
const std::string & getSymbolName() const
get the fparser symbol name
unsigned int _derivative_order
maximum derivative order
unsigned int _nargs
Number of coupled arguments.
bool dependsOn(const std::string &var) const
Check if a material property depends on a given variable.
std::string _F_name
Name of the function value material property and used as a base name to concatenate the material prop...
unsigned int _dmatvar_index
next available variable number for automatically created material property derivative variables ...
std::vector< Derivative > _derivatives
The requested derivatives of the free energy.
MatPropDescriptorList _mat_prop_descriptors
Material property descriptors (obtained by parsing _mat_prop_expressions)
std::vector< std::string > _arg_names
String vector of all argument names.
ADFunctionPtr _func_F
The undiffed free energy function parser object.
ExpressionBuilder::BINARYFUNC_OP_IMPLEMENT ( ,
ADD   
)
inherited
SUB BINARYFUNC_OP_IMPLEMENT MUL ExpressionBuilder::BINARYFUNC_OP_IMPLEMENT ( ,
DIV   
)
inherited
SUB BINARYFUNC_OP_IMPLEMENT MUL MOD ExpressionBuilder::BINARYFUNC_OP_IMPLEMENT ( )
inherited
SUB BINARYFUNC_OP_IMPLEMENT MUL MOD GREATER ExpressionBuilder::BINARYFUNC_OP_IMPLEMENT ( <=  ,
LESSEQ   
)
inherited
SUB BINARYFUNC_OP_IMPLEMENT MUL MOD GREATER GREATEREQ ExpressionBuilder::BINARYFUNC_OP_IMPLEMENT ( EQ  )
inherited
void DerivativeParsedMaterialHelper::computeProperties ( )
protectedvirtualinherited

Reimplemented from ParsedMaterialHelper.

Definition at line 208 of file DerivativeParsedMaterialHelper.C.

209 {
210  for (_qp = 0; _qp < _qrule->n_points(); _qp++)
211  {
212  // fill the parameter vector, apply tolerances
213  for (unsigned int i = 0; i < _nargs; ++i)
214  {
215  if (_tol[i] < 0.0)
216  _func_params[i] = (*_args[i])[_qp];
217  else
218  {
219  Real a = (*_args[i])[_qp];
220  _func_params[i] = a < _tol[i] ? _tol[i] : (a > 1.0 - _tol[i] ? 1.0 - _tol[i] : a);
221  }
222  }
223 
224  // insert material property values
225  unsigned int nmat_props = _mat_prop_descriptors.size();
226  for (unsigned int i = 0; i < nmat_props; ++i)
227  _func_params[i + _nargs] = _mat_prop_descriptors[i].value()[_qp];
228 
229  // set function value
230  if (_prop_F)
231  (*_prop_F)[_qp] = evaluate(_func_F);
232 
233  // set derivatives
234  for (unsigned int i = 0; i < _derivatives.size(); ++i)
235  (*_derivatives[i].first)[_qp] = evaluate(_derivatives[i].second);
236  }
237 }
std::vector< Real > _tol
Tolerance values for all arguments (to protect from log(0)).
MaterialProperty< Real > * _prop_F
Material property to store the function value.
unsigned int _nargs
Number of coupled arguments.
std::vector< Derivative > _derivatives
The requested derivatives of the free energy.
MatPropDescriptorList _mat_prop_descriptors
Material property descriptors (obtained by parsing _mat_prop_expressions)
std::vector< const VariableValue * > _args
Coupled variables for function arguments.
ADFunctionPtr _func_F
The undiffed free energy function parser object.
ParsedMaterialHelper::MatPropDescriptorList::iterator DerivativeParsedMaterialHelper::findMatPropDerivative ( const FunctionMaterialPropertyDescriptor m)
protectedinherited

Definition at line 57 of file DerivativeParsedMaterialHelper.C.

Referenced by DerivativeParsedMaterialHelper::assembleDerivatives().

58 {
59  std::string name = m.getPropertyName();
60  for (MatPropDescriptorList::iterator i = _mat_prop_descriptors.begin();
61  i != _mat_prop_descriptors.end();
62  ++i)
63  if (i->getPropertyName() == name)
64  return i;
65 
66  return _mat_prop_descriptors.end();
67 }
const std::string getPropertyName() const
get the property name
MatPropDescriptorList _mat_prop_descriptors
Material property descriptors (obtained by parsing _mat_prop_expressions)
void ParsedMaterialHelper::functionParse ( const std::string &  function_expression)
inherited
void ParsedMaterialHelper::functionParse ( const std::string &  function_expression,
const std::vector< std::string > &  constant_names,
const std::vector< std::string > &  constant_expressions 
)
inherited

Definition at line 41 of file ParsedMaterialHelper.C.

44 {
45  std::vector<std::string> empty_string_vector;
46  std::vector<Real> empty_real_vector;
47  functionParse(function_expression,
48  constant_names,
49  constant_expressions,
50  empty_string_vector,
51  empty_string_vector,
52  empty_real_vector);
53 }
void functionParse(const std::string &function_expression)
void ParsedMaterialHelper::functionParse ( const std::string &  function_expression,
const std::vector< std::string > &  constant_names,
const std::vector< std::string > &  constant_expressions,
const std::vector< std::string > &  mat_prop_names,
const std::vector< std::string > &  tol_names,
const std::vector< Real > &  tol_values 
)
inherited

Definition at line 56 of file ParsedMaterialHelper.C.

62 {
63  // build base function object
64  _func_F = ADFunctionPtr(new ADFunction());
65 
66  // set FParser internal feature flags
67  setParserFeatureFlags(_func_F);
68 
69  // initialize constants
70  addFParserConstants(_func_F, constant_names, constant_expressions);
71 
72  // add further constants coming from default value coupling
74  for (std::vector<std::string>::iterator it = _arg_constant_defaults.begin();
75  it != _arg_constant_defaults.end();
76  ++it)
77  if (!_func_F->AddConstant(*it, _pars.defaultCoupledValue(*it)))
78  mooseError("Invalid constant name in parsed function object");
79 
80  // set variable names based on map_mode
81  switch (_map_mode)
82  {
83  case USE_MOOSE_NAMES:
84  for (unsigned i = 0; i < _nargs; ++i)
86  break;
87 
88  case USE_PARAM_NAMES:
89  // we do not allow vector coupling in this mode
90  if (!_mapping_is_unique)
91  mooseError("Derivative parsed materials must couple exactly one non-linear variable per "
92  "coupled variable input parameter.");
93 
94  for (unsigned i = 0; i < _nargs; ++i)
96  break;
97 
98  default:
99  mooseError("Unnknown variable mapping mode.");
100  }
101 
102  // tolerance vectors
103  if (tol_names.size() != tol_values.size())
104  mooseError("The parameter vectors tol_names and tol_values must have equal length.");
105 
106  // set tolerances
107  _tol.resize(_nargs);
108  for (unsigned int i = 0; i < _nargs; ++i)
109  {
110  _tol[i] = -1.0;
111 
112  // for every argument look throug the entire tolerance vector to find a match
113  for (unsigned int j = 0; j < tol_names.size(); ++j)
114  if (_variable_names[i] == tol_names[j])
115  {
116  _tol[i] = tol_values[j];
117  break;
118  }
119  }
120 
121  // build 'variables' argument for fparser
122  std::string variables;
123  for (unsigned i = 0; i < _nargs; ++i)
124  variables += "," + _variable_names[i];
125 
126  // get all material properties
127  unsigned int nmat_props = mat_prop_expressions.size();
128  _mat_prop_descriptors.resize(nmat_props);
129  for (unsigned int i = 0; i < nmat_props; ++i)
130  {
131  // parse the material property parameter entry into a FunctionMaterialPropertyDescriptor
132  _mat_prop_descriptors[i] = FunctionMaterialPropertyDescriptor(mat_prop_expressions[i], this);
133 
134  // get the fparser symbol name for the new material property
135  variables += "," + _mat_prop_descriptors[i].getSymbolName();
136  }
137 
138  // erase leading comma
139  variables.erase(0, 1);
140 
141  // build the base function
142  if (_func_F->Parse(function_expression, variables) >= 0)
143  mooseError("Invalid function\n",
144  function_expression,
145  '\n',
146  variables,
147  "\nin ParsedMaterialHelper.\n",
148  _func_F->ErrorMsg());
149 
150  // create parameter passing buffer
151  _func_params.resize(_nargs + nmat_props);
152 
153  // perform next steps (either optimize or take derivatives and then optimize)
155 }
std::vector< std::string > _variable_names
variable names used in the expression (depends on the map_mode)
std::vector< std::string > _arg_constant_defaults
coupled variables with default values
Material properties get fully described using this structure, including their dependent variables and...
const VariableNameMappingMode _map_mode
Flag to indicate if MOOSE nonlinear variable names should be used as FParser variable names...
std::vector< Real > _tol
Tolerance values for all arguments (to protect from log(0)).
std::vector< std::string > _arg_param_names
String vector of the input file coupling parameter name for each argument.
virtual void functionsPostParse()
unsigned int _nargs
Number of coupled arguments.
MatPropDescriptorList _mat_prop_descriptors
Material property descriptors (obtained by parsing _mat_prop_expressions)
std::vector< std::string > _arg_names
String vector of all argument names.
bool _mapping_is_unique
Flag that indicates if exactly one linear variable is coupled per input file coupling parameter...
ADFunctionPtr _func_F
The undiffed free energy function parser object.
void ParsedMaterialHelper::functionsOptimize ( )
protectedvirtualinherited

Definition at line 169 of file ParsedMaterialHelper.C.

Referenced by DerivativeParsedMaterialHelper::functionsPostParse(), and ParsedMaterialHelper::functionsPostParse().

170 {
171  // base function
172  if (!_disable_fpoptimizer)
173  _func_F->Optimize();
174  if (_enable_jit && !_func_F->JITCompile())
175  mooseInfo("Failed to JIT compile expression, falling back to byte code interpretation.");
176 }
ADFunctionPtr _func_F
The undiffed free energy function parser object.
void DerivativeParsedMaterialHelper::functionsPostParse ( )
protectedvirtualinherited

Reimplemented from ParsedMaterialHelper.

Definition at line 42 of file DerivativeParsedMaterialHelper.C.

43 {
44  // optimize base function
46 
47  // generate derivatives
49 
50  // force a value update to get the property at least once and register it for the dependencies
51  unsigned int nmat_props = _mat_prop_descriptors.size();
52  for (unsigned int i = 0; i < nmat_props; ++i)
53  _mat_prop_descriptors[i].value();
54 }
void assembleDerivatives()
Perform a breadth first construction of all requested derivatives.
MatPropDescriptorList _mat_prop_descriptors
Material property descriptors (obtained by parsing _mat_prop_expressions)
virtual void functionsOptimize()

Member Data Documentation

std::vector<std::string> FunctionMaterialBase::_arg_constant_defaults
protectedinherited

coupled variables with default values

Definition at line 76 of file FunctionMaterialBase.h.

Referenced by FunctionMaterialBase::FunctionMaterialBase(), and ParsedMaterialHelper::functionParse().

std::vector<std::string> FunctionMaterialBase::_arg_names
protectedinherited
std::vector<unsigned int> FunctionMaterialBase::_arg_numbers
protectedinherited

Vector of all argument MOOSE variable numbers.

Definition at line 70 of file FunctionMaterialBase.h.

Referenced by FunctionMaterialBase::argIndex(), DerivativeFunctionMaterialBase::computeProperties(), and FunctionMaterialBase::FunctionMaterialBase().

std::vector<std::string> FunctionMaterialBase::_arg_param_names
protectedinherited

String vector of the input file coupling parameter name for each argument.

Definition at line 73 of file FunctionMaterialBase.h.

Referenced by FunctionMaterialBase::FunctionMaterialBase(), and ParsedMaterialHelper::functionParse().

std::vector<const VariableValue *> FunctionMaterialBase::_args
protectedinherited
const EBTerm GasFreeEnergyBase::_c
protected

Coupled variable value for the concentration \( c \).

Definition at line 33 of file GasFreeEnergyBase.h.

Referenced by IdealGasFreeEnergy::IdealGasFreeEnergy(), and VanDerWaalsFreeEnergy::VanDerWaalsFreeEnergy().

unsigned int DerivativeParsedMaterialHelper::_derivative_order
protectedinherited

maximum derivative order

Definition at line 49 of file DerivativeParsedMaterialHelper.h.

Referenced by DerivativeParsedMaterialHelper::assembleDerivatives().

std::vector<Derivative> DerivativeParsedMaterialHelper::_derivatives
protectedinherited

The requested derivatives of the free energy.

Definition at line 37 of file DerivativeParsedMaterialHelper.h.

Referenced by DerivativeParsedMaterialHelper::assembleDerivatives(), and DerivativeParsedMaterialHelper::computeProperties().

const std::string DerivativeParsedMaterialHelper::_dmatvar_base
protectedinherited

variable base name for the dynamically material property derivatives

Definition at line 43 of file DerivativeParsedMaterialHelper.h.

Referenced by DerivativeParsedMaterialHelper::assembleDerivatives().

unsigned int DerivativeParsedMaterialHelper::_dmatvar_index
protectedinherited

next available variable number for automatically created material property derivative variables

Definition at line 46 of file DerivativeParsedMaterialHelper.h.

Referenced by DerivativeParsedMaterialHelper::assembleDerivatives().

std::string FunctionMaterialBase::_F_name
protectedinherited

Name of the function value material property and used as a base name to concatenate the material property names for the derivatives.

Definition at line 58 of file FunctionMaterialBase.h.

Referenced by DerivativeParsedMaterialHelper::assembleDerivatives(), DerivativeFunctionMaterialBase::DerivativeFunctionMaterialBase(), and DerivativeFunctionMaterialBase::initialSetup().

ADFunctionPtr ParsedMaterialHelper::_func_F
protectedinherited
const Real GasFreeEnergyBase::_h
protected

physical constants

Definition at line 42 of file GasFreeEnergyBase.h.

const Real GasFreeEnergyBase::_kB
protected
const Real GasFreeEnergyBase::_m
protected

gas molecule mass in eV*s^2/Ang^2

Definition at line 39 of file GasFreeEnergyBase.h.

const VariableNameMappingMode ParsedMaterialHelper::_map_mode
protectedinherited

Flag to indicate if MOOSE nonlinear variable names should be used as FParser variable names.

This should be true only for DerivativeParsedMaterial. If set to false, this class looks up the input parameter name for each coupled variable and uses it as the FParser parameter name when parsing the FParser expression.

Definition at line 78 of file ParsedMaterialHelper.h.

Referenced by ParsedMaterialHelper::functionParse().

bool FunctionMaterialBase::_mapping_is_unique
protectedinherited

Flag that indicates if exactly one linear variable is coupled per input file coupling parameter.

Definition at line 61 of file FunctionMaterialBase.h.

Referenced by FunctionMaterialBase::FunctionMaterialBase(), and ParsedMaterialHelper::functionParse().

MatPropDescriptorList ParsedMaterialHelper::_mat_prop_descriptors
protectedinherited
const EBTerm GasFreeEnergyBase::_n
protected

gas number density n = N/V = c/Omega (where Omega is the lattice site volume)

Definition at line 47 of file GasFreeEnergyBase.h.

Referenced by IdealGasFreeEnergy::IdealGasFreeEnergy(), and VanDerWaalsFreeEnergy::VanDerWaalsFreeEnergy().

unsigned int FunctionMaterialBase::_nargs
protectedinherited
const EBTerm GasFreeEnergyBase::_nq
protected

quantum concentration

Definition at line 50 of file GasFreeEnergyBase.h.

Referenced by IdealGasFreeEnergy::IdealGasFreeEnergy(), and VanDerWaalsFreeEnergy::VanDerWaalsFreeEnergy().

const Real GasFreeEnergyBase::_omega
protected

lattice site volume

Definition at line 36 of file GasFreeEnergyBase.h.

MaterialProperty<Real>* FunctionMaterialBase::_prop_F
protectedinherited
const EBTerm GasFreeEnergyBase::_T
protected

Coupled variable value for the Temperature.

Definition at line 30 of file GasFreeEnergyBase.h.

Referenced by IdealGasFreeEnergy::IdealGasFreeEnergy(), and VanDerWaalsFreeEnergy::VanDerWaalsFreeEnergy().

bool FunctionMaterialBase::_third_derivatives
protectedinherited

Calculate (and allocate memory for) the third derivatives of the free energy.

Definition at line 79 of file FunctionMaterialBase.h.

std::vector<Real> ParsedMaterialHelper::_tol
protectedinherited

Tolerance values for all arguments (to protect from log(0)).

Definition at line 70 of file ParsedMaterialHelper.h.

Referenced by DerivativeParsedMaterialHelper::computeProperties(), ParsedMaterialHelper::computeProperties(), and ParsedMaterialHelper::functionParse().

std::vector<std::string> ParsedMaterialHelper::_variable_names
protectedinherited

variable names used in the expression (depends on the map_mode)

Definition at line 61 of file ParsedMaterialHelper.h.

Referenced by DerivativeParsedMaterialHelper::assembleDerivatives(), and ParsedMaterialHelper::functionParse().


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