www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
CrackTipEnrichmentStressDivergenceTensors Class Reference

CrackTipEnrichmentStressDivergenceTensors implements the residual and jacobian for enrichement displacement variables. More...

#include <CrackTipEnrichmentStressDivergenceTensors.h>

Inheritance diagram for CrackTipEnrichmentStressDivergenceTensors:
[legend]

Public Member Functions

 CrackTipEnrichmentStressDivergenceTensors (const InputParameters &parameters)
 
virtual void computeJacobian ()
 
virtual void computeOffDiagJacobian (unsigned int jvar)
 
virtual unsigned int crackTipEnrichementFunctionAtPoint (const Point &point, std::vector< Real > &B)
 calculate the enrichment function values at point More...
 
virtual unsigned int crackTipEnrichementFunctionDerivativeAtPoint (const Point &point, std::vector< RealVectorValue > &dB)
 calculate the enrichment function derivatives at point More...
 
void rotateFromCrackFrontCoordsToGlobal (const RealVectorValue &vector, RealVectorValue &rotated_vector, const unsigned int point_index)
 rotate a vector from crack front coordinate to global cooridate More...
 

Protected Member Functions

virtual Real computeQpResidual () override
 
virtual Real computeQpJacobian () override
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar) override
 

Protected Attributes

std::string _base_name
 
const MaterialProperty< RankTwoTensor > & _stress
 
const MaterialProperty< RankFourTensor > & _Jacobian_mult
 
const MaterialProperty< RankTwoTensor > * _deformation_gradient
 
const MaterialProperty< RankTwoTensor > * _deformation_gradient_old
 
const MaterialProperty< RankTwoTensor > * _rotation_increment
 
const unsigned int _component
 displacement components More...
 
const unsigned int _enrichment_component
 enrichment function components More...
 
unsigned int _nenrich_disp
 Coupled enrichment displacement variables. More...
 
std::vector< unsigned int > _enrich_disp_var
 
unsigned int _ndisp
 Coupled displacement variables. More...
 
std::vector< unsigned int > _disp_var
 
Assembly & _assembly_undisplaced
 undisplaced problem More...
 
MooseVariable & _var_undisplaced
 Reference to this Kernel's undisplaced MooseVariable object. More...
 
const VariablePhiGradient & _grad_phi_undisplaced
 Shape and test functions on the undisplaced mesh. More...
 
const VariableTestGradient & _grad_test_undisplaced
 

Private Attributes

std::vector< Real > _B
 enrichment function value More...
 
std::vector< RealVectorValue > _dBX
 derivatives of enrichment function respect to global cooridnate More...
 
std::vector< RealVectorValue > _dBx
 derivatives of enrichment function respect to crack front cooridnate More...
 
std::vector< Real > _BI
 enrichment function at node I More...
 
std::vector< Real > _BJ
 enrichment function at node J More...
 

Detailed Description

CrackTipEnrichmentStressDivergenceTensors implements the residual and jacobian for enrichement displacement variables.

Definition at line 29 of file CrackTipEnrichmentStressDivergenceTensors.h.

Constructor & Destructor Documentation

CrackTipEnrichmentStressDivergenceTensors::CrackTipEnrichmentStressDivergenceTensors ( const InputParameters &  parameters)

Definition at line 34 of file CrackTipEnrichmentStressDivergenceTensors.C.

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 }
std::vector< RealVectorValue > _dBx
derivatives of enrichment function respect to crack front cooridnate
EnrichmentFunctionCalculation(const CrackFrontDefinition *crack_front_definition)
std::vector< Real > _BI
enrichment function at node I
unsigned int _nenrich_disp
Coupled enrichment displacement variables.
ALEKernel(const InputParameters &parameters)
Definition: ALEKernel.C:22
std::vector< Real > _BJ
enrichment function at node J
const unsigned int _enrichment_component
enrichment function components
const MaterialProperty< RankFourTensor > & _Jacobian_mult
std::vector< RealVectorValue > _dBX
derivatives of enrichment function respect to global cooridnate

Member Function Documentation

void ALEKernel::computeJacobian ( )
virtualinherited

Reimplemented in StressDivergenceTensors.

Definition at line 33 of file ALEKernel.C.

Referenced by StressDivergenceTensors::computeJacobian().

34 {
35  _fe_problem.prepareShapes(_var.number(), _tid);
36  Kernel::computeJacobian();
37 }
void ALEKernel::computeOffDiagJacobian ( unsigned int  jvar)
virtualinherited

Reimplemented in StressDivergenceTensors.

Definition at line 40 of file ALEKernel.C.

Referenced by StressDivergenceTensors::computeOffDiagJacobian().

