https://mooseframework.inl.gov
ADPhaseFieldTwoPhaseMaterial.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 
11 
13 
16 {
18  params.addClassDescription("Material that assigns properties based on the phase field variable.");
19  params.addRequiredCoupledVar("pf", "Phase field variable");
20  params.addRequiredParam<MaterialPropertyName>("prop_name", "Name of material property.");
21  params.addRequiredParam<Real>("prop_value_1", "value of phase 1.");
22  params.addRequiredParam<Real>("prop_value_2", "value of phase 2.");
23  return params;
24 }
25 
27  : ADMaterial(parameters),
28  _pf(adCoupledValue("pf")),
29  _prop_value_1(getParam<Real>("prop_value_1")),
30  _prop_value_2(getParam<Real>("prop_value_2")),
31  _prop(declareADProperty<Real>(getParam<MaterialPropertyName>("prop_name")))
32 {
33 }
34 
35 void
37 {
38  _prop[_qp] = 0.5 * (1 - _pf[_qp]) * _prop_value_1 + 0.5 * (1 + _pf[_qp]) * _prop_value_2;
39 }
ADMaterialProperty< Real > & _prop
registerADMooseObject("PhaseFieldApp", ADPhaseFieldTwoPhaseMaterial)
virtual void computeQpProperties() override
void addRequiredParam(const std::string &name, const std::string &doc_string)
unsigned int _qp
static InputParameters validParams()
ADPhaseFieldTwoPhaseMaterial(const InputParameters &parameters)
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)