https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
23template <typename T>
24class ADAllenCahnBase : public DerivativeMaterialInterface<JvarMapKernelInterface<ADKernelValue>>
25{
26public:
27 ADAllenCahnBase(const InputParameters & parameters);
28
30
31protected:
33
35 virtual ADReal computeDFDOP() = 0;
36
39};
40
41template <typename T>
44{
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
52template <typename T>
55 _prop_L(getADMaterialProperty<T>("mob_name"))
56{
57}
58
59template <typename T>
62{
63 return _prop_L[_qp] * computeDFDOP();
64}
DualNumber< Real, DNDerivativeType, true > ADReal
const double T
This is the Allen-Cahn equation base class that implements the bulk or local energy term of the equat...
virtual ADReal computeDFDOP()=0
Compute the derivative of the bulk free energy w.r.t the order parameter.
const ADMaterialProperty< T > & _prop_L
Mobility.
virtual ADReal precomputeQpResidual()
static InputParameters validParams()
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)
void addClassDescription(const std::string &doc_string)