11 #include "MooseMesh.h"
12 #include "libmesh/fe_interface.h"
13 #include "libmesh/string_to_enum.h"
15 #include "libmesh/quadrature_gauss.h"
24 params.addClassDescription(
25 "Computes the crack tip enrichment at a point within a small strain formulation.");
26 params.addRequiredParam<std::vector<NonlinearVariableName>>(
"enrichment_displacements",
27 "The enrichment displacement");
28 params.addRequiredParam<UserObjectName>(
"crack_front_definition",
29 "The CrackFrontDefinition user object name");
34 const InputParameters & parameters)
40 _phi(_assembly.phi()),
41 _grad_phi(_assembly.gradPhi()),
49 const std::vector<NonlinearVariableName> & nl_vnames =
50 getParam<std::vector<NonlinearVariableName>>(
"enrichment_displacements");
52 if (
_ndisp == 2 && nl_vnames.size() != 8)
53 mooseError(
"The number of enrichment displacements should be total 8 for 2D.");
54 else if (
_ndisp == 3 && nl_vnames.size() != 12)
55 mooseError(
"The number of enrichment displacements should be total 12 for 3D.");
57 NonlinearSystem & nl = _fe_problem.getNonlinearSystem();
58 _nl = &(_fe_problem.getNonlinearSystem());
60 for (
unsigned int j = 0; j <
_ndisp; ++j)
61 for (
unsigned int i = 0; i < 4; ++i)
69 for (
unsigned int i = 0; i <
_BI.size(); ++i)
77 unsigned int crack_front_point_index =
80 for (
unsigned int i = 0; i < 4; ++i)
85 for (
unsigned int m = 0; m <
_ndisp; ++m)
89 for (
unsigned int i = 0; i < _current_elem->n_nodes(); ++i)
91 const Node * node_i = _current_elem->node_ptr(i);
92 for (
unsigned int j = 0; j < 4; ++j)
95 Real soln = (*_sln)(dof);
97 RealVectorValue grad_B(
_dBX[j]);
99 ((*_fe_dphi)[i][_qp] * (
_B[j] -
_BI[i][j]) + (*
_fe_phi)[i][_qp] * grad_B) * soln;
107 RankTwoTensor enrich_strain = (grad_tensor_enrich + grad_tensor_enrich.transpose()) / 2.0;
111 _total_strain[_qp] = (grad_tensor + grad_tensor.transpose()) / 2.0;
125 FEType fe_type(Utility::string_to_enum<Order>(
"first"),
126 Utility::string_to_enum<FEFamily>(
"lagrange"));
127 const unsigned int dim = _current_elem->dim();
128 std::unique_ptr<FEBase> fe(FEBase::build(dim, fe_type));
129 fe->attach_quadrature_rule(const_cast<QBase *>(_qrule));
133 if (isBoundaryMaterial())
134 fe->reinit(_current_elem, _current_side);
136 fe->reinit(_current_elem);
138 for (
unsigned int i = 0; i <
_BI.size(); ++i)
141 ComputeStrainBase::computeProperties();