www.mooseframework.org
MathEBFreeEnergy.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 "MathEBFreeEnergy.h"
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<DerivativeParsedMaterialHelper>();
14  params.addClassDescription("Material that implements the math free energy using the expression "
15  "builder and automatric differentiation");
16  params.addRequiredCoupledVar("c", "Concentration variable");
17  return params;
18 }
19 
20 MathEBFreeEnergy::MathEBFreeEnergy(const InputParameters & parameters)
21  : DerivativeParsedMaterialHelper(parameters), _c("c")
22 {
23  EBFunction free_energy;
24  // Definition of the free energy for the expression builder
25  free_energy(_c) = 1.0 / 4.0 * (1.0 + _c) * (1.0 + _c) * (1.0 - _c) * (1.0 - _c);
26 
27  // Parse function for automatic differentiation
28  functionParse(free_energy);
29 }
Helper class to perform the auto derivative taking.
EBTerm _c
Coupled variable value for the concentration .
InputParameters validParams< MathEBFreeEnergy >()
InputParameters validParams< DerivativeParsedMaterialHelper >()
MathEBFreeEnergy(const InputParameters &parameters)
User facing host object for a function. This combines a term with an argument list.
void functionParse(const std::string &function_expression)