www.mooseframework.org
CrackTipEnrichmentStressDivergenceTensors.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 
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<ALEKernel>();
16  params.addClassDescription("Enrich stress divergence kernel for small-strain simulations");
17  params.addRequiredParam<unsigned int>("component",
18  "An integer corresponding to the direction the variable "
19  "this kernel acts in. (0 for x, 1 for y, 2 for z)");
20  params.addRequiredParam<unsigned int>("enrichment_component",
21  "The component of the enrichement functions");
22  params.addRequiredCoupledVar("displacements",
23  "The string of displacements suitable for the problem statement");
24  params.addRequiredCoupledVar(
25  "enrichment_displacements",
26  "The string of enrichment displacements suitable for the problem statement");
27  params.addParam<std::string>("base_name", "Material property base name");
28  params.addRequiredParam<UserObjectName>("crack_front_definition",
29  "The CrackFrontDefinition user object name");
30  params.set<bool>("use_displaced_mesh") = false;
31  return params;
32 }
33 
35  const InputParameters & parameters)
36  : ALEKernel(parameters),
37  EnrichmentFunctionCalculation(&getUserObject<CrackFrontDefinition>("crack_front_definition")),
38  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
39  _stress(getMaterialPropertyByName<RankTwoTensor>(_base_name + "stress")),
40  _Jacobian_mult(getMaterialPropertyByName<RankFourTensor>(_base_name + "Jacobian_mult")),
41  _component(getParam<unsigned int>("component")),
42  _enrichment_component(getParam<unsigned int>("enrichment_component")),
43  _nenrich_disp(coupledComponents("enrichment_displacements")),
44  _ndisp(coupledComponents("displacements")),
45  _B(4),
46  _dBX(4),
47  _dBx(4),
48  _BI(4),
49  _BJ(4)
50 {
52  for (unsigned int i = 0; i < _nenrich_disp; ++i)
53  _enrich_disp_var[i] = coupled("enrichment_displacements", i);
54 
55  _disp_var.resize(_ndisp);
56  for (unsigned int i = 0; i < _ndisp; ++i)
57  _disp_var[i] = coupled("displacements", i);
58 }
59 
60 Real
62 {
63  crackTipEnrichementFunctionAtPoint(*_current_elem->get_node(_i), _BI);
64 
65  crackTipEnrichementFunctionAtPoint(_q_point[_qp], _B);
66  unsigned int crack_front_point_index =
68 
69  for (unsigned int i = 0; i < 4; ++i)
70  rotateFromCrackFrontCoordsToGlobal(_dBx[i], _dBX[i], crack_front_point_index);
71 
72  RealVectorValue grad_B(_dBX[_enrichment_component]);
73 
74  return _stress[_qp].row(_component) *
75  (_grad_test[_i][_qp] * (_B[_enrichment_component] - _BI[_enrichment_component]) +
76  _test[_i][_qp] * grad_B);
77 }
78 
79 Real
81 {
82  crackTipEnrichementFunctionAtPoint(*_current_elem->get_node(_i), _BI);
83  crackTipEnrichementFunctionAtPoint(*_current_elem->get_node(_j), _BJ);
84 
85  crackTipEnrichementFunctionAtPoint(_q_point[_qp], _B);
86 
87  unsigned int crack_front_point_index =
89 
90  for (unsigned int i = 0; i < 4; ++i)
91  rotateFromCrackFrontCoordsToGlobal(_dBx[i], _dBX[i], crack_front_point_index);
92 
93  RealVectorValue grad_B(_dBX[_enrichment_component]);
94 
95  RealVectorValue grad_test =
96  _grad_test[_i][_qp] * (_B[_enrichment_component] - _BI[_enrichment_component]) +
97  _test[_i][_qp] * grad_B;
98  RealVectorValue grad_phi =
99  _grad_phi[_j][_qp] * (_B[_enrichment_component] - _BJ[_enrichment_component]) +
100  _phi[_j][_qp] * grad_B;
101 
103  _Jacobian_mult[_qp], _component, _component, grad_test, grad_phi);
104 }
105 
106 Real
108 {
109  unsigned int coupled_component = 0;
110  unsigned int coupled_enrichment_component = 0;
111  bool active(false);
112  bool active_enrich(false);
113 
114  for (unsigned int i = 0; i < _enrich_disp_var.size(); ++i)
115  {
116  if (jvar == _enrich_disp_var[i])
117  {
118  coupled_component = i / 4;
119  coupled_enrichment_component = i % 4;
120  active_enrich = true;
121  }
122  }
123 
124  for (unsigned int i = 0; i < _disp_var.size(); ++i)
125  {
126  if (jvar == _disp_var[i])
127  {
128  coupled_component = i;
129  active = true;
130  }
131  }
132 
133  if (active_enrich)
134  {
135  crackTipEnrichementFunctionAtPoint(*_current_elem->get_node(_i), _BI);
136  crackTipEnrichementFunctionAtPoint(*_current_elem->get_node(_j), _BJ);
137 
138  crackTipEnrichementFunctionAtPoint(_q_point[_qp], _B);
139  unsigned int crack_front_point_index =
141 
142  for (unsigned int i = 0; i < 4; ++i)
143  rotateFromCrackFrontCoordsToGlobal(_dBx[i], _dBX[i], crack_front_point_index);
144 
145  RealVectorValue grad_B_test(_dBX[_enrichment_component]);
146  RealVectorValue grad_B_phi(_dBX[coupled_enrichment_component]);
147 
148  RealVectorValue grad_test =
149  _grad_test[_i][_qp] * (_B[_enrichment_component] - _BI[_enrichment_component]) +
150  _test[_i][_qp] * grad_B_test;
151  RealVectorValue grad_phi = _grad_phi[_j][_qp] * (_B[coupled_enrichment_component] -
152  _BJ[coupled_enrichment_component]) +
153  _phi[_j][_qp] * grad_B_phi;
154 
156  _Jacobian_mult[_qp], _component, coupled_component, grad_test, grad_phi);
157  }
158  else if (active)
159  {
160  crackTipEnrichementFunctionAtPoint(*_current_elem->get_node(_i), _BI);
161 
162  crackTipEnrichementFunctionAtPoint(_q_point[_qp], _B);
163  unsigned int crack_front_point_index =
165 
166  for (unsigned int i = 0; i < 4; ++i)
167  rotateFromCrackFrontCoordsToGlobal(_dBx[i], _dBX[i], crack_front_point_index);
168 
169  RealVectorValue grad_B_test(_dBX[_enrichment_component]);
170 
171  RealVectorValue grad_test =
172  _grad_test[_i][_qp] * (_B[_enrichment_component] - _BI[_enrichment_component]) +
173  _test[_i][_qp] * grad_B_test;
174 
176  _Jacobian_mult[_qp], _component, coupled_component, grad_test, _grad_phi[_j][_qp]);
177  }
178 
179  return 0;
180 }
std::vector< RealVectorValue > _dBx
derivatives of enrichment function respect to crack front cooridnate
virtual unsigned int crackTipEnrichementFunctionAtPoint(const Point &point, std::vector< Real > &B)
calculate the enrichment function values at point
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
void rotateFromCrackFrontCoordsToGlobal(const RealVectorValue &vector, RealVectorValue &rotated_vector, const unsigned int point_index)
rotate a vector from crack front coordinate to global cooridate
std::vector< Real > _BI
enrichment function at node I
InputParameters validParams< ALEKernel >()
Definition: ALEKernel.C:15
Real elasticJacobian(const RankFourTensor &r4t, unsigned int i, unsigned int k, const RealGradient &grad_test, const RealGradient &grad_phi)
This is used for the standard kernel stress_ij*d(test)/dx_j, when varied wrt u_k Jacobian entry: d(st...
Works on top of NodalNormalsPreprocessor.
unsigned int _nenrich_disp
Coupled enrichment displacement variables.
std::vector< Real > _BJ
enrichment function at node J
CrackTipEnrichmentStressDivergenceTensors(const InputParameters &parameters)
Perform calculation of enrichment function values and derivatives.
const unsigned int _enrichment_component
enrichment function components
virtual unsigned int crackTipEnrichementFunctionDerivativeAtPoint(const Point &point, std::vector< RealVectorValue > &dB)
calculate the enrichment function derivatives at point
const MaterialProperty< RankFourTensor > & _Jacobian_mult
std::vector< RealVectorValue > _dBX
derivatives of enrichment function respect to global cooridnate
InputParameters validParams< CrackTipEnrichmentStressDivergenceTensors >()