www.mooseframework.org
ADAllenCahnBase.h
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 #pragma once
11 
12 #include "ADKernelValue.h"
13 #include "DerivativeMaterialPropertyNameInterface.h"
14 
15 #define usingAllenCahnBaseMembers(T) \
16  usingKernelValueMembers; \
17  using ADAllenCahnBase<compute_stage, T>::_prop_L; \
18  using ADAllenCahnBase<compute_stage, T>::computeDFDOP
19 
20 // Forward declarations
21 template <ComputeStage compute_stage, typename T = void>
23 
25 
33 template <ComputeStage compute_stage, typename T>
34 class ADAllenCahnBase : public ADKernelValue<compute_stage>,
35  public DerivativeMaterialPropertyNameInterface
36 {
37 public:
38  ADAllenCahnBase(const InputParameters & parameters);
39 
40  static InputParameters validParams();
41 
42 protected:
43  virtual ADReal precomputeQpResidual();
44 
46  virtual ADReal computeDFDOP() = 0;
47 
49  const ADMaterialProperty(T) & _prop_L;
50 
52 };
53 
54 template <ComputeStage compute_stage, typename T>
55 ADAllenCahnBase<compute_stage, T>::ADAllenCahnBase(const InputParameters & parameters)
56  : ADKernelValue<compute_stage>(parameters),
57  DerivativeMaterialPropertyNameInterface(),
58  _prop_L(adGetADMaterialProperty<T>("mob_name"))
59 {
60 }
61 
62 template <ComputeStage compute_stage, typename T>
63 ADReal
65 {
66  return _prop_L[_qp] * computeDFDOP();
67 }
68 
declareADValidParams(ADAllenCahnBase)
static InputParameters validParams()
virtual ADReal computeDFDOP()=0
Compute the derivative of the bulk free energy w.r.t the order parameter.
const ADMaterialProperty(T) &_prop_L
Mobility.
ADAllenCahnBase(const InputParameters &parameters)
This is the Allen-Cahn equation base class that implements the bulk or local energy term of the equat...
virtual ADReal precomputeQpResidual()