www.mooseframework.org
DerivativeParsedMaterialHelper.h
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 #ifndef DERIVATIVEPARSEDMATERIALHELPER_H
8 #define DERIVATIVEPARSEDMATERIALHELPER_H
9 
11 #include "ParsedMaterialHelper.h"
12 #include "libmesh/fparser_ad.hh"
13 
14 // Forward Declarations
16 
17 template <>
19 
24 {
25 public:
26  DerivativeParsedMaterialHelper(const InputParameters & parameters,
28 
29 protected:
30  virtual void computeProperties();
31 
32  virtual void functionsPostParse();
33  void assembleDerivatives();
34  MatPropDescriptorList::iterator findMatPropDerivative(const FunctionMaterialPropertyDescriptor &);
35 
36  struct QueueItem;
37  struct Derivative;
38 
40  std::vector<Derivative> _derivatives;
41 
43  const std::string _dmatvar_base;
44 
46  unsigned int _dmatvar_index;
47 
49  unsigned int _derivative_order;
50 };
51 
53 {
54  QueueItem() : _dargs(0) {}
55  QueueItem(ADFunctionPtr & F) : _F(F), _dargs(0) {}
56  QueueItem(const QueueItem & rhs) : _F(rhs._F), _dargs(rhs._dargs) {}
57 
58  ADFunctionPtr _F;
59  std::vector<unsigned int> _dargs;
60 };
61 
63 {
64  MaterialProperty<Real> * first;
65  ADFunctionPtr second;
66  std::vector<VariableName> darg_names;
67 };
68 
69 #endif // DERIVATIVEPARSEDMATERIALHELPER_H
Helper class to perform the auto derivative taking.
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
unsigned int _derivative_order
maximum derivative order
DerivativeParsedMaterialHelper(const InputParameters &parameters, VariableNameMappingMode map_mode=USE_PARAM_NAMES)
void assembleDerivatives()
Perform a breadth first construction of all requested derivatives.
InputParameters validParams< DerivativeParsedMaterialHelper >()
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.
Helper class to perform the parsing and optimization of the function expression.