https://mooseframework.inl.gov
ADAllenCahnBase.h
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 
10 #pragma once
11 
12 #include "ADKernelValue.h"
13 #include "JvarMapInterface.h"
15 
23 template <typename T>
24 class ADAllenCahnBase : public DerivativeMaterialInterface<JvarMapKernelInterface<ADKernelValue>>
25 {
26 public:
27  ADAllenCahnBase(const InputParameters & parameters);
28 
30 
31 protected:
32  virtual ADReal precomputeQpResidual();
33 
35  virtual ADReal computeDFDOP() = 0;
36 
39 };
40 
41 template <typename T>
44 {
46  params.addClassDescription(
47  "Allen-Cahn bulk contribution Kernel with forward mode automatic differentiation");
48  params.addParam<MaterialPropertyName>("mob_name", "L", "The mobility used with the kernel");
49  return params;
50 }
51 
52 template <typename T>
55  _prop_L(getADMaterialProperty<T>("mob_name"))
56 {
57 }
58 
59 template <typename T>
60 ADReal
62 {
63  return _prop_L[_qp] * computeDFDOP();
64 }
ADAllenCahnBase(const InputParameters &parameters)
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
virtual ADReal precomputeQpResidual()
DualNumber< Real, DNDerivativeType, true > ADReal
const ADMaterialProperty< T > & _prop_L
Mobility.
virtual ADReal computeDFDOP()=0
Compute the derivative of the bulk free energy w.r.t the order parameter.
This is the Allen-Cahn equation base class that implements the bulk or local energy term of the equat...
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)