55 std::unique_ptr<MAST::FEBase>
58 const std::vector<Real>& JxW = fe->get_JxW();
59 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
60 const std::vector<std::vector<Real> >& phi = fe->get_phi();
63 n_phi = (
unsigned int)phi.size(),
69 mat1_n1n2 = RealMatrixX::Zero(n1, n2),
70 mat2_n2n2 = RealMatrixX::Zero(n2, n2);
72 phi_vec = RealVectorX::Zero(n_phi),
73 vec1_n1 = RealVectorX::Zero(n1),
74 vec2_n2 = RealVectorX::Zero(n2),
75 local_acc = RealVectorX::Zero(n2);
77 std::unique_ptr<MAST::FieldFunction<RealMatrixX> >
86 (*mat_inertia)(xyz[0],
_time, material_mat);
89 const unsigned int nshp = fe->n_shape_functions();
90 for (
unsigned int i=0; i<JxW.size(); i++)
93 for (
unsigned int i_var=0; i_var<3; i_var++)
94 for (
unsigned int i=0; i<nshp; i++)
95 jac_xddot(i_var*nshp+i, i_var*nshp+i) =
96 vol*material_mat(i_var, i_var);
98 f.topRows(n2) = jac_xddot.topLeftCorner(n2, n2) *
_local_accel.topRows(n2);
103 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
105 (*mat_inertia)(xyz[0],
_time, material_mat);
108 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
109 phi_vec(i_nd) = phi[i_nd][qp];
115 vec1_n1 = mat1_n1n2 * local_acc;
118 f.topRows(n2) += JxW[qp] * vec2_n2;
120 if (request_jacobian) {
124 jac_xddot.topLeftCorner(n2, n2) += JxW[qp]*mat2_n2n2;
129 return request_jacobian;
140 std::unique_ptr<MAST::FEBase>
143 const std::vector<Real>& JxW = fe->get_JxW();
144 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
146 n_phi = (
unsigned int)fe->n_shape_functions(),
154 mat_x = RealMatrixX::Zero(6,3),
155 mat_y = RealMatrixX::Zero(6,3),
156 mat_z = RealMatrixX::Zero(6,3),
157 mat1_n1n2 = RealMatrixX::Zero(n1, n2),
158 mat2_n2n2 = RealMatrixX::Zero(n2, n2),
159 mat3_3n2 = RealMatrixX::Zero(3, n2),
160 mat4_33 = RealMatrixX::Zero(3, 3),
161 mat5_n1n3 = RealMatrixX::Zero(n1, n3),
162 mat6_n2n3 = RealMatrixX::Zero(n2, n3),
163 mat7_3n3 = RealMatrixX::Zero(3, n3),
164 Gmat = RealMatrixX::Zero(6, n3),
165 K_alphaalpha = RealMatrixX::Zero(n3, n3),
166 K_ualpha = RealMatrixX::Zero(n2, n3),
167 K_corr = RealMatrixX::Zero(n2, n2);
169 strain = RealVectorX::Zero(6),
170 stress = RealVectorX::Zero(6),
171 vec1_n1 = RealVectorX::Zero(n1),
172 vec2_n2 = RealVectorX::Zero(n2),
173 vec3_3 = RealVectorX::Zero(3),
174 local_disp= RealVectorX::Zero(n2),
175 f_alpha = RealVectorX::Zero(n3),
176 alpha = RealVectorX::Zero(n3);
179 local_disp.topRows(n2) =
_local_sol.topRows(n2);
181 std::unique_ptr<MAST::FieldFunction<RealMatrixX> > mat_stiff =
194 Bmat_lin.
reinit(n1, 3, n_nodes);
195 Bmat_nl_x.
reinit(3, 3, n_nodes);
196 Bmat_nl_y.
reinit(3, 3, n_nodes);
197 Bmat_nl_z.
reinit(3, 3, n_nodes);
198 Bmat_nl_u.
reinit(3, 3, n_nodes);
199 Bmat_nl_v.
reinit(3, 3, n_nodes);
200 Bmat_nl_w.
reinit(3, 3, n_nodes);
201 Bmat_inc.
reinit(n1, n3, 1);
269 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
272 (*mat_stiff)(xyz[qp],
_time, material_mat);
289 stress = material_mat * (strain + Gmat * alpha);
292 f_alpha += JxW[qp] * Gmat.transpose() * stress;
297 f.topRows(n2) += JxW[qp] * vec2_n2;
303 vec3_3 = mat_x.transpose() * stress;
305 f.topRows(n2) += JxW[qp] * vec2_n2;
308 vec3_3 = mat_y.transpose() * stress;
310 f.topRows(n2) += JxW[qp] * vec2_n2;
313 vec3_3 = mat_z.transpose() * stress;
315 f.topRows(n2) += JxW[qp] * vec2_n2;
318 if (request_jacobian) {
329 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
334 mat3_3n2 = mat_x.transpose() * mat1_n1n2;
336 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
339 mat3_3n2 = mat_y.transpose() * mat1_n1n2;
341 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
344 mat3_3n2 = mat_z.transpose() * mat1_n1n2;
346 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
349 for (
unsigned int i_dim=0; i_dim<3; i_dim++) {
365 mat1_n1n2 = material_mat * mat1_n1n2;
367 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
370 mat3_3n2 = mat_x.transpose() * mat1_n1n2;
372 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
375 mat3_3n2 = mat_y.transpose() * mat1_n1n2;
377 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
380 mat3_3n2 = mat_z.transpose() * mat1_n1n2;
382 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
388 mat4_33(0,0) = stress(0);
389 mat4_33(1,1) = stress(1);
390 mat4_33(2,2) = stress(2);
391 mat4_33(0,1) = mat4_33(1,0) = stress(3);
392 mat4_33(1,2) = mat4_33(2,1) = stress(4);
393 mat4_33(0,2) = mat4_33(2,0) = stress(5);
398 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
403 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
408 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
415 if (request_jacobian)
416 jac.bottomRightCorner(n2, n2) += RealMatrixX::Identity(n2, n2) *
417 1.0e-20 * jac.diagonal().maxCoeff();
422 return request_jacobian;
432 std::unique_ptr<MAST::FEBase>
435 const std::vector<Real>& JxW = fe->get_JxW();
436 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
438 n_phi = (
unsigned int)fe->n_shape_functions(),
446 mat_x = RealMatrixX::Zero(6,3),
447 mat_y = RealMatrixX::Zero(6,3),
448 mat_z = RealMatrixX::Zero(6,3),
449 mat1_n1n2 = RealMatrixX::Zero(n1, n2),
450 mat2_n2n2 = RealMatrixX::Zero(n2, n2),
451 mat3_3n2 = RealMatrixX::Zero(3, n2),
452 mat4_33 = RealMatrixX::Zero(3, 3),
453 mat5_n1n3 = RealMatrixX::Zero(n1, n3),
454 mat6_n2n3 = RealMatrixX::Zero(n2, n3),
455 mat7_3n3 = RealMatrixX::Zero(3, n3),
456 Gmat = RealMatrixX::Zero(6, n3),
457 K_alphaalpha = RealMatrixX::Zero(n3, n3),
458 K_ualpha = RealMatrixX::Zero(n2, n3),
459 K_corr = RealMatrixX::Zero(n2, n2);
461 strain = RealVectorX::Zero(6),
462 stress = RealVectorX::Zero(6),
463 vec1_n1 = RealVectorX::Zero(n1),
464 vec2_n2 = RealVectorX::Zero(n2),
465 vec3_3 = RealVectorX::Zero(3),
466 local_disp= RealVectorX::Zero(n2),
467 f = RealVectorX::Zero(n3),
468 alpha = RealVectorX::Zero(n3);
471 local_disp.topRows(n2) =
_local_sol.topRows(n2);
473 std::unique_ptr<MAST::FieldFunction<RealMatrixX> > mat_stiff =
486 Bmat_lin.
reinit(n1, 3, n_nodes);
487 Bmat_nl_x.
reinit(3, 3, n_nodes);
488 Bmat_nl_y.
reinit(3, 3, n_nodes);
489 Bmat_nl_z.
reinit(3, 3, n_nodes);
490 Bmat_nl_u.
reinit(3, 3, n_nodes);
491 Bmat_nl_v.
reinit(3, 3, n_nodes);
492 Bmat_nl_w.
reinit(3, 3, n_nodes);
493 Bmat_inc.
reinit(n1, n3, 1);
501 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
504 (*mat_stiff)(xyz[qp],
_time, material_mat);
521 stress = material_mat * (strain + Gmat * alpha);
524 f += JxW[qp] * Gmat.transpose() * stress;
528 mat5_n1n3 = material_mat * Gmat;
529 K_alphaalpha += JxW[qp] * ( Gmat.transpose() * mat5_n1n3);
534 K_ualpha += JxW[qp] * mat6_n2n3;
540 mat7_3n3 = mat_x.transpose() * mat5_n1n3;
542 K_ualpha += JxW[qp] * mat6_n2n3;
545 mat7_3n3 = mat_y.transpose() * mat5_n1n3;
547 K_ualpha += JxW[qp] * mat6_n2n3;
550 mat7_3n3 = mat_z.transpose() * mat5_n1n3;
552 K_ualpha += JxW[qp] * mat6_n2n3;
558 K_alphaalpha = K_alphaalpha.inverse();
561 alpha += K_alphaalpha * (-f - K_ualpha.transpose() * dsol.topRows(n2));
568 bool request_jacobian,
572 std::unique_ptr<MAST::FEBase>
575 const std::vector<Real>& JxW = fe->get_JxW();
576 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
578 n_phi = (
unsigned int)fe->n_shape_functions(),
586 mat_x = RealMatrixX::Zero(6,3),
587 mat_y = RealMatrixX::Zero(6,3),
588 mat_z = RealMatrixX::Zero(6,3),
589 mat1_n1n2 = RealMatrixX::Zero(n1, n2),
590 mat2_n2n2 = RealMatrixX::Zero(n2, n2),
591 mat3_3n2 = RealMatrixX::Zero(3, n2),
592 mat4_33 = RealMatrixX::Zero(3, 3),
593 mat5_n1n3 = RealMatrixX::Zero(n1, n3),
594 mat6_n2n3 = RealMatrixX::Zero(n2, n3),
595 mat7_3n3 = RealMatrixX::Zero(3, n3),
596 Gmat = RealMatrixX::Zero(6, n3),
597 K_alphaalpha = RealMatrixX::Zero(n3, n3),
598 K_ualpha = RealMatrixX::Zero(n2, n3),
599 K_corr = RealMatrixX::Zero(n2, n2);
601 strain = RealVectorX::Zero(6),
602 stress = RealVectorX::Zero(6),
603 vec1_n1 = RealVectorX::Zero(n1),
604 vec2_n2 = RealVectorX::Zero(n2),
605 vec3_3 = RealVectorX::Zero(3),
606 local_disp= RealVectorX::Zero(n2),
607 f_alpha = RealVectorX::Zero(n3),
608 alpha = RealVectorX::Zero(n3);
611 local_disp.topRows(n2) =
_local_sol.topRows(n2);
613 std::unique_ptr<MAST::FieldFunction<RealMatrixX> > mat_stiff =
626 Bmat_lin.
reinit(n1, 3, n_nodes);
627 Bmat_nl_x.
reinit(3, 3, n_nodes);
628 Bmat_nl_y.
reinit(3, 3, n_nodes);
629 Bmat_nl_z.
reinit(3, 3, n_nodes);
630 Bmat_nl_u.
reinit(3, 3, n_nodes);
631 Bmat_nl_v.
reinit(3, 3, n_nodes);
632 Bmat_nl_w.
reinit(3, 3, n_nodes);
633 Bmat_inc.
reinit(n1, n3, 1);
637 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
640 mat_stiff->derivative(p, xyz[qp],
_time, material_mat);
657 stress = material_mat * (strain + Gmat * alpha);
660 f_alpha += JxW[qp] * Gmat.transpose() * stress;
665 f.topRows(n2) += JxW[qp] * vec2_n2;
671 vec3_3 = mat_x.transpose() * stress;
673 f.topRows(n2) += JxW[qp] * vec2_n2;
676 vec3_3 = mat_y.transpose() * stress;
678 f.topRows(n2) += JxW[qp] * vec2_n2;
681 vec3_3 = mat_z.transpose() * stress;
683 f.topRows(n2) += JxW[qp] * vec2_n2;
686 if (request_jacobian) {
697 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
702 mat3_3n2 = mat_x.transpose() * mat1_n1n2;
704 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
707 mat3_3n2 = mat_y.transpose() * mat1_n1n2;
709 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
712 mat3_3n2 = mat_z.transpose() * mat1_n1n2;
714 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
717 for (
unsigned int i_dim=0; i_dim<3; i_dim++) {
733 mat1_n1n2 = material_mat * mat1_n1n2;
735 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
738 mat3_3n2 = mat_x.transpose() * mat1_n1n2;
740 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
743 mat3_3n2 = mat_y.transpose() * mat1_n1n2;
745 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
748 mat3_3n2 = mat_z.transpose() * mat1_n1n2;
750 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
756 mat4_33(0,0) = stress(0);
757 mat4_33(1,1) = stress(1);
758 mat4_33(2,2) = stress(2);
759 mat4_33(0,1) = mat4_33(1,0) = stress(3);
760 mat4_33(1,2) = mat4_33(2,1) = stress(4);
761 mat4_33(0,2) = mat4_33(2,0) = stress(5);
766 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
771 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
776 jac.topLeftCorner(n2, n2) += JxW[qp] * mat2_n2n2;
783 if (request_jacobian)
784 jac.bottomRightCorner(n2, n2) += RealMatrixX::Identity(n2, n2) *
785 1.0e-20 * jac.diagonal().maxCoeff();
787 return request_jacobian;
798 return request_jacobian;
805 bool request_jacobian,
809 return request_jacobian;
820 const unsigned int side,
826 std::unique_ptr<MAST::FEBase>
829 const std::vector<Real> &JxW = fe->get_JxW();
830 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
831 const std::vector<std::vector<Real> >& phi = fe->get_phi();
832 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_reference_coordinate();
834 n_phi = (
unsigned int)phi.size(),
848 phi_vec = RealVectorX::Zero(n_phi),
849 force = RealVectorX::Zero(n1),
850 local_f = RealVectorX::Zero(n2),
851 vec_n2 = RealVectorX::Zero(n2);
853 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
856 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
857 phi_vec(i_nd) = phi[i_nd][qp];
859 Bmat.reinit(n1, phi_vec);
862 func(qpoint[qp],
_time, press);
865 for (
unsigned int i_dim=0; i_dim<n1; i_dim++)
866 force(i_dim) = press * face_normals[qp](i_dim);
868 Bmat.vector_mult_transpose(vec_n2, force);
870 local_f += JxW[qp] * vec_n2;
873 f.topRows(n2) -= local_f;
875 return (request_jacobian);
885 bool request_jacobian,
888 const unsigned int side,
894 std::unique_ptr<MAST::FEBase>
897 const std::vector<Real> &JxW = fe->get_JxW();
898 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
899 const std::vector<std::vector<Real> >& phi = fe->get_phi();
900 const std::vector<libMesh::Point>& face_normals = fe->get_normals_for_reference_coordinate();
902 n_phi = (
unsigned int)phi.size(),
916 phi_vec = RealVectorX::Zero(n_phi),
917 force = RealVectorX::Zero(2*n1),
918 local_f = RealVectorX::Zero(n2),
919 vec_n2 = RealVectorX::Zero(n2);
921 for (
unsigned int qp=0; qp<qpoint.size(); qp++) {
924 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
925 phi_vec(i_nd) = phi[i_nd][qp];
927 Bmat.reinit(2*n1, phi_vec);
933 for (
unsigned int i_dim=0; i_dim<n1; i_dim++)
934 force(i_dim) = press * face_normals[qp](i_dim);
936 Bmat.vector_mult_transpose(vec_n2, force);
938 local_f += JxW[qp] * vec_n2;
943 return (request_jacobian);
956 std::unique_ptr<MAST::FEBase>
959 const std::vector<Real>& JxW = fe->get_JxW();
960 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
963 n_phi = (
unsigned int)fe->get_phi().size(),
970 mat_x = RealMatrixX::Zero(6,3),
971 mat_y = RealMatrixX::Zero(6,3),
972 mat_z = RealMatrixX::Zero(6,3),
973 mat2_n2n2 = RealMatrixX::Zero(n2,n2),
974 mat3_3n2 = RealMatrixX::Zero(3,n2),
975 mat4_33 = RealMatrixX::Zero(3,3);
977 vec1_n1 = RealVectorX::Zero(n1),
978 vec2_3 = RealVectorX::Zero(3),
979 vec3_n2 = RealVectorX::Zero(n2),
980 delta_t = RealVectorX::Zero(1),
981 local_disp= RealVectorX::Zero(n2),
982 strain = RealVectorX::Zero(6);
985 local_disp.topRows(n2) =
_local_sol.topRows(n2);
996 Bmat_lin.
reinit(n1, 3, n_nodes);
997 Bmat_nl_x.
reinit(3, 3, n_nodes);
998 Bmat_nl_y.
reinit(3, 3, n_nodes);
999 Bmat_nl_z.
reinit(3, 3, n_nodes);
1000 Bmat_nl_u.
reinit(3, 3, n_nodes);
1001 Bmat_nl_v.
reinit(3, 3, n_nodes);
1002 Bmat_nl_w.
reinit(3, 3, n_nodes);
1004 std::unique_ptr<MAST::FieldFunction<RealMatrixX> >
1013 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
1015 (*mat) (xyz[qp],
_time, material_exp_A_mat);
1016 temp_func (xyz[qp], _time, t);
1017 ref_temp_func(xyz[qp], _time, t0);
1020 vec1_n1 = material_exp_A_mat * delta_t;
1026 mat_x, mat_y, mat_z,
1037 f.topRows(n2) -= JxW[qp] * vec3_n2;
1043 vec2_3 = mat_x.transpose() * vec1_n1;
1045 f.topRows(n2) -= JxW[qp] * vec3_n2;
1048 vec2_3 = mat_y.transpose() * vec1_n1;
1050 f.topRows(n2) -= JxW[qp] * vec3_n2;
1053 vec2_3 = mat_z.transpose() * vec1_n1;
1055 f.topRows(n2) -= JxW[qp] * vec3_n2;
1058 if (request_jacobian) {
1062 mat4_33(0,0) = vec1_n1(0);
1063 mat4_33(1,1) = vec1_n1(1);
1064 mat4_33(2,2) = vec1_n1(2);
1065 mat4_33(0,1) = mat4_33(1,0) = vec1_n1(3);
1066 mat4_33(1,2) = mat4_33(2,1) = vec1_n1(4);
1067 mat4_33(0,2) = mat4_33(2,0) = vec1_n1(5);
1072 jac.topLeftCorner(n2, n2) -= JxW[qp] * mat2_n2n2;
1077 jac.topLeftCorner(n2, n2) -= JxW[qp] * mat2_n2n2;
1082 jac.topLeftCorner(n2, n2) -= JxW[qp] * mat2_n2n2;
1088 return request_jacobian;
1095 bool request_jacobian,
1115 const unsigned int side,
1121 return (request_jacobian);
1129 bool request_jacobian,
1133 const unsigned int side,
1139 return (request_jacobian);
1151 std::unique_ptr<MAST::FEBase> fe(
_elem.
init_fe(
true,
false));
1152 std::vector<libMesh::Point> qp_loc = fe->get_qpoints();
1158 const std::vector<Real> &JxW = fe->get_JxW();
1159 const std::vector<libMesh::Point>& xyz = fe->get_xyz();
1161 n_phi = (
unsigned int)fe->n_shape_functions(),
1169 mat_x = RealMatrixX::Zero(6,3),
1170 mat_y = RealMatrixX::Zero(6,3),
1171 mat_z = RealMatrixX::Zero(6,3),
1172 Gmat = RealMatrixX::Zero(6, n3);
1175 strain = RealVectorX::Zero(6),
1176 stress = RealVectorX::Zero(6),
1177 local_disp= RealVectorX::Zero(n2),
1178 alpha = RealVectorX::Zero(n3);
1181 local_disp.topRows(n2) =
_local_sol.topRows(n2);
1183 std::unique_ptr<MAST::FieldFunction<RealMatrixX> > mat_stiff =
1196 Bmat_lin.
reinit(n1, 3, n_nodes);
1197 Bmat_nl_x.
reinit(3, 3, n_nodes);
1198 Bmat_nl_y.
reinit(3, 3, n_nodes);
1199 Bmat_nl_z.
reinit(3, 3, n_nodes);
1200 Bmat_nl_u.
reinit(3, 3, n_nodes);
1201 Bmat_nl_v.
reinit(3, 3, n_nodes);
1202 Bmat_nl_w.
reinit(3, 3, n_nodes);
1203 Bmat_inc.
reinit(n1, n3, 1);
1214 for (
unsigned int qp=0; qp<qp_loc.size(); qp++) {
1217 (*mat_stiff)(xyz[qp],
_time, material_mat);
1223 mat_x, mat_y, mat_z,
1234 strain += Gmat * alpha;
1235 stress = material_mat * strain;
1246 if (!request_derivative && !p)
1258 if (request_derivative) {
1264 return request_derivative;
1277 const std::vector<std::vector<libMesh::RealVectorValue> >&
1280 unsigned int n_phi = (
unsigned int)dphi.size();
1285 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1286 phi(i_nd) = dphi[i_nd][qp](0);
1292 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1293 phi(i_nd) = dphi[i_nd][qp](1);
1299 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1300 phi(i_nd) = dphi[i_nd][qp](2);
1330 const std::vector<std::vector<libMesh::RealVectorValue> >&
1333 unsigned int n_phi = (
unsigned int)dphi.size();
1337 libmesh_assert_equal_to(epsilon.size(), 6);
1338 libmesh_assert_equal_to(mat_x.rows(), 6);
1339 libmesh_assert_equal_to(mat_x.cols(), 3);
1340 libmesh_assert_equal_to(mat_y.rows(), 6);
1341 libmesh_assert_equal_to(mat_y.cols(), 3);
1342 libmesh_assert_equal_to(mat_z.rows(), 6);
1343 libmesh_assert_equal_to(mat_z.cols(), 3);
1344 libmesh_assert_equal_to(Bmat_lin.
m(), 6);
1345 libmesh_assert_equal_to(Bmat_lin.
n(), 3*n_phi);
1346 libmesh_assert_equal_to(Bmat_nl_x.
m(), 3);
1347 libmesh_assert_equal_to(Bmat_nl_x.
n(), 3*n_phi);
1348 libmesh_assert_equal_to(Bmat_nl_y.
m(), 3);
1349 libmesh_assert_equal_to(Bmat_nl_y.
n(), 3*n_phi);
1350 libmesh_assert_equal_to(Bmat_nl_z.
m(), 3);
1351 libmesh_assert_equal_to(Bmat_nl_z.
n(), 3*n_phi);
1356 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1357 phi(i_nd) = dphi[i_nd][qp](0);
1377 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1378 phi(i_nd) = dphi[i_nd][qp](1);
1398 for (
unsigned int i_nd=0; i_nd<n_phi; i_nd++ )
1399 phi(i_nd) = dphi[i_nd][qp](2);
1419 ddisp_dx = RealVectorX::Zero(3),
1420 ddisp_dy = RealVectorX::Zero(3),
1421 ddisp_dz = RealVectorX::Zero(3);
1429 F = RealMatrixX::Zero(3,3),
1430 E = RealMatrixX::Zero(3,3);
1431 F.col(0) = ddisp_dx;
1432 F.col(1) = ddisp_dy;
1433 F.col(2) = ddisp_dz;
1436 E = 0.5*(F + F.transpose() + F.transpose() * F);
1439 epsilon(0) = E(0,0);
1440 epsilon(1) = E(1,1);
1441 epsilon(2) = E(2,2);
1442 epsilon(3) = E(0,1) + E(1,0);
1443 epsilon(4) = E(1,2) + E(2,1);
1444 epsilon(5) = E(0,2) + E(2,0);
1448 mat_x.row(0) = ddisp_dx;
1449 mat_x.row(3) = ddisp_dy;
1450 mat_x.row(5) = ddisp_dz;
1452 mat_y.row(1) = ddisp_dy;
1453 mat_y.row(3) = ddisp_dx;
1454 mat_y.row(4) = ddisp_dz;
1457 mat_z.row(2) = ddisp_dz;
1458 mat_z.row(4) = ddisp_dy;
1459 mat_z.row(5) = ddisp_dx;
1478 const std::vector<libMesh::Point>& q_point = fe.
get_qrule().get_points();
1480 xi = q_point[qp](0),
1481 eta = q_point[qp](1),
1482 phi = q_point[qp](2);
1484 const std::vector<std::vector<Real> >&
1492 const unsigned int n_nodes = e.n_nodes();
1494 xdef = RealVectorX::Zero(n_nodes),
1495 ydef = RealVectorX::Zero(n_nodes),
1496 zdef = RealVectorX::Zero(n_nodes),
1497 phivec = RealVectorX::Zero(n_nodes);
1500 for (
unsigned int i_node=0; i_node<n_nodes; i_node++) {
1501 xdef(i_node) = e.point(i_node)(0);
1502 ydef(i_node) = e.point(i_node)(1);
1503 zdef(i_node) = e.point(i_node)(2);
1510 libmesh_assert_equal_to(dshapedxi.size(), n_nodes);
1513 jac = RealMatrixX::Zero(3,3);
1516 for (
unsigned int i_node=0; i_node<n_nodes; i_node++)
1517 phivec(i_node) = dshapedxi[i_node][qp];
1519 jac(0,0) = phivec.dot(xdef);
1520 jac(0,1) = phivec.dot(ydef);
1521 jac(0,2) = phivec.dot(zdef);
1525 for (
unsigned int i_node=0; i_node<n_nodes; i_node++)
1526 phivec(i_node) = dshapedeta[i_node][qp];
1528 jac(1,0) = phivec.dot(xdef);
1529 jac(1,1) = phivec.dot(ydef);
1530 jac(1,2) = phivec.dot(zdef);
1533 for (
unsigned int i_node=0; i_node<n_nodes; i_node++)
1534 phivec(i_node) = dshapedphi[i_node][qp];
1536 jac(2,0) = phivec.dot(xdef);
1537 jac(2,1) = phivec.dot(ydef);
1538 jac(2,2) = phivec.dot(zdef);
1587 G_mat /= jac.determinant();
1596 libmesh_assert(e.type() == libMesh::HEX8);
1600 libmesh_assert (nv);
1601 libMesh::FEType fe_type =
_system.
system().variable_type(0);
1604 for (
unsigned int i=1; i != nv; ++i)
1605 libmesh_assert(fe_type ==
_system.
system().variable_type(i));
1608 std::unique_ptr<libMesh::FEBase> fe(libMesh::FEBase::build(e.dim(), fe_type).release());
1609 const std::vector<libMesh::Point> pts(1);
1613 fe->get_dphidzeta();
1615 fe->reinit(&e, &pts);
1619 const std::vector<std::vector<Real> >&
1620 dshapedxi = fe->get_dphidxi(),
1621 dshapedeta = fe->get_dphideta(),
1622 dshapedphi = fe->get_dphidzeta();
1626 xdef = RealVectorX::Zero(e.n_nodes()),
1627 ydef = RealVectorX::Zero(e.n_nodes()),
1628 zdef = RealVectorX::Zero(e.n_nodes()),
1629 phi = RealVectorX::Zero(e.n_nodes());
1632 for (
unsigned int i_node=0; i_node<e.n_nodes(); i_node++) {
1633 xdef(i_node) = e.point(i_node)(0);
1634 ydef(i_node) = e.point(i_node)(1);
1635 zdef(i_node) = e.point(i_node)(2);
1642 libmesh_assert_equal_to(dshapedxi.size(), e.n_nodes());
1645 jac = RealMatrixX::Zero(3,3),
1646 T0 = RealMatrixX::Zero(6,6);
1649 for (
unsigned int i_node=0; i_node<e.n_nodes(); i_node++)
1650 phi(i_node) = dshapedxi[i_node][0];
1652 jac(0,0) = phi.dot(xdef);
1653 jac(0,1) = phi.dot(ydef);
1654 jac(0,2) = phi.dot(zdef);
1658 for (
unsigned int i_node=0; i_node<e.n_nodes(); i_node++)
1659 phi(i_node) = dshapedeta[i_node][0];
1661 jac(1,0) = phi.dot(xdef);
1662 jac(1,1) = phi.dot(ydef);
1663 jac(1,2) = phi.dot(zdef);
1666 for (
unsigned int i_node=0; i_node<e.n_nodes(); i_node++)
1667 phi(i_node) = dshapedphi[i_node][0];
1669 jac(2,0) = phi.dot(xdef);
1670 jac(2,1) = phi.dot(ydef);
1671 jac(2,2) = phi.dot(zdef);
1675 T0(0,0) = jac(0,0)*jac(0,0);
1676 T0(0,1) = jac(1,0)*jac(1,0);
1677 T0(0,2) = jac(2,0)*jac(2,0);
1678 T0(0,3) = 2*jac(0,0)*jac(1,0);
1679 T0(0,4) = 2*jac(1,0)*jac(2,0);
1680 T0(0,5) = 2*jac(2,0)*jac(0,0);
1682 T0(1,0) = jac(0,1)*jac(0,1);
1683 T0(1,1) = jac(1,1)*jac(1,1);
1684 T0(1,2) = jac(2,1)*jac(2,1);
1685 T0(1,3) = 2*jac(0,1)*jac(1,1);
1686 T0(1,4) = 2*jac(1,1)*jac(2,1);
1687 T0(1,5) = 2*jac(2,1)*jac(0,1);
1689 T0(2,0) = jac(0,2)*jac(0,2);
1690 T0(2,1) = jac(1,2)*jac(1,2);
1691 T0(2,2) = jac(2,2)*jac(2,2);
1692 T0(2,3) = 2*jac(0,2)*jac(1,2);
1693 T0(2,4) = 2*jac(1,2)*jac(2,2);
1694 T0(2,5) = 2*jac(2,2)*jac(0,2);
1696 T0(3,0) = jac(0,0)*jac(0,1);
1697 T0(3,1) = jac(1,0)*jac(1,1);
1698 T0(3,2) = jac(2,0)*jac(2,1);
1699 T0(3,3) = jac(0,0)*jac(1,1)+jac(1,0)*jac(0,1);
1700 T0(3,4) = jac(1,0)*jac(2,1)+jac(2,0)*jac(1,1);
1701 T0(3,5) = jac(2,1)*jac(0,0)+jac(2,0)*jac(0,1);
1703 T0(4,0) = jac(0,1)*jac(0,2);
1704 T0(4,1) = jac(1,1)*jac(1,2);
1705 T0(4,2) = jac(2,1)*jac(2,2);
1706 T0(4,3) = jac(0,1)*jac(1,2)+jac(1,1)*jac(0,2);
1707 T0(4,4) = jac(1,1)*jac(2,2)+jac(2,1)*jac(1,2);
1708 T0(4,5) = jac(2,2)*jac(0,1)+jac(2,1)*jac(0,2);
1710 T0(5,0) = jac(0,0)*jac(0,2);
1711 T0(5,1) = jac(1,0)*jac(1,2);
1712 T0(5,2) = jac(2,0)*jac(2,2);
1713 T0(5,3) = jac(0,0)*jac(1,2)+jac(1,0)*jac(0,2);
1714 T0(5,4) = jac(1,0)*jac(2,2)+jac(2,0)*jac(1,2);
1715 T0(5,5) = jac(2,2)*jac(0,0)+jac(2,0)*jac(0,2);
1717 _T0_inv_tr = jac.determinant() * T0.inverse().transpose();
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.
virtual const libMesh::Elem & get_reference_elem() const
void reinit(unsigned int n_interpolated_vars, unsigned int n_discrete_vars, unsigned int n_discrete_dofs_per_var)
this initializes the operator for number of rows and variables, assuming that all variables has the s...
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.
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
virtual void derivative(const MAST::FunctionBase &f, ValType &v) const
calculates the value of the function derivative and returns it in v.
MAST::SystemInitialization & _system
SystemInitialization object associated with this element.
virtual const std::vector< std::vector< libMesh::RealVectorValue > > & get_dphi() const
virtual const std::vector< std::vector< Real > > & get_dphidxi() const
StructuralElement3D(MAST::SystemInitialization &sys, const MAST::GeomElem &elem, const MAST::ElementPropertyCardBase &p)
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 std::unique_ptr< MAST::FieldFunction< RealMatrixX > > inertia_matrix(const MAST::ElementBase &e) const =0
virtual const std::vector< std::vector< Real > > & get_dphideta() const
virtual std::unique_ptr< MAST::FEBase > init_fe(bool init_grads, bool init_second_order_derivative, int extra_quadrature_order=0) const
initializes the finite element shape function and quadrature object with the order of quadrature rule...
virtual bool piston_theory_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac_xdot, RealMatrixX &jac, MAST::BoundaryConditionBase &bc)
Calculates the force vector and Jacobian due to piston-theory based surface pressure on the entire el...
bool 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 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
void vector_mult_transpose(T &res, const T &v) const
res = v^T * [this]
Matrix< Real, Dynamic, 1 > RealVectorX
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...
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...
const MAST::StrainType strain_type() const
returns the type of strain to be used for this element
bool if_diagonal_mass_matrix() const
returns the type of strain to be used for this element
void vector_mult(T &res, const T &v) const
res = [this] * v
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
const ValType & get(const std::string &nm) const
returns a constant reference to the specified function
virtual std::unique_ptr< MAST::FEBase > init_side_fe(unsigned int s, bool init_grads, bool init_second_order_derivative, int extra_quadrature_order=0) const
initializes the finite element shape function and quadrature object for the side with the order of qu...
virtual std::unique_ptr< MAST::FieldFunction< RealMatrixX > > thermal_expansion_A_matrix(const MAST::ElementBase &e) const =0
virtual MAST::StressStrainOutputBase::Data & get_stress_strain_data_for_elem_at_qp(const MAST::GeomElem &e, const unsigned int qp)
void left_multiply(T &r, const T &m) const
[R] = [M] * [this]
RealVectorX _local_sol
local solution
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 const std::vector< std::vector< Real > > & get_dphidzeta() const
virtual void update_incompatible_mode_solution(const RealVectorX &dsol)
updates the incompatible solution for this element.
virtual const libMesh::QBase & get_qrule() const
virtual bool prestress_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
Calculates the sensitivity prestress residual vector and Jacobian.