63 const std::vector<std::vector<libMesh::RealVectorValue> >& dphi = fe.
get_dphi();
64 const unsigned int n_phi = (
unsigned int)dphi.size();
66 libmesh_assert_equal_to(vk_strain.size(), 3);
67 libmesh_assert_equal_to(vk_dwdxi_mat.rows(), 3);
68 libmesh_assert_equal_to(vk_dwdxi_mat.cols(), 2);
69 libmesh_assert_equal_to(Bmat_vk.
m(), 2);
70 libmesh_assert_equal_to(Bmat_vk.
n(), 6*n_phi);
71 libmesh_assert_less (qp, dphi[0].size());
75 vk_dwdxi_mat.setZero();
80 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ ) {
81 phi_vec(i_nd) = dphi[i_nd][qp](0);
85 vk_dwdxi_mat(0, 0) = dw;
86 vk_dwdxi_mat(2, 1) = dw;
87 vk_strain(0) = 0.5*dw*dw;
91 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ ) {
92 phi_vec(i_nd) = dphi[i_nd][qp](1);
96 vk_dwdxi_mat(1, 1) = dw;
97 vk_dwdxi_mat(2, 0) = dw;
98 vk_strain(1) = 0.5*dw*dw;
111 const std::vector<std::vector<libMesh::RealVectorValue> >& dphi = fe.
get_dphi();
112 const unsigned int n_phi = (
unsigned int)dphi.size();
114 libmesh_assert_equal_to(vk_dwdxi_mat_sens.rows(), 3);
115 libmesh_assert_equal_to(vk_dwdxi_mat_sens.cols(), 2);
116 libmesh_assert_less (qp, dphi[0].size());
119 vk_dwdxi_mat_sens.setZero();
124 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ ) {
125 phi_vec(i_nd) = dphi[i_nd][qp](0);
128 vk_dwdxi_mat_sens(0, 0) = dw;
129 vk_dwdxi_mat_sens(2, 1) = dw;
132 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ ) {
133 phi_vec(i_nd) = dphi[i_nd][qp](1);
136 vk_dwdxi_mat_sens(1, 1) = dw;
137 vk_dwdxi_mat_sens(2, 0) = dw;
160 const std::vector<std::vector<libMesh::RealVectorValue> >&
163 unsigned int n_phi = (
unsigned int)dphi.size();
167 libmesh_assert_equal_to(epsilon.size(), 3);
168 libmesh_assert_equal_to(mat_x.rows(), 3);
169 libmesh_assert_equal_to(mat_x.cols(), 2);
170 libmesh_assert_equal_to(mat_y.rows(), 3);
171 libmesh_assert_equal_to(mat_y.cols(), 2);
172 libmesh_assert_equal_to(Bmat_lin.
m(), 3);
173 libmesh_assert_equal_to(Bmat_lin.
n(), 6*n_phi);
174 libmesh_assert_equal_to(Bmat_nl_x.
m(), 2);
175 libmesh_assert_equal_to(Bmat_nl_x.
n(), 6*n_phi);
176 libmesh_assert_equal_to(Bmat_nl_y.
m(), 2);
177 libmesh_assert_equal_to(Bmat_nl_y.
n(), 6*n_phi);
182 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
183 phi(i_nd) = dphi[i_nd][qp](0);
200 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
201 phi(i_nd) = dphi[i_nd][qp](1);
218 ddisp_dx = RealVectorX::Zero(2),
219 ddisp_dy = RealVectorX::Zero(2);
226 F = RealMatrixX::Zero(2,2),
227 E = RealMatrixX::Zero(2,2);
232 E = 0.5*(F + F.transpose() + F.transpose() * F);
237 epsilon(2) = E(0,1) + E(1,0);
241 mat_x.row(0) = ddisp_dx;
242 mat_x.row(2) = ddisp_dy;
244 mat_y.row(1) = ddisp_dy;
245 mat_y.row(2) = ddisp_dx;
259 std::vector<MAST::FEMOperatorMatrix>& dBmat_lin) {
261 epsilon_grad.setZero();
263 const std::vector<std::vector<libMesh::RealTensorValue> >&
266 unsigned int n_phi = (
unsigned int)d2phi.size();
268 phi = RealVectorX::Zero(n_phi),
269 depsilon = RealVectorX::Zero(3);
272 libmesh_assert_equal_to(epsilon_grad.rows(), 3);
273 libmesh_assert_equal_to(epsilon_grad.cols(), 2);
274 libmesh_assert_equal_to(dBmat_lin.size(), 2);
277 for (
unsigned int i=0; i<2; i++) {
279 libmesh_assert_equal_to(dBmat_lin[i].m(), 3);
280 libmesh_assert_equal_to(dBmat_lin[i].n(), 6*n_phi);
284 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
285 phi(i_nd) = d2phi[i_nd][qp](0, i);
288 dBmat_lin[i].set_shape_function(0, 0, phi);
289 dBmat_lin[i].set_shape_function(2, 1, phi);
292 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
293 phi(i_nd) = d2phi[i_nd][qp](1, i);
296 dBmat_lin[i].set_shape_function(1, 1, phi);
297 dBmat_lin[i].set_shape_function(2, 0, phi);
299 dBmat_lin[i].vector_mult(depsilon, local_disp);
300 epsilon_grad.col(i) = depsilon;
311 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
true,
false));
314 qp_loc_fe_size = (
unsigned int)fe->get_qpoints().size(),
317 std::vector<libMesh::Point>
318 qp_loc_fe = fe->get_qpoints(),
319 qp_loc(qp_loc_fe.size()*n_added_qp);
320 std::vector<Real> JxW = fe->get_JxW();
321 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
327 for (
unsigned int i=0; i<qp_loc_fe.size(); i++) {
329 qp_loc[i*2] = qp_loc_fe[i];
330 qp_loc[i*2](2) = +1.;
332 qp_loc[i*2+1] = qp_loc_fe[i];
333 qp_loc[i*2+1](2) = -1.;
340 JxW[i] /= (1.*n_added_qp);
348 std::unique_ptr<MAST::BendingOperator2D>
351 qp_loc_fe).release());
356 n_phi = (
unsigned int)fe->n_shape_functions(),
373 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
374 dstrain_dX = RealMatrixX::Zero(n1,n2),
375 dstress_dX = RealMatrixX::Zero(n1,n2),
376 mat_n1n2 = RealMatrixX::Zero(n1,n2),
377 eye = RealMatrixX::Identity(n1, n1),
378 mat_x = RealMatrixX::Zero(3,2),
379 mat_y = RealMatrixX::Zero(3,2),
380 dstrain_dX_3D= RealMatrixX::Zero(6,n2),
381 dstress_dX_3D= RealMatrixX::Zero(6,n2);
384 strain = RealVectorX::Zero(n1),
385 stress = RealVectorX::Zero(n1),
386 strain_vk = RealVectorX::Zero(n1),
387 strain_bend = RealVectorX::Zero(n1),
388 strain_3D = RealVectorX::Zero(6),
389 stress_3D = RealVectorX::Zero(6),
390 dstrain_dp = RealVectorX::Zero(n1),
391 dstress_dp = RealVectorX::Zero(n1),
392 vec1 = RealVectorX::Zero(n2),
393 vec2 = RealVectorX::Zero(n2);
439 *temp_func =
nullptr,
440 *ref_temp_func =
nullptr,
441 *alpha_func =
nullptr;
458 for (
unsigned int qp_loc_index=0; qp_loc_index<qp_loc_fe_size; qp_loc_index++)
459 for (
unsigned int section_qp_index=0; section_qp_index<n_added_qp; section_qp_index++)
461 qp = qp_loc_index*n_added_qp + section_qp_index;
464 mat_stiff(xyz[qp_loc_index],
_time, material_mat);
481 (*temp_func) (xyz[qp_loc_index],
_time, temp);
482 (*ref_temp_func)(xyz[qp_loc_index],
_time, ref_t);
483 (*alpha_func) (xyz[qp_loc_index],
_time, alpha);
484 strain(0) -= alpha*(temp-ref_t);
485 strain(1) -= alpha*(temp-ref_t);
503 h (xyz[qp_loc_index],
_time, z);
504 h_off(xyz[qp_loc_index],
_time, z_off);
507 bend->initialize_bending_strain_operator_for_z(*fe,
509 qp_loc[qp](2) * z/2.+z_off,
515 strain += strain_bend;
519 stress = material_mat * strain;
526 stress_3D(0) = stress(0);
527 stress_3D(1) = stress(1);
528 stress_3D(3) = stress(2);
529 strain_3D(0) = strain(0);
530 strain_3D(1) = strain(1);
531 strain_3D(3) = strain(2);
542 if (!request_derivative && !p)
555 if (request_derivative || p) {
562 dstrain_dX += mat_n1n2;
564 dstrain_dX += mat_n1n2;
573 dstrain_dX += mat_n1n2;
578 dstrain_dX += mat_n1n2;
582 dstress_dX = material_mat * dstrain_dX;
586 vec1 = dstress_dX.row(0);
588 dstress_dX_3D.row(0) = vec2;
590 vec1 = dstress_dX.row(1);
592 dstress_dX_3D.row(1) = vec2;
594 vec1 = dstress_dX.row(2);
596 dstress_dX_3D.row(3) = vec2;
598 vec1 = dstrain_dX.row(0);
600 dstrain_dX_3D.row(0) = vec2;
602 vec1 = dstrain_dX.row(1);
604 dstrain_dX_3D.row(1) = vec2;
606 vec1 = dstrain_dX.row(2);
608 dstrain_dX_3D.row(3) = vec2;
610 if (request_derivative)
628 dstrain_dp = RealVectorX::Zero(n1);
634 ref_temp_func->derivative(*p, xyz[qp_loc_index],
_time, dref_t);
635 alpha_func->derivative(*p, xyz[qp_loc_index],
_time, dalpha);
636 dstrain_dp(0) -= alpha*(dtemp-dref_t) + dalpha*(temp-ref_t);
637 dstrain_dp(1) -= alpha*(dtemp-dref_t) + dalpha*(temp-ref_t);
646 xyz[qp_loc_index],
_time, z);
648 xyz[qp_loc_index],
_time, z_off);
651 bend->initialize_bending_strain_operator_for_z(*fe,
653 qp_loc[qp](2) * z/2.+z_off,
659 dstrain_dp += strain_bend;
664 dstress_dp = material_mat * dstrain_dp;
677 dstress_dp += material_mat * strain;
687 stress_3D(0) = dstress_dp(0);
688 stress_3D(1) = dstress_dp(1);
689 stress_3D(3) = dstress_dp(2);
690 strain_3D(0) = dstrain_dp(0);
691 strain_3D(1) = dstrain_dp(1);
692 strain_3D(3) = dstrain_dp(2);
704 libmesh_assert(qp_loc.size() ==
709 return request_derivative || p;
718 const unsigned int s,
724 qp_loc_fe_size = (
unsigned int)fe->get_qpoints().size(),
727 std::vector<libMesh::Point>
728 qp_loc_fe = fe->get_qpoints(),
729 qp_loc(qp_loc_fe.size()*n_added_qp);
730 std::vector<Real> JxW_Vn = fe->get_JxW();
731 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
732 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
738 for (
unsigned int i=0; i<qp_loc_fe.size(); i++) {
740 qp_loc[i*2] = qp_loc_fe[i];
741 qp_loc[i*2](2) = +1.;
743 qp_loc[i*2+1] = qp_loc_fe[i];
744 qp_loc[i*2+1](2) = -1.;
750 std::unique_ptr<MAST::BendingOperator2D>
753 qp_loc_fe).release());
756 n_phi = (
unsigned int)fe->n_shape_functions(),
772 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
773 mat_n1n2 = RealMatrixX::Zero(n1,n2),
774 mat_x = RealMatrixX::Zero(3,2),
775 mat_y = RealMatrixX::Zero(3,2),
776 eye = RealMatrixX::Identity(n1, n1);
779 strain = RealVectorX::Zero(n1),
780 stress = RealVectorX::Zero(n1),
781 strain_vk = RealVectorX::Zero(n1),
782 strain_bend = RealVectorX::Zero(n1),
783 strain_3D = RealVectorX::Zero(6),
784 stress_3D = RealVectorX::Zero(6),
785 vel = RealVectorX::Zero(dim);
788 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
792 for (
unsigned int i=0; i<dim; i++)
793 vn += vel(i)*face_normals[qp](i);
794 JxW_Vn[qp] *= vn/(1.*n_added_qp);
840 *temp_func =
nullptr,
841 *ref_temp_func =
nullptr,
842 *alpha_func =
nullptr;
857 for (
unsigned int qp_loc_index=0; qp_loc_index<qp_loc_fe_size; qp_loc_index++)
858 for (
unsigned int section_qp_index=0; section_qp_index<n_added_qp; section_qp_index++)
860 qp = qp_loc_index*n_added_qp + section_qp_index;
863 mat_stiff(xyz[qp_loc_index],
_time, material_mat);
881 (*temp_func) (xyz[qp_loc_index],
_time, temp);
882 (*ref_temp_func)(xyz[qp_loc_index],
_time, ref_t);
883 (*alpha_func) (xyz[qp_loc_index],
_time, alpha);
884 strain(0) -= alpha*(temp-ref_t);
885 strain(1) -= alpha*(temp-ref_t);
903 h (xyz[qp_loc_index],
_time, z);
904 h_off(xyz[qp_loc_index],
_time, z_off);
907 bend->initialize_bending_strain_operator_for_z(*fe,
909 qp_loc[qp](2) * z/2.+z_off,
915 strain += strain_bend;
919 stress = material_mat * strain;
926 stress_3D(0) = stress(0);
927 stress_3D(1) = stress(1);
928 stress_3D(3) = stress(2);
929 strain_3D(0) = strain(0);
930 strain_3D(1) = strain(1);
931 strain_3D(3) = strain(2);
945 JxW_Vn[qp_loc_index]);
950 libmesh_assert(qp_loc.size() ==
961 std::unique_ptr<MAST::FEBase> fe_str(
_elem.
init_fe(
true,
false));
965 libmesh_assert(fe_str->get_fe_type() == fe_thermal.
get_fe_type());
970 libmesh_assert_equal_to(fe_str->get_qpoints().size(), fe_thermal.
get_qpoints().size());
975 libmesh_assert(stress_output.get_thermal_load_for_elem(
_elem));
978 qp_loc_fe_size = (
unsigned int)fe_str->get_qpoints().size(),
981 std::vector<libMesh::Point>
982 qp_loc_fe = fe_str->get_qpoints(),
983 qp_loc(qp_loc_fe.size()*n_added_qp);
985 const std::vector<std::vector<Real>>& phi_temp = fe_thermal.
get_phi();
986 const std::vector<libMesh::Point>& xyz = fe_str->get_xyz();
992 for (
unsigned int i=0; i<qp_loc_fe.size(); i++) {
994 qp_loc[i*2] = qp_loc_fe[i];
995 qp_loc[i*2](2) = +1.;
997 qp_loc[i*2+1] = qp_loc_fe[i];
998 qp_loc[i*2+1](2) = -1.;
1005 std::unique_ptr<MAST::BendingOperator2D>
1008 qp_loc_fe).release());
1013 nt = (
unsigned int)fe_thermal.
get_phi().size();
1021 dT_mat = RealMatrixX::Zero(3,1),
1022 dstrain_dX_3D = RealMatrixX::Zero(6,nt),
1023 dstress_dX_3D = RealMatrixX::Zero(6,nt),
1024 Bmat_temp = RealMatrixX::Zero(1,nt);
1026 dT_mat(0) = dT_mat(1) = 1.;
1033 stiffness_matrix(2);
1043 for (
unsigned int qp_loc_index=0; qp_loc_index<qp_loc_fe_size; qp_loc_index++)
1044 for (
unsigned int section_qp_index=0; section_qp_index<n_added_qp; section_qp_index++)
1046 qp = qp_loc_index*n_added_qp + section_qp_index;
1049 for (
unsigned int i_nd=0; i_nd<nt; i_nd++ )
1050 Bmat_temp(0, i_nd) = phi_temp[i_nd][qp_loc_index];
1053 mat_stiff(xyz[qp_loc_index],
_time, material_mat);
1057 alpha_func(xyz[qp_loc_index],
_time, alpha);
1059 dstress_dX = alpha * material_mat * dT_mat * Bmat_temp;
1061 dstress_dX_3D.row(0) = -dstress_dX.row(0);
1062 dstress_dX_3D.row(1) = -dstress_dX.row(1);
1063 dstress_dX_3D.row(3) = -dstress_dX.row(2);
1067 &data = stress_output.get_stress_strain_data_for_elem_at_qp(
_elem, qp);
1084 const std::vector<Real>& JxW = fe->get_JxW();
1085 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1088 n_phi = (
unsigned int)fe->get_phi().size(),
1097 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
1098 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
1100 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
1101 mat5_3n2 = RealMatrixX::Zero(3,n2),
1102 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
1103 stress = RealMatrixX::Zero(2,2),
1104 mat_x = RealMatrixX::Zero(3,2),
1105 mat_y = RealMatrixX::Zero(3,2),
1106 local_jac = RealMatrixX::Zero(n2,n2);
1109 vec1_n1 = RealVectorX::Zero(n1),
1110 vec2_n1 = RealVectorX::Zero(n1),
1111 vec3_n2 = RealVectorX::Zero(n2),
1112 vec4_n3 = RealVectorX::Zero(n3),
1113 vec5_n3 = RealVectorX::Zero(n3),
1114 vec6_n2 = RealVectorX::Zero(n2),
1115 strain = RealVectorX::Zero(3),
1116 local_f = RealVectorX::Zero(n2);
1140 std::unique_ptr<MAST::BendingOperator2D> bend;
1145 fe->get_qpoints()).release());
1147 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
1152 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
1155 (*mat_stiff_A)(xyz[qp],
_time, material_A_mat);
1158 (*mat_stiff_B)(xyz[qp],
_time, material_B_mat);
1159 (*mat_stiff_D)(xyz[qp],
_time, material_D_mat);
1205 bend->include_transverse_shear_energy())
1206 bend->calculate_transverse_shear_residual(request_jacobian,
1215 if (request_jacobian) {
1219 for (
unsigned int i=0; i<n_phi; i++)
1220 local_jac(5*n_phi+i, 5*n_phi+i) = 1.0e-8;
1226 return request_jacobian;
1235 bool request_jacobian,
1245 bool calculate =
false;
1257 const std::vector<Real>& JxW = fe->get_JxW();
1258 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1261 n_phi = (
unsigned int)fe->get_phi().size(),
1270 material_trans_shear_mat,
1271 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
1272 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
1274 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
1275 mat5_3n2 = RealMatrixX::Zero(3,n2),
1276 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
1277 stress = RealMatrixX::Zero(2,2),
1278 mat_x = RealMatrixX::Zero(3,2),
1279 mat_y = RealMatrixX::Zero(3,2),
1280 local_jac = RealMatrixX::Zero(n2,n2);
1282 vec1_n1 = RealVectorX::Zero(n1),
1283 vec2_n1 = RealVectorX::Zero(n1),
1284 vec3_n2 = RealVectorX::Zero(n2),
1285 vec4_n3 = RealVectorX::Zero(n3),
1286 vec5_n3 = RealVectorX::Zero(n3),
1287 vec6_n2 = RealVectorX::Zero(n2),
1288 strain = RealVectorX::Zero(3),
1289 local_f = RealVectorX::Zero(n2);
1313 std::unique_ptr<MAST::BendingOperator2D> bend;
1318 fe->get_qpoints()).release());
1320 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
1326 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
1329 mat_stiff_A->derivative(p, xyz[qp],
_time, material_A_mat);
1333 mat_stiff_B->derivative(p, xyz[qp],
_time, material_B_mat);
1334 mat_stiff_D->derivative(p, xyz[qp],
_time, material_D_mat);
1380 bend->include_transverse_shear_energy())
1381 bend->calculate_transverse_shear_residual_sensitivity(p,
1390 if (request_jacobian) {
1396 return request_jacobian;
1404 const unsigned int s,
1406 bool request_jacobian,
1415 std::vector<Real> JxW_Vn = fe->get_JxW();
1416 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1417 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
1420 n_phi = (
unsigned int)fe->get_phi().size(),
1430 material_trans_shear_mat,
1431 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
1432 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
1434 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
1435 mat5_3n2 = RealMatrixX::Zero(3,n2),
1436 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
1437 stress = RealMatrixX::Zero(2,2),
1438 mat_x = RealMatrixX::Zero(3,2),
1439 mat_y = RealMatrixX::Zero(3,2),
1440 local_jac = RealMatrixX::Zero(n2,n2);
1442 vec1_n1 = RealVectorX::Zero(n1),
1443 vec2_n1 = RealVectorX::Zero(n1),
1444 vec3_n2 = RealVectorX::Zero(n2),
1445 vec4_n3 = RealVectorX::Zero(n3),
1446 vec5_n3 = RealVectorX::Zero(n3),
1447 vec6_n2 = RealVectorX::Zero(n2),
1448 strain = RealVectorX::Zero(3),
1449 local_f = RealVectorX::Zero(n2),
1450 vel = RealVectorX::Zero(dim);
1474 std::unique_ptr<MAST::BendingOperator2D> bend;
1479 fe->get_qpoints()).release());
1481 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
1490 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
1494 for (
unsigned int i=0; i<dim; i++)
1495 vn += vel(i)*face_normals[qp](i);
1501 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
1503 (*mat_stiff_A)(xyz[qp],
_time, material_A_mat);
1507 (*mat_stiff_B)(xyz[qp],
_time, material_B_mat);
1508 (*mat_stiff_D)(xyz[qp],
_time, material_D_mat);
1553 if (bend.get() && bend->include_transverse_shear_energy())
1554 bend->calculate_transverse_shear_residual_boundary_velocity
1555 (p, s, vel_f, request_jacobian, local_f, local_jac);
1561 if (request_jacobian) {
1578 const std::vector<Real>& JxW = fe->get_JxW();
1579 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1581 n_phi = (
unsigned int)fe->get_phi().size(),
1590 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
1591 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
1593 vk_dwdxi_mat_sens = RealMatrixX::Zero(n1,n3),
1594 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
1595 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
1596 stress = RealMatrixX::Zero(2,2),
1597 mat_x = RealMatrixX::Zero(3,2),
1598 mat_y = RealMatrixX::Zero(3,2),
1599 local_jac = RealMatrixX::Zero(n2,n2);
1601 vec1_n1 = RealVectorX::Zero(n1),
1602 vec2_n1 = RealVectorX::Zero(n1),
1603 strain = RealVectorX::Zero(3);
1628 std::unique_ptr<MAST::BendingOperator2D> bend;
1633 fe->get_qpoints()).release());
1639 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
1645 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
1648 (*mat_stiff_A)(xyz[qp],
_time, material_A_mat);
1649 (*mat_stiff_B)(xyz[qp],
_time, material_B_mat);
1650 (*mat_stiff_D)(xyz[qp],
_time, material_D_mat);
1666 vec2_n1 = material_A_mat * vec1_n1;
1670 bend->initialize_bending_strain_operator(*fe, qp, Bmat_bend);
1675 vec2_n1 += material_B_mat * vec1_n1;
1689 vec1_n1(0) = (vk_dwdxi_mat(0,0)*vk_dwdxi_mat_sens(0,0));
1690 vec1_n1(1) = (vk_dwdxi_mat(1,1)*vk_dwdxi_mat_sens(1,1));
1691 vec1_n1(2) = (vk_dwdxi_mat(0,0)*vk_dwdxi_mat_sens(1,1) +
1692 vk_dwdxi_mat(1,1)*vk_dwdxi_mat_sens(0,0));
1694 vec2_n1 += material_A_mat * vec1_n1;
1699 stress(0,0) = vec2_n1(0);
1700 stress(1,1) = vec2_n1(1);
1701 stress(0,1) = vec2_n1(2);
1702 stress(1,0) = vec2_n1(2);
1711 mat3 = vk_dwdxi_mat_sens.transpose() * mat1_n1n2;
1713 local_jac += JxW[qp] * mat2_n2n2;
1717 mat3 = vk_dwdxi_mat_sens.transpose() * mat1_n1n2;
1719 local_jac += JxW[qp] * mat2_n2n2;
1722 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1724 mat3 = vk_dwdxi_mat_sens.transpose() * material_A_mat * mat3;
1726 local_jac += JxW[qp] * mat2_n2n2;
1729 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1731 mat3 = vk_dwdxi_mat.transpose() * material_A_mat * mat3;
1733 local_jac += JxW[qp] * mat2_n2n2;
1736 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1738 mat3 = material_A_mat * mat3;
1740 local_jac += JxW[qp] * mat2_n2n2;
1743 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1745 mat3 = material_B_mat.transpose() * mat3;
1747 local_jac += JxW[qp] * mat2_n2n2;
1750 mat3 = RealMatrixX::Zero(2, n2);
1753 local_jac += JxW[qp] * mat2_n2n2;
1768 const unsigned int n2,
1769 const unsigned int qp,
1771 const std::vector<Real>& JxW,
1772 bool request_jacobian,
1816 vec2_n1 = material_A_mat * strain_mem;
1823 vec2_n1 += material_B_mat * vec1_n1;
1832 strain_mem += vec1_n1;
1833 vec2_n1 += material_A_mat * vec1_n1;
1839 stress(0,0) = vec2_n1(0);
1840 stress(0,1) = vec2_n1(2);
1841 stress(1,0) = vec2_n1(2);
1842 stress(1,1) = vec2_n1(1);
1847 local_f.topRows(n2) += JxW[qp] * vec3_n2;
1853 vec4_2 = mat_x.transpose() * vec2_n1;
1855 local_f.topRows(n2) += JxW[qp] * vec6_n2;
1858 vec4_2 = mat_y.transpose() * vec2_n1;
1860 local_f.topRows(n2) += JxW[qp] * vec6_n2;
1867 vec4_2 = vk_dwdxi_mat.transpose() * vec2_n1;
1869 local_f += JxW[qp] * vec3_n2;
1874 vec1_n1 = material_B_mat.transpose() * strain_mem;
1876 local_f += JxW[qp] * vec3_n2;
1880 vec1_n1 = material_D_mat * vec2_n1;
1882 local_f += JxW[qp] * vec3_n2;
1885 if (request_jacobian) {
1889 local_jac += JxW[qp] * mat2_n2n2;
1896 mat1_n1n2 = material_A_mat * mat1_n1n2;
1898 local_jac += JxW[qp] * mat2_n2n2;
1902 mat1_n1n2 = material_A_mat * mat1_n1n2;
1904 local_jac += JxW[qp] * mat2_n2n2;
1908 mat5_3n2 = mat_x.transpose() * mat1_n1n2;
1910 local_jac += JxW[qp] * mat2_n2n2;
1914 mat1_n1n2 = material_A_mat * mat1_n1n2;
1915 mat5_3n2 = mat_x.transpose() * mat1_n1n2;
1917 local_jac += JxW[qp] * mat2_n2n2;
1921 mat1_n1n2 = material_A_mat * mat1_n1n2;
1922 mat5_3n2 = mat_x.transpose() * mat1_n1n2;
1924 local_jac += JxW[qp] * mat2_n2n2;
1928 mat5_3n2 = mat_y.transpose() * mat1_n1n2;
1930 local_jac += JxW[qp] * mat2_n2n2;
1934 mat1_n1n2 = material_A_mat * mat1_n1n2;
1935 mat5_3n2 = mat_y.transpose() * mat1_n1n2;
1937 local_jac += JxW[qp] * mat2_n2n2;
1941 mat1_n1n2 = material_A_mat * mat1_n1n2;
1942 mat5_3n2 = mat_y.transpose() * mat1_n1n2;
1944 local_jac += JxW[qp] * mat2_n2n2;
1951 local_jac += JxW[qp] * mat2_n2n2;
1958 local_jac += JxW[qp] * mat2_n2n2;
1964 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1966 mat3 = material_A_mat * mat3;
1968 local_jac += JxW[qp] * mat2_n2n2;
1972 mat3 = vk_dwdxi_mat.transpose() * mat1_n1n2;
1974 local_jac += JxW[qp] * mat2_n2n2;
1977 mat3 = RealMatrixX::Zero(2, n2);
1980 local_jac += JxW[qp] * mat2_n2n2;
1982 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1984 mat3 = vk_dwdxi_mat.transpose() * material_A_mat * mat3;
1986 local_jac += JxW[qp] * mat2_n2n2;
1989 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1991 mat3 = material_B_mat.transpose() * mat3;
1993 local_jac += JxW[qp] * mat2_n2n2;
1997 mat3 = vk_dwdxi_mat.transpose() * mat1_n1n2;
1999 local_jac += JxW[qp] * mat2_n2n2;
2003 mat3 = material_B_mat.transpose();
2006 local_jac += JxW[qp] * mat2_n2n2;
2011 local_jac += JxW[qp] * mat2_n2n2;
2016 local_jac += JxW[qp] * mat2_n2n2;
2028 libmesh_assert_equal_to(mat.rows(), 2);
2029 libmesh_assert_equal_to(mat.cols(), 2);
2030 vec = RealVectorX::Zero(3);
2042 libmesh_assert_equal_to(mat.rows(), 2);
2043 libmesh_assert_equal_to(mat.cols(), 2);
2044 vec = RealVectorX::Zero(3);
2065 const std::vector<Real>& JxW = fe->get_JxW();
2066 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
2068 n_phi = (
unsigned int)fe->get_phi().size(),
2074 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
2076 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
2077 local_jac = RealMatrixX::Zero(n2,n2),
2078 mat_x = RealMatrixX::Zero(3,2),
2079 mat_y = RealMatrixX::Zero(3,2),
2084 vec2_n1 = RealVectorX::Zero(n1),
2085 vec3_n2 = RealVectorX::Zero(n2),
2086 vec4_n3 = RealVectorX::Zero(n3),
2087 vec5_n3 = RealVectorX::Zero(n3),
2088 local_f = RealVectorX::Zero(n2),
2089 strain = RealVectorX::Zero(3),
2115 std::unique_ptr<MAST::BendingOperator2D> bend;
2120 fe->get_qpoints()).release());
2122 std::unique_ptr<MAST::FieldFunction<RealMatrixX> >
2127 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
2129 (*prestress_A)(xyz[qp],
_time, prestress_mat_A);
2130 (*prestress_B)(xyz[qp],
_time, prestress_mat_B);
2149 bend->initialize_bending_strain_operator(*fe, qp, Bmat_bend);
2163 local_f += JxW[qp] * vec3_n2;
2168 vec4_n3 = vk_dwdxi_mat.transpose() * prestress_vec_A;
2170 local_f += JxW[qp] * vec3_n2;
2175 local_f += JxW[qp] * vec3_n2;
2178 if (request_jacobian) {
2179 if (bend.get() && if_vk) {
2180 mat3 = RealMatrixX::Zero(2, n2);
2183 local_jac += JxW[qp] * mat2_n2n2;
2191 if (request_jacobian && if_vk) {
2197 return (request_jacobian);
2206 bool request_jacobian,
2217 const std::vector<Real>& JxW = fe->get_JxW();
2218 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
2220 n_phi = (
unsigned int)fe->get_phi().size(),
2226 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
2228 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
2229 local_jac = RealMatrixX::Zero(n2,n2),
2230 mat_x = RealMatrixX::Zero(3,2),
2231 mat_y = RealMatrixX::Zero(3,2),
2236 vec2_n1 = RealVectorX::Zero(n1),
2237 vec3_n2 = RealVectorX::Zero(n2),
2238 vec4_n3 = RealVectorX::Zero(n3),
2239 vec5_n3 = RealVectorX::Zero(n3),
2240 local_f = RealVectorX::Zero(n2),
2241 strain = RealVectorX::Zero(3),
2267 std::unique_ptr<MAST::BendingOperator2D> bend;
2272 fe->get_qpoints()).release());
2274 std::unique_ptr<MAST::FieldFunction<RealMatrixX> >
2279 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
2281 prestress_A->derivative(p, xyz[qp],
_time, prestress_mat_A);
2282 prestress_B->derivative(p, xyz[qp],
_time, prestress_mat_B);
2301 bend->initialize_bending_strain_operator(*fe, qp, Bmat_bend);
2315 local_f += JxW[qp] * vec3_n2;
2320 vec4_n3 = vk_dwdxi_mat.transpose() * prestress_vec_A;
2322 local_f += JxW[qp] * vec3_n2;
2327 local_f += JxW[qp] * vec3_n2;
2330 if (request_jacobian) {
2331 if (bend.get() && if_vk) {
2332 mat3 = RealMatrixX::Zero(2, n2);
2335 local_jac += JxW[qp] * mat2_n2n2;
2343 if (request_jacobian && if_vk) {
2349 return (request_jacobian);
2361 const unsigned int side,
2369 const std::vector<Real> &JxW = fe->
get_JxW();
2370 const std::vector<libMesh::Point>& qpoint = fe->
get_xyz();
2371 const std::vector<std::vector<Real> >& phi = fe->
get_phi();
2373 n_phi = (
unsigned int)phi.size(),
2388 trac = RealVectorX::Zero(3);
2393 phi_vec = RealVectorX::Zero(n_phi),
2394 force = RealVectorX::Zero(2*n1),
2395 local_f = RealVectorX::Zero(n2),
2396 vec_n2 = RealVectorX::Zero(n2);
2398 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
2401 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
2402 phi_vec(i_nd) = phi[i_nd][qp];
2404 Bmat.reinit(2*n1, phi_vec);
2407 trac_func(qpoint[qp],
_time, trac);
2408 t_func (qpoint[qp],
_time, t_val);
2411 for (
unsigned int i_dim=0; i_dim<n1; i_dim++)
2412 force(i_dim) = trac(i_dim)*t_val;
2414 Bmat.vector_mult_transpose(vec_n2, force);
2416 local_f += JxW[qp] * vec_n2;
2424 return (request_jacobian);
2432 bool request_jacobian,
2435 const unsigned int side,
2443 const std::vector<Real> &JxW = fe->
get_JxW();
2444 const std::vector<libMesh::Point>& qpoint = fe->
get_xyz();
2445 const std::vector<std::vector<Real> >& phi = fe->
get_phi();
2447 n_phi = (
unsigned int)phi.size(),
2462 trac = RealVectorX::Zero(3),
2463 dtrac = RealVectorX::Zero(3);
2469 phi_vec = RealVectorX::Zero(n_phi),
2470 force = RealVectorX::Zero(2*n1),
2471 local_f = RealVectorX::Zero(n2),
2472 vec_n2 = RealVectorX::Zero(n2);
2474 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
2477 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
2478 phi_vec(i_nd) = phi[i_nd][qp];
2480 Bmat.reinit(2*n1, phi_vec);
2483 trac_func(qpoint[qp],
_time, trac);
2485 t_func (qpoint[qp],
_time, t_val);
2489 for (
unsigned int i_dim=0; i_dim<n1; i_dim++)
2490 force(i_dim) = (trac(i_dim)*dt_val + dtrac(i_dim)*t_val);
2492 Bmat.vector_mult_transpose(vec_n2, force);
2494 local_f += JxW[qp] * vec_n2;
2502 return (request_jacobian);
2513 const unsigned int side,
2521 const std::vector<Real> &JxW = fe->
get_JxW();
2522 const std::vector<libMesh::Point>& qpoint = fe->
get_xyz();
2523 const std::vector<std::vector<Real> >& phi = fe->
get_phi();
2526 n_phi = (
unsigned int)phi.size(),
2535 bc.get<LevelSetBoundaryVelocity>("phi_vel");
2544 trac = RealVectorX::Zero(3),
2545 stress = RealVectorX::Zero(3),
2546 dnormal = RealVectorX::Zero(3),
2547 normal = RealVectorX::Zero(3),
2548 bnd_pt = RealVectorX::Zero(3),
2549 phi_vec = RealVectorX::Zero(n_phi),
2550 force = RealVectorX::Zero(2*n1),
2551 local_f = RealVectorX::Zero(n2),
2552 vec_n2 = RealVectorX::Zero(n2);
2555 normal_mat = RealMatrixX::Zero(2,n1),
2556 stress_grad = RealMatrixX::Zero(n1,2),
2557 mat1_n1n2 = RealMatrixX::Zero(2*n1, n2),
2558 mat2_n2n2 = RealMatrixX::Zero(n2, n2),
2559 local_jac = RealMatrixX::Zero(n2, n2),
2560 dstress_dX = RealMatrixX::Zero(n1,n2),
2561 *dstress_mat= request_jacobian?&dstress_dX:
nullptr;
2570 std::vector<RealMatrixX>
2571 stress_grad_dX(2, RealMatrixX::Zero(n1,n2)),
2572 *stress_grad_mat = request_jacobian?&stress_grad_dX:
nullptr;
2575 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
2578 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
2579 phi_vec(i_nd) = phi[i_nd][qp];
2581 Bmat.reinit(2*n1, phi_vec);
2589 pt(0) = bnd_pt(0); pt(1) = bnd_pt(1); pt(2) = bnd_pt(2);
2591 trac_func (pt, _time, trac);
2592 interface.normal_at_point(pt, _time, normal);
2594 t_func (qpoint[qp], _time, t_val);
2597 for (
unsigned int i_dim=0; i_dim<n1; i_dim++)
2598 dnormal(i_dim) = face_normals[qp](i_dim) - normal(i_dim);
2605 force.topRows(2) = trac.topRows(2) + normal_mat * stress;
2612 for (
unsigned int i_dim=0; i_dim<2; i_dim++)
2613 force.topRows(2) -= normal_mat * stress_grad.col(i_dim) * (bnd_pt(i_dim) - qpoint[qp](i_dim));
2615 Bmat.vector_mult_transpose(vec_n2, force);
2625 local_f += t_val * JxW[qp] * vec_n2;
2627 if (request_jacobian) {
2631 mat1_n1n2.topLeftCorner(2, n2) = normal_mat * dstress_dX;
2635 for (
unsigned int i_dim=0; i_dim<2; i_dim++) {
2637 mat1_n1n2.topLeftCorner(2, n2) -=
2638 (bnd_pt(i_dim) - qpoint[qp](i_dim)) * normal_mat * stress_grad_dX[i_dim];
2641 Bmat.right_multiply_transpose(mat2_n2n2, mat1_n1n2);
2642 local_jac += t_val * JxW[qp] * mat2_n2n2;
2650 if (request_jacobian) {
2656 return request_jacobian;
2664 bool request_jacobian,
2667 const unsigned int side,
2675 const std::vector<Real> &JxW = fe->
get_JxW();
2676 const std::vector<libMesh::Point>& qpoint = fe->
get_xyz();
2677 const std::vector<std::vector<Real> >& phi = fe->
get_phi();
2680 n_phi = (
unsigned int)phi.size(),
2689 bc.get<LevelSetBoundaryVelocity>("phi_vel");
2698 trac = RealVectorX::Zero(3),
2699 dtrac = RealVectorX::Zero(3),
2700 stress = RealVectorX::Zero(3),
2701 dnormal = RealVectorX::Zero(3),
2702 normal = RealVectorX::Zero(3),
2703 normal_sens = RealVectorX::Zero(3),
2704 bnd_pt = RealVectorX::Zero(3),
2705 bnd_pt_sens = RealVectorX::Zero(3),
2706 phi_vec = RealVectorX::Zero(n_phi),
2707 force = RealVectorX::Zero(2*n1),
2708 local_f = RealVectorX::Zero(n2),
2709 vec_n2 = RealVectorX::Zero(n2);
2712 normal_mat = RealMatrixX::Zero(2,n1),
2713 stress_grad = RealMatrixX::Zero(n1,2),
2714 mat1_n1n2 = RealMatrixX::Zero(2*n1, n2),
2715 mat2_n2n2 = RealMatrixX::Zero(n2, n2),
2716 local_jac = RealMatrixX::Zero(n2, n2),
2717 dstress_dX = RealMatrixX::Zero(n1,n2),
2718 *dstress_mat= request_jacobian?&dstress_dX:
nullptr;
2728 std::vector<RealMatrixX>
2729 stress_grad_dX(2, RealMatrixX::Zero(n1,n2)),
2730 *stress_grad_mat = request_jacobian?&stress_grad_dX:
nullptr;
2733 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
2736 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
2737 phi_vec(i_nd) = phi[i_nd][qp];
2739 Bmat.reinit(2*n1, phi_vec);
2747 interface.search_nearest_interface_point_derivative(p,
2753 pt(0) = bnd_pt(0); pt(1) = bnd_pt(1); pt(2) = bnd_pt(2);
2756 trac_func(pt, _time, trac);
2758 interface.normal_at_point(pt, _time, normal);
2759 interface.normal_derivative_at_point(p, pt, _time, normal_sens);
2760 t_func (qpoint[qp], _time, t_val);
2761 t_func.derivative(p, qpoint[qp], _time, dt_val);
2764 for (
unsigned int i_dim=0; i_dim<n1; i_dim++)
2765 dnormal(i_dim) = face_normals[qp](i_dim) - normal(i_dim);
2768 force.topRows(2) = dtrac.topRows(2) + normal_mat * stress;
2771 for (
unsigned int i_dim=0; i_dim<n1; i_dim++)
2772 dnormal(i_dim) = normal_sens(i_dim);
2775 force.topRows(2) -= normal_mat * stress;
2779 for (
unsigned int i_dim=0; i_dim<2; i_dim++)
2780 force.topRows(2) -= normal_mat * stress_grad.col(i_dim) * (bnd_pt(i_dim) - qpoint[qp](i_dim));
2784 for (
unsigned int i_dim=0; i_dim<2; i_dim++)
2785 force.topRows(2) -= normal_mat * stress_grad.col(i_dim) * bnd_pt_sens(i_dim);
2789 for (
unsigned int i_dim=0; i_dim<2; i_dim++)
2790 force.topRows(2) -= normal_mat * stress_grad.col(i_dim) * (bnd_pt(i_dim) - qpoint[qp](i_dim));
2793 Bmat.vector_mult_transpose(vec_n2, force);
2795 local_f += t_val * JxW[qp] * vec_n2;
2811 for (
unsigned int i_dim=0; i_dim<n1; i_dim++)
2812 dnormal(i_dim) = face_normals[qp](i_dim) - normal(i_dim);
2819 force.topRows(2) = trac.topRows(2) + normal_mat * stress;
2826 for (
unsigned int i_dim=0; i_dim<2; i_dim++)
2827 force.topRows(2) -= normal_mat * stress_grad.col(i_dim) * (bnd_pt(i_dim) - qpoint[qp](i_dim));
2829 Bmat.vector_mult_transpose(vec_n2, force);
2831 local_f += dt_val * JxW[qp] * vec_n2;
2834 if (request_jacobian) {
2836 libmesh_assert(
false);
2844 if (request_jacobian) {
2850 return request_jacobian;
2860 const unsigned int side,
2868 const std::vector<Real> &JxW = fe->
get_JxW();
2869 const std::vector<libMesh::Point>& qpoint = fe->
get_xyz();
2870 const std::vector<std::vector<Real> >& phi = fe->
get_phi();
2873 n_phi = (
unsigned int)phi.size(),
2892 phi_vec = RealVectorX::Zero(n_phi),
2893 force = RealVectorX::Zero(2*n1),
2894 local_f = RealVectorX::Zero(n2),
2895 vec_n2 = RealVectorX::Zero(n2);
2897 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
2900 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
2901 phi_vec(i_nd) = phi[i_nd][qp];
2903 Bmat.reinit(2*n1, phi_vec);
2906 p_func(qpoint[qp],
_time, press);
2907 t_func(qpoint[qp],
_time, t_val);
2910 for (
unsigned int i_dim=0; i_dim<n1; i_dim++)
2911 force(i_dim) = (press*t_val) * face_normals[qp](i_dim);
2913 Bmat.vector_mult_transpose(vec_n2, force);
2915 local_f += JxW[qp] * vec_n2;
2923 return (request_jacobian);
2933 bool request_jacobian,
2936 const unsigned int side,
2944 const std::vector<Real> &JxW = fe->
get_JxW();
2945 const std::vector<libMesh::Point>& qpoint = fe->
get_xyz();
2946 const std::vector<std::vector<Real> >& phi = fe->
get_phi();
2949 n_phi = (
unsigned int)phi.size(),
2971 phi_vec = RealVectorX::Zero(n_phi),
2972 force = RealVectorX::Zero(2*n1),
2973 local_f = RealVectorX::Zero(n2),
2974 vec_n2 = RealVectorX::Zero(n2);
2976 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
2979 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
2980 phi_vec(i_nd) = phi[i_nd][qp];
2982 Bmat.reinit(2*n1, phi_vec);
2985 p_func(qpoint[qp],
_time, press);
2987 t_func(qpoint[qp],
_time, t_val);
2991 for (
unsigned int i_dim=0; i_dim<n1; i_dim++)
2992 force(i_dim) = (press*dt_val + dpress*t_val) * face_normals[qp](i_dim);
2994 Bmat.vector_mult_transpose(vec_n2, force);
2996 local_f += JxW[qp] * vec_n2;
3004 return (request_jacobian);
3022 const std::vector<Real>& JxW = fe->get_JxW();
3023 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
3026 n_phi = (
unsigned int)fe->get_phi().size(),
3034 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
3035 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
3036 mat3 = RealMatrixX::Zero(2, n2),
3037 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
3038 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
3039 stress = RealMatrixX::Zero(2,2),
3040 mat_x = RealMatrixX::Zero(3,2),
3041 mat_y = RealMatrixX::Zero(3,2),
3042 local_jac = RealMatrixX::Zero(n2,n2);
3045 vec1_n1 = RealVectorX::Zero(n1),
3046 vec2_n1 = RealVectorX::Zero(n1),
3047 vec3_n2 = RealVectorX::Zero(n2),
3048 vec4_2 = RealVectorX::Zero(2),
3049 vec5_n3 = RealVectorX::Zero(n3),
3050 local_f = RealVectorX::Zero(n2),
3051 strain = RealVectorX::Zero(3),
3052 delta_t = RealVectorX::Zero(1);
3076 std::unique_ptr<MAST::BendingOperator2D> bend;
3081 fe->get_qpoints()).release());
3083 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
3096 if (bc.
contains(
"thermal_jacobian_scaling"))
3099 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
3102 (*expansion_A)(xyz[qp],
_time, material_exp_A_mat);
3103 (*expansion_B)(xyz[qp],
_time, material_exp_B_mat);
3106 temp_func(xyz[qp], _time, t);
3107 ref_temp_func(xyz[qp], _time, t0);
3110 vec1_n1 = material_exp_A_mat * delta_t;
3111 vec2_n1 = material_exp_B_mat * delta_t;
3112 stress(0,0) = vec1_n1(0);
3113 stress(0,1) = vec1_n1(2);
3114 stress(1,0) = vec1_n1(2);
3115 stress(1,1) = vec1_n1(1);
3131 local_f += JxW[qp] * vec3_n2;
3137 vec4_2 = mat_x.transpose() * vec1_n1;
3139 local_f.topRows(n2) += JxW[qp] * vec3_n2;
3142 vec4_2 = mat_y.transpose() * vec1_n1;
3144 local_f.topRows(n2) += JxW[qp] * vec3_n2;
3149 bend->initialize_bending_strain_operator(*fe, qp, Bmat_bend);
3151 local_f += JxW[qp] * vec3_n2;
3162 vec4_2 = vk_dwdxi_mat.transpose() * vec1_n1;
3164 local_f += JxW[qp] * vec3_n2;
3168 if (request_jacobian &&
3174 local_jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
3179 local_jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
3182 if (request_jacobian && if_vk) {
3184 mat3 = RealMatrixX::Zero(2, n2);
3187 local_jac += JxW[qp] * mat2_n2n2;
3194 if (request_jacobian && if_vk) {
3196 jac -= scaling * mat2_n2n2;
3200 return request_jacobian;
3209 bool request_jacobian,
3218 const std::vector<Real>& JxW = fe->get_JxW();
3219 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
3222 n_phi = (
unsigned int)fe->get_phi().size(),
3230 material_exp_A_mat_sens,
3231 material_exp_B_mat_sens,
3232 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
3233 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
3234 mat3 = RealMatrixX::Zero(2, n2),
3235 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
3236 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
3237 stress = RealMatrixX::Zero(2,2),
3238 mat_x = RealMatrixX::Zero(3,2),
3239 mat_y = RealMatrixX::Zero(3,2),
3240 local_jac = RealMatrixX::Zero(n2,n2);
3243 vec1_n1 = RealVectorX::Zero(n1),
3244 vec2_n1 = RealVectorX::Zero(n1),
3245 vec3_n2 = RealVectorX::Zero(n2),
3246 vec4_2 = RealVectorX::Zero(2),
3247 vec5_n1 = RealVectorX::Zero(n1),
3248 local_f = RealVectorX::Zero(n2),
3249 strain = RealVectorX::Zero(3),
3250 delta_t = RealVectorX::Zero(1),
3251 delta_t_sens = RealVectorX::Zero(1);
3275 std::unique_ptr<MAST::BendingOperator2D> bend;
3280 fe->get_qpoints()).release());
3282 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
3291 Real t, t0, t_sens, t0_sens;
3293 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
3296 (*expansion_A)(xyz[qp],
_time, material_exp_A_mat);
3297 (*expansion_B)(xyz[qp],
_time, material_exp_B_mat);
3298 expansion_A->
derivative(p, xyz[qp], _time, material_exp_A_mat_sens);
3299 expansion_B->derivative(p, xyz[qp], _time, material_exp_B_mat_sens);
3302 temp_func(xyz[qp], _time, t);
3303 ref_temp_func(xyz[qp], _time, t0);
3307 temp_func(xyz[qp], _time, t);
3308 temp_func.
derivative(p, xyz[qp], _time, t_sens);
3309 ref_temp_func(xyz[qp], _time, t0);
3310 ref_temp_func.derivative(p, xyz[qp], _time, t0_sens);
3312 delta_t_sens(0) = t_sens-t0_sens;
3315 vec1_n1 = material_exp_A_mat * delta_t_sens;
3316 vec2_n1 = material_exp_A_mat_sens * delta_t;
3318 stress(0,0) = vec1_n1(0);
3319 stress(0,1) = vec1_n1(2);
3320 stress(1,0) = vec1_n1(2);
3321 stress(1,1) = vec1_n1(1);
3323 vec2_n1 = material_exp_B_mat * delta_t_sens;
3324 vec5_n1 = material_exp_B_mat_sens * delta_t;
3342 local_f += JxW[qp] * vec3_n2;
3348 vec4_2 = mat_x.transpose() * vec1_n1;
3350 local_f.topRows(n2) += JxW[qp] * vec3_n2;
3353 vec4_2 = mat_y.transpose() * vec1_n1;
3355 local_f.topRows(n2) += JxW[qp] * vec3_n2;
3360 bend->initialize_bending_strain_operator(*fe, qp, Bmat_bend);
3362 local_f += JxW[qp] * vec3_n2;
3373 vec4_2 = vk_dwdxi_mat.transpose() * vec1_n1;
3375 local_f += JxW[qp] * vec3_n2;
3379 if (request_jacobian &&
3385 local_jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
3390 local_jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
3393 if (request_jacobian && if_vk) {
3396 mat3 = RealMatrixX::Zero(2, n2);
3399 local_jac += JxW[qp] * mat2_n2n2;
3407 if (request_jacobian && if_vk) {
3413 return request_jacobian;
3422 const unsigned int s,
3425 bool request_jacobian,
3434 std::vector<Real> JxW_Vn = fe->get_JxW();
3435 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
3436 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
3439 n_phi = (
unsigned int)fe->get_phi().size(),
3447 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
3448 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
3449 mat3 = RealMatrixX::Zero(2, n2),
3450 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
3451 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
3452 stress = RealMatrixX::Zero(2,2),
3453 mat_x = RealMatrixX::Zero(3,2),
3454 mat_y = RealMatrixX::Zero(3,2),
3455 local_jac = RealMatrixX::Zero(n2,n2);
3458 vec1_n1 = RealVectorX::Zero(n1),
3459 vec2_n1 = RealVectorX::Zero(n1),
3460 vec3_n2 = RealVectorX::Zero(n2),
3461 vec4_2 = RealVectorX::Zero(2),
3462 vec5_n3 = RealVectorX::Zero(n3),
3463 local_f = RealVectorX::Zero(n2),
3464 delta_t = RealVectorX::Zero(1),
3465 strain = RealVectorX::Zero(3),
3466 vel = RealVectorX::Zero(dim);
3490 std::unique_ptr<MAST::BendingOperator2D> bend;
3495 fe->get_qpoints()).release());
3497 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
3511 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
3515 for (
unsigned int i=0; i<dim; i++)
3516 vn += vel(i)*face_normals[qp](i);
3520 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
3523 (*expansion_A)(xyz[qp],
_time, material_exp_A_mat);
3524 (*expansion_B)(xyz[qp],
_time, material_exp_B_mat);
3527 temp_func(xyz[qp], _time, t);
3528 ref_temp_func(xyz[qp], _time, t0);
3531 vec1_n1 = material_exp_A_mat * delta_t;
3532 vec2_n1 = material_exp_B_mat * delta_t;
3533 stress(0,0) = vec1_n1(0);
3534 stress(0,1) = vec1_n1(2);
3535 stress(1,0) = vec1_n1(2);
3536 stress(1,1) = vec1_n1(1);
3552 local_f += JxW_Vn[qp] * vec3_n2;
3558 vec4_2 = mat_x.transpose() * vec1_n1;
3560 local_f.topRows(n2) += JxW_Vn[qp] * vec3_n2;
3563 vec4_2 = mat_y.transpose() * vec1_n1;
3565 local_f.topRows(n2) += JxW_Vn[qp] * vec3_n2;
3570 bend->initialize_bending_strain_operator(*fe, qp, Bmat_bend);
3572 local_f += JxW_Vn[qp] * vec3_n2;
3583 vec4_2 = vk_dwdxi_mat.transpose() * vec1_n1;
3585 local_f += JxW_Vn[qp] * vec3_n2;
3589 if (request_jacobian &&
3595 local_jac.topLeftCorner(n2, n2) += JxW_Vn[qp] * mat2_n2n2;
3600 local_jac.topLeftCorner(n2, n2) += JxW_Vn[qp] * mat2_n2n2;
3603 if (request_jacobian && if_vk) {
3605 mat3 = RealMatrixX::Zero(2, n2);
3608 local_jac += JxW_Vn[qp] * mat2_n2n2;
3615 if (request_jacobian && if_vk) {
3629 const std::vector<std::vector<Real>>& phi_temp = fe_thermal.
get_phi();
3630 const std::vector<Real>& JxW = fe_thermal.
get_JxW();
3631 const std::vector<libMesh::Point>& xyz = fe_thermal.
get_xyz();
3633 std::unique_ptr<MAST::FEBase> fe_str(
_elem.
init_fe(
true,
false,
3635 libmesh_assert(fe_str->get_fe_type() == fe_thermal.
get_fe_type());
3640 libmesh_assert_equal_to(fe_str->get_qpoints().size(), fe_thermal.
get_qpoints().size());
3644 n_phi_str = (
unsigned int)fe_str->get_phi().size(),
3645 nt = (
unsigned int)fe_thermal.
get_phi().size(),
3653 mat1_n1nt = RealMatrixX::Zero(n1,nt),
3654 mat2_n1nt = RealMatrixX::Zero(n1,nt),
3655 mat3_n2nt = RealMatrixX::Zero(n2,nt),
3657 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
3658 stress = RealMatrixX::Zero(2,2),
3659 mat_x = RealMatrixX::Zero(3,2),
3660 mat_y = RealMatrixX::Zero(3,2),
3661 Bmat_temp = RealMatrixX::Zero(1,nt),
3662 local_m = RealMatrixX::Zero(n2,nt);
3665 phi = RealVectorX::Zero(nt),
3666 vec_n1 = RealVectorX::Zero(n1),
3667 strain = RealVectorX::Zero(3);
3691 std::unique_ptr<MAST::BendingOperator2D> bend;
3696 fe_str->get_qpoints()).release());
3698 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
3702 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
3705 (*expansion_A)(xyz[qp],
_time, material_exp_A_mat);
3706 (*expansion_B)(xyz[qp],
_time, material_exp_B_mat);
3709 for (
unsigned int i_nd=0; i_nd<nt; i_nd++ )
3710 Bmat_temp(0, i_nd) = phi_temp[i_nd][qp];
3724 mat1_n1nt = material_exp_A_mat * Bmat_temp;
3725 mat2_n1nt = material_exp_B_mat * Bmat_temp;
3727 local_m += JxW[qp] * mat3_n2nt;
3734 mat5 = mat_x.transpose() * mat1_n1nt;
3736 local_m.topRows(n2) += JxW[qp] * mat3_n2nt;
3739 mat5 = mat_y.transpose() * mat1_n1nt;
3741 local_m.topRows(n2) += JxW[qp] * mat3_n2nt;
3746 bend->initialize_bending_strain_operator(*fe_str, qp, Bmat_bend);
3748 local_m += JxW[qp] * mat3_n2nt;
3759 mat5 = vk_dwdxi_mat.transpose() * mat1_n1nt;
3761 local_m += JxW[qp] * mat3_n2nt;
3766 mat3_n2nt.setZero();
3767 phi = RealVectorX::Zero(n2);
3768 vec_n1 = RealVectorX::Zero(n2);
3769 for (
unsigned int i=0; i<nt; i++) {
3770 phi = local_m.col(i);
3772 mat3_n2nt.col(i) = vec_n1;
3786 const unsigned int side,
3789 libmesh_assert(
false);
3791 return (request_jacobian);
3800 bool request_jacobian,
3804 const unsigned int side,
3807 libmesh_assert(
false);
3809 return (request_jacobian);
3827 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
true,
false));
3829 const std::vector<Real> &JxW = fe->
get_JxW();
3830 const std::vector<libMesh::Point>& qpoint = fe->
get_xyz();
3831 const std::vector<std::vector<Real> >& phi = fe->
get_phi();
3833 n_phi = (
unsigned int)phi.size(),
3839 libMesh::Point normal;
3854 dwdx_p (
"dwdx", 0.),
3855 dwdt_p (
"dwdt", 0.);
3858 dwdx_f (
"dwdx", dwdx_p),
3859 dwdt_f (
"dwdx", dwdt_p);
3862 std::unique_ptr<MAST::FieldFunction<Real> >
3863 pressure (piston_bc.get_pressure_function(dwdx_f, dwdt_f).release()),
3864 dpressure_dx (piston_bc.get_dpdx_function (dwdx_f, dwdt_f).release()),
3865 dpressure_dxdot (piston_bc.get_dpdxdot_function (dwdx_f, dwdt_f).release());
3874 phi_vec = RealVectorX::Zero(n_phi),
3875 force = RealVectorX::Zero(n1),
3876 local_f = RealVectorX::Zero(n2),
3877 vec_n1 = RealVectorX::Zero(n1),
3878 vec_n2 = RealVectorX::Zero(n2),
3879 vel_vec = RealVectorX::Zero(3),
3880 dummy = RealVectorX::Zero(3);
3883 dwdx = RealMatrixX::Zero(3,2),
3884 local_jac_xdot = RealMatrixX::Zero(n2,n2),
3885 local_jac = RealMatrixX::Zero(n2,n2),
3886 mat_n2n2 = RealMatrixX::Zero(n2,n2),
3887 mat_n1n2 = RealMatrixX::Zero(n1,n2),
3888 mat_22 = RealMatrixX::Zero(2,2);
3892 vel_vec =
_elem.
T_matrix().transpose() * piston_bc.vel_vec();
3900 for (
unsigned int qp=0; qp<qpoint.size(); qp++)
3904 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
3905 phi_vec(i_nd) = phi[i_nd][qp];
3909 Bmat_w.set_shape_function(0, 2, phi_vec);
3915 dwdt_val = vec_n1(0);
3928 for (
unsigned int i=0; i<2; i++)
3929 dwdx_val += dwdx(i,i) * vel_vec(i);
3934 (*pressure)(qpoint[qp],
_time, p_val);
3937 force(0) = p_val * normal(2);
3940 Bmat_w.vector_mult_transpose(vec_n2, force);
3941 local_f += JxW[qp] * vec_n2;
3945 if (request_jacobian) {
3948 (*dpressure_dxdot)(qpoint[qp],
_time, p_val);
3951 Bmat_w.right_multiply_transpose(mat_n2n2, Bmat_w);
3952 local_jac_xdot += (JxW[qp] * p_val * normal(2)) * mat_n2n2;
3955 (*dpressure_dx)(qpoint[qp],
_time, p_val);
3958 mat_22.setZero(2,2);
3959 mat_22(0,0) = vel_vec(0);
3960 dBmat.left_multiply(mat_n1n2, mat_22);
3961 Bmat_w.right_multiply_transpose(mat_n2n2, mat_n1n2);
3962 local_jac += (JxW[qp] * p_val * normal(2)) * mat_n2n2;
3965 mat_22.setZero(2,2);
3966 mat_22(1,1) = vel_vec(1);
3967 dBmat.left_multiply(mat_n1n2, mat_22);
3968 Bmat_w.right_multiply_transpose(mat_n2n2, mat_n1n2);
3969 local_jac += (JxW[qp] * p_val * normal(2)) * mat_n2n2;
3980 if (request_jacobian) {
3982 jac_xdot -= mat_n2n2;
3988 return request_jacobian;
3997 bool request_jacobian,
4007 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
true,
false));
4009 const std::vector<Real> &JxW = fe->
get_JxW();
4010 const std::vector<libMesh::Point>& qpoint = fe->
get_xyz();
4011 const std::vector<std::vector<Real> >& phi = fe->
get_phi();
4013 n_phi = (
unsigned int)phi.size(),
4019 libMesh::Point normal;
4034 dwdx_p (
"dwdx", 0.),
4035 dwdt_p (
"dwdt", 0.);
4038 dwdx_f (
"dwdx", dwdx_p),
4039 dwdt_f (
"dwdx", dwdt_p);
4042 std::unique_ptr<MAST::FieldFunction<Real> >
4043 pressure (piston_bc.get_pressure_function(dwdx_f, dwdt_f).release()),
4044 dpressure_dx (piston_bc.get_dpdx_function (dwdx_f, dwdt_f).release()),
4045 dpressure_dxdot (piston_bc.get_dpdxdot_function (dwdx_f, dwdt_f).release());
4054 phi_vec = RealVectorX::Zero(n_phi),
4055 force = RealVectorX::Zero(n1),
4056 local_f = RealVectorX::Zero(n2),
4057 vec_n1 = RealVectorX::Zero(n1),
4058 vec_n2 = RealVectorX::Zero(n2),
4059 vel_vec = RealVectorX::Zero(3),
4060 dummy = RealVectorX::Zero(3);
4063 dwdx = RealMatrixX::Zero(3,2),
4064 local_jac_xdot = RealMatrixX::Zero(n2,n2),
4065 local_jac = RealMatrixX::Zero(n2,n2),
4066 mat_n2n2 = RealMatrixX::Zero(n2,n2),
4067 mat_n1n2 = RealMatrixX::Zero(n1,n2),
4068 mat_22 = RealMatrixX::Zero(2,2);
4072 vel_vec =
_elem.
T_matrix().transpose() * piston_bc.vel_vec();
4080 for (
unsigned int qp=0; qp<qpoint.size(); qp++)
4084 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
4085 phi_vec(i_nd) = phi[i_nd][qp];
4089 Bmat_w.set_shape_function(0, 2, phi_vec);
4095 dwdt_val = vec_n1(0);
4108 for (
unsigned int i=0; i<2; i++)
4109 dwdx_val += dwdx(i,i) * vel_vec(i);
4114 pressure->derivative(p, qpoint[qp],
_time, p_val);
4117 force(0) = p_val * normal(2);
4120 Bmat_w.vector_mult_transpose(vec_n2, force);
4121 local_f += JxW[qp] * vec_n2;
4125 if (request_jacobian) {
4128 dpressure_dxdot->derivative(p, qpoint[qp],
_time, p_val);
4131 Bmat_w.right_multiply_transpose(mat_n2n2, Bmat_w);
4132 local_jac_xdot += (JxW[qp] * p_val * normal(2)) * mat_n2n2;
4135 dpressure_dx->derivative(p, qpoint[qp],
_time, p_val);
4138 mat_22.setZero(2,2);
4139 mat_22(0,0) = vel_vec(0);
4140 dBmat.left_multiply(mat_n1n2, mat_22);
4141 Bmat_w.right_multiply_transpose(mat_n2n2, mat_n1n2);
4142 local_jac += (JxW[qp] * p_val * normal(2)) * mat_n2n2;
4145 mat_22.setZero(2,2);
4146 mat_22(1,1) = vel_vec(1);
4147 dBmat.left_multiply(mat_n1n2, mat_22);
4148 Bmat_w.right_multiply_transpose(mat_n2n2, mat_n1n2);
4149 local_jac += (JxW[qp] * p_val * normal(2)) * mat_n2n2;
4160 if (request_jacobian) {
4162 jac_xdot -= mat_n2n2;
4169 return request_jacobian;
4193 std::vector<Real> JxW = fe.
get_JxW();
4194 const std::vector<libMesh::Point>& xyz = fe.
get_xyz();
4216 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
4217 dstrain_dX = RealMatrixX::Zero(n1,n2),
4218 mat_n1n2 = RealMatrixX::Zero(n1,n2),
4219 eye = RealMatrixX::Identity(n1, n1),
4220 mat_x = RealMatrixX::Zero(3,2),
4221 mat_y = RealMatrixX::Zero(3,2),
4222 dstrain_dX_3D= RealMatrixX::Zero(6,n2),
4223 dstress_dX_3D= RealMatrixX::Zero(6,n2);
4226 strain = RealVectorX::Zero(n1),
4227 strain_vk = RealVectorX::Zero(n1),
4228 strain_bend = RealVectorX::Zero(n1),
4229 strain_3D = RealVectorX::Zero(6),
4230 stress_3D = RealVectorX::Zero(6),
4231 dstrain_dp = RealVectorX::Zero(n1),
4232 dstress_dp = RealVectorX::Zero(n1),
4233 vec1 = RealVectorX::Zero(n2),
4234 vec2 = RealVectorX::Zero(n2);
4259 stiffness_matrix(2);
4295 mat_stiff(xyz[qp],
_time, material_mat);
4351 stress = material_mat * strain;
4382 *dstress_dX = material_mat * dstrain_dX;
4492 std::vector<Real> JxW = fe.
get_JxW();
4493 const std::vector<libMesh::Point>& xyz = fe.
get_xyz();
4515 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
4516 dstrain_dX = RealMatrixX::Zero(n1,n2),
4517 mat_n1n2 = RealMatrixX::Zero(n1,n2),
4518 eye = RealMatrixX::Identity(n1, n1),
4519 mat_x = RealMatrixX::Zero(3,2),
4520 mat_y = RealMatrixX::Zero(3,2),
4521 dstrain_dX_3D= RealMatrixX::Zero(6,n2),
4522 dstress_dX_3D= RealMatrixX::Zero(6,n2);
4525 strain = RealVectorX::Zero(n1),
4526 strain_vk = RealVectorX::Zero(n1),
4527 strain_bend = RealVectorX::Zero(n1),
4528 strain_3D = RealVectorX::Zero(6),
4529 stress_3D = RealVectorX::Zero(6),
4530 dstrain_dp = RealVectorX::Zero(n1),
4531 dstress_dp = RealVectorX::Zero(n1),
4532 vec1 = RealVectorX::Zero(n2),
4533 vec2 = RealVectorX::Zero(n2);
4558 stiffness_matrix(2);
4650 stress = material_mat * strain;
4660 std::vector<RealMatrixX>* dstress_grad_dX) {
4672 std::vector<Real> JxW = fe.
get_JxW();
4673 const std::vector<libMesh::Point>& xyz = fe.
get_xyz();
4695 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
4696 dstrain = RealMatrixX::Zero(n1,2),
4697 dstrain_dX = RealMatrixX::Zero(n1,n2),
4698 mat_n1n2 = RealMatrixX::Zero(n1,n2),
4699 eye = RealMatrixX::Identity(n1, n1),
4700 mat_x = RealMatrixX::Zero(3,2),
4701 mat_y = RealMatrixX::Zero(3,2),
4702 dstrain_dX_3D= RealMatrixX::Zero(6,n2),
4703 dstress_dX_3D= RealMatrixX::Zero(6,n2);
4706 strain_vk = RealVectorX::Zero(n1),
4707 strain_bend = RealVectorX::Zero(n1),
4708 strain_3D = RealVectorX::Zero(6),
4709 stress_3D = RealVectorX::Zero(6),
4710 dstrain_dp = RealVectorX::Zero(n1),
4711 dstress_dp = RealVectorX::Zero(n1),
4712 vec1 = RealVectorX::Zero(n2),
4713 vec2 = RealVectorX::Zero(n2);
4724 std::vector<FEMOperatorMatrix>
4727 for (
unsigned int i=0; i<2; i++)
4744 stiffness_matrix(2);
4780 mat_stiff(xyz[qp],
_time, material_mat);
4830 stress_grad = material_mat * dstrain;
4833 if (dstress_grad_dX) {
4835 for (
unsigned int i=0; i<2; i++) {
4837 dBmat_lin[i].left_multiply(dstrain_dX, eye);
4863 (*dstress_grad_dX)[i] = material_mat * dstrain_dX;
4888 stress_grad.setZero();
4890 std::vector<Real> JxW = fe.
get_JxW();
4891 const std::vector<libMesh::Point>& xyz = fe.
get_xyz();
4913 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
4914 dstrain = RealMatrixX::Zero(n1,2),
4915 dstrain_dX = RealMatrixX::Zero(n1,n2),
4916 mat_n1n2 = RealMatrixX::Zero(n1,n2),
4917 eye = RealMatrixX::Identity(n1, n1),
4918 mat_x = RealMatrixX::Zero(3,2),
4919 mat_y = RealMatrixX::Zero(3,2),
4920 dstrain_dX_3D= RealMatrixX::Zero(6,n2),
4921 dstress_dX_3D= RealMatrixX::Zero(6,n2);
4924 strain_vk = RealVectorX::Zero(n1),
4925 strain_bend = RealVectorX::Zero(n1),
4926 strain_3D = RealVectorX::Zero(6),
4927 stress_3D = RealVectorX::Zero(6),
4928 dstrain_dp = RealVectorX::Zero(n1),
4929 dstress_dp = RealVectorX::Zero(n1),
4930 vec1 = RealVectorX::Zero(n2),
4931 vec2 = RealVectorX::Zero(n2);
4942 std::vector<FEMOperatorMatrix>
4945 for (
unsigned int i=0; i<2; i++)
4962 stiffness_matrix(2);
5048 stress_grad = material_mat * dstrain;
5056 libmesh_assert_equal_to(normal.size(), 3);
5057 libmesh_assert_equal_to(normal_mat.rows(), 2);
5058 libmesh_assert_equal_to(normal_mat.cols(), 3);
5059 normal_mat.setZero();
5073 normal_mat = RealMatrixX::Zero(2, 3);
5076 normal_mat(0,0) = normal_mat(1,2) = normal(0);
5079 normal_mat(0,2) = normal_mat(1,1) = normal(1);
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > prestress_A_matrix(MAST::ElementBase &e) const =0
virtual MAST::BendingOperatorType bending_model(const MAST::GeomElem &elem) const =0
returns the bending model to be used for the element.
virtual bool calculate_stress(bool request_derivative, const MAST::FunctionBase *p, MAST::StressStrainOutputBase &output)
Calculates the stress tensor.
virtual bool surface_traction_residual_shifted_boundary_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int side, MAST::BoundaryConditionBase &bc)
Calculates the sensitivity of force vector and Jacobian due to surface traction and sensitiity due to...
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > thermal_expansion_B_matrix(const MAST::ElementBase &e) const =0
void _convert_prestress_B_mat_to_vector(const RealMatrixX &mat, RealVectorX &vec) const
converts the prestress stress tensor to a vector representation
void _surface_normal_voigt_notation(const RealVectorX &normal, RealMatrixX &normal_mat)
creates a matrix that can be multiplied with the Voigt notation of stress to compute the surface norm...
virtual bool is_shape_parameter() const
const MAST::GeomElem & _elem
geometric element for which the computations are performed
Data structure provides the mechanism to store stress and strain output from a structural analysis...
virtual bool surface_traction_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int side, MAST::BoundaryConditionBase &bc)
Calculates the sensitivity of element vector and matrix quantities for surface traction boundary cond...
virtual unsigned int n_direct_strain_components()
row dimension of the direct strain matrix, also used for the bending operator row dimension ...
virtual const libMesh::Elem & get_reference_elem() const
virtual void initialize_strain_operator_gradient(const unsigned int qp, const MAST::FEBase &fe, const RealVectorX &local_disp, RealMatrixX &epsilon_grad, std::vector< MAST::FEMOperatorMatrix > &dBmat_lin)
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > prestress_B_matrix(MAST::ElementBase &e) const =0
virtual const std::vector< libMesh::Point > & get_qpoints() const
virtual void _internal_residual_operation(bool if_vk, const unsigned int n2, const unsigned int qp, const MAST::FEBase &fe, const std::vector< Real > &JxW, bool request_jacobian, RealVectorX &local_f, RealMatrixX &local_jac, RealVectorX &local_disp, RealVectorX &strain_mem, MAST::BendingOperator2D *bend, FEMOperatorMatrix &Bmat_lin, FEMOperatorMatrix &Bmat_nl_x, FEMOperatorMatrix &Bmat_nl_y, FEMOperatorMatrix &Bmat_nl_u, FEMOperatorMatrix &Bmat_nl_v, MAST::FEMOperatorMatrix &Bmat_bend, MAST::FEMOperatorMatrix &Bmat_vk, RealMatrixX &mat_x, RealMatrixX &mat_y, RealMatrixX &stress, RealMatrixX &vk_dwdxi_mat, RealMatrixX &material_A_mat, RealMatrixX &material_B_mat, RealMatrixX &material_D_mat, RealVectorX &vec1_n1, RealVectorX &vec2_n1, RealVectorX &vec3_n2, RealVectorX &vec4_2, RealVectorX &vec5_2, RealVectorX &vec6_n2, RealMatrixX &mat1_n1n2, RealMatrixX &mat2_n2n2, RealMatrixX &mat3, RealMatrixX &mat4_2n2, RealMatrixX &mat5_3n2)
performs integration at the quadrature point for the provided matrices.
void reinit(unsigned int n_interpolated_vars, unsigned int n_discrete_vars, unsigned int n_discrete_dofs_per_var)
this initializes the operator for number of rows and variables, assuming that all variables has the s...
virtual const MAST::MaterialPropertyCardBase & get_material() const
return the material property.
virtual bool prestress_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the internal residual vector and Jacobian due to strain energy coming from a prestress...
void set_shape_function(unsigned int interpolated_var, unsigned int discrete_var, const RealVectorX &shape_func)
sets the shape function values for the block corresponding to interpolated_var and discrete_var...
This is a scalar function whose value can be changed and one that can be used as a design variable in...
virtual bool internal_residual_jac_dot_state_sensitivity(RealMatrixX &jac)
calculates d[J]/d{x} .
virtual const std::vector< libMesh::Point > & get_xyz() const
physical location of the quadrature point in the global coordinate system for the reference element ...
virtual bool if_prestressed() const
virtual const std::vector< std::vector< libMesh::RealTensorValue > > & get_d2phi() const
void _compute_stress(MAST::FEBase &fe, unsigned int qp, RealVectorX &stress, RealMatrixX *dstress_dX)
Computes the stress at the specified quadrature point of the FE data structure.
virtual unsigned int n_shape_functions() const
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > stiffness_B_matrix(const MAST::ElementBase &e) const =0
virtual void derivative(const MAST::FunctionBase &f, ValType &v) const
calculates the value of the function derivative and returns it in v.
RealVectorX _local_sol_sens
local solution sensitivity
virtual bool surface_traction_residual_shifted_boundary(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int side, MAST::BoundaryConditionBase &bc)
Calculates the sensitivity of force vector and Jacobian due to surface traction and sensitiity due to...
MAST::SystemInitialization & _system
SystemInitialization object associated with this element.
virtual const std::vector< std::vector< libMesh::RealVectorValue > > & get_dphi() const
void _compute_stress_sensitivity(const MAST::FunctionBase &f, MAST::FEBase &fe, unsigned int qp, RealVectorX &stress)
virtual const std::vector< std::vector< Real > > & get_phi() const
virtual void thermal_residual_temperature_derivative(const MAST::FEBase &fe_thermal, RealMatrixX &m)
unsigned int n_vars() const
virtual std::unique_ptr< MAST::FEBase > init_fe(bool init_grads, bool init_second_order_derivative, int extra_quadrature_order=0) const
initializes the finite element shape function and quadrature object with the order of quadrature rule...
virtual void initialize_bending_strain_operator(const MAST::FEBase &fe, const unsigned int qp, MAST::FEMOperatorMatrix &Bmat)=0
initialze the bending strain operator for the specified quadrature point
virtual bool internal_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the internal residual vector and Jacobian due to strain energy.
virtual void calculate_stress_temperature_derivative(MAST::FEBase &fe_thermal, MAST::StressStrainOutputBase &output)
virtual bool piston_theory_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac_xdot, RealMatrixX &jac, MAST::BoundaryConditionBase &bc)
Calculates the force vector and Jacobian due to piston-theory based surface pressure on the entire el...
bool contains(const std::string &nm) const
checks if the card contains the specified property value
bool follower_forces
flag for follower forces
virtual void thermal_residual_boundary_velocity(const MAST::FunctionBase &p, const unsigned int s, const MAST::FieldFunction< RealVectorX > &vel_f, MAST::BoundaryConditionBase &bc, bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
calculates the term on side s: .
std::unique_ptr< MAST::BendingOperator2D > build_bending_operator_2D(MAST::BendingOperatorType type, MAST::StructuralElementBase &elem, const std::vector< libMesh::Point > &pts)
Matrix< Real, Dynamic, Dynamic > RealMatrixX
virtual ~StructuralElement2D()
virtual bool thermal_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac, MAST::BoundaryConditionBase &bc)
Calculates the sensitivity of residual vector and the Jacobian due to thermal stresses.
MAST::BoundaryConditionBase * get_thermal_load_for_elem(const MAST::GeomElem &elem)
Bending strain operator for 1D element.
virtual bool prestress_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the internal residual vector and Jacobian due to strain energy coming from a prestress...
unsigned int n_stress_strain_data_for_elem(const MAST::GeomElem &e) const
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > stiffness_A_matrix(const MAST::ElementBase &e) const =0
void vector_mult_transpose(T &res, const T &v) const
res = v^T * [this]
Matrix< Real, Dynamic, 1 > RealVectorX
StructuralElement2D(MAST::SystemInitialization &sys, const MAST::GeomElem &elem, const MAST::ElementPropertyCardBase &p)
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > stiffness_D_matrix(const MAST::ElementBase &e) const =0
virtual void initialize_von_karman_strain_operator(const unsigned int qp, const MAST::FEBase &fe, RealVectorX &vk_strain, RealMatrixX &vk_dwdxi_mat, MAST::FEMOperatorMatrix &Bmat_vk)
initialze the von Karman strain in vK_strain, the operator matrices needed for Jacobian calculation...
void right_multiply_transpose(T &r, const T &m) const
[R] = [this]^T * [M]
unsigned int n_boundary_stress_strain_data_for_elem(const GeomElem &e) const
virtual void initialize_von_karman_strain_operator_sensitivity(const unsigned int qp, const MAST::FEBase &fe, RealMatrixX &vk_dwdxi_mat_sens)
initialze the sensitivity of von Karman operator matrices needed for Jacobian calculation.
const MAST::ElementPropertyCardBase & _property
element property
This class provides a mechanism to store stress/strain values, their derivatives and sensitivity valu...
const RealMatrixX & T_matrix() const
O.
virtual const std::vector< libMesh::Point > & get_normals_for_local_coordinate() const
normals defined in the coordinate system for the local reference element.
This class acts as a wrapper around libMesh::Elem for the purpose of providing a uniform interface fo...
const MAST::StrainType strain_type() const
returns the type of strain to be used for this element
void vector_mult(T &res, const T &v) const
res = [this] * v
bool surface_pressure_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int side, MAST::BoundaryConditionBase &bc)
Calculates the force vector and Jacobian due to surface pressure.
virtual bool internal_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the sensitivity internal residual vector and Jacobian due to strain energy.
const ValType & get(const std::string &nm) const
returns a constant reference to the specified function
virtual std::unique_ptr< MAST::FEBase > init_side_fe(unsigned int s, bool init_grads, bool init_second_order_derivative, int extra_quadrature_order=0) const
initializes the finite element shape function and quadrature object for the side with the order of qu...
void set_derivatives(const RealMatrixX &dstress_dX, const RealMatrixX &dstrain_dX)
adds the derivative data
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > thermal_expansion_A_matrix(const MAST::ElementBase &e) const =0
libMesh::FEType get_fe_type() const
virtual bool surface_traction_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int side, MAST::BoundaryConditionBase &bc)
Calculates the force vector and Jacobian due to surface traction.
virtual MAST::StressStrainOutputBase::Data & get_stress_strain_data_for_elem_at_qp(const MAST::GeomElem &e, const unsigned int qp)
virtual bool piston_theory_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac_xdot, RealMatrixX &jac, MAST::BoundaryConditionBase &bc)
Calculates the sensitivity of force vector and Jacobian due to piston-theory based surface pressure o...
virtual const std::vector< Real > & get_JxW() const
void transform_matrix_to_global_system(const ValType &local_mat, ValType &global_mat) const
void left_multiply(T &r, const T &m) const
[R] = [M] * [this]
void _convert_prestress_A_mat_to_vector(const RealMatrixX &mat, RealVectorX &vec) const
converts the prestress stress tensor to a vector representation
RealVectorX _local_sol
local solution
virtual bool surface_pressure_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int side, MAST::BoundaryConditionBase &bc)
Calculates the force vector and Jacobian due to surface pressure.
RealVectorX _local_vel
local velocity
void _compute_stress_gradient(MAST::FEBase &fe, unsigned int qp, RealMatrixX &stress_grad, std::vector< RealMatrixX > *dstress_grad_dX)
computes the gradient of stress in Voigt notation in stress_grad where the three columns are the deri...
virtual void calculate_stress_boundary_velocity(const MAST::FunctionBase &p, MAST::StressStrainOutputBase &output, const unsigned int s, const MAST::FieldFunction< RealVectorX > &vel_f)
Calculates the boundary velocity term contributions to the sensitivity of stress at the specified bou...
virtual void initialize_green_lagrange_strain_operator(const unsigned int qp, const MAST::FEBase &fe, const RealVectorX &local_disp, RealVectorX &epsilon, RealMatrixX &mat_x, RealMatrixX &mat_y, MAST::FEMOperatorMatrix &Bmat_lin, MAST::FEMOperatorMatrix &Bmat_nl_x, MAST::FEMOperatorMatrix &Bmat_nl_y, MAST::FEMOperatorMatrix &Bmat_nl_u, MAST::FEMOperatorMatrix &Bmat_nl_v)
virtual MAST::StressStrainOutputBase::Data & add_stress_strain_at_qp_location(const MAST::GeomElem &e, const unsigned int qp, const libMesh::Point &quadrature_pt, const libMesh::Point &physical_pt, const RealVectorX &stress, const RealVectorX &strain, Real JxW)
add the stress tensor associated with the qp.
const Real & _time
time for which system is being assembled
virtual void internal_residual_boundary_velocity(const MAST::FunctionBase &p, const unsigned int s, const MAST::FieldFunction< RealVectorX > &vel_f, bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
calculates the term on side s: .
void _compute_stress_gradient_sensitivity(const MAST::FunctionBase &f, MAST::FEBase &fe, unsigned int qp, RealMatrixX &stress_grad)
virtual bool thermal_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, MAST::BoundaryConditionBase &bc)
Calculates the residual vector and Jacobian due to thermal stresses.
virtual int extra_quadrature_order(const MAST::GeomElem &elem) const =0
returns the extra quadrature order (on top of the system) that this element should use...
void transform_vector_to_global_system(const ValType &local_vec, ValType &global_vec) const
virtual unsigned int n_von_karman_strain_components()
row dimension of the von Karman strain matrix
virtual bool depends_on(const MAST::FunctionBase &f) const
returns true if the property card depends on the function f
void set_sensitivity(const MAST::FunctionBase &f, const RealVectorX &dstress_df, const RealVectorX &dstrain_df)
sets the sensitivity of the data with respect to a function
virtual MAST::StressStrainOutputBase::Data & add_stress_strain_at_boundary_qp_location(const MAST::GeomElem &e, const unsigned int s, const unsigned int qp, const libMesh::Point &quadrature_pt, const libMesh::Point &physical_pt, const RealVectorX &stress, const RealVectorX &strain, Real JxW_Vn)
add the stress tensor associated with the qp on side s of element e.