56 std::unique_ptr<MAST::FEBase>
59 const std::vector<Real>& JxW = fe->get_JxW();
60 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
61 const std::vector<std::vector<Real> >& phi = fe->get_phi();
64 n_phi = (
unsigned int)phi.size(),
70 mat1_n1n2 = RealMatrixX::Zero(n1, n2),
71 mat2_n2n2 = RealMatrixX::Zero(n2, n2);
73 phi_vec = RealVectorX::Zero(n_phi),
74 vec1_n1 = RealVectorX::Zero(n1),
75 vec2_n2 = RealVectorX::Zero(n2),
76 local_acc = RealVectorX::Zero(n2);
78 std::unique_ptr<MAST::FieldFunction<RealMatrixX> >
87 (*mat_inertia)(xyz[0],
_time, material_mat);
90 const unsigned int nshp = fe->n_shape_functions();
91 for (
unsigned int i=0; i<JxW.size(); i++)
94 for (
unsigned int i_var=0; i_var<3; i_var++)
95 for (
unsigned int i=0; i<nshp; i++)
96 jac_xddot(i_var*nshp+i, i_var*nshp+i) =
97 vol*material_mat(i_var, i_var);
99 f.topRows(n2) = jac_xddot.topLeftCorner(n2, n2) *
_local_accel.topRows(n2);
104 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
106 (*mat_inertia)(xyz[0],
_time, material_mat);
109 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
110 phi_vec(i_nd) = phi[i_nd][qp];
116 vec1_n1 = mat1_n1n2 * local_acc;
119 f.topRows(n2) += JxW[qp] * vec2_n2;
121 if (request_jacobian) {
125 jac_xddot.topLeftCorner(n2, n2) += JxW[qp]*mat2_n2n2;
130 return request_jacobian;
141 std::unique_ptr<MAST::FEBase>
144 const std::vector<Real>& JxW = fe->get_JxW();
145 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
147 n_phi = (
unsigned int)fe->n_shape_functions(),
155 mat_x = RealMatrixX::Zero(6,3),
156 mat_y = RealMatrixX::Zero(6,3),
157 mat_z = RealMatrixX::Zero(6,3),
158 mat1_n1n2 = RealMatrixX::Zero(n1, n2),
159 mat2_n2n2 = RealMatrixX::Zero(n2, n2),
160 mat3_3n2 = RealMatrixX::Zero(3, n2),
161 mat4_33 = RealMatrixX::Zero(3, 3),
162 mat5_n1n3 = RealMatrixX::Zero(n1, n3),
163 mat6_n2n3 = RealMatrixX::Zero(n2, n3),
164 mat7_3n3 = RealMatrixX::Zero(3, n3),
165 Gmat = RealMatrixX::Zero(6, n3),
166 K_alphaalpha = RealMatrixX::Zero(n3, n3),
167 K_ualpha = RealMatrixX::Zero(n2, n3),
168 K_corr = RealMatrixX::Zero(n2, n2);
170 strain = RealVectorX::Zero(6),
171 stress = RealVectorX::Zero(6),
172 vec1_n1 = RealVectorX::Zero(n1),
173 vec2_n2 = RealVectorX::Zero(n2),
174 vec3_3 = RealVectorX::Zero(3),
175 local_disp= RealVectorX::Zero(n2),
176 f_alpha = RealVectorX::Zero(n3),
177 alpha = RealVectorX::Zero(n3);
180 local_disp.topRows(n2) =
_local_sol.topRows(n2);
182 std::unique_ptr<MAST::FieldFunction<RealMatrixX> > mat_stiff =
195 Bmat_lin.
reinit(n1, 3, n_nodes);
196 Bmat_nl_x.
reinit(3, 3, n_nodes);
197 Bmat_nl_y.
reinit(3, 3, n_nodes);
198 Bmat_nl_z.
reinit(3, 3, n_nodes);
199 Bmat_nl_u.
reinit(3, 3, n_nodes);
200 Bmat_nl_v.
reinit(3, 3, n_nodes);
201 Bmat_nl_w.
reinit(3, 3, n_nodes);
202 Bmat_inc.
reinit(n1, n3, 1);
270 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
273 (*mat_stiff)(xyz[qp],
_time, material_mat);
290 stress = material_mat * (strain + Gmat * alpha);
293 f_alpha += JxW[qp] * Gmat.transpose() * stress;
298 f.topRows(n2) += JxW[qp] * vec2_n2;
304 vec3_3 = mat_x.transpose() * stress;
306 f.topRows(n2) += JxW[qp] * vec2_n2;
309 vec3_3 = mat_y.transpose() * stress;
311 f.topRows(n2) += JxW[qp] * vec2_n2;
314 vec3_3 = mat_z.transpose() * stress;
316 f.topRows(n2) += JxW[qp] * vec2_n2;
319 if (request_jacobian) {
330 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
335 mat3_3n2 = mat_x.transpose() * mat1_n1n2;
337 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
340 mat3_3n2 = mat_y.transpose() * mat1_n1n2;
342 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
345 mat3_3n2 = mat_z.transpose() * mat1_n1n2;
347 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
350 for (
unsigned int i_dim=0; i_dim<3; i_dim++) {
366 mat1_n1n2 = material_mat * mat1_n1n2;
368 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
371 mat3_3n2 = mat_x.transpose() * mat1_n1n2;
373 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
376 mat3_3n2 = mat_y.transpose() * mat1_n1n2;
378 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
381 mat3_3n2 = mat_z.transpose() * mat1_n1n2;
383 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
389 mat4_33(0,0) = stress(0);
390 mat4_33(1,1) = stress(1);
391 mat4_33(2,2) = stress(2);
392 mat4_33(0,1) = mat4_33(1,0) = stress(3);
393 mat4_33(1,2) = mat4_33(2,1) = stress(4);
394 mat4_33(0,2) = mat4_33(2,0) = stress(5);
399 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
404 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
409 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
416 if (request_jacobian)
417 jac.bottomRightCorner(n2, n2) += RealMatrixX::Identity(n2, n2) *
418 1.0e-20 * jac.diagonal().maxCoeff();
423 return request_jacobian;
433 std::unique_ptr<MAST::FEBase>
436 const std::vector<Real>& JxW = fe->get_JxW();
437 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
439 n_phi = (
unsigned int)fe->n_shape_functions(),
447 mat_x = RealMatrixX::Zero(6,3),
448 mat_y = RealMatrixX::Zero(6,3),
449 mat_z = RealMatrixX::Zero(6,3),
450 mat1_n1n2 = RealMatrixX::Zero(n1, n2),
451 mat2_n2n2 = RealMatrixX::Zero(n2, n2),
452 mat3_3n2 = RealMatrixX::Zero(3, n2),
453 mat4_33 = RealMatrixX::Zero(3, 3),
454 mat5_n1n3 = RealMatrixX::Zero(n1, n3),
455 mat6_n2n3 = RealMatrixX::Zero(n2, n3),
456 mat7_3n3 = RealMatrixX::Zero(3, n3),
457 Gmat = RealMatrixX::Zero(6, n3),
458 K_alphaalpha = RealMatrixX::Zero(n3, n3),
459 K_ualpha = RealMatrixX::Zero(n2, n3),
460 K_corr = RealMatrixX::Zero(n2, n2);
462 strain = RealVectorX::Zero(6),
463 stress = RealVectorX::Zero(6),
464 vec1_n1 = RealVectorX::Zero(n1),
465 vec2_n2 = RealVectorX::Zero(n2),
466 vec3_3 = RealVectorX::Zero(3),
467 local_disp= RealVectorX::Zero(n2),
468 f = RealVectorX::Zero(n3),
469 alpha = RealVectorX::Zero(n3);
472 local_disp.topRows(n2) =
_local_sol.topRows(n2);
474 std::unique_ptr<MAST::FieldFunction<RealMatrixX> > mat_stiff =
487 Bmat_lin.
reinit(n1, 3, n_nodes);
488 Bmat_nl_x.
reinit(3, 3, n_nodes);
489 Bmat_nl_y.
reinit(3, 3, n_nodes);
490 Bmat_nl_z.
reinit(3, 3, n_nodes);
491 Bmat_nl_u.
reinit(3, 3, n_nodes);
492 Bmat_nl_v.
reinit(3, 3, n_nodes);
493 Bmat_nl_w.
reinit(3, 3, n_nodes);
494 Bmat_inc.
reinit(n1, n3, 1);
502 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
505 (*mat_stiff)(xyz[qp],
_time, material_mat);
522 stress = material_mat * (strain + Gmat * alpha);
525 f += JxW[qp] * Gmat.transpose() * stress;
529 mat5_n1n3 = material_mat * Gmat;
530 K_alphaalpha += JxW[qp] * ( Gmat.transpose() * mat5_n1n3);
535 K_ualpha += JxW[qp] * mat6_n2n3;
541 mat7_3n3 = mat_x.transpose() * mat5_n1n3;
543 K_ualpha += JxW[qp] * mat6_n2n3;
546 mat7_3n3 = mat_y.transpose() * mat5_n1n3;
548 K_ualpha += JxW[qp] * mat6_n2n3;
551 mat7_3n3 = mat_z.transpose() * mat5_n1n3;
553 K_ualpha += JxW[qp] * mat6_n2n3;
559 K_alphaalpha = K_alphaalpha.inverse();
562 alpha += K_alphaalpha * (-f - K_ualpha.transpose() * dsol.topRows(n2));
569 bool request_jacobian,
573 return request_jacobian;
584 return request_jacobian;
591 bool request_jacobian,
595 return request_jacobian;
606 const unsigned int side,
612 std::unique_ptr<MAST::FEBase>
615 const std::vector<Real> &JxW = fe->get_JxW();
616 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
617 const std::vector<std::vector<Real> >& phi = fe->get_phi();
618 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_reference_coordinate();
620 n_phi = (
unsigned int)phi.size(),
634 phi_vec = RealVectorX::Zero(n_phi),
635 force = RealVectorX::Zero(n1),
636 local_f = RealVectorX::Zero(n2),
637 vec_n2 = RealVectorX::Zero(n2);
639 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
642 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
643 phi_vec(i_nd) = phi[i_nd][qp];
645 Bmat.reinit(n1, phi_vec);
648 func(qpoint[qp],
_time, press);
651 for (
unsigned int i_dim=0; i_dim<n1; i_dim++)
652 force(i_dim) = press * face_normals[qp](i_dim);
654 Bmat.vector_mult_transpose(vec_n2, force);
656 local_f += JxW[qp] * vec_n2;
659 f.topRows(n2) -= local_f;
661 return (request_jacobian);
671 bool request_jacobian,
674 const unsigned int side,
680 std::unique_ptr<MAST::FEBase>
683 const std::vector<Real> &JxW = fe->get_JxW();
684 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
685 const std::vector<std::vector<Real> >& phi = fe->get_phi();
686 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_reference_coordinate();
688 n_phi = (
unsigned int)phi.size(),
702 phi_vec = RealVectorX::Zero(n_phi),
703 force = RealVectorX::Zero(2*n1),
704 local_f = RealVectorX::Zero(n2),
705 vec_n2 = RealVectorX::Zero(n2);
707 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
710 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
711 phi_vec(i_nd) = phi[i_nd][qp];
713 Bmat.reinit(2*n1, phi_vec);
719 for (
unsigned int i_dim=0; i_dim<n1; i_dim++)
720 force(i_dim) = press * face_normals[qp](i_dim);
722 Bmat.vector_mult_transpose(vec_n2, force);
724 local_f += JxW[qp] * vec_n2;
729 return (request_jacobian);
742 std::unique_ptr<MAST::FEBase>
745 const std::vector<Real>& JxW = fe->get_JxW();
746 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
749 n_phi = (
unsigned int)fe->get_phi().size(),
756 mat_x = RealMatrixX::Zero(6,3),
757 mat_y = RealMatrixX::Zero(6,3),
758 mat_z = RealMatrixX::Zero(6,3),
759 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
760 mat3_3n2 = RealMatrixX::Zero(3,n2),
761 mat4_33 = RealMatrixX::Zero(3,3);
763 vec1_n1 = RealVectorX::Zero(n1),
764 vec2_3 = RealVectorX::Zero(3),
765 vec3_n2 = RealVectorX::Zero(n2),
766 delta_t = RealVectorX::Zero(1),
767 local_disp= RealVectorX::Zero(n2),
768 strain = RealVectorX::Zero(6);
771 local_disp.topRows(n2) =
_local_sol.topRows(n2);
782 Bmat_lin.
reinit(n1, 3, n_nodes);
783 Bmat_nl_x.
reinit(3, 3, n_nodes);
784 Bmat_nl_y.
reinit(3, 3, n_nodes);
785 Bmat_nl_z.
reinit(3, 3, n_nodes);
786 Bmat_nl_u.
reinit(3, 3, n_nodes);
787 Bmat_nl_v.
reinit(3, 3, n_nodes);
788 Bmat_nl_w.
reinit(3, 3, n_nodes);
790 std::unique_ptr<MAST::FieldFunction<RealMatrixX> >
799 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
801 (*mat) (xyz[qp],
_time, material_exp_A_mat);
802 temp_func (xyz[qp], _time, t);
803 ref_temp_func(xyz[qp], _time, t0);
806 vec1_n1 = material_exp_A_mat * delta_t;
823 f.topRows(n2) -= JxW[qp] * vec3_n2;
829 vec2_3 = mat_x.transpose() * vec1_n1;
831 f.topRows(n2) -= JxW[qp] * vec3_n2;
834 vec2_3 = mat_y.transpose() * vec1_n1;
836 f.topRows(n2) -= JxW[qp] * vec3_n2;
839 vec2_3 = mat_z.transpose() * vec1_n1;
841 f.topRows(n2) -= JxW[qp] * vec3_n2;
844 if (request_jacobian) {
848 mat4_33(0,0) = vec1_n1(0);
849 mat4_33(1,1) = vec1_n1(1);
850 mat4_33(2,2) = vec1_n1(2);
851 mat4_33(0,1) = mat4_33(1,0) = vec1_n1(3);
852 mat4_33(1,2) = mat4_33(2,1) = vec1_n1(4);
853 mat4_33(0,2) = mat4_33(2,0) = vec1_n1(5);
858 jac.topLeftCorner(n2, n2) -= JxW[qp] * mat2_n2n2;
863 jac.topLeftCorner(n2, n2) -= JxW[qp] * mat2_n2n2;
868 jac.topLeftCorner(n2, n2) -= JxW[qp] * mat2_n2n2;
874 return request_jacobian;
881 bool request_jacobian,
901 const unsigned int side,
907 return (request_jacobian);
915 bool request_jacobian,
919 const unsigned int side,
925 return (request_jacobian);
937 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
true,
false));
938 std::vector<libMesh::Point> qp_loc = fe->get_qpoints();
944 const std::vector<Real> &JxW = fe->get_JxW();
945 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
947 n_phi = (
unsigned int)fe->n_shape_functions(),
955 mat_x = RealMatrixX::Zero(6,3),
956 mat_y = RealMatrixX::Zero(6,3),
957 mat_z = RealMatrixX::Zero(6,3),
958 Gmat = RealMatrixX::Zero(6, n3);
961 strain = RealVectorX::Zero(6),
962 stress = RealVectorX::Zero(6),
963 local_disp= RealVectorX::Zero(n2),
964 alpha = RealVectorX::Zero(n3);
967 local_disp.topRows(n2) =
_local_sol.topRows(n2);
969 std::unique_ptr<MAST::FieldFunction<RealMatrixX> > mat_stiff =
982 Bmat_lin.
reinit(n1, 3, n_nodes);
983 Bmat_nl_x.
reinit(3, 3, n_nodes);
984 Bmat_nl_y.
reinit(3, 3, n_nodes);
985 Bmat_nl_z.
reinit(3, 3, n_nodes);
986 Bmat_nl_u.
reinit(3, 3, n_nodes);
987 Bmat_nl_v.
reinit(3, 3, n_nodes);
988 Bmat_nl_w.
reinit(3, 3, n_nodes);
989 Bmat_inc.
reinit(n1, n3, 1);
1000 for (
unsigned int qp=0; qp<qp_loc.size(); qp++) {
1003 (*mat_stiff)(xyz[qp],
_time, material_mat);
1009 mat_x, mat_y, mat_z,
1020 strain += Gmat * alpha;
1021 stress = material_mat * strain;
1032 if (!request_derivative && !p)
1044 if (request_derivative) {
1050 return request_derivative;
1063 const std::vector<std::vector<libMesh::RealVectorValue> >&
1066 unsigned int n_phi = (
unsigned int)dphi.size();
1071 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1072 phi(i_nd) = dphi[i_nd][qp](0);
1078 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1079 phi(i_nd) = dphi[i_nd][qp](1);
1085 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1086 phi(i_nd) = dphi[i_nd][qp](2);
1116 const std::vector<std::vector<libMesh::RealVectorValue> >&
1119 unsigned int n_phi = (
unsigned int)dphi.size();
1123 libmesh_assert_equal_to(epsilon.size(), 6);
1124 libmesh_assert_equal_to(mat_x.rows(), 6);
1125 libmesh_assert_equal_to(mat_x.cols(), 3);
1126 libmesh_assert_equal_to(mat_y.rows(), 6);
1127 libmesh_assert_equal_to(mat_y.cols(), 3);
1128 libmesh_assert_equal_to(mat_z.rows(), 6);
1129 libmesh_assert_equal_to(mat_z.cols(), 3);
1130 libmesh_assert_equal_to(Bmat_lin.
m(), 6);
1131 libmesh_assert_equal_to(Bmat_lin.
n(), 3*n_phi);
1132 libmesh_assert_equal_to(Bmat_nl_x.
m(), 3);
1133 libmesh_assert_equal_to(Bmat_nl_x.
n(), 3*n_phi);
1134 libmesh_assert_equal_to(Bmat_nl_y.
m(), 3);
1135 libmesh_assert_equal_to(Bmat_nl_y.
n(), 3*n_phi);
1136 libmesh_assert_equal_to(Bmat_nl_z.
m(), 3);
1137 libmesh_assert_equal_to(Bmat_nl_z.
n(), 3*n_phi);
1142 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1143 phi(i_nd) = dphi[i_nd][qp](0);
1163 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1164 phi(i_nd) = dphi[i_nd][qp](1);
1184 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1185 phi(i_nd) = dphi[i_nd][qp](2);
1205 ddisp_dx = RealVectorX::Zero(3),
1206 ddisp_dy = RealVectorX::Zero(3),
1207 ddisp_dz = RealVectorX::Zero(3);
1215 F = RealMatrixX::Zero(3,3),
1216 E = RealMatrixX::Zero(3,3);
1217 F.col(0) = ddisp_dx;
1218 F.col(1) = ddisp_dy;
1219 F.col(2) = ddisp_dz;
1222 E = 0.5*(F + F.transpose() + F.transpose() * F);
1225 epsilon(0) = E(0,0);
1226 epsilon(1) = E(1,1);
1227 epsilon(2) = E(2,2);
1228 epsilon(3) = E(0,1) + E(1,0);
1229 epsilon(4) = E(1,2) + E(2,1);
1230 epsilon(5) = E(0,2) + E(2,0);
1234 mat_x.row(0) = ddisp_dx;
1235 mat_x.row(3) = ddisp_dy;
1236 mat_x.row(5) = ddisp_dz;
1238 mat_y.row(1) = ddisp_dy;
1239 mat_y.row(3) = ddisp_dx;
1240 mat_y.row(4) = ddisp_dz;
1243 mat_z.row(2) = ddisp_dz;
1244 mat_z.row(4) = ddisp_dy;
1245 mat_z.row(5) = ddisp_dx;
1264 const std::vector<libMesh::Point>& q_point = fe.
get_qrule().get_points();
1266 xi = q_point[qp](0),
1267 eta = q_point[qp](1),
1268 phi = q_point[qp](2);
1270 const std::vector<std::vector<Real> >&
1278 const unsigned int n_nodes = e.n_nodes();
1280 xdef = RealVectorX::Zero(n_nodes),
1281 ydef = RealVectorX::Zero(n_nodes),
1282 zdef = RealVectorX::Zero(n_nodes),
1283 phivec = RealVectorX::Zero(n_nodes);
1286 for (
unsigned int i_node=0; i_node<n_nodes; i_node++) {
1287 xdef(i_node) = e.point(i_node)(0);
1288 ydef(i_node) = e.point(i_node)(1);
1289 zdef(i_node) = e.point(i_node)(2);
1296 libmesh_assert_equal_to(dshapedxi.size(), n_nodes);
1299 jac = RealMatrixX::Zero(3,3);
1302 for (
unsigned int i_node=0; i_node<n_nodes; i_node++)
1303 phivec(i_node) = dshapedxi[i_node][qp];
1305 jac(0,0) = phivec.dot(xdef);
1306 jac(0,1) = phivec.dot(ydef);
1307 jac(0,2) = phivec.dot(zdef);
1311 for (
unsigned int i_node=0; i_node<n_nodes; i_node++)
1312 phivec(i_node) = dshapedeta[i_node][qp];
1314 jac(1,0) = phivec.dot(xdef);
1315 jac(1,1) = phivec.dot(ydef);
1316 jac(1,2) = phivec.dot(zdef);
1319 for (
unsigned int i_node=0; i_node<n_nodes; i_node++)
1320 phivec(i_node) = dshapedphi[i_node][qp];
1322 jac(2,0) = phivec.dot(xdef);
1323 jac(2,1) = phivec.dot(ydef);
1324 jac(2,2) = phivec.dot(zdef);
1373 G_mat /= jac.determinant();
1382 libmesh_assert(e.type() == libMesh::HEX8);
1386 libmesh_assert (nv);
1387 libMesh::FEType fe_type =
_system.
system().variable_type(0);
1390 for (
unsigned int i=1; i != nv; ++i)
1391 libmesh_assert(fe_type ==
_system.
system().variable_type(i));
1394 std::unique_ptr<libMesh::FEBase> fe(libMesh::FEBase::build(e.dim(), fe_type).release());
1395 const std::vector<libMesh::Point> pts(1);
1399 fe->get_dphidzeta();
1401 fe->reinit(&e, &pts);
1405 const std::vector<std::vector<Real> >&
1406 dshapedxi = fe->get_dphidxi(),
1407 dshapedeta = fe->get_dphideta(),
1408 dshapedphi = fe->get_dphidzeta();
1412 xdef = RealVectorX::Zero(e.n_nodes()),
1413 ydef = RealVectorX::Zero(e.n_nodes()),
1414 zdef = RealVectorX::Zero(e.n_nodes()),
1415 phi = RealVectorX::Zero(e.n_nodes());
1418 for (
unsigned int i_node=0; i_node<e.n_nodes(); i_node++) {
1419 xdef(i_node) = e.point(i_node)(0);
1420 ydef(i_node) = e.point(i_node)(1);
1421 zdef(i_node) = e.point(i_node)(2);
1428 libmesh_assert_equal_to(dshapedxi.size(), e.n_nodes());
1431 jac = RealMatrixX::Zero(3,3),
1432 T0 = RealMatrixX::Zero(6,6);
1435 for (
unsigned int i_node=0; i_node<e.n_nodes(); i_node++)
1436 phi(i_node) = dshapedxi[i_node][0];
1438 jac(0,0) = phi.dot(xdef);
1439 jac(0,1) = phi.dot(ydef);
1440 jac(0,2) = phi.dot(zdef);
1444 for (
unsigned int i_node=0; i_node<e.n_nodes(); i_node++)
1445 phi(i_node) = dshapedeta[i_node][0];
1447 jac(1,0) = phi.dot(xdef);
1448 jac(1,1) = phi.dot(ydef);
1449 jac(1,2) = phi.dot(zdef);
1452 for (
unsigned int i_node=0; i_node<e.n_nodes(); i_node++)
1453 phi(i_node) = dshapedphi[i_node][0];
1455 jac(2,0) = phi.dot(xdef);
1456 jac(2,1) = phi.dot(ydef);
1457 jac(2,2) = phi.dot(zdef);
1461 T0(0,0) = jac(0,0)*jac(0,0);
1462 T0(0,1) = jac(1,0)*jac(1,0);
1463 T0(0,2) = jac(2,0)*jac(2,0);
1464 T0(0,3) = 2*jac(0,0)*jac(1,0);
1465 T0(0,4) = 2*jac(1,0)*jac(2,0);
1466 T0(0,5) = 2*jac(2,0)*jac(0,0);
1468 T0(1,0) = jac(0,1)*jac(0,1);
1469 T0(1,1) = jac(1,1)*jac(1,1);
1470 T0(1,2) = jac(2,1)*jac(2,1);
1471 T0(1,3) = 2*jac(0,1)*jac(1,1);
1472 T0(1,4) = 2*jac(1,1)*jac(2,1);
1473 T0(1,5) = 2*jac(2,1)*jac(0,1);
1475 T0(2,0) = jac(0,2)*jac(0,2);
1476 T0(2,1) = jac(1,2)*jac(1,2);
1477 T0(2,2) = jac(2,2)*jac(2,2);
1478 T0(2,3) = 2*jac(0,2)*jac(1,2);
1479 T0(2,4) = 2*jac(1,2)*jac(2,2);
1480 T0(2,5) = 2*jac(2,2)*jac(0,2);
1482 T0(3,0) = jac(0,0)*jac(0,1);
1483 T0(3,1) = jac(1,0)*jac(1,1);
1484 T0(3,2) = jac(2,0)*jac(2,1);
1485 T0(3,3) = jac(0,0)*jac(1,1)+jac(1,0)*jac(0,1);
1486 T0(3,4) = jac(1,0)*jac(2,1)+jac(2,0)*jac(1,1);
1487 T0(3,5) = jac(2,1)*jac(0,0)+jac(2,0)*jac(0,1);
1489 T0(4,0) = jac(0,1)*jac(0,2);
1490 T0(4,1) = jac(1,1)*jac(1,2);
1491 T0(4,2) = jac(2,1)*jac(2,2);
1492 T0(4,3) = jac(0,1)*jac(1,2)+jac(1,1)*jac(0,2);
1493 T0(4,4) = jac(1,1)*jac(2,2)+jac(2,1)*jac(1,2);
1494 T0(4,5) = jac(2,2)*jac(0,1)+jac(2,1)*jac(0,2);
1496 T0(5,0) = jac(0,0)*jac(0,2);
1497 T0(5,1) = jac(1,0)*jac(1,2);
1498 T0(5,2) = jac(2,0)*jac(2,2);
1499 T0(5,3) = jac(0,0)*jac(1,2)+jac(1,0)*jac(0,2);
1500 T0(5,4) = jac(1,0)*jac(2,2)+jac(2,0)*jac(1,2);
1501 T0(5,5) = jac(2,2)*jac(0,0)+jac(2,0)*jac(0,2);
1503 _T0_inv_tr = jac.determinant() * T0.inverse().transpose();
void vector_mult_transpose(T &res, const T &v) const
res = v^T * [this]
MAST::NonlinearSystem & system()
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...
RealMatrixX _T0_inv_tr
Jacobian matrix at element center needed for incompatible modes.
void reinit(unsigned int n_interpolated_vars, unsigned int n_discrete_vars, unsigned int n_discrete_dofs_per_var)
this initializes the operator for number of rows and variables, assuming that all variables has the s...
virtual const libMesh::QBase & get_qrule() const
virtual bool calculate_stress(bool request_derivative, const MAST::FunctionBase *p, MAST::StressStrainOutputBase &output)
Calculates the stress tensor.
virtual bool inertial_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac_xddot, RealMatrixX &jac_xdot, RealMatrixX &jac)
Calculates the inertial force and the Jacobian matrices.
virtual bool internal_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the sensitivity of internal residual vector and Jacobian due to strain energy...
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< Real > > & get_dphidzeta() 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...
virtual ~StructuralElement3D()
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 force vector and Jacobian sensitivity due to piston-theory based surface pressure on t...
RealVectorX _local_accel
local acceleration
MAST::SystemInitialization & _system
SystemInitialization object associated with this element.
void initialize_strain_operator(const unsigned int qp, const MAST::FEBase &fe, FEMOperatorMatrix &Bmat)
initialize strain operator matrix
void _init_incompatible_fe_mapping(const libMesh::Elem &e)
initialize the Jacobian needed for incompatible modes
void initialize_incompatible_strain_operator(const unsigned int qp, const MAST::FEBase &fe, FEMOperatorMatrix &Bmat, RealMatrixX &G_mat)
initialize incompatible strain operator
virtual const libMesh::Elem & get_reference_elem() const
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > inertia_matrix(const MAST::ElementBase &e) const =0
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.
bool follower_forces
flag for follower forces
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 Jacobian due to thermal stresses.
Matrix< Real, Dynamic, Dynamic > RealMatrixX
virtual const std::vector< std::vector< Real > > & get_dphideta() const
const MAST::StrainType strain_type() const
returns the type of strain to be used for this element
virtual const std::vector< std::vector< Real > > & get_dphidxi() const
void vector_mult(T &res, const T &v) const
res = [this] * v
virtual bool internal_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the internal residual 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.
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 std::unique_ptr< MAST::FieldFunction< RealMatrixX > > stiffness_A_matrix(const MAST::ElementBase &e) const =0
Matrix< Real, Dynamic, 1 > RealVectorX
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...
virtual bool prestress_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the prestress residual vector and Jacobian.
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
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, RealMatrixX &mat_z, MAST::FEMOperatorMatrix &Bmat_lin, MAST::FEMOperatorMatrix &Bmat_nl_x, MAST::FEMOperatorMatrix &Bmat_nl_y, MAST::FEMOperatorMatrix &Bmat_nl_z, MAST::FEMOperatorMatrix &Bmat_nl_u, MAST::FEMOperatorMatrix &Bmat_nl_v, MAST::FEMOperatorMatrix &Bmat_nl_w)
initialize the strain operator matrices for the Green-Lagrange strain matrices
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
StructuralElement3D(MAST::SystemInitialization &sys, MAST::AssemblyBase &assembly, const MAST::GeomElem &elem, const MAST::ElementPropertyCardBase &p)
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
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...
const Real & _time
time for which system is being assembled
virtual void update_incompatible_mode_solution(const RealVectorX &dsol)
updates the incompatible solution for this element.
bool if_diagonal_mass_matrix() const
returns the type of strain to be used for this element
virtual bool prestress_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the sensitivity prestress residual vector and Jacobian.