www.mooseframework.org
MathEBFreeEnergy.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "MathEBFreeEnergy.h"
11 
12 registerMooseObject("PhaseFieldApp", MathEBFreeEnergy);
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<DerivativeParsedMaterialHelper>();
19  params.addClassDescription("Material that implements the math free energy using the expression "
20  "builder and automatric differentiation");
21  params.addRequiredCoupledVar("c", "Concentration variable");
22  return params;
23 }
24 
25 MathEBFreeEnergy::MathEBFreeEnergy(const InputParameters & parameters)
26  : DerivativeParsedMaterialHelper(parameters), _c("c")
27 {
28  EBFunction free_energy;
29  // Definition of the free energy for the expression builder
30  free_energy(_c) = 1.0 / 4.0 * (1.0 + _c) * (1.0 + _c) * (1.0 - _c) * (1.0 - _c);
31 
32  // Parse function for automatic differentiation
33  functionParse(free_energy);
34 }
EBTerm _c
Coupled variable value for the concentration .
Material class that creates the math free energy with the expression builder and uses automatic diffe...
InputParameters validParams< MathEBFreeEnergy >()
registerMooseObject("PhaseFieldApp", MathEBFreeEnergy)
MathEBFreeEnergy(const InputParameters &parameters)
User facing host object for a function. This combines a term with an argument list.