41 {
42  _fe_problem.prepareShapes(jvar, _tid);
43  Kernel::computeOffDiagJacobian(jvar);
44 }
Real CrackTipEnrichmentStressDivergenceTensors::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 80 of file CrackTipEnrichmentStressDivergenceTensors.C.

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 }
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
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
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...
std::vector< Real > _BJ
enrichment function at node J
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
Real CrackTipEnrichmentStressDivergenceTensors::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 107 of file CrackTipEnrichmentStressDivergenceTensors.C.

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
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
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...
std::vector< Real > _BJ
enrichment function at node J
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
Real CrackTipEnrichmentStressDivergenceTensors::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 61 of file CrackTipEnrichmentStressDivergenceTensors.C.

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 }
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
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
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
std::vector< RealVectorValue > _dBX
derivatives of enrichment function respect to global cooridnate
unsigned int EnrichmentFunctionCalculation::crackTipEnrichementFunctionAtPoint ( const Point &  point,
std::vector< Real > &  B 
)
virtualinherited

calculate the enrichment function values at point

Returns
the closest crack front index

Definition at line 17 of file EnrichmentFunctionCalculation.C.

Referenced by ComputeCrackTipEnrichmentSmallStrain::computeProperties(), computeQpJacobian(), computeQpOffDiagJacobian(), ComputeCrackTipEnrichmentSmallStrain::computeQpProperties(), and computeQpResidual().

19 {
20  unsigned int crack_front_point_index =
22 
23  if (MooseUtils::absoluteFuzzyEqual(_r, 0.0))
24  mooseError("EnrichmentFunctionCalculation: the distance between a point and the crack "
25  "tip/front is zero.");
26 
27  Real st = std::sin(_theta);
28  Real st2 = std::sin(_theta / 2.0);
29  Real ct2 = std::cos(_theta / 2.0);
30  Real sr = std::sqrt(_r);
31 
32  B[0] = sr * st2;
33  B[1] = sr * ct2;
34  B[2] = sr * st2 * st;
35  B[3] = sr * ct2 * st;
36 
37  return crack_front_point_index;
38 }
void calculateRThetaToCrackFront(const Point qp, const unsigned int point_index, Real &r, Real &theta) const
calculate r and theta in the crack front polar cooridnate
const CrackFrontDefinition * _crack_front_definition
unsigned int EnrichmentFunctionCalculation::crackTipEnrichementFunctionDerivativeAtPoint ( const Point &  point,
std::vector< RealVectorValue > &  dB 
)
virtualinherited

calculate the enrichment function derivatives at point

Returns
the closest crack front index

Definition at line 41 of file EnrichmentFunctionCalculation.C.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), ComputeCrackTipEnrichmentSmallStrain::computeQpProperties(), and computeQpResidual().

43 {
44  unsigned int crack_front_point_index =
46 
47  if (MooseUtils::absoluteFuzzyEqual(_r, 0.0))
48  mooseError("EnrichmentFunctionCalculation: the distance between a point and the crack "
49  "tip/front is zero.");
50 
51  Real st = std::sin(_theta);
52  Real ct = std::cos(_theta);
53  Real st2 = std::sin(_theta / 2.0);
54  Real ct2 = std::cos(_theta / 2.0);
55  Real st15 = std::sin(1.5 * _theta);
56  Real ct15 = std::cos(1.5 * _theta);
57  Real sr = std::sqrt(_r);
58 
59  dB[0](0) = -0.5 / sr * st2;
60  dB[0](1) = 0.5 / sr * ct2;
61  dB[0](2) = 0.0;
62  dB[1](0) = 0.5 / sr * ct2;
63  dB[1](1) = 0.5 / sr * st2;
64  dB[1](2) = 0.0;
65  dB[2](0) = -0.5 / sr * st15 * st;
66  dB[2](1) = 0.5 / sr * (st2 + st15 * ct);
67  dB[2](2) = 0.0;
68  dB[3](0) = -0.5 / sr * ct15 * st;
69  dB[3](1) = 0.5 / sr * (ct2 + ct15 * ct);
70  dB[3](2) = 0.0;
71 
72  return crack_front_point_index;
73 }
void calculateRThetaToCrackFront(const Point qp, const unsigned int point_index, Real &r, Real &theta) const
calculate r and theta in the crack front polar cooridnate
const CrackFrontDefinition * _crack_front_definition
void EnrichmentFunctionCalculation::rotateFromCrackFrontCoordsToGlobal ( const RealVectorValue &  vector,
RealVectorValue &  rotated_vector,
const unsigned int  point_index 
)
inherited

rotate a vector from crack front coordinate to global cooridate

Parameters
rotated_vectorrotated vector

Definition at line 76 of file EnrichmentFunctionCalculation.C.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), ComputeCrackTipEnrichmentSmallStrain::computeQpProperties(), and computeQpResidual().

