https://mooseframework.inl.gov
ACSwitching.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 "ACBulk.h"
13 #include "ADAllenCahnBase.h"
14 
23 template <bool is_ad>
24 using ACSwitchingBase = typename std::conditional<is_ad, ADAllenCahnBase<Real>, ACBulk<Real>>::type;
25 
26 template <bool is_ad>
27 class ACSwitchingTempl : public ACSwitchingBase<is_ad>
28 {
29 public:
31 
32  ACSwitchingTempl(const InputParameters & parameters);
33  virtual void initialSetup() override;
34 
35 protected:
37  VariableName _etai_name;
38 
40  std::vector<MaterialPropertyName> _Fj_names;
41  unsigned int _num_j;
42 
44  std::vector<const GenericMaterialProperty<Real, is_ad> *> _prop_Fj;
45 
47  std::vector<MaterialPropertyName> _hj_names;
48 
50  std::vector<const GenericMaterialProperty<Real, is_ad> *> _prop_dhjdetai;
51 
52  using ACSwitchingBase<is_ad>::_qp;
53  using ACSwitchingBase<is_ad>::_var;
54  using ACSwitchingBase<is_ad>::_test;
55 };
56 
57 class ACSwitching : public ACSwitchingTempl<false>
58 {
59 public:
60  ACSwitching(const InputParameters & parameters);
61 
62  virtual void initialSetup() override;
63 
64 protected:
65  virtual Real computeDFDOP(PFFunctionType type) override;
66  virtual Real computeQpOffDiagJacobian(unsigned int jvar) override;
67 
69  std::vector<std::vector<const MaterialProperty<Real> *>> _prop_dFjdarg;
70 
72  std::vector<const MaterialProperty<Real> *> _prop_d2hjdetai2;
73 
75  std::vector<std::vector<const MaterialProperty<Real> *>> _prop_d2hjdetaidarg;
76 };
77 
78 class ADACSwitching : public ACSwitchingTempl<true>
79 {
80 public:
81  using ACSwitchingTempl<true>::ACSwitchingTempl;
82 
83 protected:
84  virtual ADReal computeDFDOP() override;
85 };
DualNumber< Real, DNDerivativeType, true > ADReal
InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real