20 params.addClassDescription(
21 "Compute an evolving elasticity tensor coupled to a grain growth phase field model.");
22 params.addRequiredParam<UserObjectName>(
23 "grain_tracker",
"Name of GrainTracker user object that provides RankFourTensors");
24 params.addParam<Real>(
"length_scale", 1.0e-9,
"Length scale of the problem, in meters");
25 params.addParam<Real>(
"pressure_scale", 1.0e6,
"Pressure scale of the problem, in pa");
26 params.addRequiredCoupledVarWithAutoBuild(
27 "v",
"var_name_base",
"op_num",
"Array of coupled variables");
32 const InputParameters & parameters)
34 _length_scale(getParam<Real>(
"length_scale")),
35 _pressure_scale(getParam<Real>(
"pressure_scale")),
37 _op_num(coupledComponents(
"v")),
39 _D_elastic_tensor(_op_num),
43 for (MooseIndex(
_op_num) op_index = 0; op_index <
_op_num; ++op_index)
46 _vals[op_index] = &coupledValue(
"v", op_index);
63 for (MooseIndex(op_to_grains) op_index = 0; op_index < op_to_grains.size(); ++op_index)
65 auto grain_id = op_to_grains[op_index];
70 Real h = (1.0 + std::sin(libMesh::pi * ((*
_vals[op_index])[_qp] - 0.5))) / 2.0;
77 const Real
tol = 1.0e-10;
78 sum_h = std::max(sum_h,
tol);
82 for (MooseIndex(
_op_num) op_index = 0; op_index <
_op_num; ++op_index)
85 for (MooseIndex(op_to_grains) op_index = 0; op_index < op_to_grains.size(); ++op_index)
87 auto grain_id = op_to_grains[op_index];
91 Real dhdopi = libMesh::pi * std::cos(libMesh::pi * ((*
_vals[op_index])[_qp] - 0.5)) / 2.0;