79 {
80  rotated_vector = _crack_front_definition->rotateFromCrackFrontCoordsToGlobal(vector, point_index);
81 }
const CrackFrontDefinition * _crack_front_definition
RealVectorValue rotateFromCrackFrontCoordsToGlobal(const RealVectorValue vector, const unsigned int point_index) const
rotate a vector from crack front cartesian coordinate to global cartesian coordinate ...

Member Data Documentation

Assembly& ALEKernel::_assembly_undisplaced
protectedinherited

undisplaced problem

Definition at line 29 of file ALEKernel.h.

std::vector<Real> CrackTipEnrichmentStressDivergenceTensors::_B
private

enrichment function value

Definition at line 64 of file CrackTipEnrichmentStressDivergenceTensors.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

std::string CrackTipEnrichmentStressDivergenceTensors::_base_name
protected

Definition at line 40 of file CrackTipEnrichmentStressDivergenceTensors.h.

std::vector<Real> CrackTipEnrichmentStressDivergenceTensors::_BI
private

enrichment function at node I

Definition at line 70 of file CrackTipEnrichmentStressDivergenceTensors.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

std::vector<Real> CrackTipEnrichmentStressDivergenceTensors::_BJ
private

enrichment function at node J

Definition at line 72 of file CrackTipEnrichmentStressDivergenceTensors.h.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

const unsigned int CrackTipEnrichmentStressDivergenceTensors::_component
protected

displacement components

Definition at line 50 of file CrackTipEnrichmentStressDivergenceTensors.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

std::vector<RealVectorValue> CrackTipEnrichmentStressDivergenceTensors::_dBX
private

derivatives of enrichment function respect to global cooridnate

Definition at line 66 of file CrackTipEnrichmentStressDivergenceTensors.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

std::vector<RealVectorValue> CrackTipEnrichmentStressDivergenceTensors::_dBx
private

derivatives of enrichment function respect to crack front cooridnate

Definition at line 68 of file CrackTipEnrichmentStressDivergenceTensors.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

const MaterialProperty<RankTwoTensor>* CrackTipEnrichmentStressDivergenceTensors::_deformation_gradient
protected

Definition at line 45 of file CrackTipEnrichmentStressDivergenceTensors.h.

const MaterialProperty<RankTwoTensor>* CrackTipEnrichmentStressDivergenceTensors::_deformation_gradient_old
protected

Definition at line 46 of file CrackTipEnrichmentStressDivergenceTensors.h.

std::vector<unsigned int> CrackTipEnrichmentStressDivergenceTensors::_disp_var
protected
std::vector<unsigned int> CrackTipEnrichmentStressDivergenceTensors::_enrich_disp_var
protected
const unsigned int CrackTipEnrichmentStressDivergenceTensors::_enrichment_component
protected

enrichment function components

Definition at line 52 of file CrackTipEnrichmentStressDivergenceTensors.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

const VariablePhiGradient& ALEKernel::_grad_phi_undisplaced
protectedinherited

Shape and test functions on the undisplaced mesh.

Definition at line 35 of file ALEKernel.h.

Referenced by StressDivergenceTensors::computeQpJacobian(), and StressDivergenceTensors::computeQpOffDiagJacobian().

const VariableTestGradient& ALEKernel::_grad_test_undisplaced
protectedinherited

Definition at line 36 of file ALEKernel.h.

const MaterialProperty<RankFourTensor>& CrackTipEnrichmentStressDivergenceTensors::_Jacobian_mult
protected
unsigned int CrackTipEnrichmentStressDivergenceTensors::_ndisp
protected

Coupled displacement variables.

Definition at line 59 of file CrackTipEnrichmentStressDivergenceTensors.h.

Referenced by CrackTipEnrichmentStressDivergenceTensors().

unsigned int CrackTipEnrichmentStressDivergenceTensors::_nenrich_disp
protected

Coupled enrichment displacement variables.

Definition at line 55 of file CrackTipEnrichmentStressDivergenceTensors.h.

Referenced by CrackTipEnrichmentStressDivergenceTensors().

const MaterialProperty<RankTwoTensor>* CrackTipEnrichmentStressDivergenceTensors::_rotation_increment
protected

Definition at line 47 of file CrackTipEnrichmentStressDivergenceTensors.h.

const MaterialProperty<RankTwoTensor>& CrackTipEnrichmentStressDivergenceTensors::_stress
protected

Definition at line 42 of file CrackTipEnrichmentStressDivergenceTensors.h.

Referenced by computeQpResidual().

MooseVariable& ALEKernel::_var_undisplaced
protectedinherited

Reference to this Kernel's undisplaced MooseVariable object.

Definition at line 32 of file ALEKernel.h.


The documentation for this class was generated from the following files: