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 () override
 
virtual void computeOffDiagJacobian (MooseVariableFEBase &jvar) override
 
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 32 of file CrackTipEnrichmentStressDivergenceTensors.h.

Constructor & Destructor Documentation

◆ CrackTipEnrichmentStressDivergenceTensors()

CrackTipEnrichmentStressDivergenceTensors::CrackTipEnrichmentStressDivergenceTensors ( const InputParameters &  parameters)

Definition at line 38 of file CrackTipEnrichmentStressDivergenceTensors.C.

40  : ALEKernel(parameters),
41  EnrichmentFunctionCalculation(&getUserObject<CrackFrontDefinition>("crack_front_definition")),
42  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
43  _stress(getMaterialPropertyByName<RankTwoTensor>(_base_name + "stress")),
44  _Jacobian_mult(getMaterialPropertyByName<RankFourTensor>(_base_name + "Jacobian_mult")),
45  _component(getParam<unsigned int>("component")),
46  _enrichment_component(getParam<unsigned int>("enrichment_component")),
47  _nenrich_disp(coupledComponents("enrichment_displacements")),
48  _ndisp(coupledComponents("displacements")),
49  _B(4),
50  _dBX(4),
51  _dBx(4),
52  _BI(4),
53  _BJ(4)
54 {
56  for (unsigned int i = 0; i < _nenrich_disp; ++i)
57  _enrich_disp_var[i] = coupled("enrichment_displacements", i);
58 
59  _disp_var.resize(_ndisp);
60  for (unsigned int i = 0; i < _ndisp; ++i)
61  _disp_var[i] = coupled("displacements", i);
62 }
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:24
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

◆ computeJacobian()

void ALEKernel::computeJacobian ( )
overridevirtualinherited

Reimplemented in StressDivergenceTensors.

Definition at line 35 of file ALEKernel.C.

Referenced by StressDivergenceTensors::computeJacobian().

36 {
37  _fe_problem.prepareShapes(_var.number(), _tid);
38  Kernel::computeJacobian();
39 }

◆ computeOffDiagJacobian()

void ALEKernel::computeOffDiagJacobian ( MooseVariableFEBase &  jvar)
overridevirtualinherited

Reimplemented in StressDivergenceTensors.

Definition at line 42 of file ALEKernel.C.

Referenced by StressDivergenceTensors::computeOffDiagJacobian().

43 {
44  _fe_problem.prepareShapes(jvar.number(), _tid);
45  Kernel::computeOffDiagJacobian(jvar);
46 }

◆ computeQpJacobian()

Real CrackTipEnrichmentStressDivergenceTensors::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 84 of file CrackTipEnrichmentStressDivergenceTensors.C.

85 {
86  crackTipEnrichementFunctionAtPoint(*_current_elem->get_node(_i), _BI);
87  crackTipEnrichementFunctionAtPoint(*_current_elem->get_node(_j), _BJ);
88 
89  crackTipEnrichementFunctionAtPoint(_q_point[_qp], _B);
90 
91  unsigned int crack_front_point_index =
93 
94  for (unsigned int i = 0; i < 4; ++i)
95  rotateFromCrackFrontCoordsToGlobal(_dBx[i], _dBX[i], crack_front_point_index);
96 
97  RealVectorValue grad_B(_dBX[_enrichment_component]);
98 
99  RealVectorValue grad_test =
100  _grad_test[_i][_qp] * (_B[_enrichment_component] - _BI[_enrichment_component]) +
101  _test[_i][_qp] * grad_B;
102  RealVectorValue grad_phi =
103  _grad_phi[_j][_qp] * (_B[_enrichment_component] - _BJ[_enrichment_component]) +
104  _phi[_j][_qp] * grad_B;
105 
107  _Jacobian_mult[_qp], _component, _component, grad_test, grad_phi);
108 }
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

◆ computeQpOffDiagJacobian()

Real CrackTipEnrichmentStressDivergenceTensors::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 111 of file CrackTipEnrichmentStressDivergenceTensors.C.

112 {
113  unsigned int coupled_component = 0;
114  unsigned int coupled_enrichment_component = 0;
115  bool active(false);
116  bool active_enrich(false);
117 
118  for (unsigned int i = 0; i < _enrich_disp_var.size(); ++i)
119  {
120  if (jvar == _enrich_disp_var[i])
121  {
122  coupled_component = i / 4;
123  coupled_enrichment_component = i % 4;
124  active_enrich = true;
125  }
126  }
127 
128  for (unsigned int i = 0; i < _disp_var.size(); ++i)
129  {
130  if (jvar == _disp_var[i])
131  {
132  coupled_component = i;
133  active = true;
134  }
135  }
136 
137  if (active_enrich)
138  {
139  crackTipEnrichementFunctionAtPoint(*_current_elem->get_node(_i), _BI);
140  crackTipEnrichementFunctionAtPoint(*_current_elem->get_node(_j), _BJ);
141 
142  crackTipEnrichementFunctionAtPoint(_q_point[_qp], _B);
143  unsigned int crack_front_point_index =
145 
146  for (unsigned int i = 0; i < 4; ++i)
147  rotateFromCrackFrontCoordsToGlobal(_dBx[i], _dBX[i], crack_front_point_index);
148 
149  RealVectorValue grad_B_test(_dBX[_enrichment_component]);
150  RealVectorValue grad_B_phi(_dBX[coupled_enrichment_component]);
151 
152  RealVectorValue grad_test =
153  _grad_test[_i][_qp] * (_B[_enrichment_component] - _BI[_enrichment_component]) +
154  _test[_i][_qp] * grad_B_test;
155  RealVectorValue grad_phi = _grad_phi[_j][_qp] * (_B[coupled_enrichment_component] -
156  _BJ[coupled_enrichment_component]) +
157  _phi[_j][_qp] * grad_B_phi;
158 
160  _Jacobian_mult[_qp], _component, coupled_component, grad_test, grad_phi);
161  }
162  else if (active)
163  {
164  crackTipEnrichementFunctionAtPoint(*_current_elem->get_node(_i), _BI);
165 
166  crackTipEnrichementFunctionAtPoint(_q_point[_qp], _B);
167  unsigned int crack_front_point_index =
169 
170  for (unsigned int i = 0; i < 4; ++i)
171  rotateFromCrackFrontCoordsToGlobal(_dBx[i], _dBX[i], crack_front_point_index);
172 
173  RealVectorValue grad_B_test(_dBX[_enrichment_component]);
174 
175  RealVectorValue grad_test =
176  _grad_test[_i][_qp] * (_B[_enrichment_component] - _BI[_enrichment_component]) +
177  _test[_i][_qp] * grad_B_test;
178 
180  _Jacobian_mult[_qp], _component, coupled_component, grad_test, _grad_phi[_j][_qp]);
181  }
182 
183  return 0;
184 }
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

◆ computeQpResidual()

Real CrackTipEnrichmentStressDivergenceTensors::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 65 of file CrackTipEnrichmentStressDivergenceTensors.C.

66 {
67  crackTipEnrichementFunctionAtPoint(*_current_elem->get_node(_i), _BI);
68 
69  crackTipEnrichementFunctionAtPoint(_q_point[_qp], _B);
70  unsigned int crack_front_point_index =
72 
73  for (unsigned int i = 0; i < 4; ++i)
74  rotateFromCrackFrontCoordsToGlobal(_dBx[i], _dBX[i], crack_front_point_index);
75 
76  RealVectorValue grad_B(_dBX[_enrichment_component]);
77 
78  return _stress[_qp].row(_component) *
79  (_grad_test[_i][_qp] * (_B[_enrichment_component] - _BI[_enrichment_component]) +
80  _test[_i][_qp] * grad_B);
81 }
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

◆ crackTipEnrichementFunctionAtPoint()

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 19 of file EnrichmentFunctionCalculation.C.

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

21 {
22  unsigned int crack_front_point_index =
24 
25  if (MooseUtils::absoluteFuzzyEqual(_r, 0.0))
26  mooseError("EnrichmentFunctionCalculation: the distance between a point and the crack "
27  "tip/front is zero.");
28 
29  Real st = std::sin(_theta);
30  Real st2 = std::sin(_theta / 2.0);
31  Real ct2 = std::cos(_theta / 2.0);
32  Real sr = std::sqrt(_r);
33 
34  B[0] = sr * st2;
35  B[1] = sr * ct2;
36  B[2] = sr * st2 * st;
37  B[3] = sr * ct2 * st;
38 
39  return crack_front_point_index;
40 }
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

◆ crackTipEnrichementFunctionDerivativeAtPoint()

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 43 of file EnrichmentFunctionCalculation.C.

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

45 {
46  unsigned int crack_front_point_index =
48 
49  if (MooseUtils::absoluteFuzzyEqual(_r, 0.0))
50  mooseError("EnrichmentFunctionCalculation: the distance between a point and the crack "
51  "tip/front is zero.");
52 
53  Real st = std::sin(_theta);
54  Real ct = std::cos(_theta);
55  Real st2 = std::sin(_theta / 2.0);
56  Real ct2 = std::cos(_theta / 2.0);
57  Real st15 = std::sin(1.5 * _theta);
58  Real ct15 = std::cos(1.5 * _theta);
59  Real sr = std::sqrt(_r);
60 
61  dB[0](0) = -0.5 / sr * st2;
62  dB[0](1) = 0.5 / sr * ct2;
63  dB[0](2) = 0.0;
64  dB[1](0) = 0.5 / sr * ct2;
65  dB[1](1) = 0.5 / sr * st2;
66  dB[1](2) = 0.0;
67  dB[2](0) = -0.5 / sr * st15 * st;
68  dB[2](1) = 0.5 / sr * (st2 + st15 * ct);
69  dB[2](2) = 0.0;
70  dB[3](0) = -0.5 / sr * ct15 * st;
71  dB[3](1) = 0.5 / sr * (ct2 + ct15 * ct);
72  dB[3](2) = 0.0;
73 
74  return crack_front_point_index;
75 }
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

◆ rotateFromCrackFrontCoordsToGlobal()

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 78 of file EnrichmentFunctionCalculation.C.

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

81 {
82  rotated_vector = _crack_front_definition->rotateFromCrackFrontCoordsToGlobal(vector, point_index);
83 }
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_undisplaced

Assembly& ALEKernel::_assembly_undisplaced
protectedinherited

undisplaced problem

Definition at line 33 of file ALEKernel.h.

◆ _B

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

enrichment function value

Definition at line 67 of file CrackTipEnrichmentStressDivergenceTensors.h.

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

◆ _base_name

std::string CrackTipEnrichmentStressDivergenceTensors::_base_name
protected

Definition at line 43 of file CrackTipEnrichmentStressDivergenceTensors.h.

◆ _BI

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

enrichment function at node I

Definition at line 73 of file CrackTipEnrichmentStressDivergenceTensors.h.

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

◆ _BJ

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

enrichment function at node J

Definition at line 75 of file CrackTipEnrichmentStressDivergenceTensors.h.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

◆ _component

const unsigned int CrackTipEnrichmentStressDivergenceTensors::_component
protected

displacement components

Definition at line 53 of file CrackTipEnrichmentStressDivergenceTensors.h.

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

◆ _dBX

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

derivatives of enrichment function respect to global cooridnate

Definition at line 69 of file CrackTipEnrichmentStressDivergenceTensors.h.

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

◆ _dBx

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

derivatives of enrichment function respect to crack front cooridnate

Definition at line 71 of file CrackTipEnrichmentStressDivergenceTensors.h.

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

◆ _deformation_gradient

const MaterialProperty<RankTwoTensor>* CrackTipEnrichmentStressDivergenceTensors::_deformation_gradient
protected

Definition at line 48 of file CrackTipEnrichmentStressDivergenceTensors.h.

◆ _deformation_gradient_old

const MaterialProperty<RankTwoTensor>* CrackTipEnrichmentStressDivergenceTensors::_deformation_gradient_old
protected

Definition at line 49 of file CrackTipEnrichmentStressDivergenceTensors.h.

◆ _disp_var

std::vector<unsigned int> CrackTipEnrichmentStressDivergenceTensors::_disp_var
protected

◆ _enrich_disp_var

std::vector<unsigned int> CrackTipEnrichmentStressDivergenceTensors::_enrich_disp_var
protected

◆ _enrichment_component

const unsigned int CrackTipEnrichmentStressDivergenceTensors::_enrichment_component
protected

enrichment function components

Definition at line 55 of file CrackTipEnrichmentStressDivergenceTensors.h.

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

◆ _grad_phi_undisplaced

const VariablePhiGradient& ALEKernel::_grad_phi_undisplaced
protectedinherited

Shape and test functions on the undisplaced mesh.

Definition at line 39 of file ALEKernel.h.

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

◆ _grad_test_undisplaced

const VariableTestGradient& ALEKernel::_grad_test_undisplaced
protectedinherited

Definition at line 40 of file ALEKernel.h.

◆ _Jacobian_mult

const MaterialProperty<RankFourTensor>& CrackTipEnrichmentStressDivergenceTensors::_Jacobian_mult
protected

◆ _ndisp

unsigned int CrackTipEnrichmentStressDivergenceTensors::_ndisp
protected

Coupled displacement variables.

Definition at line 62 of file CrackTipEnrichmentStressDivergenceTensors.h.

Referenced by CrackTipEnrichmentStressDivergenceTensors().

◆ _nenrich_disp

unsigned int CrackTipEnrichmentStressDivergenceTensors::_nenrich_disp
protected

Coupled enrichment displacement variables.

Definition at line 58 of file CrackTipEnrichmentStressDivergenceTensors.h.

Referenced by CrackTipEnrichmentStressDivergenceTensors().

◆ _rotation_increment

const MaterialProperty<RankTwoTensor>* CrackTipEnrichmentStressDivergenceTensors::_rotation_increment
protected

Definition at line 50 of file CrackTipEnrichmentStressDivergenceTensors.h.

◆ _stress

const MaterialProperty<RankTwoTensor>& CrackTipEnrichmentStressDivergenceTensors::_stress
protected

Definition at line 45 of file CrackTipEnrichmentStressDivergenceTensors.h.

Referenced by computeQpResidual().

◆ _var_undisplaced

MooseVariable& ALEKernel::_var_undisplaced
protectedinherited

Reference to this Kernel's undisplaced MooseVariable object.

Definition at line 36 of file ALEKernel.h.


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