www.mooseframework.org
ADSplitCHWResBase.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 "ADKernelGrad.h"
13 #include "DerivativeMaterialInterface.h"
14 
15 #define usingSplitCHWResBase(T) \
16  usingKernelGradMembers; \
17  using ADSplitCHWResBase<compute_stage, T>::_mob_name; \
18  using ADSplitCHWResBase<compute_stage, T>::_mob
19 
20 // Forward declarations
21 template <ComputeStage compute_stage, typename T = void>
23 
25 
31 template <ComputeStage compute_stage, typename T>
32 class ADSplitCHWResBase : public ADKernelGrad<compute_stage>
33 {
34 public:
35  ADSplitCHWResBase(const InputParameters & parameters);
36 
37 protected:
38  virtual ADRealVectorValue precomputeQpResidual();
39 
40  const MaterialPropertyName _mob_name;
41  const ADMaterialProperty(T) & _mob;
42 
44 };
45 
46 template <ComputeStage compute_stage, typename T>
47 ADSplitCHWResBase<compute_stage, T>::ADSplitCHWResBase(const InputParameters & parameters)
48  : ADKernelGrad<compute_stage>(parameters),
49  _mob_name(getParam<MaterialPropertyName>("mob_name")),
50  _mob(getADMaterialProperty<T>("mob_name"))
51 {
52 }
53 
54 template <ComputeStage compute_stage, typename T>
55 ADRealVectorValue
57 {
58  return _mob[_qp] * _grad_u[_qp];
59 }
ADSplitCHWResBase::usingKernelGradMembers
usingKernelGradMembers
Definition: ADSplitCHWResBase.h:43
ADSplitCHWResBase::ADSplitCHWResBase
ADSplitCHWResBase(const InputParameters &parameters)
Definition: ADSplitCHWResBase.h:47
ADSplitCHWResBase
ADSplitCHWResBase implements the residual for the chemical potential in the split form of the Cahn-Hi...
Definition: ADSplitCHWResBase.h:22
ADSplitCHWResBase::precomputeQpResidual
virtual ADRealVectorValue precomputeQpResidual()
Definition: ADSplitCHWResBase.h:56
ADSplitCHWResBase::ADMaterialProperty
const ADMaterialProperty(T) &_mob
declareADValidParams
declareADValidParams(ADSplitCHWResBase)
ADSplitCHWResBase::_mob_name
const MaterialPropertyName _mob_name
Definition: ADSplitCHWResBase.h:40