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;
257 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
true,
false));
260 qp_loc_fe_size = (
unsigned int)fe->get_qpoints().size(),
263 std::vector<libMesh::Point>
264 qp_loc_fe = fe->get_qpoints(),
265 qp_loc(qp_loc_fe.size()*n_added_qp);
266 std::vector<Real> JxW = fe->get_JxW();
267 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
273 for (
unsigned int i=0; i<qp_loc_fe.size(); i++) {
275 qp_loc[i*2] = qp_loc_fe[i];
276 qp_loc[i*2](2) = +1.;
278 qp_loc[i*2+1] = qp_loc_fe[i];
279 qp_loc[i*2+1](2) = -1.;
286 JxW[i] /= (1.*n_added_qp);
294 std::unique_ptr<MAST::BendingOperator2D>
297 qp_loc_fe).release());
302 n_phi = (
unsigned int)fe->n_shape_functions(),
319 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
320 dstrain_dX = RealMatrixX::Zero(n1,n2),
321 dstress_dX = RealMatrixX::Zero(n1,n2),
322 mat_n1n2 = RealMatrixX::Zero(n1,n2),
323 eye = RealMatrixX::Identity(n1, n1),
324 mat_x = RealMatrixX::Zero(3,2),
325 mat_y = RealMatrixX::Zero(3,2),
326 dstrain_dX_3D= RealMatrixX::Zero(6,n2),
327 dstress_dX_3D= RealMatrixX::Zero(6,n2);
330 strain = RealVectorX::Zero(n1),
331 stress = RealVectorX::Zero(n1),
332 strain_vk = RealVectorX::Zero(n1),
333 strain_bend = RealVectorX::Zero(n1),
334 strain_3D = RealVectorX::Zero(6),
335 stress_3D = RealVectorX::Zero(6),
336 dstrain_dp = RealVectorX::Zero(n1),
337 dstress_dp = RealVectorX::Zero(n1);
383 *temp_func =
nullptr,
384 *ref_temp_func =
nullptr,
385 *alpha_func =
nullptr;
402 for (
unsigned int qp_loc_index=0; qp_loc_index<qp_loc_fe_size; qp_loc_index++)
403 for (
unsigned int section_qp_index=0; section_qp_index<n_added_qp; section_qp_index++)
405 qp = qp_loc_index*n_added_qp + section_qp_index;
408 mat_stiff(xyz[qp_loc_index],
_time, material_mat);
425 (*temp_func) (xyz[qp_loc_index],
_time, temp);
426 (*ref_temp_func)(xyz[qp_loc_index],
_time, ref_t);
427 (*alpha_func) (xyz[qp_loc_index],
_time, alpha);
428 strain(0) -= alpha*(temp-ref_t);
429 strain(1) -= alpha*(temp-ref_t);
447 h (xyz[qp_loc_index],
_time, z);
448 h_off(xyz[qp_loc_index],
_time, z_off);
451 bend->initialize_bending_strain_operator_for_z(*fe,
453 qp_loc[qp](2) * z/2.+z_off,
459 strain += strain_bend;
463 stress = material_mat * strain;
470 stress_3D(0) = stress(0);
471 stress_3D(1) = stress(1);
472 stress_3D(3) = stress(2);
473 strain_3D(0) = strain(0);
474 strain_3D(1) = strain(1);
475 strain_3D(3) = strain(2);
486 if (!request_derivative && !p)
499 if (request_derivative || p) {
506 dstrain_dX += mat_n1n2;
508 dstrain_dX += mat_n1n2;
517 dstrain_dX += mat_n1n2;
522 dstrain_dX += mat_n1n2;
526 dstress_dX = material_mat * dstrain_dX;
529 dstress_dX_3D.row(0) = dstress_dX.row(0);
530 dstress_dX_3D.row(1) = dstress_dX.row(1);
531 dstress_dX_3D.row(3) = dstress_dX.row(2);
532 dstrain_dX_3D.row(0) = dstrain_dX.row(0);
533 dstrain_dX_3D.row(1) = dstrain_dX.row(1);
534 dstrain_dX_3D.row(3) = dstrain_dX.row(2);
536 if (request_derivative)
554 dstrain_dp = RealVectorX::Zero(n1);
560 ref_temp_func->derivative(*p, xyz[qp_loc_index],
_time, dref_t);
561 alpha_func->derivative(*p, xyz[qp_loc_index],
_time, dalpha);
562 dstrain_dp(0) -= alpha*(dtemp-dref_t) - dalpha*(temp-ref_t);
563 dstrain_dp(1) -= alpha*(dtemp-dref_t) - dalpha*(temp-ref_t);
572 xyz[qp_loc_index],
_time, z);
574 xyz[qp_loc_index],
_time, z_off);
577 bend->initialize_bending_strain_operator_for_z(*fe,
579 qp_loc[qp](2) * z/2.+z_off,
585 dstrain_dp += strain_bend;
590 dstress_dp = material_mat * dstrain_dp;
603 dstress_dp += material_mat * strain;
613 stress_3D(0) = dstress_dp(0);
614 stress_3D(1) = dstress_dp(1);
615 stress_3D(3) = dstress_dp(2);
616 strain_3D(0) = dstrain_dp(0);
617 strain_3D(1) = dstrain_dp(1);
618 strain_3D(3) = dstrain_dp(2);
630 libmesh_assert(qp_loc.size() ==
635 return request_derivative || p;
644 const unsigned int s,
650 qp_loc_fe_size = (
unsigned int)fe->get_qpoints().size(),
653 std::vector<libMesh::Point>
654 qp_loc_fe = fe->get_qpoints(),
655 qp_loc(qp_loc_fe.size()*n_added_qp);
656 std::vector<Real> JxW_Vn = fe->get_JxW();
657 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
658 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
664 for (
unsigned int i=0; i<qp_loc_fe.size(); i++) {
666 qp_loc[i*2] = qp_loc_fe[i];
667 qp_loc[i*2](2) = +1.;
669 qp_loc[i*2+1] = qp_loc_fe[i];
670 qp_loc[i*2+1](2) = -1.;
676 std::unique_ptr<MAST::BendingOperator2D>
679 qp_loc_fe).release());
682 n_phi = (
unsigned int)fe->n_shape_functions(),
698 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
699 mat_n1n2 = RealMatrixX::Zero(n1,n2),
700 mat_x = RealMatrixX::Zero(3,2),
701 mat_y = RealMatrixX::Zero(3,2),
702 eye = RealMatrixX::Identity(n1, n1);
705 strain = RealVectorX::Zero(n1),
706 stress = RealVectorX::Zero(n1),
707 strain_vk = RealVectorX::Zero(n1),
708 strain_bend = RealVectorX::Zero(n1),
709 strain_3D = RealVectorX::Zero(6),
710 stress_3D = RealVectorX::Zero(6),
711 vel = RealVectorX::Zero(dim);
714 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
716 vel_f(xyz[qp],
_time, vel);
718 for (
unsigned int i=0; i<dim; i++)
719 vn += vel(i)*face_normals[qp](i);
720 JxW_Vn[qp] *= vn/(1.*n_added_qp);
766 *temp_func =
nullptr,
767 *ref_temp_func =
nullptr,
768 *alpha_func =
nullptr;
783 for (
unsigned int qp_loc_index=0; qp_loc_index<qp_loc_fe_size; qp_loc_index++)
784 for (
unsigned int section_qp_index=0; section_qp_index<n_added_qp; section_qp_index++)
786 qp = qp_loc_index*n_added_qp + section_qp_index;
789 mat_stiff(xyz[qp_loc_index],
_time, material_mat);
807 (*temp_func) (xyz[qp_loc_index],
_time, temp);
808 (*ref_temp_func)(xyz[qp_loc_index],
_time, ref_t);
809 (*alpha_func) (xyz[qp_loc_index],
_time, alpha);
810 strain(0) -= alpha*(temp-ref_t);
811 strain(1) -= alpha*(temp-ref_t);
829 h (xyz[qp_loc_index],
_time, z);
830 h_off(xyz[qp_loc_index],
_time, z_off);
833 bend->initialize_bending_strain_operator_for_z(*fe,
835 qp_loc[qp](2) * z/2.+z_off,
841 strain += strain_bend;
845 stress = material_mat * strain;
852 stress_3D(0) = stress(0);
853 stress_3D(1) = stress(1);
854 stress_3D(3) = stress(2);
855 strain_3D(0) = strain(0);
856 strain_3D(1) = strain(1);
857 strain_3D(3) = strain(2);
871 JxW_Vn[qp_loc_index]);
876 libmesh_assert(qp_loc.size() ==
887 std::unique_ptr<MAST::FEBase> fe_str(
_elem.
init_fe(
true,
false));
891 libmesh_assert(fe_str->get_fe_type() == fe_thermal.
get_fe_type());
896 libmesh_assert_equal_to(fe_str->get_qpoints().size(), fe_thermal.
get_qpoints().size());
901 libmesh_assert(stress_output.get_thermal_load_for_elem(
_elem));
904 qp_loc_fe_size = (
unsigned int)fe_str->get_qpoints().size(),
907 std::vector<libMesh::Point>
908 qp_loc_fe = fe_str->get_qpoints(),
909 qp_loc(qp_loc_fe.size()*n_added_qp);
911 const std::vector<std::vector<Real>>& phi_temp = fe_thermal.
get_phi();
912 const std::vector<libMesh::Point>& xyz = fe_str->get_xyz();
918 for (
unsigned int i=0; i<qp_loc_fe.size(); i++) {
920 qp_loc[i*2] = qp_loc_fe[i];
921 qp_loc[i*2](2) = +1.;
923 qp_loc[i*2+1] = qp_loc_fe[i];
924 qp_loc[i*2+1](2) = -1.;
931 std::unique_ptr<MAST::BendingOperator2D>
934 qp_loc_fe).release());
939 nt = (
unsigned int)fe_thermal.
get_phi().size();
947 dT_mat = RealMatrixX::Zero(3,1),
948 dstrain_dX_3D = RealMatrixX::Zero(6,nt),
949 dstress_dX_3D = RealMatrixX::Zero(6,nt),
950 Bmat_temp = RealMatrixX::Zero(1,nt);
952 dT_mat(0) = dT_mat(1) = 1.;
969 for (
unsigned int qp_loc_index=0; qp_loc_index<qp_loc_fe_size; qp_loc_index++)
970 for (
unsigned int section_qp_index=0; section_qp_index<n_added_qp; section_qp_index++)
972 qp = qp_loc_index*n_added_qp + section_qp_index;
975 for (
unsigned int i_nd=0; i_nd<nt; i_nd++ )
976 Bmat_temp(0, i_nd) = phi_temp[i_nd][qp_loc_index];
979 mat_stiff(xyz[qp_loc_index],
_time, material_mat);
983 alpha_func(xyz[qp_loc_index],
_time, alpha);
985 dstress_dX = alpha * material_mat * dT_mat * Bmat_temp;
987 dstress_dX_3D.row(0) = -dstress_dX.row(0);
988 dstress_dX_3D.row(1) = -dstress_dX.row(1);
989 dstress_dX_3D.row(3) = -dstress_dX.row(2);
993 &data = stress_output.get_stress_strain_data_for_elem_at_qp(
_elem, qp);
1010 const std::vector<Real>& JxW = fe->get_JxW();
1011 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1014 n_phi = (
unsigned int)fe->get_phi().size(),
1023 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
1024 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
1026 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
1027 mat5_3n2 = RealMatrixX::Zero(3,n2),
1028 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
1029 stress = RealMatrixX::Zero(2,2),
1030 mat_x = RealMatrixX::Zero(3,2),
1031 mat_y = RealMatrixX::Zero(3,2),
1032 local_jac = RealMatrixX::Zero(n2,n2);
1035 vec1_n1 = RealVectorX::Zero(n1),
1036 vec2_n1 = RealVectorX::Zero(n1),
1037 vec3_n2 = RealVectorX::Zero(n2),
1038 vec4_n3 = RealVectorX::Zero(n3),
1039 vec5_n3 = RealVectorX::Zero(n3),
1040 vec6_n2 = RealVectorX::Zero(n2),
1041 strain = RealVectorX::Zero(3),
1042 local_f = RealVectorX::Zero(n2);
1066 std::unique_ptr<MAST::BendingOperator2D> bend;
1071 fe->get_qpoints()).release());
1073 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
1078 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
1081 (*mat_stiff_A)(xyz[qp],
_time, material_A_mat);
1084 (*mat_stiff_B)(xyz[qp],
_time, material_B_mat);
1085 (*mat_stiff_D)(xyz[qp],
_time, material_D_mat);
1131 bend->include_transverse_shear_energy())
1132 bend->calculate_transverse_shear_residual(request_jacobian,
1141 if (request_jacobian) {
1145 for (
unsigned int i=0; i<n_phi; i++)
1146 local_jac(5*n_phi+i, 5*n_phi+i) = 1.0e-8;
1152 return request_jacobian;
1161 bool request_jacobian,
1171 bool calculate =
false;
1183 const std::vector<Real>& JxW = fe->get_JxW();
1184 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1187 n_phi = (
unsigned int)fe->get_phi().size(),
1196 material_trans_shear_mat,
1197 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
1198 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
1200 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
1201 mat5_3n2 = RealMatrixX::Zero(3,n2),
1202 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
1203 stress = RealMatrixX::Zero(2,2),
1204 mat_x = RealMatrixX::Zero(3,2),
1205 mat_y = RealMatrixX::Zero(3,2),
1206 local_jac = RealMatrixX::Zero(n2,n2);
1208 vec1_n1 = RealVectorX::Zero(n1),
1209 vec2_n1 = RealVectorX::Zero(n1),
1210 vec3_n2 = RealVectorX::Zero(n2),
1211 vec4_n3 = RealVectorX::Zero(n3),
1212 vec5_n3 = RealVectorX::Zero(n3),
1213 vec6_n2 = RealVectorX::Zero(n2),
1214 strain = RealVectorX::Zero(3),
1215 local_f = RealVectorX::Zero(n2);
1239 std::unique_ptr<MAST::BendingOperator2D> bend;
1244 fe->get_qpoints()).release());
1246 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
1252 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
1255 mat_stiff_A->derivative(p, xyz[qp],
_time, material_A_mat);
1259 mat_stiff_B->derivative(p, xyz[qp],
_time, material_B_mat);
1260 mat_stiff_D->derivative(p, xyz[qp],
_time, material_D_mat);
1306 bend->include_transverse_shear_energy())
1307 bend->calculate_transverse_shear_residual_sensitivity(p,
1316 if (request_jacobian) {
1322 return request_jacobian;
1330 const unsigned int s,
1332 bool request_jacobian,
1341 std::vector<Real> JxW_Vn = fe->get_JxW();
1342 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1343 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
1346 n_phi = (
unsigned int)fe->get_phi().size(),
1356 material_trans_shear_mat,
1357 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
1358 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
1360 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
1361 mat5_3n2 = RealMatrixX::Zero(3,n2),
1362 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
1363 stress = RealMatrixX::Zero(2,2),
1364 mat_x = RealMatrixX::Zero(3,2),
1365 mat_y = RealMatrixX::Zero(3,2),
1366 local_jac = RealMatrixX::Zero(n2,n2);
1368 vec1_n1 = RealVectorX::Zero(n1),
1369 vec2_n1 = RealVectorX::Zero(n1),
1370 vec3_n2 = RealVectorX::Zero(n2),
1371 vec4_n3 = RealVectorX::Zero(n3),
1372 vec5_n3 = RealVectorX::Zero(n3),
1373 vec6_n2 = RealVectorX::Zero(n2),
1374 strain = RealVectorX::Zero(3),
1375 local_f = RealVectorX::Zero(n2),
1376 vel = RealVectorX::Zero(dim);
1400 std::unique_ptr<MAST::BendingOperator2D> bend;
1405 fe->get_qpoints()).release());
1407 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
1416 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
1418 vel_f(xyz[qp],
_time, vel);
1420 for (
unsigned int i=0; i<dim; i++)
1421 vn += vel(i)*face_normals[qp](i);
1427 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
1429 (*mat_stiff_A)(xyz[qp],
_time, material_A_mat);
1433 (*mat_stiff_B)(xyz[qp],
_time, material_B_mat);
1434 (*mat_stiff_D)(xyz[qp],
_time, material_D_mat);
1479 if (bend.get() && bend->include_transverse_shear_energy())
1480 bend->calculate_transverse_shear_residual_boundary_velocity
1481 (p, s, vel_f, request_jacobian, local_f, local_jac);
1487 if (request_jacobian) {
1504 const std::vector<Real>& JxW = fe->get_JxW();
1505 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1507 n_phi = (
unsigned int)fe->get_phi().size(),
1516 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
1517 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
1519 vk_dwdxi_mat_sens = RealMatrixX::Zero(n1,n3),
1520 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
1521 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
1522 stress = RealMatrixX::Zero(2,2),
1523 mat_x = RealMatrixX::Zero(3,2),
1524 mat_y = RealMatrixX::Zero(3,2),
1525 local_jac = RealMatrixX::Zero(n2,n2);
1527 vec1_n1 = RealVectorX::Zero(n1),
1528 vec2_n1 = RealVectorX::Zero(n1),
1529 strain = RealVectorX::Zero(3);
1554 std::unique_ptr<MAST::BendingOperator2D> bend;
1559 fe->get_qpoints()).release());
1565 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
1571 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
1574 (*mat_stiff_A)(xyz[qp],
_time, material_A_mat);
1575 (*mat_stiff_B)(xyz[qp],
_time, material_B_mat);
1576 (*mat_stiff_D)(xyz[qp],
_time, material_D_mat);
1592 vec2_n1 = material_A_mat * vec1_n1;
1596 bend->initialize_bending_strain_operator(*fe, qp, Bmat_bend);
1601 vec2_n1 += material_B_mat * vec1_n1;
1615 vec1_n1(0) = (vk_dwdxi_mat(0,0)*vk_dwdxi_mat_sens(0,0));
1616 vec1_n1(1) = (vk_dwdxi_mat(1,1)*vk_dwdxi_mat_sens(1,1));
1617 vec1_n1(2) = (vk_dwdxi_mat(0,0)*vk_dwdxi_mat_sens(1,1) +
1618 vk_dwdxi_mat(1,1)*vk_dwdxi_mat_sens(0,0));
1620 vec2_n1 += material_A_mat * vec1_n1;
1625 stress(0,0) = vec2_n1(0);
1626 stress(1,1) = vec2_n1(1);
1627 stress(0,1) = vec2_n1(2);
1628 stress(1,0) = vec2_n1(2);
1637 mat3 = vk_dwdxi_mat_sens.transpose() * mat1_n1n2;
1639 local_jac += JxW[qp] * mat2_n2n2;
1643 mat3 = vk_dwdxi_mat_sens.transpose() * mat1_n1n2;
1645 local_jac += JxW[qp] * mat2_n2n2;
1648 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1650 mat3 = vk_dwdxi_mat_sens.transpose() * material_A_mat * mat3;
1652 local_jac += JxW[qp] * mat2_n2n2;
1655 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1657 mat3 = vk_dwdxi_mat.transpose() * material_A_mat * mat3;
1659 local_jac += JxW[qp] * mat2_n2n2;
1662 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1664 mat3 = material_A_mat * mat3;
1666 local_jac += JxW[qp] * mat2_n2n2;
1669 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1671 mat3 = material_B_mat.transpose() * mat3;
1673 local_jac += JxW[qp] * mat2_n2n2;
1676 mat3 = RealMatrixX::Zero(2, n2);
1679 local_jac += JxW[qp] * mat2_n2n2;
1694 const unsigned int n2,
1695 const unsigned int qp,
1697 const std::vector<Real>& JxW,
1698 bool request_jacobian,
1742 vec2_n1 = material_A_mat * strain_mem;
1749 vec2_n1 += material_B_mat * vec1_n1;
1758 strain_mem += vec1_n1;
1759 vec2_n1 += material_A_mat * vec1_n1;
1765 stress(0,0) = vec2_n1(0);
1766 stress(0,1) = vec2_n1(2);
1767 stress(1,0) = vec2_n1(2);
1768 stress(1,1) = vec2_n1(1);
1773 local_f.topRows(n2) += JxW[qp] * vec3_n2;
1779 vec4_2 = mat_x.transpose() * vec2_n1;
1781 local_f.topRows(n2) += JxW[qp] * vec6_n2;
1784 vec4_2 = mat_y.transpose() * vec2_n1;
1786 local_f.topRows(n2) += JxW[qp] * vec6_n2;
1793 vec4_2 = vk_dwdxi_mat.transpose() * vec2_n1;
1795 local_f += JxW[qp] * vec3_n2;
1800 vec1_n1 = material_B_mat.transpose() * strain_mem;
1802 local_f += JxW[qp] * vec3_n2;
1806 vec1_n1 = material_D_mat * vec2_n1;
1808 local_f += JxW[qp] * vec3_n2;
1811 if (request_jacobian) {
1815 local_jac += JxW[qp] * mat2_n2n2;
1822 mat1_n1n2 = material_A_mat * mat1_n1n2;
1824 local_jac += JxW[qp] * mat2_n2n2;
1828 mat1_n1n2 = material_A_mat * mat1_n1n2;
1830 local_jac += JxW[qp] * mat2_n2n2;
1834 mat5_3n2 = mat_x.transpose() * mat1_n1n2;
1836 local_jac += JxW[qp] * mat2_n2n2;
1840 mat1_n1n2 = material_A_mat * mat1_n1n2;
1841 mat5_3n2 = mat_x.transpose() * mat1_n1n2;
1843 local_jac += JxW[qp] * mat2_n2n2;
1847 mat1_n1n2 = material_A_mat * mat1_n1n2;
1848 mat5_3n2 = mat_x.transpose() * mat1_n1n2;
1850 local_jac += JxW[qp] * mat2_n2n2;
1854 mat5_3n2 = mat_y.transpose() * mat1_n1n2;
1856 local_jac += JxW[qp] * mat2_n2n2;
1860 mat1_n1n2 = material_A_mat * mat1_n1n2;
1861 mat5_3n2 = mat_y.transpose() * mat1_n1n2;
1863 local_jac += JxW[qp] * mat2_n2n2;
1867 mat1_n1n2 = material_A_mat * mat1_n1n2;
1868 mat5_3n2 = mat_y.transpose() * mat1_n1n2;
1870 local_jac += JxW[qp] * mat2_n2n2;
1877 local_jac += JxW[qp] * mat2_n2n2;
1884 local_jac += JxW[qp] * mat2_n2n2;
1890 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1892 mat3 = material_A_mat * mat3;
1894 local_jac += JxW[qp] * mat2_n2n2;
1898 mat3 = vk_dwdxi_mat.transpose() * mat1_n1n2;
1900 local_jac += JxW[qp] * mat2_n2n2;
1903 mat3 = RealMatrixX::Zero(2, n2);
1906 local_jac += JxW[qp] * mat2_n2n2;
1908 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1910 mat3 = vk_dwdxi_mat.transpose() * material_A_mat * mat3;
1912 local_jac += JxW[qp] * mat2_n2n2;
1915 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1917 mat3 = material_B_mat.transpose() * mat3;
1919 local_jac += JxW[qp] * mat2_n2n2;
1923 mat3 = vk_dwdxi_mat.transpose() * mat1_n1n2;
1925 local_jac += JxW[qp] * mat2_n2n2;
1929 mat3 = material_B_mat.transpose();
1932 local_jac += JxW[qp] * mat2_n2n2;
1937 local_jac += JxW[qp] * mat2_n2n2;
1942 local_jac += JxW[qp] * mat2_n2n2;
1954 libmesh_assert_equal_to(mat.rows(), 2);
1955 libmesh_assert_equal_to(mat.cols(), 2);
1956 vec = RealVectorX::Zero(3);
1968 libmesh_assert_equal_to(mat.rows(), 2);
1969 libmesh_assert_equal_to(mat.cols(), 2);
1970 vec = RealVectorX::Zero(3);
1991 const std::vector<Real>& JxW = fe->get_JxW();
1992 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1994 n_phi = (
unsigned int)fe->get_phi().size(),
2000 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
2002 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
2003 local_jac = RealMatrixX::Zero(n2,n2),
2004 mat_x = RealMatrixX::Zero(3,2),
2005 mat_y = RealMatrixX::Zero(3,2),
2010 vec2_n1 = RealVectorX::Zero(n1),
2011 vec3_n2 = RealVectorX::Zero(n2),
2012 vec4_n3 = RealVectorX::Zero(n3),
2013 vec5_n3 = RealVectorX::Zero(n3),
2014 local_f = RealVectorX::Zero(n2),
2015 strain = RealVectorX::Zero(3),
2041 std::unique_ptr<MAST::BendingOperator2D> bend;
2046 fe->get_qpoints()).release());
2048 std::unique_ptr<MAST::FieldFunction<RealMatrixX> >
2053 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
2055 (*prestress_A)(xyz[qp],
_time, prestress_mat_A);
2056 (*prestress_B)(xyz[qp],
_time, prestress_mat_B);
2075 bend->initialize_bending_strain_operator(*fe, qp, Bmat_bend);
2089 local_f += JxW[qp] * vec3_n2;
2094 vec4_n3 = vk_dwdxi_mat.transpose() * prestress_vec_A;
2096 local_f += JxW[qp] * vec3_n2;
2101 local_f += JxW[qp] * vec3_n2;
2104 if (request_jacobian) {
2105 if (bend.get() && if_vk) {
2106 mat3 = RealMatrixX::Zero(2, n2);
2109 local_jac += JxW[qp] * mat2_n2n2;
2117 if (request_jacobian && if_vk) {
2123 return (request_jacobian);
2132 bool request_jacobian,
2143 const std::vector<Real>& JxW = fe->get_JxW();
2144 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
2146 n_phi = (
unsigned int)fe->get_phi().size(),
2152 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
2154 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
2155 local_jac = RealMatrixX::Zero(n2,n2),
2156 mat_x = RealMatrixX::Zero(3,2),
2157 mat_y = RealMatrixX::Zero(3,2),
2162 vec2_n1 = RealVectorX::Zero(n1),
2163 vec3_n2 = RealVectorX::Zero(n2),
2164 vec4_n3 = RealVectorX::Zero(n3),
2165 vec5_n3 = RealVectorX::Zero(n3),
2166 local_f = RealVectorX::Zero(n2),
2167 strain = RealVectorX::Zero(3),
2193 std::unique_ptr<MAST::BendingOperator2D> bend;
2198 fe->get_qpoints()).release());
2200 std::unique_ptr<MAST::FieldFunction<RealMatrixX> >
2205 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
2207 prestress_A->derivative(p, xyz[qp],
_time, prestress_mat_A);
2208 prestress_B->derivative(p, xyz[qp],
_time, prestress_mat_B);
2227 bend->initialize_bending_strain_operator(*fe, qp, Bmat_bend);
2241 local_f += JxW[qp] * vec3_n2;
2246 vec4_n3 = vk_dwdxi_mat.transpose() * prestress_vec_A;
2248 local_f += JxW[qp] * vec3_n2;
2253 local_f += JxW[qp] * vec3_n2;
2256 if (request_jacobian) {
2257 if (bend.get() && if_vk) {
2258 mat3 = RealMatrixX::Zero(2, n2);
2261 local_jac += JxW[qp] * mat2_n2n2;
2269 if (request_jacobian && if_vk) {
2275 return (request_jacobian);
2287 const unsigned int side,
2295 const std::vector<Real> &JxW = fe->
get_JxW();
2296 const std::vector<libMesh::Point>& qpoint = fe->
get_xyz();
2297 const std::vector<std::vector<Real> >& phi = fe->
get_phi();
2300 n_phi = (
unsigned int)phi.size(),
2319 phi_vec = RealVectorX::Zero(n_phi),
2320 force = RealVectorX::Zero(2*n1),
2321 local_f = RealVectorX::Zero(n2),
2322 vec_n2 = RealVectorX::Zero(n2);
2324 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
2327 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
2328 phi_vec(i_nd) = phi[i_nd][qp];
2330 Bmat.reinit(2*n1, phi_vec);
2333 p_func(qpoint[qp],
_time, press);
2334 t_func(qpoint[qp],
_time, t_val);
2337 for (
unsigned int i_dim=0; i_dim<n1; i_dim++)
2338 force(i_dim) = (press*t_val) * face_normals[qp](i_dim);
2340 Bmat.vector_mult_transpose(vec_n2, force);
2342 local_f += JxW[qp] * vec_n2;
2350 return (request_jacobian);
2360 bool request_jacobian,
2363 const unsigned int side,
2371 const std::vector<Real> &JxW = fe->
get_JxW();
2372 const std::vector<libMesh::Point>& qpoint = fe->
get_xyz();
2373 const std::vector<std::vector<Real> >& phi = fe->
get_phi();
2376 n_phi = (
unsigned int)phi.size(),
2398 phi_vec = RealVectorX::Zero(n_phi),
2399 force = RealVectorX::Zero(2*n1),
2400 local_f = RealVectorX::Zero(n2),
2401 vec_n2 = RealVectorX::Zero(n2);
2403 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
2406 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
2407 phi_vec(i_nd) = phi[i_nd][qp];
2409 Bmat.reinit(2*n1, phi_vec);
2412 p_func(qpoint[qp],
_time, press);
2414 t_func(qpoint[qp],
_time, t_val);
2418 for (
unsigned int i_dim=0; i_dim<n1; i_dim++)
2419 force(i_dim) = (press*dt_val + dpress*t_val) * face_normals[qp](i_dim);
2421 Bmat.vector_mult_transpose(vec_n2, force);
2423 local_f += JxW[qp] * vec_n2;
2431 return (request_jacobian);
2449 const std::vector<Real>& JxW = fe->get_JxW();
2450 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
2453 n_phi = (
unsigned int)fe->get_phi().size(),
2461 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
2462 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
2463 mat3 = RealMatrixX::Zero(2, n2),
2464 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
2465 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
2466 stress = RealMatrixX::Zero(2,2),
2467 mat_x = RealMatrixX::Zero(3,2),
2468 mat_y = RealMatrixX::Zero(3,2),
2469 local_jac = RealMatrixX::Zero(n2,n2);
2472 vec1_n1 = RealVectorX::Zero(n1),
2473 vec2_n1 = RealVectorX::Zero(n1),
2474 vec3_n2 = RealVectorX::Zero(n2),
2475 vec4_2 = RealVectorX::Zero(2),
2476 vec5_n3 = RealVectorX::Zero(n3),
2477 local_f = RealVectorX::Zero(n2),
2478 strain = RealVectorX::Zero(3),
2479 delta_t = RealVectorX::Zero(1);
2503 std::unique_ptr<MAST::BendingOperator2D> bend;
2508 fe->get_qpoints()).release());
2510 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
2523 if (bc.
contains(
"thermal_jacobian_scaling"))
2526 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
2529 (*expansion_A)(xyz[qp],
_time, material_exp_A_mat);
2530 (*expansion_B)(xyz[qp],
_time, material_exp_B_mat);
2533 temp_func(xyz[qp], _time, t);
2534 ref_temp_func(xyz[qp], _time, t0);
2537 vec1_n1 = material_exp_A_mat * delta_t;
2538 vec2_n1 = material_exp_B_mat * delta_t;
2539 stress(0,0) = vec1_n1(0);
2540 stress(0,1) = vec1_n1(2);
2541 stress(1,0) = vec1_n1(2);
2542 stress(1,1) = vec1_n1(1);
2558 local_f += JxW[qp] * vec3_n2;
2564 vec4_2 = mat_x.transpose() * vec1_n1;
2566 local_f.topRows(n2) += JxW[qp] * vec3_n2;
2569 vec4_2 = mat_y.transpose() * vec1_n1;
2571 local_f.topRows(n2) += JxW[qp] * vec3_n2;
2576 bend->initialize_bending_strain_operator(*fe, qp, Bmat_bend);
2578 local_f += JxW[qp] * vec3_n2;
2589 vec4_2 = vk_dwdxi_mat.transpose() * vec1_n1;
2591 local_f += JxW[qp] * vec3_n2;
2595 if (request_jacobian &&
2601 local_jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
2606 local_jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
2609 if (request_jacobian && if_vk) {
2611 mat3 = RealMatrixX::Zero(2, n2);
2614 local_jac += JxW[qp] * mat2_n2n2;
2621 if (request_jacobian && if_vk) {
2623 jac -= scaling * mat2_n2n2;
2627 return request_jacobian;
2636 bool request_jacobian,
2645 const std::vector<Real>& JxW = fe->get_JxW();
2646 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
2649 n_phi = (
unsigned int)fe->get_phi().size(),
2657 material_exp_A_mat_sens,
2658 material_exp_B_mat_sens,
2659 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
2660 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
2661 mat3 = RealMatrixX::Zero(2, n2),
2662 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
2663 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
2664 stress = RealMatrixX::Zero(2,2),
2665 mat_x = RealMatrixX::Zero(3,2),
2666 mat_y = RealMatrixX::Zero(3,2),
2667 local_jac = RealMatrixX::Zero(n2,n2);
2670 vec1_n1 = RealVectorX::Zero(n1),
2671 vec2_n1 = RealVectorX::Zero(n1),
2672 vec3_n2 = RealVectorX::Zero(n2),
2673 vec4_2 = RealVectorX::Zero(2),
2674 vec5_n1 = RealVectorX::Zero(n1),
2675 local_f = RealVectorX::Zero(n2),
2676 strain = RealVectorX::Zero(3),
2677 delta_t = RealVectorX::Zero(1),
2678 delta_t_sens = RealVectorX::Zero(1);
2702 std::unique_ptr<MAST::BendingOperator2D> bend;
2707 fe->get_qpoints()).release());
2709 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
2720 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
2723 (*expansion_A)(xyz[qp],
_time, material_exp_A_mat);
2724 (*expansion_B)(xyz[qp],
_time, material_exp_B_mat);
2725 expansion_A->
derivative(p, xyz[qp], _time, material_exp_A_mat_sens);
2726 expansion_B->derivative(p, xyz[qp], _time, material_exp_B_mat_sens);
2729 temp_func(xyz[qp], _time, t);
2730 ref_temp_func(xyz[qp], _time, t0);
2734 temp_func(xyz[qp], _time, t);
2735 temp_func.
derivative(p, xyz[qp], _time, t_sens);
2736 ref_temp_func(xyz[qp], _time, t0);
2738 delta_t_sens(0) = t_sens;
2741 vec1_n1 = material_exp_A_mat * delta_t_sens;
2742 vec2_n1 = material_exp_A_mat_sens * delta_t;
2744 stress(0,0) = vec1_n1(0);
2745 stress(0,1) = vec1_n1(2);
2746 stress(1,0) = vec1_n1(2);
2747 stress(1,1) = vec1_n1(1);
2749 vec2_n1 = material_exp_B_mat * delta_t_sens;
2750 vec5_n1 = material_exp_B_mat_sens * delta_t;
2768 local_f += JxW[qp] * vec3_n2;
2774 vec4_2 = mat_x.transpose() * vec1_n1;
2776 local_f.topRows(n2) += JxW[qp] * vec3_n2;
2779 vec4_2 = mat_y.transpose() * vec1_n1;
2781 local_f.topRows(n2) += JxW[qp] * vec3_n2;
2786 bend->initialize_bending_strain_operator(*fe, qp, Bmat_bend);
2788 local_f += JxW[qp] * vec3_n2;
2799 vec4_2 = vk_dwdxi_mat.transpose() * vec1_n1;
2801 local_f += JxW[qp] * vec3_n2;
2805 if (request_jacobian &&
2811 local_jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
2816 local_jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
2819 if (request_jacobian && if_vk) {
2822 mat3 = RealMatrixX::Zero(2, n2);
2825 local_jac += JxW[qp] * mat2_n2n2;
2833 if (request_jacobian && if_vk) {
2839 return request_jacobian;
2848 const unsigned int s,
2851 bool request_jacobian,
2860 std::vector<Real> JxW_Vn = fe->get_JxW();
2861 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
2862 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
2865 n_phi = (
unsigned int)fe->get_phi().size(),
2873 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
2874 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
2875 mat3 = RealMatrixX::Zero(2, n2),
2876 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
2877 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
2878 stress = RealMatrixX::Zero(2,2),
2879 mat_x = RealMatrixX::Zero(3,2),
2880 mat_y = RealMatrixX::Zero(3,2),
2881 local_jac = RealMatrixX::Zero(n2,n2);
2884 vec1_n1 = RealVectorX::Zero(n1),
2885 vec2_n1 = RealVectorX::Zero(n1),
2886 vec3_n2 = RealVectorX::Zero(n2),
2887 vec4_2 = RealVectorX::Zero(2),
2888 vec5_n3 = RealVectorX::Zero(n3),
2889 local_f = RealVectorX::Zero(n2),
2890 delta_t = RealVectorX::Zero(1),
2891 strain = RealVectorX::Zero(3),
2892 vel = RealVectorX::Zero(dim);
2916 std::unique_ptr<MAST::BendingOperator2D> bend;
2921 fe->get_qpoints()).release());
2923 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
2937 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
2939 vel_f(xyz[qp],
_time, vel);
2941 for (
unsigned int i=0; i<dim; i++)
2942 vn += vel(i)*face_normals[qp](i);
2946 for (
unsigned int qp=0; qp<JxW_Vn.size(); qp++) {
2949 (*expansion_A)(xyz[qp],
_time, material_exp_A_mat);
2950 (*expansion_B)(xyz[qp],
_time, material_exp_B_mat);
2953 temp_func(xyz[qp], _time, t);
2954 ref_temp_func(xyz[qp], _time, t0);
2957 vec1_n1 = material_exp_A_mat * delta_t;
2958 vec2_n1 = material_exp_B_mat * delta_t;
2959 stress(0,0) = vec1_n1(0);
2960 stress(0,1) = vec1_n1(2);
2961 stress(1,0) = vec1_n1(2);
2962 stress(1,1) = vec1_n1(1);
2978 local_f += JxW_Vn[qp] * vec3_n2;
2984 vec4_2 = mat_x.transpose() * vec1_n1;
2986 local_f.topRows(n2) += JxW_Vn[qp] * vec3_n2;
2989 vec4_2 = mat_y.transpose() * vec1_n1;
2991 local_f.topRows(n2) += JxW_Vn[qp] * vec3_n2;
2996 bend->initialize_bending_strain_operator(*fe, qp, Bmat_bend);
2998 local_f += JxW_Vn[qp] * vec3_n2;
3009 vec4_2 = vk_dwdxi_mat.transpose() * vec1_n1;
3011 local_f += JxW_Vn[qp] * vec3_n2;
3015 if (request_jacobian &&
3021 local_jac.topLeftCorner(n2, n2) += JxW_Vn[qp] * mat2_n2n2;
3026 local_jac.topLeftCorner(n2, n2) += JxW_Vn[qp] * mat2_n2n2;
3029 if (request_jacobian && if_vk) {
3031 mat3 = RealMatrixX::Zero(2, n2);
3034 local_jac += JxW_Vn[qp] * mat2_n2n2;
3041 if (request_jacobian && if_vk) {
3055 const std::vector<std::vector<Real>>& phi_temp = fe_thermal.
get_phi();
3056 const std::vector<Real>& JxW = fe_thermal.
get_JxW();
3057 const std::vector<libMesh::Point>& xyz = fe_thermal.
get_xyz();
3059 std::unique_ptr<MAST::FEBase> fe_str(
_elem.
init_fe(
true,
false,
3061 libmesh_assert(fe_str->get_fe_type() == fe_thermal.
get_fe_type());
3066 libmesh_assert_equal_to(fe_str->get_qpoints().size(), fe_thermal.
get_qpoints().size());
3070 n_phi_str = (
unsigned int)fe_str->get_phi().size(),
3071 nt = (
unsigned int)fe_thermal.
get_phi().size(),
3079 mat1_n1nt = RealMatrixX::Zero(n1,nt),
3080 mat2_n1nt = RealMatrixX::Zero(n1,nt),
3081 mat3_n2nt = RealMatrixX::Zero(n2,nt),
3083 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
3084 stress = RealMatrixX::Zero(2,2),
3085 mat_x = RealMatrixX::Zero(3,2),
3086 mat_y = RealMatrixX::Zero(3,2),
3087 Bmat_temp = RealMatrixX::Zero(1,nt),
3088 local_m = RealMatrixX::Zero(n2,nt);
3091 phi = RealVectorX::Zero(nt),
3092 vec_n1 = RealVectorX::Zero(n1),
3093 strain = RealVectorX::Zero(3);
3117 std::unique_ptr<MAST::BendingOperator2D> bend;
3122 fe_str->get_qpoints()).release());
3124 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
3128 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
3131 (*expansion_A)(xyz[qp],
_time, material_exp_A_mat);
3132 (*expansion_B)(xyz[qp],
_time, material_exp_B_mat);
3135 for (
unsigned int i_nd=0; i_nd<nt; i_nd++ )
3136 Bmat_temp(0, i_nd) = phi_temp[i_nd][qp];
3150 mat1_n1nt = material_exp_A_mat * Bmat_temp;
3151 mat2_n1nt = material_exp_B_mat * Bmat_temp;
3153 local_m += JxW[qp] * mat3_n2nt;
3160 mat5 = mat_x.transpose() * mat1_n1nt;
3162 local_m.topRows(n2) += JxW[qp] * mat3_n2nt;
3165 mat5 = mat_y.transpose() * mat1_n1nt;
3167 local_m.topRows(n2) += JxW[qp] * mat3_n2nt;
3172 bend->initialize_bending_strain_operator(*fe_str, qp, Bmat_bend);
3174 local_m += JxW[qp] * mat3_n2nt;
3185 mat5 = vk_dwdxi_mat.transpose() * mat1_n1nt;
3187 local_m += JxW[qp] * mat3_n2nt;
3192 mat3_n2nt.setZero();
3193 phi = RealVectorX::Zero(n2);
3194 vec_n1 = RealVectorX::Zero(n2);
3195 for (
unsigned int i=0; i<nt; i++) {
3196 phi = local_m.col(i);
3198 mat3_n2nt.col(i) = vec_n1;
3212 const unsigned int side,
3215 libmesh_assert(
false);
3217 return (request_jacobian);
3226 bool request_jacobian,
3230 const unsigned int side,
3233 libmesh_assert(
false);
3235 return (request_jacobian);
3253 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
true,
false));
3255 const std::vector<Real> &JxW = fe->
get_JxW();
3256 const std::vector<libMesh::Point>& qpoint = fe->
get_xyz();
3257 const std::vector<std::vector<Real> >& phi = fe->
get_phi();
3259 n_phi = (
unsigned int)phi.size(),
3265 libMesh::Point normal;
3280 dwdx_p (
"dwdx", 0.),
3281 dwdt_p (
"dwdt", 0.);
3284 dwdx_f (
"dwdx", dwdx_p),
3285 dwdt_f (
"dwdx", dwdt_p);
3288 std::unique_ptr<MAST::FieldFunction<Real> >
3289 pressure (piston_bc.get_pressure_function(dwdx_f, dwdt_f).release()),
3290 dpressure_dx (piston_bc.get_dpdx_function (dwdx_f, dwdt_f).release()),
3291 dpressure_dxdot (piston_bc.get_dpdxdot_function (dwdx_f, dwdt_f).release());
3300 phi_vec = RealVectorX::Zero(n_phi),
3301 force = RealVectorX::Zero(n1),
3302 local_f = RealVectorX::Zero(n2),
3303 vec_n1 = RealVectorX::Zero(n1),
3304 vec_n2 = RealVectorX::Zero(n2),
3305 vel_vec = RealVectorX::Zero(3),
3306 dummy = RealVectorX::Zero(3);
3309 dwdx = RealMatrixX::Zero(3,2),
3310 local_jac_xdot = RealMatrixX::Zero(n2,n2),
3311 local_jac = RealMatrixX::Zero(n2,n2),
3312 mat_n2n2 = RealMatrixX::Zero(n2,n2),
3313 mat_n1n2 = RealMatrixX::Zero(n1,n2),
3314 mat_22 = RealMatrixX::Zero(2,2);
3318 vel_vec =
_elem.
T_matrix().transpose() * piston_bc.vel_vec();
3326 for (
unsigned int qp=0; qp<qpoint.size(); qp++)
3330 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
3331 phi_vec(i_nd) = phi[i_nd][qp];
3335 Bmat_w.set_shape_function(0, 2, phi_vec);
3341 dwdt_val = vec_n1(0);
3354 for (
unsigned int i=0; i<2; i++)
3355 dwdx_val += dwdx(i,i) * vel_vec(i);
3360 (*pressure)(qpoint[qp],
_time, p_val);
3363 force(0) = p_val * normal(2);
3366 Bmat_w.vector_mult_transpose(vec_n2, force);
3367 local_f += JxW[qp] * vec_n2;
3371 if (request_jacobian) {
3374 (*dpressure_dxdot)(qpoint[qp],
_time, p_val);
3377 Bmat_w.right_multiply_transpose(mat_n2n2, Bmat_w);
3378 local_jac_xdot += (JxW[qp] * p_val * normal(2)) * mat_n2n2;
3381 (*dpressure_dx)(qpoint[qp],
_time, p_val);
3384 mat_22.setZero(2,2);
3385 mat_22(0,0) = vel_vec(0);
3386 dBmat.left_multiply(mat_n1n2, mat_22);
3387 Bmat_w.right_multiply_transpose(mat_n2n2, mat_n1n2);
3388 local_jac += (JxW[qp] * p_val * normal(2)) * mat_n2n2;
3391 mat_22.setZero(2,2);
3392 mat_22(1,1) = vel_vec(1);
3393 dBmat.left_multiply(mat_n1n2, mat_22);
3394 Bmat_w.right_multiply_transpose(mat_n2n2, mat_n1n2);
3395 local_jac += (JxW[qp] * p_val * normal(2)) * mat_n2n2;
3406 if (request_jacobian) {
3408 jac_xdot -= mat_n2n2;
3414 return request_jacobian;
3423 bool request_jacobian,
3433 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
true,
false));
3435 const std::vector<Real> &JxW = fe->
get_JxW();
3436 const std::vector<libMesh::Point>& qpoint = fe->
get_xyz();
3437 const std::vector<std::vector<Real> >& phi = fe->
get_phi();
3439 n_phi = (
unsigned int)phi.size(),
3445 libMesh::Point normal;
3460 dwdx_p (
"dwdx", 0.),
3461 dwdt_p (
"dwdt", 0.);
3464 dwdx_f (
"dwdx", dwdx_p),
3465 dwdt_f (
"dwdx", dwdt_p);
3468 std::unique_ptr<MAST::FieldFunction<Real> >
3469 pressure (piston_bc.get_pressure_function(dwdx_f, dwdt_f).release()),
3470 dpressure_dx (piston_bc.get_dpdx_function (dwdx_f, dwdt_f).release()),
3471 dpressure_dxdot (piston_bc.get_dpdxdot_function (dwdx_f, dwdt_f).release());
3480 phi_vec = RealVectorX::Zero(n_phi),
3481 force = RealVectorX::Zero(n1),
3482 local_f = RealVectorX::Zero(n2),
3483 vec_n1 = RealVectorX::Zero(n1),
3484 vec_n2 = RealVectorX::Zero(n2),
3485 vel_vec = RealVectorX::Zero(3),
3486 dummy = RealVectorX::Zero(3);
3489 dwdx = RealMatrixX::Zero(3,2),
3490 local_jac_xdot = RealMatrixX::Zero(n2,n2),
3491 local_jac = RealMatrixX::Zero(n2,n2),
3492 mat_n2n2 = RealMatrixX::Zero(n2,n2),
3493 mat_n1n2 = RealMatrixX::Zero(n1,n2),
3494 mat_22 = RealMatrixX::Zero(2,2);
3498 vel_vec =
_elem.
T_matrix().transpose() * piston_bc.vel_vec();
3506 for (
unsigned int qp=0; qp<qpoint.size(); qp++)
3510 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
3511 phi_vec(i_nd) = phi[i_nd][qp];
3515 Bmat_w.set_shape_function(0, 2, phi_vec);
3521 dwdt_val = vec_n1(0);
3534 for (
unsigned int i=0; i<2; i++)
3535 dwdx_val += dwdx(i,i) * vel_vec(i);
3540 pressure->derivative(p, qpoint[qp],
_time, p_val);
3543 force(0) = p_val * normal(2);
3546 Bmat_w.vector_mult_transpose(vec_n2, force);
3547 local_f += JxW[qp] * vec_n2;
3551 if (request_jacobian) {
3554 dpressure_dxdot->derivative(p, qpoint[qp],
_time, p_val);
3557 Bmat_w.right_multiply_transpose(mat_n2n2, Bmat_w);
3558 local_jac_xdot += (JxW[qp] * p_val * normal(2)) * mat_n2n2;
3561 dpressure_dx->derivative(p, qpoint[qp],
_time, p_val);
3564 mat_22.setZero(2,2);
3565 mat_22(0,0) = vel_vec(0);
3566 dBmat.left_multiply(mat_n1n2, mat_22);
3567 Bmat_w.right_multiply_transpose(mat_n2n2, mat_n1n2);
3568 local_jac += (JxW[qp] * p_val * normal(2)) * mat_n2n2;
3571 mat_22.setZero(2,2);
3572 mat_22(1,1) = vel_vec(1);
3573 dBmat.left_multiply(mat_n1n2, mat_22);
3574 Bmat_w.right_multiply_transpose(mat_n2n2, mat_n1n2);
3575 local_jac += (JxW[qp] * p_val * normal(2)) * mat_n2n2;
3586 if (request_jacobian) {
3588 jac_xdot -= mat_n2n2;
3595 return request_jacobian;
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.
void vector_mult_transpose(T &res, const T &v) const
res = v^T * [this]
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > thermal_expansion_B_matrix(const MAST::ElementBase &e) const =0
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 unsigned int n_direct_strain_components()
row dimension of the direct strain matrix, also used for the bending operator row dimension ...
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > prestress_B_matrix(MAST::ElementBase &e) const =0
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.
virtual const std::vector< Real > & get_JxW() const
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...
unsigned int n_boundary_stress_strain_data_for_elem(const GeomElem &e) const
virtual const std::vector< libMesh::Point > & get_xyz() const
physical location of the quadrature point in the global coordinate system for the reference element ...
StructuralElement2D(MAST::SystemInitialization &sys, MAST::AssemblyBase &assembly, const MAST::GeomElem &elem, const MAST::ElementPropertyCardBase &p)
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...
virtual const std::vector< libMesh::Point > & get_qpoints() const
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} .
unsigned int n_vars() const
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > stiffness_B_matrix(const MAST::ElementBase &e) const =0
RealVectorX _local_sol_sens
local solution sensitivity
MAST::SystemInitialization & _system
SystemInitialization object associated with this element.
virtual void thermal_residual_temperature_derivative(const MAST::FEBase &fe_thermal, RealMatrixX &m)
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 depends_on(const MAST::FunctionBase &f) const
returns true if the property card depends on the function f
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)
unsigned int n_stress_strain_data_for_elem(const MAST::GeomElem &e) const
virtual bool is_shape_parameter() const
virtual const MAST::MaterialPropertyCardBase & get_material() const
return the material property.
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...
virtual void derivative(const MAST::FunctionBase &f, ValType &v) const
calculates the value of the function derivative and returns it in v.
void transform_matrix_to_global_system(const ValType &local_mat, ValType &global_mat) const
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()
const RealMatrixX & T_matrix() const
O.
const MAST::StrainType strain_type() const
returns the type of strain to be used for this element
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.
void vector_mult(T &res, const T &v) const
res = [this] * v
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...
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > stiffness_A_matrix(const MAST::ElementBase &e) const =0
Matrix< Real, Dynamic, 1 > RealVectorX
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...
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...
virtual std::unique_ptr< MAST::FEBase > init_side_fe(unsigned int s, bool init_grads, int extra_quadrature_order=0) const
initializes the finite element shape function and quadrature object for the side with the order of qu...
This class acts as a wrapper around libMesh::Elem for the purpose of providing a uniform interface fo...
virtual const std::vector< std::vector< libMesh::RealVectorValue > > & get_dphi() const
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.
void _convert_prestress_A_mat_to_vector(const RealMatrixX &mat, RealVectorX &vec) const
converts the prestress stress tensor to a vector representation
void set_derivatives(const RealMatrixX &dstress_dX, const RealMatrixX &dstrain_dX)
adds the derivative data
void right_multiply_transpose(T &r, const T &m) const
[R] = [this]^T * [M]
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > thermal_expansion_A_matrix(const MAST::ElementBase &e) const =0
void left_multiply(T &r, const T &m) const
[R] = [M] * [this]
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< std::vector< Real > > & get_phi() const
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
const ValType & get(const std::string &nm) const
returns a constant reference to the specified function
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.
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...
const Real & _time
time for which system is being assembled
libMesh::FEType get_fe_type() const
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 transform_vector_to_global_system(const ValType &local_vec, ValType &global_vec) const
void _convert_prestress_B_mat_to_vector(const RealMatrixX &mat, RealVectorX &vec) const
converts the prestress stress tensor to a vector representation
virtual const std::vector< libMesh::Point > & get_normals_for_local_coordinate() const
normals defined in the coordinate system for the local reference element.
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...
virtual bool if_prestressed() const
virtual unsigned int n_von_karman_strain_components()
row dimension of the von Karman strain matrix
bool contains(const std::string &nm) const
checks if the card contains the specified property value
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.