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 registerADMooseObject("PhaseFieldApp", ADMathFreeEnergy);
13 
16  ADMaterial,
17  params.addClassDescription("Material that implements the math free energy and its derivatives: "
18  "\nF = 1/4(1 + c)^2*(1 - c)^2");
19  params.addParam<MaterialPropertyName>("f_name", "F", "function property name");
20  params.addRequiredCoupledVar("c", "Concentration variable"););
21 
22 template <ComputeStage compute_stage>
23 ADMathFreeEnergy<compute_stage>::ADMathFreeEnergy(const InputParameters & parameters)
24  : ADMaterial<compute_stage>(parameters),
25  _c(adCoupledValue("c")),
26  _f_name(getParam<MaterialPropertyName>("f_name")),
27  _prop_F(declareADProperty<Real>(_f_name)),
28  _prop_dFdc(
29  declareADProperty<Real>(derivativePropertyNameFirst(_f_name, this->getVar("c", 0)->name())))
30 {
31 }
32 
33 template <ComputeStage compute_stage>
34 void
36 {
37  _prop_F[_qp] = 1.0 / 4.0 * (1.0 + _c[_qp]) * (1.0 + _c[_qp]) * (1.0 - _c[_qp]) * (1.0 - _c[_qp]);
38  _prop_dFdc[_qp] = _c[_qp] * (_c[_qp] * _c[_qp] - 1.0);
39 }
ADMathFreeEnergy
Material class that creates the math free energy and its derivatives for use with ADSplitCHParsed.
Definition: ADMathFreeEnergy.h:17
defineADValidParams
defineADValidParams(ADMathFreeEnergy, ADMaterial, params.addClassDescription("Material that implements the math free energy and its derivatives: " "\nF = 1/4(1 + c)^2*(1 - c)^2");params.addParam< MaterialPropertyName >("f_name", "F", "function property name");params.addRequiredCoupledVar("c", "Concentration variable");)
registerADMooseObject
registerADMooseObject("PhaseFieldApp", ADMathFreeEnergy)
ADMathFreeEnergy::computeQpProperties
virtual void computeQpProperties()
Definition: ADMathFreeEnergy.C:35
ADMathFreeEnergy::ADMathFreeEnergy
ADMathFreeEnergy(const InputParameters &parameters)
Definition: ADMathFreeEnergy.C:23
name
const std::string name
Definition: Setup.h:21
ADMathFreeEnergy.h