60 const std::vector<std::vector<libMesh::RealVectorValue> >& dphi = fe.
get_dphi();
62 unsigned int n_phi = (
unsigned int)dphi.size();
65 libmesh_assert_equal_to(Bmat.
m(), 2);
66 libmesh_assert_equal_to(Bmat.
n(), 6*n_phi);
67 libmesh_assert_less (qp, dphi[0].size());
71 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
72 phi(i_nd) = dphi[i_nd][qp](0);
89 const std::vector<std::vector<libMesh::RealVectorValue> >& dphi = fe.
get_dphi();
90 const unsigned int n_phi = (
unsigned int)dphi.size();
92 libmesh_assert_equal_to(vk_strain.size(), 2);
93 libmesh_assert_equal_to(vk_dvdxi_mat.rows(), 2);
94 libmesh_assert_equal_to(vk_dvdxi_mat.cols(), 2);
95 libmesh_assert_equal_to(Bmat_v_vk.
m(), 2);
96 libmesh_assert_equal_to(Bmat_v_vk.
n(), 6*n_phi);
97 libmesh_assert_equal_to(vk_dwdxi_mat.rows(), 2);
98 libmesh_assert_equal_to(vk_dwdxi_mat.cols(), 2);
99 libmesh_assert_equal_to(Bmat_w_vk.
m(), 2);
100 libmesh_assert_equal_to(Bmat_w_vk.
n(), 6*n_phi);
101 libmesh_assert_less (qp, dphi[0].size());
105 vk_dvdxi_mat.setZero();
106 vk_dwdxi_mat.setZero();
110 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ ) {
111 phi_vec(i_nd) = dphi[i_nd][qp](0);
118 vk_dvdxi_mat(0, 0) = dv;
119 vk_dwdxi_mat(0, 0) = dw;
120 vk_strain(0) = 0.5*(dv*dv+dw*dw);
133 const std::vector<std::vector<libMesh::RealVectorValue> >& dphi = fe.
get_dphi();
134 const unsigned int n_phi = (
unsigned int)dphi.size();
136 libmesh_assert_equal_to(vk_dvdxi_mat_sens.rows(), 2);
137 libmesh_assert_equal_to(vk_dvdxi_mat_sens.cols(), 2);
138 libmesh_assert_equal_to(vk_dwdxi_mat_sens.rows(), 2);
139 libmesh_assert_equal_to(vk_dwdxi_mat_sens.cols(), 2);
140 libmesh_assert_less (qp, dphi[0].size());
143 vk_dvdxi_mat_sens.setZero();
144 vk_dwdxi_mat_sens.setZero();
148 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ ) {
149 phi_vec(i_nd) = dphi[i_nd][qp](0);
154 vk_dvdxi_mat_sens(0, 0) = dv;
155 vk_dwdxi_mat_sens(0, 0) = dw;
166 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
true,
false));
169 qp_loc_fe_size = (
unsigned int)fe->get_qpoints().size(),
172 std::vector<libMesh::Point>
173 qp_loc_fe = fe->get_qpoints(),
174 qp_loc(qp_loc_fe_size*n_added_qp);
180 for (
unsigned int i=0; i<qp_loc_fe.size(); i++) {
182 qp_loc[i*4] = qp_loc_fe[i];
183 qp_loc[i*4](1) = +1.;
184 qp_loc[i*4](2) = +1.;
186 qp_loc[i*4+1] = qp_loc_fe[i];
187 qp_loc[i*4+1](1) = -1.;
188 qp_loc[i*4+1](2) = +1.;
190 qp_loc[i*4+2] = qp_loc_fe[i];
191 qp_loc[i*4+2](1) = +1.;
192 qp_loc[i*4+2](2) = -1.;
194 qp_loc[i*4+3] = qp_loc_fe[i];
195 qp_loc[i*4+3](1) = -1.;
196 qp_loc[i*4+3](2) = -1.;
202 std::unique_ptr<MAST::BendingOperator1D>
211 const std::vector<Real> &JxW = fe->get_JxW();
212 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
214 n_phi = (
unsigned int)fe->n_shape_functions(),
233 vk_dvdxi_mat = RealMatrixX::Zero(n1,n3),
234 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
235 dstrain_dX = RealMatrixX::Zero(n1,n2),
236 dstress_dX = RealMatrixX::Zero(n1,n2),
237 mat_n1n2 = RealMatrixX::Zero(n1,n2),
238 eye = RealMatrixX::Identity(n1, n1),
239 dstrain_dX_3D= RealMatrixX::Zero(6,n2),
240 dstress_dX_3D= RealMatrixX::Zero(6,n2);
243 strain = RealVectorX::Zero(n1),
244 stress = RealVectorX::Zero(n1),
245 strain_bend = RealVectorX::Zero(n1),
246 strain_vk = RealVectorX::Zero(n3),
247 strain_3D = RealVectorX::Zero(6),
248 stress_3D = RealVectorX::Zero(6),
249 dstrain_dp = RealVectorX::Zero(n1),
250 dstress_dp = RealVectorX::Zero(n1);
292 *temp_func =
nullptr,
293 *ref_temp_func =
nullptr,
294 *alpha_func =
nullptr;
314 for (
unsigned int qp_loc_index=0; qp_loc_index<qp_loc_fe_size; qp_loc_index++)
315 for (
unsigned int section_qp_index=0; section_qp_index<n_added_qp; section_qp_index++)
317 qp = qp_loc_index*n_added_qp + section_qp_index;
320 mat_stiff(xyz[qp_loc_index],
_time, material_mat);
330 (*temp_func) (xyz[qp_loc_index],
_time, temp);
331 (*ref_temp_func)(xyz[qp_loc_index],
_time, ref_t);
332 (*alpha_func) (xyz[qp_loc_index],
_time, alpha);
333 strain(0) -= alpha*(temp-ref_t);
352 hy (xyz[qp_loc_index],
_time, y);
353 hz (xyz[qp_loc_index],
_time, z);
354 hy_off(xyz[qp_loc_index],
_time, y_off);
355 hz_off(xyz[qp_loc_index],
_time, z_off);
362 bend->initialize_bending_strain_operator_for_yz(*fe,
364 qp_loc[qp](1) * y/2.+y_off,
365 qp_loc[qp](2) * z/2.+z_off,
369 strain += strain_bend;
372 strain += strain_bend;
377 stress = material_mat * strain;
383 strain_3D(0) = strain(0);
384 stress_3D(0) = stress(0);
395 if (!request_derivative && !p)
408 if (request_derivative || p) {
418 dstrain_dX += mat_n1n2;
421 dstrain_dX += mat_n1n2;
426 dstrain_dX += mat_n1n2;
429 dstrain_dX += mat_n1n2;
433 dstress_dX = material_mat * dstrain_dX;
436 dstress_dX_3D.row(0) = dstress_dX.row(0);
437 dstrain_dX_3D.row(0) = dstrain_dX.row(0);
439 if (request_derivative)
456 dstrain_dp = RealVectorX::Zero(n1);
462 ref_temp_func->derivative(*p, xyz[qp_loc_index],
_time, dref_t);
463 alpha_func->derivative(*p, xyz[qp_loc_index],
_time, dalpha);
464 dstrain_dp(0) -= alpha*(dtemp-dref_t) - dalpha*(temp-ref_t);
472 hz.derivative(*p, xyz[qp_loc_index],
_time, z);
473 hy_off.derivative(*p, xyz[qp_loc_index],
_time, y_off);
474 hz_off.derivative(*p, xyz[qp_loc_index],
_time, z_off);
476 bend->initialize_bending_strain_operator_for_yz(*fe,
478 qp_loc[qp](1) * y/2.+y_off,
479 qp_loc[qp](2) * z/2.+z_off,
483 dstrain_dp += strain_bend;
486 dstrain_dp += strain_bend;
491 dstress_dp = material_mat * dstrain_dp;
501 dstress_dp += material_mat * strain;
513 stress_3D(0) = dstress_dp(0);
514 strain_3D(0) = dstrain_dp(0);
526 libmesh_assert(qp_loc.size() ==
531 return request_derivative || p;
547 const std::vector<Real>& JxW = fe->get_JxW();
548 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
550 n_phi = (
unsigned int)fe->get_phi().size(),
559 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
560 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
562 mat4_n3n2 = RealMatrixX::Zero(n3,2),
563 vk_dvdxi_mat = RealMatrixX::Zero(n1,n3),
564 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
565 stress = RealMatrixX::Zero(2,2),
566 stress_l = RealMatrixX::Zero(2,2),
567 local_jac = RealMatrixX::Zero(n2,n2);
570 vec1_n1 = RealVectorX::Zero(n1),
571 vec2_n1 = RealVectorX::Zero(n1),
572 vec3_n2 = RealVectorX::Zero(n2),
573 vec4_n3 = RealVectorX::Zero(n3),
574 vec5_n3 = RealVectorX::Zero(n3),
575 local_f = RealVectorX::Zero(n2);
598 std::unique_ptr<MAST::BendingOperator1D> bend;
603 fe->get_qpoints()).release());
606 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
611 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
614 (*mat_stiff_A)(xyz[qp],
_time, material_A_mat);
617 (*mat_stiff_B)(xyz[qp],
_time, material_B_mat);
618 (*mat_stiff_D)(xyz[qp],
_time, material_D_mat);
626 Bmat_mem, Bmat_bend_v, Bmat_bend_w,
627 Bmat_v_vk, Bmat_w_vk,
628 stress, stress_l, vk_dvdxi_mat, vk_dwdxi_mat,
630 material_B_mat, material_D_mat, vec1_n1,
631 vec2_n1, vec3_n2, vec4_n3,
632 vec5_n3, mat1_n1n2, mat2_n2n2,
640 if (bend.get() && bend->include_transverse_shear_energy())
641 bend->calculate_transverse_shear_residual(request_jacobian,
650 if (request_jacobian) {
655 return request_jacobian;
664 bool request_jacobian,
674 bool calculate =
false;
686 const std::vector<Real>& JxW = fe->get_JxW();
687 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
689 n_phi = (
unsigned int)fe->get_phi().size(),
698 material_trans_shear_mat,
699 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
700 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
702 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
703 vk_dvdxi_mat = RealMatrixX::Zero(n1,n3),
704 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
705 stress = RealMatrixX::Zero(2,2),
706 stress_l = RealMatrixX::Zero(2,2),
707 local_jac = RealMatrixX::Zero(n2,n2);
709 vec1_n1 = RealVectorX::Zero(n1),
710 vec2_n1 = RealVectorX::Zero(n1),
711 vec3_n2 = RealVectorX::Zero(n2),
712 vec4_n3 = RealVectorX::Zero(n3),
713 vec5_n3 = RealVectorX::Zero(n3),
714 local_f = RealVectorX::Zero(n2);
737 std::unique_ptr<MAST::BendingOperator1D> bend;
742 fe->get_qpoints()).release());
744 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
750 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
753 mat_stiff_A->derivative(p, xyz[qp],
_time, material_A_mat);
756 mat_stiff_B->derivative(p, xyz[qp],
_time, material_B_mat);
757 mat_stiff_D->derivative(p, xyz[qp],
_time, material_D_mat);
765 Bmat_mem, Bmat_bend_v, Bmat_bend_w,
766 Bmat_v_vk, Bmat_w_vk,
767 stress, stress_l, vk_dvdxi_mat, vk_dwdxi_mat,
769 material_B_mat, material_D_mat, vec1_n1,
770 vec2_n1, vec3_n2, vec4_n3,
771 vec5_n3, mat1_n1n2, mat2_n2n2,
777 if (bend.get() && bend->include_transverse_shear_energy())
778 bend->calculate_transverse_shear_residual_sensitivity(p,
787 if (request_jacobian) {
792 return request_jacobian;
806 const std::vector<Real>& JxW = fe->get_JxW();
807 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
809 n_phi = (
unsigned int)fe->get_phi().size(),
818 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
819 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
821 vk_dvdxi_mat_sens = RealMatrixX::Zero(n1,n3),
822 vk_dwdxi_mat_sens = RealMatrixX::Zero(n1,n3),
823 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
824 vk_dvdxi_mat = RealMatrixX::Zero(n1,n3),
825 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
826 stress = RealMatrixX::Zero(2,2),
827 local_jac = RealMatrixX::Zero(n2,n2);
829 vec1_n1 = RealVectorX::Zero(n1),
830 vec2_n1 = RealVectorX::Zero(n1),
831 vec3_n2 = RealVectorX::Zero(n2),
832 vec4_n3 = RealVectorX::Zero(n3),
833 vec5_n3 = RealVectorX::Zero(n3);
856 std::unique_ptr<MAST::BendingOperator1D> bend;
861 fe->get_qpoints()).release());
867 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
873 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
876 (*mat_stiff_A)(xyz[qp],
_time, material_A_mat);
878 (*mat_stiff_B)(xyz[qp],
_time, material_B_mat);
879 (*mat_stiff_D)(xyz[qp],
_time, material_D_mat);
886 vec2_n1 = material_A_mat * vec1_n1;
889 stress(0,0) = vec2_n1(0);
894 bend->initialize_bending_strain_operator(*fe, qp,
901 vec1_n1 = material_B_mat * vec2_n1;
902 stress(0,0) += vec1_n1(0);
905 vec1_n1 = material_B_mat * vec2_n1;
906 stress(0,0) += vec1_n1(0);
924 vec2_n1(0) = (vk_dvdxi_mat(0,0)*vk_dvdxi_mat_sens(0,0) +
925 vk_dwdxi_mat(0,0)*vk_dwdxi_mat_sens(0,0));
926 vec1_n1 = material_A_mat * vec2_n1;
927 stress(0,0) += vec1_n1(0);
936 mat3 = RealMatrixX::Zero(vk_dvdxi_mat.rows(), n2);
938 mat3 = material_A_mat * mat3;
940 local_jac += JxW[qp] * mat2_n2n2;
943 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
945 mat3 = material_A_mat * mat3;
947 local_jac += JxW[qp] * mat2_n2n2;
951 mat3 = vk_dvdxi_mat_sens.transpose() * mat1_n1n2;
953 local_jac += JxW[qp] * mat2_n2n2;
957 mat3 = vk_dwdxi_mat_sens.transpose() * mat1_n1n2;
959 local_jac += JxW[qp] * mat2_n2n2;
962 mat3 = RealMatrixX::Zero(2, n2);
965 local_jac += JxW[qp] * mat2_n2n2;
967 mat3 = RealMatrixX::Zero(vk_dvdxi_mat.rows(), n2);
969 mat3 = vk_dvdxi_mat_sens.transpose() * material_A_mat * mat3;
971 local_jac += JxW[qp] * mat2_n2n2;
973 mat3 = RealMatrixX::Zero(vk_dvdxi_mat.rows(), n2);
975 mat3 = vk_dvdxi_mat.transpose() * material_A_mat * mat3;
977 local_jac += JxW[qp] * mat2_n2n2;
980 mat3 = RealMatrixX::Zero(2, n2);
983 local_jac += JxW[qp] * mat2_n2n2;
985 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
987 mat3 = vk_dwdxi_mat_sens.transpose() * material_A_mat * mat3;
989 local_jac += JxW[qp] * mat2_n2n2;
991 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
993 mat3 = vk_dwdxi_mat.transpose() * material_A_mat * mat3;
995 local_jac += JxW[qp] * mat2_n2n2;
998 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1000 mat3 = vk_dvdxi_mat.transpose() * material_A_mat * mat3;
1002 local_jac += JxW[qp] * mat2_n2n2;
1004 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1006 mat3 = vk_dvdxi_mat_sens.transpose() * material_A_mat * mat3;
1008 local_jac += JxW[qp] * mat2_n2n2;
1010 mat3 = RealMatrixX::Zero(vk_dvdxi_mat.rows(), n2);
1012 mat3 = vk_dwdxi_mat.transpose() * material_A_mat * mat3;
1014 local_jac += JxW[qp] * mat2_n2n2;
1016 mat3 = RealMatrixX::Zero(vk_dvdxi_mat.rows(), n2);
1018 mat3 = vk_dwdxi_mat_sens.transpose() * material_A_mat * mat3;
1020 local_jac += JxW[qp] * mat2_n2n2;
1023 mat3 = RealMatrixX::Zero(vk_dvdxi_mat.rows(), n2);
1025 mat3 = material_B_mat.transpose() * mat3;
1027 local_jac += JxW[qp] * mat2_n2n2;
1029 local_jac += JxW[qp] * mat2_n2n2;
1032 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1034 mat3 = material_B_mat.transpose() * mat3;
1036 local_jac += JxW[qp] * mat2_n2n2;
1038 local_jac += JxW[qp] * mat2_n2n2;
1042 mat3 = vk_dvdxi_mat_sens.transpose() * mat1_n1n2;
1044 local_jac += JxW[qp] * mat2_n2n2;
1047 mat3 = vk_dwdxi_mat_sens.transpose() * mat1_n1n2;
1049 local_jac += JxW[qp] * mat2_n2n2;
1053 mat3 = vk_dvdxi_mat_sens.transpose() * mat1_n1n2;
1055 local_jac += JxW[qp] * mat2_n2n2;
1058 mat3 = vk_dwdxi_mat_sens.transpose() * mat1_n1n2;
1060 local_jac += JxW[qp] * mat2_n2n2;
1075 const unsigned int n2,
1076 const unsigned int qp,
1078 const std::vector<Real>& JxW,
1079 bool request_jacobian,
1109 vec2_n1 = material_A_mat * vec1_n1;
1112 stress_l(0,0) = vec2_n1(0);
1113 stress(0,0) = vec2_n1(0);
1114 stress(1,1) = vec1_n1(0);
1115 stress(0,1) = vec2_n1(1);
1127 vec1_n1 = material_B_mat * vec2_n1;
1128 stress_l(0,0) += vec1_n1(0);
1129 stress(0,0) += vec1_n1(0);
1132 vec1_n1 = material_B_mat * vec2_n1;
1133 stress_l(0,0) += vec1_n1(0);
1134 stress(0,0) += vec1_n1(0);
1145 vec1_n1 = material_A_mat * vec2_n1;
1146 stress(0,0) += vec1_n1(0);
1147 stress(1,1) += vec2_n1(0);
1153 vec1_n1(0) = stress(0,0);
1154 vec1_n1(1) = stress(0,1);
1160 local_f += JxW[qp] * vec3_n2;
1165 vec4_2 = vk_dvdxi_mat.transpose() * vec1_n1;
1167 local_f += JxW[qp] * vec3_n2;
1170 vec4_2 = vk_dwdxi_mat.transpose() * vec1_n1;
1172 local_f += JxW[qp] * vec3_n2;
1176 vec2_n1(0) = stress(1,1);
1180 vec1_n1 = material_B_mat.transpose() * vec2_n1;
1182 local_f += JxW[qp] * vec3_n2;
1184 local_f += JxW[qp] * vec3_n2;
1188 vec1_n1 = material_D_mat * vec2_n1;
1190 local_f += JxW[qp] * vec3_n2;
1193 vec1_n1 = material_D_mat * vec2_n1;
1195 local_f += JxW[qp] * vec3_n2;
1198 if (request_jacobian) {
1202 local_jac += JxW[qp] * mat2_n2n2;
1207 mat3 = RealMatrixX::Zero(vk_dvdxi_mat.rows(), n2);
1209 mat3 = material_A_mat * mat3;
1211 local_jac += JxW[qp] * mat2_n2n2;
1214 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1216 mat3 = material_A_mat * mat3;
1218 local_jac += JxW[qp] * mat2_n2n2;
1222 mat3 = vk_dvdxi_mat.transpose() * mat1_n1n2;
1224 local_jac += JxW[qp] * mat2_n2n2;
1228 mat3 = vk_dwdxi_mat.transpose() * mat1_n1n2;
1230 local_jac += JxW[qp] * mat2_n2n2;
1251 mat3 = RealMatrixX::Zero(2, n2);
1254 local_jac += JxW[qp] * mat2_n2n2;
1256 mat3 = RealMatrixX::Zero(vk_dvdxi_mat.rows(), n2);
1258 mat3 = vk_dvdxi_mat.transpose() * material_A_mat * mat3;
1260 local_jac += JxW[qp] * mat2_n2n2;
1263 mat3 = RealMatrixX::Zero(2, n2);
1266 local_jac += JxW[qp] * mat2_n2n2;
1268 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1270 mat3 = vk_dwdxi_mat.transpose() * material_A_mat * mat3;
1272 local_jac += JxW[qp] * mat2_n2n2;
1275 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1277 mat3 = vk_dvdxi_mat.transpose() * material_A_mat * mat3;
1279 local_jac += JxW[qp] * mat2_n2n2;
1281 mat3 = RealMatrixX::Zero(vk_dvdxi_mat.rows(), n2);
1283 mat3 = vk_dwdxi_mat.transpose() * material_A_mat * mat3;
1285 local_jac += JxW[qp] * mat2_n2n2;
1290 mat3 = RealMatrixX::Zero(vk_dvdxi_mat.rows(), n2);
1292 mat3 = material_B_mat.transpose() * mat3;
1294 local_jac += JxW[qp] * mat2_n2n2;
1296 local_jac += JxW[qp] * mat2_n2n2;
1299 mat3 = RealMatrixX::Zero(vk_dwdxi_mat.rows(), n2);
1301 mat3 = material_B_mat.transpose() * mat3;
1303 local_jac += JxW[qp] * mat2_n2n2;
1305 local_jac += JxW[qp] * mat2_n2n2;
1309 mat3 = vk_dvdxi_mat.transpose() * mat1_n1n2;
1311 local_jac += JxW[qp] * mat2_n2n2;
1314 mat3 = vk_dwdxi_mat.transpose() * mat1_n1n2;
1316 local_jac += JxW[qp] * mat2_n2n2;
1320 mat3 = vk_dvdxi_mat.transpose() * mat1_n1n2;
1322 local_jac += JxW[qp] * mat2_n2n2;
1325 mat3 = vk_dwdxi_mat.transpose() * mat1_n1n2;
1327 local_jac += JxW[qp] * mat2_n2n2;
1331 mat3 = material_B_mat.transpose();
1334 local_jac += JxW[qp] * mat2_n2n2;
1336 local_jac += JxW[qp] * mat2_n2n2;
1341 local_jac += JxW[qp] * mat2_n2n2;
1345 local_jac += JxW[qp] * mat2_n2n2;
1350 local_jac += JxW[qp] * mat2_n2n2;
1354 local_jac += JxW[qp] * mat2_n2n2;
1365 libmesh_assert_equal_to(mat.rows(), 2);
1366 libmesh_assert_equal_to(mat.cols(), 2);
1367 vec = RealVectorX::Zero(2);
1376 libmesh_assert_equal_to(mat.rows(), 2);
1377 libmesh_assert_equal_to(mat.cols(), 2);
1378 vec = RealVectorX::Zero(2);
1397 const std::vector<Real>& JxW = fe->get_JxW();
1398 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1400 n_phi = (
unsigned int)fe->get_phi().size(),
1406 mat2_n2n2 = RealMatrixX::Zero(n2, n2),
1408 vk_dvdxi_mat = RealMatrixX::Zero(n1, n3),
1409 vk_dwdxi_mat = RealMatrixX::Zero(n1, n3),
1410 local_jac = RealMatrixX::Zero(n2, n2),
1414 vec2_n1 = RealVectorX::Zero(n1),
1415 vec3_n2 = RealVectorX::Zero(n2),
1416 vec4_n3 = RealVectorX::Zero(n3),
1417 vec5_n3 = RealVectorX::Zero(n3),
1418 local_f = RealVectorX::Zero(n2),
1423 local_jac.setZero();
1443 std::unique_ptr<MAST::BendingOperator1D> bend;
1448 fe->get_qpoints()).release());
1450 std::unique_ptr<MAST::FieldFunction<RealMatrixX> >
1455 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
1457 (*prestress_A)(xyz[qp],
_time, prestress_mat_A);
1458 (*prestress_B)(xyz[qp],
_time, prestress_mat_B);
1467 bend->initialize_bending_strain_operator(*fe, qp,
1485 local_f += JxW[qp] * vec3_n2;
1490 vec4_n3 = vk_dvdxi_mat.transpose() * prestress_vec_A;
1492 local_f += JxW[qp] * vec3_n2;
1495 vec4_n3 = vk_dwdxi_mat.transpose() * prestress_vec_A;
1497 local_f += JxW[qp] * vec3_n2;
1502 local_f += JxW[qp] * vec3_n2;
1504 local_f += JxW[qp] * vec3_n2;
1507 if (request_jacobian) {
1508 if (bend.get() && if_vk) {
1510 mat3 = RealMatrixX::Zero(2, n2);
1513 local_jac += JxW[qp] * mat2_n2n2;
1516 mat3 = RealMatrixX::Zero(2, n2);
1519 local_jac += JxW[qp] * mat2_n2n2;
1527 if (request_jacobian && if_vk) {
1533 return (request_jacobian);
1542 bool request_jacobian,
1553 const std::vector<Real>& JxW = fe->get_JxW();
1554 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1556 n_phi = (
unsigned int)fe->get_phi().size(),
1562 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
1564 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
1565 vk_dvdxi_mat = RealMatrixX::Zero(n1,n3),
1566 local_jac = RealMatrixX::Zero(n2,n2),
1570 vec2_n1 = RealVectorX::Zero(n1),
1571 vec3_n2 = RealVectorX::Zero(n2),
1572 vec4_n3 = RealVectorX::Zero(n3),
1573 vec5_n3 = RealVectorX::Zero(n3),
1574 local_f = RealVectorX::Zero(n2),
1579 local_jac.setZero();
1599 std::unique_ptr<MAST::BendingOperator1D> bend;
1604 fe->get_qpoints()).release());
1606 std::unique_ptr<MAST::FieldFunction<RealMatrixX> >
1611 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
1613 prestress_A->derivative(p, xyz[qp],
_time, prestress_mat_A);
1614 prestress_B->derivative(p, xyz[qp],
_time, prestress_mat_B);
1623 bend->initialize_bending_strain_operator(*fe, qp,
1641 local_f += JxW[qp] * vec3_n2;
1646 vec4_n3 = vk_dvdxi_mat.transpose() * prestress_vec_A;
1648 local_f += JxW[qp] * vec3_n2;
1651 vec4_n3 = vk_dwdxi_mat.transpose() * prestress_vec_A;
1653 local_f += JxW[qp] * vec3_n2;
1658 local_f += JxW[qp] * vec3_n2;
1660 local_f += JxW[qp] * vec3_n2;
1663 if (request_jacobian) {
1664 if (bend.get() && if_vk) {
1666 mat3 = RealMatrixX::Zero(2, n2);
1669 local_jac += JxW[qp] * mat2_n2n2;
1672 mat3 = RealMatrixX::Zero(2, n2);
1675 local_jac += JxW[qp] * mat2_n2n2;
1683 if (request_jacobian && if_vk) {
1689 return (request_jacobian);
1700 const unsigned int side,
1708 const std::vector<Real> &JxW = fe->get_JxW();
1709 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1710 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1711 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
1713 n_phi = (
unsigned int)phi.size(),
1731 phi_vec = RealVectorX::Zero(n_phi),
1732 force = RealVectorX::Zero(2*n1),
1733 local_f = RealVectorX::Zero(n2),
1734 vec_n2 = RealVectorX::Zero(n2);
1736 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1739 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1740 phi_vec(i_nd) = phi[i_nd][qp];
1742 Bmat.
reinit(2*n1, phi_vec);
1745 p_func(qpoint[qp],
_time, press);
1746 A_func(qpoint[qp],
_time, A_val);
1749 for (
unsigned int i_dim=0; i_dim<n1; i_dim++)
1750 force(i_dim) = (press*A_val) * face_normals[qp](i_dim);
1754 local_f += JxW[qp] * vec_n2;
1766 return (request_jacobian);
1776 bool request_jacobian,
1779 const unsigned int side,
1787 const std::vector<Real> &JxW = fe->get_JxW();
1788 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1789 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1790 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
1792 n_phi = (
unsigned int)phi.size(),
1812 phi_vec = RealVectorX::Zero(n_phi),
1813 force = RealVectorX::Zero(2*n1),
1814 local_f = RealVectorX::Zero(n2),
1815 vec_n2 = RealVectorX::Zero(n2);
1817 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1820 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1821 phi_vec(i_nd) = phi[i_nd][qp];
1823 Bmat.
reinit(2*n1, phi_vec);
1826 p_func(qpoint[qp],
_time, press);
1828 A_func(qpoint[qp],
_time, A_val);
1832 for (
unsigned int i_dim=0; i_dim<n1; i_dim++)
1833 force(i_dim) = (press*dA_val + dpress*A_val) * face_normals[qp](i_dim);
1837 local_f += JxW[qp] * vec_n2;
1849 return (request_jacobian);
1867 const std::vector<Real>& JxW = fe->get_JxW();
1868 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1870 n_phi = (
unsigned int)fe->get_phi().size(),
1878 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
1879 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
1881 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
1882 vk_dvdxi_mat = RealMatrixX::Zero(n1,n3),
1883 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
1884 stress = RealMatrixX::Zero(2,2),
1885 local_jac = RealMatrixX::Zero(n2, n2);
1887 vec1_n1 = RealVectorX::Zero(n1),
1888 vec2_n1 = RealVectorX::Zero(n1),
1889 vec3_n2 = RealVectorX::Zero(n2),
1890 vec4_2 = RealVectorX::Zero(2),
1891 vec5_n3 = RealVectorX::Zero(n3),
1892 local_f = RealVectorX::Zero(n2),
1893 delta_t = RealVectorX::Zero(1);
1896 local_jac.setZero();
1916 std::unique_ptr<MAST::BendingOperator1D> bend;
1921 fe->get_qpoints()).release());
1923 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
1937 if (bc.
contains(
"thermal_jacobian_scaling"))
1940 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
1943 (*expansion_A)(xyz[qp],
_time, material_exp_A_mat);
1944 (*expansion_B)(xyz[qp],
_time, material_exp_B_mat);
1947 temp_func (xyz[qp], _time, t);
1948 ref_temp_func(xyz[qp], _time, t0);
1951 vec1_n1 = material_exp_A_mat * delta_t;
1952 stress(0,0) = vec1_n1(0);
1953 vec2_n1 = material_exp_B_mat * delta_t;
1959 local_f += JxW[qp] * vec3_n2;
1963 bend->initialize_bending_strain_operator(*fe, qp,
1967 local_f += JxW[qp] * vec3_n2;
1969 local_f += JxW[qp] * vec3_n2;
1982 vec4_2 = vk_dvdxi_mat.transpose() * vec1_n1;
1984 local_f += JxW[qp] * vec3_n2;
1987 vec4_2 = vk_dwdxi_mat.transpose() * vec1_n1;
1989 local_f += JxW[qp] * vec3_n2;
1992 if (request_jacobian && if_vk) {
1995 mat3 = RealMatrixX::Zero(2, n2);
1998 local_jac += JxW[qp] * mat2_n2n2;
2001 mat3 = RealMatrixX::Zero(2, n2);
2004 local_jac += JxW[qp] * mat2_n2n2;
2013 if (request_jacobian && if_vk) {
2015 jac -= scaling * mat2_n2n2;
2019 return request_jacobian;
2027 bool request_jacobian,
2036 const std::vector<Real>& JxW = fe->get_JxW();
2037 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
2039 n_phi = (
unsigned int)fe->get_phi().size(),
2047 material_exp_A_mat_sens,
2048 material_exp_B_mat_sens,
2049 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
2050 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
2052 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
2053 vk_dvdxi_mat = RealMatrixX::Zero(2,2),
2054 vk_dwdxi_mat = RealMatrixX::Zero(2,2),
2055 stress = RealMatrixX::Zero(2,2),
2056 local_jac = RealMatrixX::Zero(n2,n2);
2058 vec1_n1 = RealVectorX::Zero(n1),
2059 vec2_n1 = RealVectorX::Zero(n1),
2060 vec3_n2 = RealVectorX::Zero(n2),
2061 vec4_2 = RealVectorX::Zero(2),
2062 vec5_n1 = RealVectorX::Zero(n1),
2063 local_f = RealVectorX::Zero(n2),
2064 delta_t = RealVectorX::Zero(1),
2065 delta_t_sens = RealVectorX::Zero(1);
2085 std::unique_ptr<MAST::BendingOperator1D> bend;
2090 fe->get_qpoints()).release());
2092 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
2103 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
2106 (*expansion_A)(xyz[qp],
_time, material_exp_A_mat);
2107 (*expansion_B)(xyz[qp],
_time, material_exp_B_mat);
2108 expansion_A->
derivative(p, xyz[qp], _time, material_exp_A_mat_sens);
2109 expansion_B->derivative(p, xyz[qp], _time, material_exp_B_mat_sens);
2112 temp_func(xyz[qp], _time, t);
2113 temp_func.
derivative(p, xyz[qp], _time, t_sens);
2114 ref_temp_func(xyz[qp], _time, t0);
2116 delta_t_sens(0) = t_sens;
2119 vec1_n1 = material_exp_A_mat * delta_t_sens;
2120 vec2_n1 = material_exp_A_mat_sens * delta_t;
2122 stress(0,0) = vec1_n1(0);
2125 vec2_n1 = material_exp_B_mat * delta_t_sens;
2126 vec5_n1 = material_exp_B_mat_sens * delta_t;
2134 local_f += JxW[qp] * vec3_n2;
2138 bend->initialize_bending_strain_operator(*fe, qp,
2142 local_f += JxW[qp] * vec3_n2;
2144 local_f += JxW[qp] * vec3_n2;
2157 vec4_2 = vk_dvdxi_mat.transpose() * vec1_n1;
2159 local_f += JxW[qp] * vec3_n2;
2162 vec4_2 = vk_dwdxi_mat.transpose() * vec1_n1;
2164 local_f += JxW[qp] * vec3_n2;
2167 if (request_jacobian && if_vk) {
2169 mat3 = RealMatrixX::Zero(2, n2);
2172 local_jac += JxW[qp] * mat2_n2n2;
2175 mat3 = RealMatrixX::Zero(2, n2);
2178 local_jac += JxW[qp] * mat2_n2n2;
2187 if (request_jacobian && if_vk) {
2193 return request_jacobian;
2212 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
true,
false));
2214 const std::vector<Real> &JxW = fe->get_JxW();
2215 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
2216 const std::vector<std::vector<Real> >& phi = fe->get_phi();
2218 n_phi = (
unsigned int)phi.size(),
2232 dwdx_p (
"dwdx", 0.),
2233 dwdt_p (
"dwdt", 0.);
2236 dwdx_f (
"dwdx", dwdx_p),
2237 dwdt_f (
"dwdx", dwdt_p);
2239 std::unique_ptr<MAST::FieldFunction<Real> >
2254 phi_vec = RealVectorX::Zero(n_phi),
2255 force = RealVectorX::Zero(n1),
2256 local_f = RealVectorX::Zero(n2),
2257 vec_n1 = RealVectorX::Zero(n1),
2258 vec_n2 = RealVectorX::Zero(n2),
2259 vel = RealVectorX::Zero(3),
2260 p_val = RealVectorX::Zero(3),
2261 normal = RealVectorX::Zero(3),
2262 dummy = RealVectorX::Zero(2);
2271 dvdx = RealMatrixX::Zero(2,2),
2272 dwdx = RealMatrixX::Zero(2,2),
2273 local_jac = RealMatrixX::Zero(n2,n2),
2274 local_jac_xdot = RealMatrixX::Zero(n2,n2),
2275 mat_n2n2 = RealMatrixX::Zero(n2,n2);
2278 for (
unsigned int qp=0; qp<qpoint.size(); qp++)
2282 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
2283 phi_vec(i_nd) = phi[i_nd][qp];
2286 Bmat_v.set_shape_function(0, 1, phi_vec);
2288 Bmat_w.set_shape_function(1, 2, phi_vec);
2311 (*pressure)(qpoint[qp],
_time, p_val(1));
2316 (*pressure)(qpoint[qp],
_time, p_val(2));
2321 force(0) = p_val(1) * normal(1);
2322 Bmat_v.vector_mult_transpose(vec_n2, force);
2323 local_f += JxW[qp] * vec_n2;
2327 force(1) = p_val(2) * normal(2);
2328 Bmat_v.vector_mult_transpose(vec_n2, force);
2329 local_f += JxW[qp] * vec_n2;
2333 if (request_jacobian) {
2338 (*dpressure_dxdot)(qpoint[qp],
_time, p_val(1));
2341 Bmat_v.right_multiply_transpose(mat_n2n2, Bmat_v);
2342 local_jac_xdot += JxW[qp] * p_val(1) * normal(1) * mat_n2n2;
2345 (*dpressure_dx)(qpoint[qp],
_time, p_val(1));
2347 Bmat_v.right_multiply_transpose(mat_n2n2, Bmat_dvdx);
2348 local_jac += (JxW[qp] * p_val(1) * normal(1)) * mat_n2n2;
2353 (*dpressure_dxdot)(qpoint[qp],
_time, p_val(2));
2356 Bmat_w.right_multiply_transpose(mat_n2n2, Bmat_w);
2357 local_jac_xdot += JxW[qp] * p_val(2) * normal(2) * mat_n2n2;
2360 (*dpressure_dx)(qpoint[qp],
_time, p_val(2));
2361 Bmat_w.right_multiply_transpose(mat_n2n2, Bmat_dwdx);
2362 local_jac += (JxW[qp] * p_val(2) * normal(2)) * mat_n2n2;
2372 if (request_jacobian) {
2374 jac_xdot -= mat_n2n2;
2380 return (request_jacobian);
2395 bool request_jacobian,
2404 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
true,
false));
2406 const std::vector<Real> &JxW = fe->get_JxW();
2407 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
2408 const std::vector<std::vector<Real> >& phi = fe->get_phi();
2410 n_phi = (
unsigned int)phi.size(),
2424 dwdx_p (
"dwdx", 0.),
2425 dwdt_p (
"dwdt", 0.);
2428 dwdx_f (
"dwdx", dwdx_p),
2429 dwdt_f (
"dwdx", dwdt_p);
2431 std::unique_ptr<MAST::FieldFunction<Real> >
2446 phi_vec = RealVectorX::Zero(n_phi),
2447 force = RealVectorX::Zero(n1),
2448 local_f = RealVectorX::Zero(n2),
2449 vec_n1 = RealVectorX::Zero(n1),
2450 vec_n2 = RealVectorX::Zero(n2),
2451 vel = RealVectorX::Zero(3),
2452 p_val = RealVectorX::Zero(3),
2453 normal = RealVectorX::Zero(3),
2454 dummy = RealVectorX::Zero(2);
2463 dvdx = RealMatrixX::Zero(2,2),
2464 dwdx = RealMatrixX::Zero(2,2),
2465 local_jac = RealMatrixX::Zero(n2,n2),
2466 local_jac_xdot = RealMatrixX::Zero(n2,n2),
2467 mat_n2n2 = RealMatrixX::Zero(n2,n2);
2470 for (
unsigned int qp=0; qp<qpoint.size(); qp++)
2474 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
2475 phi_vec(i_nd) = phi[i_nd][qp];
2478 Bmat_v.set_shape_function(0, 1, phi_vec);
2480 Bmat_w.set_shape_function(1, 2, phi_vec);
2503 pressure->derivative(p, qpoint[qp],
_time, p_val(1));
2508 pressure->derivative(p, qpoint[qp],
_time, p_val(2));
2513 force(0) = p_val(1) * normal(1);
2514 Bmat_v.vector_mult_transpose(vec_n2, force);
2515 local_f += JxW[qp] * vec_n2;
2519 force(1) = p_val(2) * normal(2);
2520 Bmat_v.vector_mult_transpose(vec_n2, force);
2521 local_f += JxW[qp] * vec_n2;
2525 if (request_jacobian) {
2530 dpressure_dxdot->derivative(p, qpoint[qp],
_time, p_val(1));
2533 Bmat_v.right_multiply_transpose(mat_n2n2, Bmat_v);
2534 local_jac_xdot += JxW[qp] * p_val(1) * normal(1) * mat_n2n2;
2537 dpressure_dx->derivative(p, qpoint[qp],
_time, p_val(1));
2540 Bmat_v.right_multiply_transpose(mat_n2n2, Bmat_dvdx);
2541 local_jac += (JxW[qp] * p_val(1) * normal(1)) * mat_n2n2;
2546 dpressure_dxdot->derivative(p, qpoint[qp],
_time, p_val(2));
2549 Bmat_w.right_multiply_transpose(mat_n2n2, Bmat_w);
2550 local_jac_xdot += JxW[qp] * p_val(2) * normal(2) * mat_n2n2;
2553 dpressure_dx->derivative(p, qpoint[qp],
_time, p_val(2));
2554 Bmat_w.right_multiply_transpose(mat_n2n2, Bmat_dwdx);
2555 local_jac += (JxW[qp] * p_val(2) * normal(2)) * mat_n2n2;
2565 if (request_jacobian) {
2567 jac_xdot -= mat_n2n2;
2575 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 void initialize_direct_strain_operator(const unsigned int qp, const MAST::FEBase &fe, MAST::FEMOperatorMatrix &Bmat)
initialize membrane strain operator matrix
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
virtual ~StructuralElement1D()
std::unique_ptr< MAST::BendingOperator1D > build_bending_operator_1D(MAST::BendingOperatorType type, MAST::StructuralElementBase &elem, const std::vector< libMesh::Point > &pts)
builds a bending operator and returns it in a smart-pointer
virtual unsigned int n_direct_strain_components()
row dimension of the direct strain matrix, also used for the bending operator row dimension ...
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...
void _convert_prestress_B_mat_to_vector(const RealMatrixX &mat, RealVectorX &vec) const
converts the prestress stress tensor to a vector representation
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > prestress_B_matrix(MAST::ElementBase &e) const =0
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 bool prestress_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the internal force vector and Jacobian due to strain energy coming from a prestress...
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...
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...
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...
This is a scalar function whose value can be changed and one that can be used as a design variable in...
virtual bool thermal_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac, MAST::BoundaryConditionBase &bc)
Calculates the sensitivity of force vector and the Jacobian due to thermal stresses.
unsigned int n_vars() 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, MAST::BendingOperator1D *bend_op, MAST::FEMOperatorMatrix &Bmat_mem, MAST::FEMOperatorMatrix &Bmat_bend_v, MAST::FEMOperatorMatrix &Bmat_bend_w, MAST::FEMOperatorMatrix &Bmat_v_vk, MAST::FEMOperatorMatrix &Bmat_w_vk, RealMatrixX &stress, RealMatrixX &stress_l, RealMatrixX &vk_dvdxi_mat, 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, RealMatrixX &mat1_n1n2, RealMatrixX &mat2_n2n2, RealMatrixX &mat3, RealMatrixX &mat4_2n2)
performs integration at the quadrature point for the provided matrices.
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 bool depends_on(const MAST::FunctionBase &f) const
returns true if the property card depends on the function f
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.
void initialize_von_karman_strain_operator_sensitivity(const unsigned int qp, const MAST::FEBase &fe, RealMatrixX &vk_dvdxi_mat_sens, RealMatrixX &vk_dwdxi_mat_sens)
initialze the sensitivity of von Karman operator matrices needed for Jacobian calculation.
virtual bool internal_residual_jac_dot_state_sensitivity(RealMatrixX &jac)
calculates d[J]/d{x} .
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
Matrix< Real, Dynamic, Dynamic > RealMatrixX
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
std::unique_ptr< MAST::FieldFunction< Real > > get_dpdx_function(const MAST::FieldFunction< Real > &dwdx, const MAST::FieldFunction< Real > &dwdt) const
MAST::BoundaryConditionBase * get_thermal_load_for_elem(const MAST::GeomElem &elem)
Bending strain operator for 1D element.
virtual bool prestress_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the internal force 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
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...
std::unique_ptr< MAST::FieldFunction< Real > > get_dpdxdot_function(const MAST::FieldFunction< Real > &dwdx, const MAST::FieldFunction< Real > &dwdt) const
This class acts as a wrapper around libMesh::Elem for the purpose of providing a uniform interface fo...
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.
virtual const std::vector< std::vector< libMesh::RealVectorValue > > & get_dphi() const
std::unique_ptr< MAST::FieldFunction< Real > > get_pressure_function(const MAST::FieldFunction< Real > &dwdx, const MAST::FieldFunction< Real > &dwdt) const
virtual void initialize_bending_strain_operator(const MAST::FEBase &fe, const unsigned int qp, MAST::FEMOperatorMatrix &Bmat_v, MAST::FEMOperatorMatrix &Bmat_w)=0
initialze the bending strain operator for the specified quadrature point
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
virtual unsigned int n_von_karman_strain_components()
row dimension of the von Karman strain matrix
virtual bool thermal_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, MAST::BoundaryConditionBase &bc)
Calculates the force vector and Jacobian due to thermal stresses.
virtual bool calculate_stress(bool request_derivative, const MAST::FunctionBase *p, MAST::StressStrainOutputBase &output)
Calculates the stress tensor.
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)
RealVectorX _local_sol
local solution
RealVectorX _local_vel
local velocity
virtual void initialize_von_karman_strain_operator(const unsigned int qp, const MAST::FEBase &fe, RealVectorX &vk_strain, RealMatrixX &vk_dvdxi_mat, RealMatrixX &vk_dwdxi_mat, MAST::FEMOperatorMatrix &Bmat_v_vk, MAST::FEMOperatorMatrix &Bmat_w_vk)
initialze the von Karman strain in vK_strain, the operator matrices needed for Jacobian calculation...
const ValType & get(const std::string &nm) const
returns a constant reference to the specified function
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...
StructuralElement1D(MAST::SystemInitialization &sys, MAST::AssemblyBase &assembly, const MAST::GeomElem &elem, const MAST::ElementPropertyCardBase &p)
const Real & _time
time for which system is being assembled
virtual bool internal_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the sensitivity internal force vector and Jacobian due to strain energy.
void transform_vector_to_global_system(const ValType &local_vec, ValType &global_vec) 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 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 bool internal_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the internal force vector and Jacobian due to strain energy.
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