www.mooseframework.org
PhaseFieldFractureMechanicsOffDiag.C
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 
11 
13 
16 {
18  params.addClassDescription("Stress divergence kernel for phase-field fracture: Computes off "
19  "diagonal damage dependent Jacobian components. To be used with "
20  "StressDivergenceTensors or DynamicStressDivergenceTensors.");
21  params.addParam<std::string>("base_name", "Material property base name");
22  params.addRequiredParam<unsigned int>("component",
23  "An integer corresponding to the direction "
24  "the variable this kernel acts in. (0 for x, "
25  "1 for y, 2 for z)");
26  params.addCoupledVar(
27  "c",
28  "Phase field damage variable: Used to indicate calculation of Off Diagonal Jacobian term");
29  return params;
30 }
31 
33  const InputParameters & parameters)
34  : DerivativeMaterialInterface<Kernel>(parameters),
35  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
36  _component(getParam<unsigned int>("component")),
37  _c_coupled(isCoupled("c")),
38  _c_var(_c_coupled ? coupled("c") : 0),
39  _d_stress_dc(
40  getMaterialPropertyDerivative<RankTwoTensor>(_base_name + "stress", coupledName("c", 0)))
41 {
42 }
43 
44 Real
46 {
47  if (_c_coupled && jvar == _c_var)
48  {
49  Real val = 0.0;
50  for (unsigned int k = 0; k < 3; ++k)
51  val += _d_stress_dc[_qp](_component, k) * _grad_test[_i][_qp](k);
52  return val * _phi[_j][_qp];
53  }
54 
55  // Returns if coupled variable is not c (damage variable)
56  return 0.0;
57 }
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
registerMooseObject("SolidMechanicsApp", PhaseFieldFractureMechanicsOffDiag)
const MaterialProperty< RankTwoTensor > & _d_stress_dc
This class computes the off-diagonal Jacobian component of stress divergence residual system Contribu...
void addRequiredParam(const std::string &name, const std::string &doc_string)
const unsigned int _component
An integer corresponding to the direction this kernel acts in.
PhaseFieldFractureMechanicsOffDiag(const InputParameters &parameters)
void addCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
static const std::string k
Definition: NS.h:124
void ErrorVector unsigned int
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override