www.mooseframework.org
PhaseFieldFractureMechanicsOffDiag.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<Kernel>();
15  params.addClassDescription("Stress divergence kernel for phase-field fracture: Computes off "
16  "diagonal damage dependent Jacobian components. To be used with "
17  "StressDivergenceTensors or DynamicStressDivergenceTensors.");
18  params.addParam<std::string>("base_name", "Material property base name");
19  params.addRequiredParam<unsigned int>("component",
20  "An integer corresponding to the direction "
21  "the variable this kernel acts in. (0 for x, "
22  "1 for y, 2 for z)");
23  params.addCoupledVar(
24  "c",
25  "Phase field damage variable: Used to indicate calculation of Off Diagonal Jacobian term");
26  return params;
27 }
28 
30  const InputParameters & parameters)
31  : DerivativeMaterialInterface<Kernel>(parameters),
32  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
33  _component(getParam<unsigned int>("component")),
34  _c_coupled(isCoupled("c")),
35  _c_var(_c_coupled ? coupled("c") : 0),
36  _d_stress_dc(
37  getMaterialPropertyDerivative<RankTwoTensor>(_base_name + "stress", getVar("c", 0)->name()))
38 {
39 }
40 
41 Real
43 {
44  if (_c_coupled && jvar == _c_var)
45  {
46  Real val = 0.0;
47  for (unsigned int k = 0; k < 3; ++k)
48  val += _d_stress_dc[_qp](_component, k) * _grad_test[_i][_qp](k);
49  return val * _phi[_j][_qp];
50  }
51 
52  // Returns if coupled variable is not c (damage variable)
53  return 0.0;
54 }
const MaterialProperty< RankTwoTensor > & _d_stress_dc
PhaseFieldFractureMechanicsOffDiag(const InputParameters &parameters)
InputParameters validParams< PhaseFieldFractureMechanicsOffDiag >()
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override