www.mooseframework.org
ADMathFreeEnergy.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 "ADMathFreeEnergy.h"
11 
12 registerMooseObject("PhaseFieldApp", ADMathFreeEnergy);
13 
16 {
18  params.addClassDescription("Material that implements the math free energy and its derivatives: "
19  "\n$F = 1/4(1 + c)^2(1 - c)^2$");
20  params.addParam<MaterialPropertyName>("f_name", "F", "function property name");
21  params.addRequiredCoupledVar("c", "Concentration variable");
22  return params;
23 }
24 
26  : Material(parameters),
27  _c(adCoupledValue("c")),
28  _f_name(getParam<MaterialPropertyName>("f_name")),
29  _prop_F(declareADProperty<Real>(_f_name)),
30  _prop_dFdc(
31  declareADProperty<Real>(derivativePropertyNameFirst(_f_name, this->coupledName("c", 0))))
32 {
33 }
34 
35 void
37 {
38  _prop_F[_qp] = 1.0 / 4.0 * (1.0 + _c[_qp]) * (1.0 + _c[_qp]) * (1.0 - _c[_qp]) * (1.0 - _c[_qp]);
39  _prop_dFdc[_qp] = _c[_qp] * (_c[_qp] * _c[_qp] - 1.0);
40 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
virtual void computeQpProperties()
unsigned int _qp
const ADVariableValue & _c
Coupled variable value for the concentration .
static InputParameters validParams()
ADMaterialProperty< Real > & _prop_F
function value
registerMooseObject("PhaseFieldApp", ADMathFreeEnergy)
Material class that creates the math free energy and its derivatives for use with ADSplitCHParsed...
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
ADMathFreeEnergy(const InputParameters &parameters)
static InputParameters validParams()
ADMaterialProperty< Real > & _prop_dFdc
function value derivative