36 #define eps 2.2204460492503131e-16 //numpy.spacing(1), used to avoid singular stiffness matrices 61 const std::vector<std::vector<libMesh::RealVectorValue> >& dphi = fe.
get_dphi();
63 unsigned int n_phi = (
unsigned int)dphi.size();
66 libmesh_assert_equal_to(Bmat.
m(), 2);
67 libmesh_assert_equal_to(Bmat.
n(), 6*n_phi);
68 libmesh_assert_less (qp, dphi[0].size());
72 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
73 phi(i_nd) = dphi[i_nd][qp](0);
90 const std::vector<std::vector<libMesh::RealVectorValue> >& dphi = fe.
get_dphi();
91 const unsigned int n_phi = (
unsigned int)dphi.size();
93 libmesh_assert_equal_to(vk_strain.size(), 2);
94 libmesh_assert_equal_to(vk_dvdxi_mat.rows(), 2);
95 libmesh_assert_equal_to(vk_dvdxi_mat.cols(), 2);
96 libmesh_assert_equal_to(Bmat_v_vk.
m(), 2);
97 libmesh_assert_equal_to(Bmat_v_vk.
n(), 6*n_phi);
98 libmesh_assert_equal_to(vk_dwdxi_mat.rows(), 2);
99 libmesh_assert_equal_to(vk_dwdxi_mat.cols(), 2);
100 libmesh_assert_equal_to(Bmat_w_vk.
m(), 2);
101 libmesh_assert_equal_to(Bmat_w_vk.
n(), 6*n_phi);
102 libmesh_assert_less (qp, dphi[0].size());
106 vk_dvdxi_mat.setZero();
107 vk_dwdxi_mat.setZero();
111 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ ) {
112 phi_vec(i_nd) = dphi[i_nd][qp](0);
119 vk_dvdxi_mat(0, 0) = dv;
120 vk_dwdxi_mat(0, 0) = dw;
121 vk_strain(0) = 0.5*(dv*dv+dw*dw);
134 const std::vector<std::vector<libMesh::RealVectorValue> >& dphi = fe.
get_dphi();
135 const unsigned int n_phi = (
unsigned int)dphi.size();
137 libmesh_assert_equal_to(vk_dvdxi_mat_sens.rows(), 2);
138 libmesh_assert_equal_to(vk_dvdxi_mat_sens.cols(), 2);
139 libmesh_assert_equal_to(vk_dwdxi_mat_sens.rows(), 2);
140 libmesh_assert_equal_to(vk_dwdxi_mat_sens.cols(), 2);
141 libmesh_assert_less (qp, dphi[0].size());
144 vk_dvdxi_mat_sens.setZero();
145 vk_dwdxi_mat_sens.setZero();
149 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ ) {
150 phi_vec(i_nd) = dphi[i_nd][qp](0);
155 vk_dvdxi_mat_sens(0, 0) = dv;
156 vk_dwdxi_mat_sens(0, 0) = dw;
167 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
true,
false));
170 qp_loc_fe_size = (
unsigned int)fe->get_qpoints().size(),
173 std::vector<libMesh::Point>
174 qp_loc_fe = fe->get_qpoints(),
175 qp_loc(qp_loc_fe_size*n_added_qp);
181 for (
unsigned int i=0; i<qp_loc_fe.size(); i++) {
183 qp_loc[i*4] = qp_loc_fe[i];
184 qp_loc[i*4](1) = +1.;
185 qp_loc[i*4](2) = +1.;
187 qp_loc[i*4+1] = qp_loc_fe[i];
188 qp_loc[i*4+1](1) = -1.;
189 qp_loc[i*4+1](2) = +1.;
191 qp_loc[i*4+2] = qp_loc_fe[i];
192 qp_loc[i*4+2](1) = +1.;
193 qp_loc[i*4+2](2) = -1.;
195 qp_loc[i*4+3] = qp_loc_fe[i];
196 qp_loc[i*4+3](1) = -1.;
197 qp_loc[i*4+3](2) = -1.;
203 std::unique_ptr<MAST::BendingOperator1D>
212 const std::vector<Real> &JxW = fe->get_JxW();
213 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
215 n_phi = (
unsigned int)fe->n_shape_functions(),
234 vk_dvdxi_mat = RealMatrixX::Zero(n1,n3),
235 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
236 dstrain_dX = RealMatrixX::Zero(n1,n2),
237 dstress_dX = RealMatrixX::Zero(n1,n2),
238 mat_n1n2 = RealMatrixX::Zero(n1,n2),
239 eye = RealMatrixX::Identity(n1, n1),
240 dstrain_dX_3D= RealMatrixX::Zero(6,n2),
241 dstress_dX_3D= RealMatrixX::Zero(6,n2);
244 strain = RealVectorX::Zero(n1),
245 stress = RealVectorX::Zero(n1),
246 strain_bend = RealVectorX::Zero(n1),
247 strain_vk = RealVectorX::Zero(n3),
248 strain_3D = RealVectorX::Zero(6),
249 stress_3D = RealVectorX::Zero(6),
250 dstrain_dp = RealVectorX::Zero(n1),
251 dstress_dp = RealVectorX::Zero(n1),
252 vec1 = RealVectorX::Zero(n2),
253 vec2 = RealVectorX::Zero(n2);
295 *temp_func =
nullptr,
296 *ref_temp_func =
nullptr,
297 *alpha_func =
nullptr;
317 for (
unsigned int qp_loc_index=0; qp_loc_index<qp_loc_fe_size; qp_loc_index++)
318 for (
unsigned int section_qp_index=0; section_qp_index<n_added_qp; section_qp_index++)
320 qp = qp_loc_index*n_added_qp + section_qp_index;
323 mat_stiff(xyz[qp_loc_index],
_time, material_mat);
333 (*temp_func) (xyz[qp_loc_index],
_time, temp);
334 (*ref_temp_func)(xyz[qp_loc_index],
_time, ref_t);
335 (*alpha_func) (xyz[qp_loc_index],
_time, alpha);
336 strain(0) -= alpha*(temp-ref_t);
355 hy (xyz[qp_loc_index],
_time, y);
356 hz (xyz[qp_loc_index],
_time, z);
357 hy_off(xyz[qp_loc_index],
_time, y_off);
358 hz_off(xyz[qp_loc_index],
_time, z_off);
365 bend->initialize_bending_strain_operator_for_yz(*fe,
367 qp_loc[qp](1) * y/2.+y_off,
368 qp_loc[qp](2) * z/2.+z_off,
372 strain += strain_bend;
375 strain += strain_bend;
380 stress = material_mat * strain;
386 strain_3D(0) = strain(0);
387 stress_3D(0) = stress(0);
398 if (!request_derivative && !p)
411 if (request_derivative || p) {
421 dstrain_dX += mat_n1n2;
424 dstrain_dX += mat_n1n2;
429 dstrain_dX += mat_n1n2;
432 dstrain_dX += mat_n1n2;
436 dstress_dX = material_mat * dstrain_dX;
439 vec1 = dstress_dX.row(0);
441 dstress_dX_3D.row(0) = vec2;
442 vec1 = dstrain_dX.row(0);
444 dstrain_dX_3D.row(0) = vec2;
446 if (request_derivative)
463 dstrain_dp = RealVectorX::Zero(n1);
469 ref_temp_func->derivative(*p, xyz[qp_loc_index],
_time, dref_t);
470 alpha_func->derivative(*p, xyz[qp_loc_index],
_time, dalpha);
471 dstrain_dp(0) -= alpha*(dtemp-dref_t) + dalpha*(temp-ref_t);
479 hz.derivative(*p, xyz[qp_loc_index],
_time, z);
480 hy_off.derivative(*p, xyz[qp_loc_index],
_time, y_off);
481 hz_off.derivative(*p, xyz[qp_loc_index],
_time, z_off);
483 bend->initialize_bending_strain_operator_for_yz(*fe,
485 qp_loc[qp](1) * y/2.+y_off,
486 qp_loc[qp](2) * z/2.+z_off,
490 dstrain_dp += strain_bend;
493 dstrain_dp += strain_bend;
498 dstress_dp = material_mat * dstrain_dp;
508 dstress_dp += material_mat * strain;
520 stress_3D(0) = dstress_dp(0);
521 strain_3D(0) = dstrain_dp(0);
533 libmesh_assert(qp_loc.size() ==
538 return request_derivative || p;
554 const std::vector<Real>& JxW = fe->get_JxW();
555 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
557 n_phi = (
unsigned int)fe->get_phi().size(),
566 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
567 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
569 mat4_n3n2 = RealMatrixX::Zero(n3,2),
570 vk_dvdxi_mat = RealMatrixX::Zero(n1,n3),
571 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
572 stress = RealMatrixX::Zero(2,2),
573 stress_l = RealMatrixX::Zero(2,2),
574 local_jac = RealMatrixX::Zero(n2,n2);
577 vec1_n1 = RealVectorX::Zero(n1),
578 vec2_n1 = RealVectorX::Zero(n1),
579 vec3_n2 = RealVectorX::Zero(n2),
580 vec4_n3 = RealVectorX::Zero(n3),
581 vec5_n3 = RealVectorX::Zero(n3),
582 local_f = RealVectorX::Zero(n2);
605 std::unique_ptr<MAST::BendingOperator1D> bend;
610 fe->get_qpoints()).release());
613 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
618 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
621 (*mat_stiff_A)(xyz[qp],
_time, material_A_mat);
624 (*mat_stiff_B)(xyz[qp],
_time, material_B_mat);
625 (*mat_stiff_D)(xyz[qp],
_time, material_D_mat);
633 Bmat_mem, Bmat_bend_v, Bmat_bend_w,
634 Bmat_v_vk, Bmat_w_vk,
635 stress, stress_l, vk_dvdxi_mat, vk_dwdxi_mat,
637 material_B_mat, material_D_mat, vec1_n1,
638 vec2_n1, vec3_n2, vec4_n3,
639 vec5_n3, mat1_n1n2, mat2_n2n2,
647 if (bend.get() && bend->include_transverse_shear_energy())
648 bend->calculate_transverse_shear_residual(request_jacobian,
657 if (request_jacobian) {
663 double k_eps =
eps*(jac.diagonal().maxCoeff());
664 for (uint i=0; i<jac.rows(); i++)
666 if (std::abs(jac(i,i))<2.2204460492503131e-16)
675 return request_jacobian;
684 bool request_jacobian,
694 bool calculate =
false;
706 const std::vector<Real>& JxW = fe->get_JxW();
707 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
709 n_phi = (
unsigned int)fe->get_phi().size(),
718 material_trans_shear_mat,
719 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
720 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
722 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
723 vk_dvdxi_mat = RealMatrixX::Zero(n1,n3),
724 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
725 stress = RealMatrixX::Zero(2,2),
726 stress_l = RealMatrixX::Zero(2,2),
727 local_jac = RealMatrixX::Zero(n2,n2);
729 vec1_n1 = RealVectorX::Zero(n1),
730 vec2_n1 = RealVectorX::Zero(n1),
731 vec3_n2 = RealVectorX::Zero(n2),
732 vec4_n3 = RealVectorX::Zero(n3),
733 vec5_n3 = RealVectorX::Zero(n3),
734 local_f = RealVectorX::Zero(n2);
757 std::unique_ptr<MAST::BendingOperator1D> bend;
762 fe->get_qpoints()).release());
764 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
770 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
773 mat_stiff_A->derivative(p, xyz[qp],
_time, material_A_mat);
776 mat_stiff_B->derivative(p, xyz[qp],
_time, material_B_mat);
777 mat_stiff_D->derivative(p, xyz[qp],
_time, material_D_mat);
785 Bmat_mem, Bmat_bend_v, Bmat_bend_w,
786 Bmat_v_vk, Bmat_w_vk,
787 stress, stress_l, vk_dvdxi_mat, vk_dwdxi_mat,
789 material_B_mat, material_D_mat, vec1_n1,
790 vec2_n1, vec3_n2, vec4_n3,
791 vec5_n3, mat1_n1n2, mat2_n2n2,
797 if (bend.get() && bend->include_transverse_shear_energy())
798 bend->calculate_transverse_shear_residual_sensitivity(p,
807 if (request_jacobian) {
812 return request_jacobian;
826 const std::vector<Real>& JxW = fe->get_JxW();
827 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
829 n_phi = (
unsigned int)fe->get_phi().size(),
838 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
839 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
841 vk_dvdxi_mat_sens = RealMatrixX::Zero(n1,n3),
842 vk_dwdxi_mat_sens = RealMatrixX::Zero(n1,n3),
843 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
844 vk_dvdxi_mat = RealMatrixX::Zero(n1,n3),
845 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
846 stress = RealMatrixX::Zero(2,2),
847 local_jac = RealMatrixX::Zero(n2,n2);
849 vec1_n1 = RealVectorX::Zero(n1),
850 vec2_n1 = RealVectorX::Zero(n1),
851 vec3_n2 = RealVectorX::Zero(n2),
852 vec4_n3 = RealVectorX::Zero(n3),
853 vec5_n3 = RealVectorX::Zero(n3);
876 std::unique_ptr<MAST::BendingOperator1D> bend;
881 fe->get_qpoints()).release());
887 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
893 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
896 (*mat_stiff_A)(xyz[qp],
_time, material_A_mat);
898 (*mat_stiff_B)(xyz[qp],
_time, material_B_mat);
899 (*mat_stiff_D)(xyz[qp],
_time, material_D_mat);
906 vec2_n1 = material_A_mat * vec1_n1;
909 stress(0,0) = vec2_n1(0);
914 bend->initialize_bending_strain_operator(*fe, qp,
921 vec1_n1 = material_B_mat(0,0) * vec2_n1;
922 stress(0,0) += vec1_n1(0);
925 vec1_n1 = material_B_mat(0,1) * vec2_n1;
926 stress(0,0) += vec1_n1(0);
944 vec2_n1(0) = (vk_dvdxi_mat(0,0)*vk_dvdxi_mat_sens(0,0) +
945 vk_dwdxi_mat(0,0)*vk_dwdxi_mat_sens(0,0));
946 vec1_n1 = material_A_mat * vec2_n1;
947 stress(0,0) += vec1_n1(0);
957 local_jac += JxW[qp] * vk_dvdxi_mat_sens(0,0) * material_A_mat(0,0) * mat2_n2n2;
961 local_jac += JxW[qp] * vk_dwdxi_mat_sens(0,0) * material_A_mat(0,0) * mat2_n2n2;
965 local_jac += JxW[qp] * vk_dvdxi_mat_sens(0,0) * material_A_mat(0,0) * mat2_n2n2;
969 local_jac += JxW[qp] * vk_dwdxi_mat_sens(0,0) * material_A_mat(0,0) * mat2_n2n2;
973 local_jac += JxW[qp] * stress(0,0) * mat2_n2n2;
976 local_jac += JxW[qp] * vk_dvdxi_mat_sens(0,0) * vk_dvdxi_mat(0,0) * material_A_mat(0,0) * mat2_n2n2;
979 local_jac += JxW[qp] * vk_dvdxi_mat(0,0) * vk_dvdxi_mat_sens(0,0) * material_A_mat(0,0) * mat2_n2n2;
983 local_jac += JxW[qp] * stress(0,0) * mat2_n2n2;
986 local_jac += JxW[qp] * vk_dwdxi_mat(0,0) * vk_dwdxi_mat_sens(0,0) * material_A_mat(0,0) * mat2_n2n2;
989 local_jac += JxW[qp] * vk_dwdxi_mat(0,0) * vk_dwdxi_mat_sens(0,0) * material_A_mat(0,0) * mat2_n2n2;
993 local_jac += JxW[qp] * vk_dvdxi_mat(0,0) * vk_dwdxi_mat_sens(0,0) * material_A_mat(0,0) * mat2_n2n2;
996 local_jac += JxW[qp] * vk_dvdxi_mat_sens(0,0) * vk_dwdxi_mat(0,0) * material_A_mat(0,0) * mat2_n2n2;
999 local_jac += JxW[qp] * vk_dwdxi_mat(0,0) * vk_dvdxi_mat_sens(0,0) * material_A_mat(0,0) * mat2_n2n2;
1002 local_jac += JxW[qp] * vk_dwdxi_mat_sens(0,0) * vk_dvdxi_mat(0,0) * material_A_mat(0,0) * mat2_n2n2;
1006 local_jac += JxW[qp] * vk_dvdxi_mat_sens(0,0) * material_B_mat(0,0) * mat2_n2n2;
1009 local_jac += JxW[qp] * vk_dvdxi_mat_sens(0,0) * material_B_mat(0,1) * mat2_n2n2;
1013 local_jac += JxW[qp] * vk_dwdxi_mat_sens(0,0) * material_B_mat(0,0) * mat2_n2n2;
1016 local_jac += JxW[qp] * vk_dwdxi_mat_sens(0,0) * material_B_mat(0,1) * mat2_n2n2;
1020 local_jac += JxW[qp] * vk_dvdxi_mat_sens(0,0) * material_B_mat(0,1) * mat2_n2n2;
1023 local_jac += JxW[qp] * vk_dwdxi_mat_sens(0,0) * material_B_mat(0,0) * mat2_n2n2;
1027 local_jac += JxW[qp] * vk_dvdxi_mat_sens(0,0) * material_B_mat(0,1) * mat2_n2n2;
1030 local_jac += JxW[qp] * vk_dwdxi_mat_sens(0,0) * material_B_mat(0,1) * mat2_n2n2;
1045 const unsigned int n2,
1046 const unsigned int qp,
1048 const std::vector<Real>& JxW,
1049 bool request_jacobian,
1079 vec2_n1 = material_A_mat * vec1_n1;
1082 stress_l(0,0) = vec2_n1(0);
1083 stress(0,0) = vec2_n1(0);
1084 stress(1,1) = vec1_n1(0);
1085 stress(0,1) = vec2_n1(1);
1097 vec1_n1 = material_B_mat(0,0) * vec2_n1;
1098 stress_l(0,0) += vec1_n1(0);
1099 stress(0,0) += vec1_n1(0);
1102 vec1_n1 = material_B_mat(0,1) * vec2_n1;
1103 stress_l(0,0) += vec1_n1(0);
1104 stress(0,0) += vec1_n1(0);
1115 vec1_n1 = material_A_mat * vec2_n1;
1117 stress(0,0) += vec1_n1(0);
1119 stress(1,1) += vec2_n1(0);
1125 vec1_n1(0) = stress(0,0);
1126 vec1_n1(1) = stress(0,1);
1132 local_f += JxW[qp] * vec3_n2;
1138 local_f += JxW[qp] * vk_dvdxi_mat(0,0) * vec3_n2;
1142 local_f += JxW[qp] * vk_dwdxi_mat(0,0) * vec3_n2;
1146 vec2_n1(0) = stress(1,1);
1151 local_f += JxW[qp] * material_B_mat(0,0) * vec3_n2;
1154 local_f += JxW[qp] * material_B_mat(0,1) * vec3_n2;
1160 local_f += JxW[qp] * material_D_mat(0,0) * vec3_n2;
1165 local_f += JxW[qp] * material_D_mat(1,0) * vec3_n2;
1170 local_f += JxW[qp] * material_D_mat(1,1) * vec3_n2;
1175 local_f += JxW[qp] * material_D_mat(0,1) * vec3_n2;
1178 if (request_jacobian) {
1182 local_jac += JxW[qp] * mat2_n2n2;
1188 local_jac += JxW[qp] * vk_dvdxi_mat(0,0) * material_A_mat(0,0) * mat2_n2n2;
1192 local_jac += JxW[qp] * vk_dwdxi_mat(0,0) * material_A_mat(0,0) * mat2_n2n2;
1196 local_jac += JxW[qp] * vk_dvdxi_mat(0,0) * material_A_mat(0,0) * mat2_n2n2;
1200 local_jac += JxW[qp] * vk_dwdxi_mat(0,0) * material_A_mat(0,0) * mat2_n2n2;
1204 local_jac += JxW[qp] * stress(0,0) * mat2_n2n2;
1207 local_jac += JxW[qp] * vk_dvdxi_mat(0,0) * vk_dvdxi_mat(0,0) * material_A_mat(0,0) * mat2_n2n2;
1211 local_jac += JxW[qp] * stress(0,0) * mat2_n2n2;
1214 local_jac += JxW[qp] * vk_dwdxi_mat(0,0) * vk_dwdxi_mat(0,0) * material_A_mat(0,0) * mat2_n2n2;
1218 local_jac += JxW[qp] * vk_dvdxi_mat(0,0) * vk_dwdxi_mat(0,0) * material_A_mat(0,0) * mat2_n2n2;
1221 local_jac += JxW[qp] * vk_dwdxi_mat(0,0) * vk_dvdxi_mat(0,0) * material_A_mat(0,0) * mat2_n2n2;
1225 local_jac += JxW[qp] * vk_dvdxi_mat(0,0) * material_B_mat(0,0) * mat2_n2n2;
1228 local_jac += JxW[qp] * vk_dvdxi_mat(0,0) * material_B_mat(0,1) * mat2_n2n2;
1232 local_jac += JxW[qp] * vk_dwdxi_mat(0,0) * material_B_mat(0,0) * mat2_n2n2;
1235 local_jac += JxW[qp] * vk_dwdxi_mat(0,0) * material_B_mat(0,1) * mat2_n2n2;
1239 local_jac += JxW[qp] * vk_dvdxi_mat(0,0) * material_B_mat(0,0) * mat2_n2n2;
1242 local_jac += JxW[qp] * vk_dwdxi_mat(0,0) * material_B_mat(0,0) * mat2_n2n2;
1246 local_jac += JxW[qp] * vk_dvdxi_mat(0,0) * material_B_mat(0,1) * mat2_n2n2;
1249 local_jac += JxW[qp] * vk_dwdxi_mat(0,0) * material_B_mat(0,1) * mat2_n2n2;
1254 local_jac += JxW[qp] * material_B_mat(0,0) * mat2_n2n2;
1257 local_jac += JxW[qp] * material_B_mat(0,1) * mat2_n2n2;
1261 local_jac += JxW[qp] * material_B_mat(0, 0) * mat2_n2n2;
1264 local_jac += JxW[qp] * material_B_mat(0, 1) * mat2_n2n2;
1268 local_jac += JxW[qp] * material_D_mat(0,0) * mat2_n2n2;
1271 local_jac += JxW[qp] * material_D_mat(1,1) * mat2_n2n2;
1274 local_jac += JxW[qp] * material_D_mat(1, 0) * mat2_n2n2;
1277 local_jac += JxW[qp] * material_D_mat(0, 1) * mat2_n2n2;
1288 libmesh_assert_equal_to(mat.rows(), 2);
1289 libmesh_assert_equal_to(mat.cols(), 2);
1290 vec = RealVectorX::Zero(2);
1299 libmesh_assert_equal_to(mat.rows(), 2);
1300 libmesh_assert_equal_to(mat.cols(), 2);
1301 vec = RealVectorX::Zero(2);
1320 const std::vector<Real>& JxW = fe->get_JxW();
1321 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1323 n_phi = (
unsigned int)fe->get_phi().size(),
1329 mat2_n2n2 = RealMatrixX::Zero(n2, n2),
1331 vk_dvdxi_mat = RealMatrixX::Zero(n1, n3),
1332 vk_dwdxi_mat = RealMatrixX::Zero(n1, n3),
1333 local_jac = RealMatrixX::Zero(n2, n2),
1337 vec2_n1 = RealVectorX::Zero(n1),
1338 vec3_n2 = RealVectorX::Zero(n2),
1339 vec4_n3 = RealVectorX::Zero(n3),
1340 vec5_n3 = RealVectorX::Zero(n3),
1341 local_f = RealVectorX::Zero(n2),
1346 local_jac.setZero();
1366 std::unique_ptr<MAST::BendingOperator1D> bend;
1371 fe->get_qpoints()).release());
1373 std::unique_ptr<MAST::FieldFunction<RealMatrixX> >
1378 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
1380 (*prestress_A)(xyz[qp],
_time, prestress_mat_A);
1381 (*prestress_B)(xyz[qp],
_time, prestress_mat_B);
1390 bend->initialize_bending_strain_operator(*fe, qp,
1408 local_f += JxW[qp] * vec3_n2;
1413 vec4_n3 = vk_dvdxi_mat.transpose() * prestress_vec_A;
1415 local_f += JxW[qp] * vec3_n2;
1418 vec4_n3 = vk_dwdxi_mat.transpose() * prestress_vec_A;
1420 local_f += JxW[qp] * vec3_n2;
1425 local_f += JxW[qp] * vec3_n2;
1427 local_f += JxW[qp] * vec3_n2;
1430 if (request_jacobian) {
1431 if (bend.get() && if_vk) {
1433 mat3 = RealMatrixX::Zero(2, n2);
1436 local_jac += JxW[qp] * mat2_n2n2;
1439 mat3 = RealMatrixX::Zero(2, n2);
1442 local_jac += JxW[qp] * mat2_n2n2;
1450 if (request_jacobian && if_vk) {
1456 return (request_jacobian);
1465 bool request_jacobian,
1476 const std::vector<Real>& JxW = fe->get_JxW();
1477 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1479 n_phi = (
unsigned int)fe->get_phi().size(),
1485 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
1487 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
1488 vk_dvdxi_mat = RealMatrixX::Zero(n1,n3),
1489 local_jac = RealMatrixX::Zero(n2,n2),
1493 vec2_n1 = RealVectorX::Zero(n1),
1494 vec3_n2 = RealVectorX::Zero(n2),
1495 vec4_n3 = RealVectorX::Zero(n3),
1496 vec5_n3 = RealVectorX::Zero(n3),
1497 local_f = RealVectorX::Zero(n2),
1502 local_jac.setZero();
1522 std::unique_ptr<MAST::BendingOperator1D> bend;
1527 fe->get_qpoints()).release());
1529 std::unique_ptr<MAST::FieldFunction<RealMatrixX> >
1534 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
1536 prestress_A->derivative(p, xyz[qp],
_time, prestress_mat_A);
1537 prestress_B->derivative(p, xyz[qp],
_time, prestress_mat_B);
1546 bend->initialize_bending_strain_operator(*fe, qp,
1564 local_f += JxW[qp] * vec3_n2;
1569 vec4_n3 = vk_dvdxi_mat.transpose() * prestress_vec_A;
1571 local_f += JxW[qp] * vec3_n2;
1574 vec4_n3 = vk_dwdxi_mat.transpose() * prestress_vec_A;
1576 local_f += JxW[qp] * vec3_n2;
1581 local_f += JxW[qp] * vec3_n2;
1583 local_f += JxW[qp] * vec3_n2;
1586 if (request_jacobian) {
1587 if (bend.get() && if_vk) {
1589 mat3 = RealMatrixX::Zero(2, n2);
1592 local_jac += JxW[qp] * mat2_n2n2;
1595 mat3 = RealMatrixX::Zero(2, n2);
1598 local_jac += JxW[qp] * mat2_n2n2;
1606 if (request_jacobian && if_vk) {
1612 return (request_jacobian);
1623 const unsigned int side,
1631 const std::vector<Real> &JxW = fe->get_JxW();
1632 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1633 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1634 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
1636 n_phi = (
unsigned int)phi.size(),
1654 phi_vec = RealVectorX::Zero(n_phi),
1655 force = RealVectorX::Zero(2*n1),
1656 local_f = RealVectorX::Zero(n2),
1657 vec_n2 = RealVectorX::Zero(n2);
1659 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1662 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1663 phi_vec(i_nd) = phi[i_nd][qp];
1665 Bmat.
reinit(2*n1, phi_vec);
1668 p_func(qpoint[qp],
_time, press);
1669 A_func(qpoint[qp],
_time, A_val);
1672 for (
unsigned int i_dim=0; i_dim<n1; i_dim++)
1673 force(i_dim) = (press*A_val) * face_normals[qp](i_dim);
1677 local_f += JxW[qp] * vec_n2;
1689 return (request_jacobian);
1699 bool request_jacobian,
1702 const unsigned int side,
1710 const std::vector<Real> &JxW = fe->get_JxW();
1711 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
1712 const std::vector<std::vector<Real> >& phi = fe->get_phi();
1713 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_local_coordinate();
1715 n_phi = (
unsigned int)phi.size(),
1735 phi_vec = RealVectorX::Zero(n_phi),
1736 force = RealVectorX::Zero(2*n1),
1737 local_f = RealVectorX::Zero(n2),
1738 vec_n2 = RealVectorX::Zero(n2);
1740 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
1743 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1744 phi_vec(i_nd) = phi[i_nd][qp];
1746 Bmat.
reinit(2*n1, phi_vec);
1749 p_func(qpoint[qp],
_time, press);
1751 A_func(qpoint[qp],
_time, A_val);
1755 for (
unsigned int i_dim=0; i_dim<n1; i_dim++)
1756 force(i_dim) = (press*dA_val + dpress*A_val) * face_normals[qp](i_dim);
1760 local_f += JxW[qp] * vec_n2;
1772 return (request_jacobian);
1790 const std::vector<Real>& JxW = fe->get_JxW();
1791 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1793 n_phi = (
unsigned int)fe->get_phi().size(),
1801 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
1802 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
1804 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
1805 vk_dvdxi_mat = RealMatrixX::Zero(n1,n3),
1806 vk_dwdxi_mat = RealMatrixX::Zero(n1,n3),
1807 stress = RealMatrixX::Zero(2,2),
1808 local_jac = RealMatrixX::Zero(n2, n2);
1810 vec1_n1 = RealVectorX::Zero(n1),
1811 vec2_n1 = RealVectorX::Zero(n1),
1812 vec3_n2 = RealVectorX::Zero(n2),
1813 vec4_2 = RealVectorX::Zero(2),
1814 vec5_n3 = RealVectorX::Zero(n3),
1815 local_f = RealVectorX::Zero(n2),
1816 delta_t = RealVectorX::Zero(1);
1819 local_jac.setZero();
1839 std::unique_ptr<MAST::BendingOperator1D> bend;
1844 fe->get_qpoints()).release());
1846 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
1860 if (bc.
contains(
"thermal_jacobian_scaling"))
1863 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
1866 (*expansion_A)(xyz[qp],
_time, material_exp_A_mat);
1867 (*expansion_B)(xyz[qp],
_time, material_exp_B_mat);
1870 temp_func (xyz[qp], _time, t);
1871 ref_temp_func(xyz[qp], _time, t0);
1874 vec1_n1 = material_exp_A_mat * delta_t;
1875 stress(0,0) = vec1_n1(0);
1876 vec2_n1 = material_exp_B_mat * delta_t;
1882 local_f += JxW[qp] * vec3_n2;
1886 bend->initialize_bending_strain_operator(*fe, qp,
1890 local_f += JxW[qp] * vec3_n2;
1892 local_f += JxW[qp] * vec3_n2;
1905 vec4_2 = vk_dvdxi_mat.transpose() * vec1_n1;
1907 local_f += JxW[qp] * vec3_n2;
1910 vec4_2 = vk_dwdxi_mat.transpose() * vec1_n1;
1912 local_f += JxW[qp] * vec3_n2;
1915 if (request_jacobian && if_vk) {
1918 mat3 = RealMatrixX::Zero(2, n2);
1921 local_jac += JxW[qp] * mat2_n2n2;
1924 mat3 = RealMatrixX::Zero(2, n2);
1927 local_jac += JxW[qp] * mat2_n2n2;
1936 if (request_jacobian && if_vk) {
1938 jac -= scaling * mat2_n2n2;
1942 return request_jacobian;
1950 bool request_jacobian,
1959 const std::vector<Real>& JxW = fe->get_JxW();
1960 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1962 n_phi = (
unsigned int)fe->get_phi().size(),
1970 material_exp_A_mat_sens,
1971 material_exp_B_mat_sens,
1972 mat1_n1n2 = RealMatrixX::Zero(n1,n2),
1973 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
1975 mat4_n3n2 = RealMatrixX::Zero(n3,n2),
1976 vk_dvdxi_mat = RealMatrixX::Zero(2,2),
1977 vk_dwdxi_mat = RealMatrixX::Zero(2,2),
1978 stress = RealMatrixX::Zero(2,2),
1979 local_jac = RealMatrixX::Zero(n2,n2);
1981 vec1_n1 = RealVectorX::Zero(n1),
1982 vec2_n1 = RealVectorX::Zero(n1),
1983 vec3_n2 = RealVectorX::Zero(n2),
1984 vec4_2 = RealVectorX::Zero(2),
1985 vec5_n1 = RealVectorX::Zero(n1),
1986 local_f = RealVectorX::Zero(n2),
1987 delta_t = RealVectorX::Zero(1),
1988 delta_t_sens = RealVectorX::Zero(1);
2008 std::unique_ptr<MAST::BendingOperator1D> bend;
2013 fe->get_qpoints()).release());
2015 std::unique_ptr<MAST::FieldFunction<RealMatrixX > >
2024 Real t, t0, t_sens, t0_sens;
2026 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
2029 (*expansion_A)(xyz[qp],
_time, material_exp_A_mat);
2030 (*expansion_B)(xyz[qp],
_time, material_exp_B_mat);
2031 expansion_A->
derivative(p, xyz[qp], _time, material_exp_A_mat_sens);
2032 expansion_B->derivative(p, xyz[qp], _time, material_exp_B_mat_sens);
2035 temp_func(xyz[qp], _time, t);
2036 temp_func.
derivative(p, xyz[qp], _time, t_sens);
2037 ref_temp_func(xyz[qp], _time, t0);
2038 ref_temp_func.derivative(p, xyz[qp], _time, t0_sens);
2040 delta_t_sens(0) = t_sens-t0_sens;
2043 vec1_n1 = material_exp_A_mat * delta_t_sens;
2044 vec2_n1 = material_exp_A_mat_sens * delta_t;
2046 stress(0,0) = vec1_n1(0);
2049 vec2_n1 = material_exp_B_mat * delta_t_sens;
2050 vec5_n1 = material_exp_B_mat_sens * delta_t;
2058 local_f += JxW[qp] * vec3_n2;
2062 bend->initialize_bending_strain_operator(*fe, qp,
2066 local_f += JxW[qp] * vec3_n2;
2068 local_f += JxW[qp] * vec3_n2;
2081 vec4_2 = vk_dvdxi_mat.transpose() * vec1_n1;
2083 local_f += JxW[qp] * vec3_n2;
2086 vec4_2 = vk_dwdxi_mat.transpose() * vec1_n1;
2088 local_f += JxW[qp] * vec3_n2;
2091 if (request_jacobian && if_vk) {
2093 mat3 = RealMatrixX::Zero(2, n2);
2096 local_jac += JxW[qp] * mat2_n2n2;
2099 mat3 = RealMatrixX::Zero(2, n2);
2102 local_jac += JxW[qp] * mat2_n2n2;
2111 if (request_jacobian && if_vk) {
2117 return request_jacobian;
2136 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
true,
false));
2138 const std::vector<Real> &JxW = fe->get_JxW();
2139 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
2140 const std::vector<std::vector<Real> >& phi = fe->get_phi();
2142 n_phi = (
unsigned int)phi.size(),
2156 dwdx_p (
"dwdx", 0.),
2157 dwdt_p (
"dwdt", 0.);
2160 dwdx_f (
"dwdx", dwdx_p),
2161 dwdt_f (
"dwdx", dwdt_p);
2163 std::unique_ptr<MAST::FieldFunction<Real> >
2178 phi_vec = RealVectorX::Zero(n_phi),
2179 force = RealVectorX::Zero(n1),
2180 local_f = RealVectorX::Zero(n2),
2181 vec_n1 = RealVectorX::Zero(n1),
2182 vec_n2 = RealVectorX::Zero(n2),
2183 vel = RealVectorX::Zero(3),
2184 p_val = RealVectorX::Zero(3),
2185 normal = RealVectorX::Zero(3),
2186 dummy = RealVectorX::Zero(2);
2195 dvdx = RealMatrixX::Zero(2,2),
2196 dwdx = RealMatrixX::Zero(2,2),
2197 local_jac = RealMatrixX::Zero(n2,n2),
2198 local_jac_xdot = RealMatrixX::Zero(n2,n2),
2199 mat_n2n2 = RealMatrixX::Zero(n2,n2);
2202 for (
unsigned int qp=0; qp<qpoint.size(); qp++)
2206 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
2207 phi_vec(i_nd) = phi[i_nd][qp];
2210 Bmat_v.set_shape_function(0, 1, phi_vec);
2212 Bmat_w.set_shape_function(1, 2, phi_vec);
2235 (*pressure)(qpoint[qp],
_time, p_val(1));
2240 (*pressure)(qpoint[qp],
_time, p_val(2));
2245 force(0) = p_val(1) * normal(1);
2246 Bmat_v.vector_mult_transpose(vec_n2, force);
2247 local_f += JxW[qp] * vec_n2;
2251 force(1) = p_val(2) * normal(2);
2252 Bmat_v.vector_mult_transpose(vec_n2, force);
2253 local_f += JxW[qp] * vec_n2;
2257 if (request_jacobian) {
2262 (*dpressure_dxdot)(qpoint[qp],
_time, p_val(1));
2265 Bmat_v.right_multiply_transpose(mat_n2n2, Bmat_v);
2266 local_jac_xdot += JxW[qp] * p_val(1) * normal(1) * mat_n2n2;
2269 (*dpressure_dx)(qpoint[qp],
_time, p_val(1));
2271 Bmat_v.right_multiply_transpose(mat_n2n2, Bmat_dvdx);
2272 local_jac += (JxW[qp] * p_val(1) * normal(1)) * mat_n2n2;
2277 (*dpressure_dxdot)(qpoint[qp],
_time, p_val(2));
2280 Bmat_w.right_multiply_transpose(mat_n2n2, Bmat_w);
2281 local_jac_xdot += JxW[qp] * p_val(2) * normal(2) * mat_n2n2;
2284 (*dpressure_dx)(qpoint[qp],
_time, p_val(2));
2285 Bmat_w.right_multiply_transpose(mat_n2n2, Bmat_dwdx);
2286 local_jac += (JxW[qp] * p_val(2) * normal(2)) * mat_n2n2;
2296 if (request_jacobian) {
2298 jac_xdot -= mat_n2n2;
2304 return (request_jacobian);
2319 bool request_jacobian,
2328 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
true,
false));
2330 const std::vector<Real> &JxW = fe->get_JxW();
2331 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
2332 const std::vector<std::vector<Real> >& phi = fe->get_phi();
2334 n_phi = (
unsigned int)phi.size(),
2348 dwdx_p (
"dwdx", 0.),
2349 dwdt_p (
"dwdt", 0.);
2352 dwdx_f (
"dwdx", dwdx_p),
2353 dwdt_f (
"dwdx", dwdt_p);
2355 std::unique_ptr<MAST::FieldFunction<Real> >
2370 phi_vec = RealVectorX::Zero(n_phi),
2371 force = RealVectorX::Zero(n1),
2372 local_f = RealVectorX::Zero(n2),
2373 vec_n1 = RealVectorX::Zero(n1),
2374 vec_n2 = RealVectorX::Zero(n2),
2375 vel = RealVectorX::Zero(3),
2376 p_val = RealVectorX::Zero(3),
2377 normal = RealVectorX::Zero(3),
2378 dummy = RealVectorX::Zero(2);
2387 dvdx = RealMatrixX::Zero(2,2),
2388 dwdx = RealMatrixX::Zero(2,2),
2389 local_jac = RealMatrixX::Zero(n2,n2),
2390 local_jac_xdot = RealMatrixX::Zero(n2,n2),
2391 mat_n2n2 = RealMatrixX::Zero(n2,n2);
2394 for (
unsigned int qp=0; qp<qpoint.size(); qp++)
2398 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
2399 phi_vec(i_nd) = phi[i_nd][qp];
2402 Bmat_v.set_shape_function(0, 1, phi_vec);
2404 Bmat_w.set_shape_function(1, 2, phi_vec);
2427 pressure->derivative(p, qpoint[qp],
_time, p_val(1));
2432 pressure->derivative(p, qpoint[qp],
_time, p_val(2));
2437 force(0) = p_val(1) * normal(1);
2438 Bmat_v.vector_mult_transpose(vec_n2, force);
2439 local_f += JxW[qp] * vec_n2;
2443 force(1) = p_val(2) * normal(2);
2444 Bmat_v.vector_mult_transpose(vec_n2, force);
2445 local_f += JxW[qp] * vec_n2;
2449 if (request_jacobian) {
2454 dpressure_dxdot->derivative(p, qpoint[qp],
_time, p_val(1));
2457 Bmat_v.right_multiply_transpose(mat_n2n2, Bmat_v);
2458 local_jac_xdot += JxW[qp] * p_val(1) * normal(1) * mat_n2n2;
2461 dpressure_dx->derivative(p, qpoint[qp],
_time, p_val(1));
2464 Bmat_v.right_multiply_transpose(mat_n2n2, Bmat_dvdx);
2465 local_jac += (JxW[qp] * p_val(1) * normal(1)) * mat_n2n2;
2470 dpressure_dxdot->derivative(p, qpoint[qp],
_time, p_val(2));
2473 Bmat_w.right_multiply_transpose(mat_n2n2, Bmat_w);
2474 local_jac_xdot += JxW[qp] * p_val(2) * normal(2) * mat_n2n2;
2477 dpressure_dx->derivative(p, qpoint[qp],
_time, p_val(2));
2478 Bmat_w.right_multiply_transpose(mat_n2n2, Bmat_dwdx);
2479 local_jac += (JxW[qp] * p_val(2) * normal(2)) * mat_n2n2;
2489 if (request_jacobian) {
2491 jac_xdot -= mat_n2n2;
2499 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
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > thermal_expansion_B_matrix(const MAST::ElementBase &e) const =0
virtual ~StructuralElement1D()
virtual bool is_shape_parameter() const
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
std::unique_ptr< MAST::FieldFunction< Real > > get_dpdxdot_function(const MAST::FieldFunction< Real > &dwdx, const MAST::FieldFunction< Real > &dwdt) const
Data structure provides the mechanism to store stress and strain output from a structural analysis...
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 const MAST::MaterialPropertyCardBase & get_material() const
return the material property.
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.
virtual bool if_prestressed() 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.
std::unique_ptr< MAST::FieldFunction< Real > > get_dpdx_function(const MAST::FieldFunction< Real > &dwdx, const MAST::FieldFunction< Real > &dwdt) const
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > stiffness_B_matrix(const MAST::ElementBase &e) const =0
virtual void derivative(const MAST::FunctionBase &f, ValType &v) const
calculates the value of the function derivative and returns it in v.
RealVectorX _local_sol_sens
local solution sensitivity
MAST::SystemInitialization & _system
SystemInitialization object associated with this element.
virtual const std::vector< std::vector< libMesh::RealVectorValue > > & get_dphi() const
unsigned int n_vars() const
virtual std::unique_ptr< MAST::FEBase > init_fe(bool init_grads, bool init_second_order_derivative, int extra_quadrature_order=0) const
initializes the finite element shape function and quadrature object with the order of quadrature rule...
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} .
bool contains(const std::string &nm) const
checks if the card contains the specified property value
bool follower_forces
flag for follower forces
Matrix< Real, Dynamic, Dynamic > RealMatrixX
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...
unsigned int n_stress_strain_data_for_elem(const MAST::GeomElem &e) const
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > stiffness_A_matrix(const MAST::ElementBase &e) const =0
void vector_mult_transpose(T &res, const T &v) const
res = v^T * [this]
Matrix< Real, Dynamic, 1 > RealVectorX
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > stiffness_D_matrix(const MAST::ElementBase &e) const =0
void right_multiply_transpose(T &r, const T &m) const
[R] = [this]^T * [M]
const MAST::ElementPropertyCardBase & _property
element property
This class provides a mechanism to store stress/strain values, their derivatives and sensitivity valu...
This class acts as a wrapper around libMesh::Elem for the purpose of providing a uniform interface fo...
const MAST::StrainType strain_type() const
returns the type of strain to be used for this element
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 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 vector_mult(T &res, const T &v) const
res = [this] * v
const ValType & get(const std::string &nm) const
returns a constant reference to the specified function
std::unique_ptr< MAST::FieldFunction< Real > > get_pressure_function(const MAST::FieldFunction< Real > &dwdx, const MAST::FieldFunction< Real > &dwdt) const
virtual std::unique_ptr< MAST::FEBase > init_side_fe(unsigned int s, bool init_grads, bool init_second_order_derivative, int extra_quadrature_order=0) const
initializes the finite element shape function and quadrature object for the side with the order of qu...
void set_derivatives(const RealMatrixX &dstress_dX, const RealMatrixX &dstrain_dX)
adds the derivative data
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > thermal_expansion_A_matrix(const MAST::ElementBase &e) const =0
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.
virtual MAST::StressStrainOutputBase::Data & get_stress_strain_data_for_elem_at_qp(const MAST::GeomElem &e, const unsigned int qp)
void transform_matrix_to_global_system(const ValType &local_mat, ValType &global_mat) const
void left_multiply(T &r, const T &m) const
[R] = [M] * [this]
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...
virtual MAST::StressStrainOutputBase::Data & add_stress_strain_at_qp_location(const MAST::GeomElem &e, const unsigned int qp, const libMesh::Point &quadrature_pt, const libMesh::Point &physical_pt, const RealVectorX &stress, const RealVectorX &strain, Real JxW)
add the stress tensor associated with the qp.
const Real & _time
time for which system is being assembled
virtual 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.
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.
StructuralElement1D(MAST::SystemInitialization &sys, const MAST::GeomElem &elem, const MAST::ElementPropertyCardBase &p)
virtual int extra_quadrature_order(const MAST::GeomElem &elem) const =0
returns the extra quadrature order (on top of the system) that this element should use...
void transform_vector_to_global_system(const ValType &local_vec, ValType &global_vec) const
virtual bool depends_on(const MAST::FunctionBase &f) const
returns true if the property card depends on the function f
void _convert_prestress_B_mat_to_vector(const RealMatrixX &mat, RealVectorX &vec) const
converts the prestress stress tensor to a vector representation
virtual bool internal_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the internal force vector and Jacobian due to strain energy.
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
void _convert_prestress_A_mat_to_vector(const RealMatrixX &mat, RealVectorX &vec) const
converts the prestress stress tensor to a vector representation