60 unsigned n_dim=load.size();
61 for (
unsigned i=0;
i<n_dim;
i++) {load[
i]=0.0;}
79 const unsigned n_dim = 3;
82 const unsigned n_lagrangian = 2;
85 const unsigned n_node =
nnode();
91 Shape psi(n_node,n_position_type);
92 DShape dpsidxi(n_node,n_position_type,n_lagrangian);
95 DShape d2psidxi(n_node,n_position_type,3);
109 for(
unsigned i=0;
i<n_dim;
i++)
111 for(
unsigned j=0;j<n_lagrangian;j++) {interpolated_A(j,
i) = 0.0;}
115 for(
unsigned l=0;l<n_node;l++)
118 for(
unsigned k=0;k<n_position_type;k++)
121 for(
unsigned i=0;
i<n_dim;
i++)
126 for(
unsigned j=0;j<n_lagrangian;j++)
128 interpolated_A(j,
i) += x_value*dpsidxi(l,k,j);
135 N[0] = (interpolated_A(0,1)*interpolated_A(1,2) -
136 interpolated_A(0,2)*interpolated_A(1,1));
137 N[1] = (interpolated_A(0,2)*interpolated_A(1,0) -
138 interpolated_A(0,0)*interpolated_A(1,2));
139 N[2] = (interpolated_A(0,0)*interpolated_A(1,1) -
140 interpolated_A(0,1)*interpolated_A(1,0));
143 double norm=1.0/sqrt(N[0]*N[0]+N[1]*N[1]+N[2]*N[2]);
144 for (
unsigned i=0;
i<3;
i++) {N[
i]*=norm;}
156 const unsigned n_dim = 3;
159 const unsigned n_lagrangian = 2;
162 const unsigned n_node =
nnode();
168 Shape psi(n_node,n_position_type);
169 DShape dpsidxi(n_node,n_position_type,n_lagrangian);
172 DShape d2psidxi(n_node,n_position_type,3);
189 for(
unsigned i=0;
i<n_dim;
i++)
191 for(
unsigned j=0;j<n_lagrangian;j++) {interpolated_A(j,
i) = 0.0;}
192 for(
unsigned j=0;j<3;j++) {interpolated_dAdxi(
i,j) = 0.0;}
196 for(
unsigned l=0;l<n_node;l++)
199 for(
unsigned k=0;k<n_position_type;k++)
202 for(
unsigned i=0;
i<n_lagrangian;
i++)
206 for(
unsigned i=0;
i<n_dim;
i++)
211 interpolated_x[
i] += x_value*psi(l,k);
217 for(
unsigned j=0;j<n_lagrangian;j++)
219 interpolated_A(j,
i) += x_value*dpsidxi(l,k,j);
222 for(
unsigned j=0;j<3;j++)
224 interpolated_dAdxi(j,
i) += x_value*d2psidxi(l,k,j);
238 interpolated_a,dadxi);
244 for(
unsigned i=0;
i<3;
i++)
246 interpolated_dadxi(0,
i) = dadxi(0,0,
i);
247 interpolated_dadxi(1,
i) = dadxi(1,1,
i);
248 interpolated_dadxi(2,
i) = dadxi(0,1,
i);
252 double a[2][2], A[2][2], aup[2][2], Aup[2][2];
255 for(
unsigned al=0;al<2;al++)
257 for(
unsigned be=0;be<2;be++)
263 for(
unsigned k=0;k<3;k++)
265 a[al][be] += interpolated_a(al,k)*interpolated_a(be,k);
266 A[al][be] += interpolated_A(al,k)*interpolated_A(be,k);
269 strain(al,be) = 0.5*(A[al][be] - a[al][be]);
278 double sqrt_adet = sqrt(adet);
279 double sqrt_Adet = sqrt(Adet);
283 n[0] = (interpolated_a(0,1)*interpolated_a(1,2) -
284 interpolated_a(0,2)*interpolated_a(1,1))/sqrt_adet;
285 n[1] = (interpolated_a(0,2)*interpolated_a(1,0) -
286 interpolated_a(0,0)*interpolated_a(1,2))/sqrt_adet;
287 n[2] = (interpolated_a(0,0)*interpolated_a(1,1) -
288 interpolated_a(0,1)*interpolated_a(1,0))/sqrt_adet;
289 N[0] = (interpolated_A(0,1)*interpolated_A(1,2) -
290 interpolated_A(0,2)*interpolated_A(1,1))/sqrt_Adet;
291 N[1] = (interpolated_A(0,2)*interpolated_A(1,0) -
292 interpolated_A(0,0)*interpolated_A(1,2))/sqrt_Adet;
293 N[2] = (interpolated_A(0,0)*interpolated_A(1,1) -
294 interpolated_A(0,1)*interpolated_A(1,0))/sqrt_Adet;
298 double b[2][2],
B[2][2];
300 b[0][0] = n[0]*interpolated_dadxi(0,0)
301 + n[1]*interpolated_dadxi(0,1)
302 + n[2]*interpolated_dadxi(0,2);
305 b[0][1] = b[1][0] = n[0]*interpolated_dadxi(2,0)
306 + n[1]*interpolated_dadxi(2,1)
307 + n[2]*interpolated_dadxi(2,2);
309 b[1][1] = n[0]*interpolated_dadxi(1,0)
310 + n[1]*interpolated_dadxi(1,1)
311 + n[2]*interpolated_dadxi(1,2);
314 B[0][0] = N[0]*interpolated_dAdxi(0,0)
315 + N[1]*interpolated_dAdxi(0,1)
316 + N[2]*interpolated_dAdxi(0,2);
319 B[0][1] = B[1][0] = N[0]*interpolated_dAdxi(2,0)
320 + N[1]*interpolated_dAdxi(2,1)
321 + N[2]*interpolated_dAdxi(2,2);
323 B[1][1] = N[0]*interpolated_dAdxi(1,0)
324 + N[1]*interpolated_dAdxi(1,1)
325 + N[2]*interpolated_dAdxi(1,2);
328 for(
unsigned i=0;
i<2;
i++)
330 for(
unsigned j=0;j<2;j++)
332 bend(
i,j) = b[
i][j] - B[
i][j];
338 return std::make_pair(adet,Adet);
351 const unsigned n_dim = 3;
354 const unsigned n_lagrangian = 2;
357 const unsigned n_node =
nnode();
363 Shape psi(n_node,n_position_type);
364 DShape dpsidxi(n_node,n_position_type,n_lagrangian);
367 DShape d2psidxi(n_node,n_position_type,3);
374 const double nu_cached =
nu();
375 const double h_cached =
h();
376 const double lambda_sq_cached =
lambda_sq();
381 const double bending_scale = (1.0/12.0)*h_cached*h_cached;
384 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
406 for(
unsigned i=0;
i<n_dim;
i++)
408 for(
unsigned j=0;j<n_lagrangian;j++) {interpolated_A(j,
i) = 0.0;}
409 for(
unsigned j=0;j<3;j++) {interpolated_dAdxi(
i,j) = 0.0;}
413 for(
unsigned l=0;l<n_node;l++)
416 for(
unsigned k=0;k<n_position_type;k++)
419 for(
unsigned i=0;
i<n_lagrangian;
i++)
423 for(
unsigned i=0;
i<n_dim;
i++)
428 interpolated_x[
i] += x_value*psi(l,k);
434 for(
unsigned j=0;j<n_lagrangian;j++)
436 interpolated_A(j,
i) += x_value*dpsidxi(l,k,j);
439 for(
unsigned j=0;j<3;j++)
441 interpolated_dAdxi(j,
i) += x_value*d2psidxi(l,k,j);
455 interpolated_a,dadxi);
461 for(
unsigned i=0;
i<3;
i++)
463 interpolated_dadxi(0,
i) = dadxi(0,0,
i);
464 interpolated_dadxi(1,
i) = dadxi(1,1,
i);
465 interpolated_dadxi(2,
i) = dadxi(0,1,
i);
470 double a[2][2], A[2][2], aup[2][2], Aup[2][2], gamma[2][2];
473 for(
unsigned al=0;al<2;al++)
475 for(
unsigned be=0;be<2;be++)
481 for(
unsigned k=0;k<3;k++)
483 a[al][be] += interpolated_a(al,k)*interpolated_a(be,k);
484 A[al][be] += interpolated_A(al,k)*interpolated_A(be,k);
487 gamma[al][be] = 0.5*(A[al][be] - a[al][be]);
496 double sqrt_adet = sqrt(adet);
497 double sqrt_Adet = sqrt(Adet);
501 n[0] = (interpolated_a(0,1)*interpolated_a(1,2) -
502 interpolated_a(0,2)*interpolated_a(1,1))/sqrt_adet;
503 n[1] = (interpolated_a(0,2)*interpolated_a(1,0) -
504 interpolated_a(0,0)*interpolated_a(1,2))/sqrt_adet;
505 n[2] = (interpolated_a(0,0)*interpolated_a(1,1) -
506 interpolated_a(0,1)*interpolated_a(1,0))/sqrt_adet;
507 N[0] = (interpolated_A(0,1)*interpolated_A(1,2) -
508 interpolated_A(0,2)*interpolated_A(1,1))/sqrt_Adet;
509 N[1] = (interpolated_A(0,2)*interpolated_A(1,0) -
510 interpolated_A(0,0)*interpolated_A(1,2))/sqrt_Adet;
511 N[2] = (interpolated_A(0,0)*interpolated_A(1,1) -
512 interpolated_A(0,1)*interpolated_A(1,0))/sqrt_Adet;
516 double b[2][2],
B[2][2];
518 b[0][0] = n[0]*interpolated_dadxi(0,0)
519 + n[1]*interpolated_dadxi(0,1)
520 + n[2]*interpolated_dadxi(0,2);
523 b[0][1] = b[1][0] = n[0]*interpolated_dadxi(2,0)
524 + n[1]*interpolated_dadxi(2,1)
525 + n[2]*interpolated_dadxi(2,2);
527 b[1][1] = n[0]*interpolated_dadxi(1,0)
528 + n[1]*interpolated_dadxi(1,1)
529 + n[2]*interpolated_dadxi(1,2);
532 B[0][0] = N[0]*interpolated_dAdxi(0,0)
533 + N[1]*interpolated_dAdxi(0,1)
534 + N[2]*interpolated_dAdxi(0,2);
537 B[0][1] = B[1][0] = N[0]*interpolated_dAdxi(2,0)
538 + N[1]*interpolated_dAdxi(2,1)
539 + N[2]*interpolated_dAdxi(2,2);
541 B[1][1] = N[0]*interpolated_dAdxi(1,0)
542 + N[1]*interpolated_dAdxi(1,1)
543 + N[2]*interpolated_dAdxi(1,2);
548 for(
unsigned i=0;
i<2;
i++)
550 for(
unsigned j=0;j<2;j++)
552 kappa[
i][j] = b[
i][j] - B[
i][j];
557 double Et[2][2][2][2];
564 double C1=0.5*(1.0-nu_cached);
568 for(
unsigned i=0;
i<2;
i++)
570 for(
unsigned j=0;j<2;j++)
572 for(
unsigned k=0;k<2;k++)
574 for(
unsigned l=0;l<2;l++)
578 Et[
i][j][k][l] = C1*(aup[
i][k]*aup[j][l] + aup[
i][l]*aup[j][k])
579 + C2*aup[
i][j]*aup[k][l];
594 double normal_var[3][3];
599 unsigned mix[2][2] = {{0,2},{2,1}};
602 for(
unsigned l=0;l<n_node;l++)
605 for(
unsigned k=0;k<n_position_type;k++)
608 normal_var[0][0] = 0.0;
609 normal_var[0][1] = (-interpolated_A(1,2)*dpsidxi(l,k,0)
610 + interpolated_A(0,2)*dpsidxi(l,k,1))/sqrt_Adet;
611 normal_var[0][2] = (interpolated_A(1,1)*dpsidxi(l,k,0)
612 - interpolated_A(0,1)*dpsidxi(l,k,1))/sqrt_Adet;
614 normal_var[1][0] = (interpolated_A(1,2)*dpsidxi(l,k,0)
615 - interpolated_A(0,2)*dpsidxi(l,k,1))/sqrt_Adet;
616 normal_var[1][1] = 0.0;
617 normal_var[1][2] = (-interpolated_A(1,0)*dpsidxi(l,k,0)
618 + interpolated_A(0,0)*dpsidxi(l,k,1))/sqrt_Adet;
620 normal_var[2][0] = (-interpolated_A(1,1)*dpsidxi(l,k,0)
621 + interpolated_A(0,1)*dpsidxi(l,k,1))/sqrt_Adet;
622 normal_var[2][1] = (interpolated_A(1,0)*dpsidxi(l,k,0)
623 - interpolated_A(0,0)*dpsidxi(l,k,1))/sqrt_Adet;
624 normal_var[2][2] = 0.0;
627 for(
unsigned i=0;
i<3;
i++)
636 double bending_dot_product_multiplier =
637 ((A[1][1]*interpolated_A(0,
i) -
638 A[1][0]*interpolated_A(1,
i))*dpsidxi(l,k,0)
639 + (A[0][0]*interpolated_A(1,
i) -
640 A[0][1]*interpolated_A(0,
i))*dpsidxi(l,k,1))/Adet;
643 for(
unsigned i2=0;i2<3;i2++)
644 {normal_var[
i][i2] -= N[i2]*bending_dot_product_multiplier;}
647 residuals[local_eqn] -= f[
i]/h_cached*psi(l,k)*W*sqrt_Adet;
652 double other_residual_terms = lambda_sq_cached*accel[
i]*psi(l,k);
655 for(
unsigned al=0;al<2;al++)
657 for(
unsigned be=0;be<2;be++)
660 other_residual_terms +=
662 *interpolated_A(al,
i)
666 for(
unsigned ga=0;ga<2;ga++)
668 for(
unsigned de=0;de<2;de++)
673 other_residual_terms +=
674 Et[al][be][ga][de]*gamma[al][be]
675 *interpolated_A(ga,
i)
680 other_residual_terms -=
681 bending_scale*Et[al][be][ga][de]*kappa[al][be]*
682 (N[
i]*d2psidxi(l,k,mix[ga][de])
684 + normal_var[
i][0]*interpolated_dAdxi(mix[ga][de],0)
685 + normal_var[
i][1]*interpolated_dAdxi(mix[ga][de],1)
686 + normal_var[
i][2]*interpolated_dAdxi(mix[ga][de],2));
692 residuals[local_eqn] += other_residual_terms*W*sqrt_adet;
720 unsigned n_dof =
ndof();
752 const unsigned n_node =
nnode();
758 Shape psi(n_node,n_position_type);
759 DShape dpsidxi(n_node,n_position_type,n_lagrangian);
760 DShape d2psidxi(n_node,n_position_type,3);
767 const double nu_cached =
nu();
768 const double h_cached =
h();
769 const double lambda_sq_cached =
lambda_sq();
776 "Warning: Not sure if the energy is computed correctly\n";
777 error_message +=
" for nonzero prestress\n";
793 const double bending_scale = (1.0/12.0)*h_cached*h_cached;
796 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
808 for(
unsigned i=0;
i<n_dim;
i++)
811 for(
unsigned j=0;j<n_lagrangian;j++)
813 interpolated_A(j,
i) = 0.0;
815 for(
unsigned j=0;j<3;j++)
817 interpolated_dAdxi(
i,j) = 0.0;
820 for(
unsigned j=0;j<n_lagrangian;j++)
822 interpolated_xi[j] = 0.0;
826 for(
unsigned l=0;l<n_node;l++)
829 for(
unsigned k=0;k<n_position_type;k++)
832 for(
unsigned i=0;
i<n_lagrangian;
i++)
838 for(
unsigned i=0;
i<n_dim;
i++)
845 for(
unsigned j=0;j<n_lagrangian;j++)
847 interpolated_A(j,
i) += x_value*dpsidxi(l,k,j);
850 for(
unsigned j=0;j<3;j++)
852 interpolated_dAdxi(j,
i) += x_value*d2psidxi(l,k,j);
860 for(
unsigned i=0;
i<n_dim;
i++)
862 veloc_sq += veloc[
i]*veloc[
i];
880 for(
unsigned i=0;
i<3;
i++)
882 interpolated_dadxi(0,
i) = dadxi(0,0,
i);
883 interpolated_dadxi(1,
i) = dadxi(1,1,
i);
884 interpolated_dadxi(2,
i) = dadxi(0,1,
i);
889 double a[2][2], A[2][2], aup[2][2], Aup[2][2], gamma[2][2];
892 for(
unsigned al=0;al<2;al++)
894 for(
unsigned be=0;be<2;be++)
900 for(
unsigned k=0;k<n_dim;k++)
902 a[al][be] += interpolated_a(al,k)*interpolated_a(be,k);
903 A[al][be] += interpolated_A(al,k)*interpolated_A(be,k);
906 gamma[al][be] = 0.5*(A[al][be] - a[al][be]);
915 double sqrt_adet = sqrt(adet);
916 double sqrt_Adet = sqrt(Adet);
920 n[0] = (interpolated_a(0,1)*interpolated_a(1,2) -
921 interpolated_a(0,2)*interpolated_a(1,1))/sqrt_adet;
922 n[1] = (interpolated_a(0,2)*interpolated_a(1,0) -
923 interpolated_a(0,0)*interpolated_a(1,2))/sqrt_adet;
924 n[2] = (interpolated_a(0,0)*interpolated_a(1,1) -
925 interpolated_a(0,1)*interpolated_a(1,0))/sqrt_adet;
926 N[0] = (interpolated_A(0,1)*interpolated_A(1,2) -
927 interpolated_A(0,2)*interpolated_A(1,1))/sqrt_Adet;
928 N[1] = (interpolated_A(0,2)*interpolated_A(1,0) -
929 interpolated_A(0,0)*interpolated_A(1,2))/sqrt_Adet;
930 N[2] = (interpolated_A(0,0)*interpolated_A(1,1) -
931 interpolated_A(0,1)*interpolated_A(1,0))/sqrt_Adet;
935 double b[2][2],
B[2][2];
937 b[0][0] = n[0]*interpolated_dadxi(0,0)
938 + n[1]*interpolated_dadxi(0,1)
939 + n[2]*interpolated_dadxi(0,2);
942 b[0][1] = b[1][0] = n[0]*interpolated_dadxi(2,0)
943 + n[1]*interpolated_dadxi(2,1)
944 + n[2]*interpolated_dadxi(2,2);
946 b[1][1] = n[0]*interpolated_dadxi(1,0)
947 + n[1]*interpolated_dadxi(1,1)
948 + n[2]*interpolated_dadxi(1,2);
951 B[0][0] = N[0]*interpolated_dAdxi(0,0)
952 + N[1]*interpolated_dAdxi(0,1)
953 + N[2]*interpolated_dAdxi(0,2);
956 B[0][1] = B[1][0] = N[0]*interpolated_dAdxi(2,0)
957 + N[1]*interpolated_dAdxi(2,1)
958 + N[2]*interpolated_dAdxi(2,2);
960 B[1][1] = N[0]*interpolated_dAdxi(1,0)
961 + N[1]*interpolated_dAdxi(1,1)
962 + N[2]*interpolated_dAdxi(1,2);
967 for(
unsigned i=0;
i<2;
i++)
969 for(
unsigned j=0;j<2;j++)
971 kappa[
i][j] = b[
i][j] - B[
i][j];
976 double Et[2][2][2][2];
979 double C1=0.5*(1.0-nu_cached);
983 for(
unsigned i=0;
i<2;
i++)
985 for(
unsigned j=0;j<2;j++)
987 for(
unsigned k=0;k<2;k++)
989 for(
unsigned l=0;l<2;l++)
991 Et[
i][j][k][l] = C1*(aup[
i][k]*aup[j][l] + aup[
i][l]*aup[j][k])
992 + C2*aup[
i][j]*aup[k][l];
999 double pot_en_cont = 0.0;
1001 for(
unsigned i=0;
i<2;
i++)
1003 for(
unsigned j=0;j<2;j++)
1005 for(
unsigned k=0;k<2;k++)
1007 for(
unsigned l=0;l<2;l++)
1009 pot_en_cont+= Et[
i][j][k][l] *
1010 (gamma[
i][j]*gamma[k][l] + bending_scale*kappa[
i][j]*kappa[k][l]);
1015 pot_en += pot_en_cont*0.5*W*sqrt_adet;
1018 kin_en+=0.5*lambda_sq_cached*veloc_sq*W*sqrt_adet;
1039 double rate_of_work_integral=0.0;
1042 const unsigned n_dim = 3;
1045 const unsigned n_lagrangian = 2;
1048 const unsigned n_node =
nnode();
1060 Shape psi(n_node, n_position_type);
1061 DShape dpsidxi(n_node, n_position_type, n_lagrangian);
1083 for (
unsigned ipt=0;ipt<n_intpt;ipt++)
1089 for(
unsigned i=0;
i<n_lagrangian;
i++)
1101 for(
unsigned i=0;
i<n_dim;
i++)
1105 for(
unsigned j=0;j<n_lagrangian;j++)
1107 interpolated_A(j,
i) = 0.0;
1112 for(
unsigned i=0;
i<n_lagrangian;
i++)
1118 for(
unsigned l=0;l<n_node;l++)
1121 for(
unsigned k=0;k<n_position_type;k++)
1124 for(
unsigned i=0;
i<n_lagrangian;
i++)
1130 for(
unsigned i=0;
i<n_dim;
i++)
1135 x[
i] += x_value*psi(l,k);
1138 for(
unsigned j=0;j<n_lagrangian;j++)
1140 interpolated_A(j,
i) += x_value*dpsidxi(l,k,j);
1148 for(
unsigned al=0;al<2;al++)
1150 for(
unsigned be=0;be<2;be++)
1155 for(
unsigned k=0;k<n_dim;k++)
1157 A[al][be] += interpolated_A(al,k)*interpolated_A(be,k);
1163 double A_det = A[0][0]*A[1][1] - A[0][1]*A[1][0];
1172 double rate_of_work=0.0;
1173 for (
unsigned i=0;
i<n_dim;
i++)
1175 rate_of_work+=load[
i]*velocity[
i];
1179 rate_of_work_integral+=rate_of_work/
h()*W*A_det;
1182 return rate_of_work_integral;
1192 const unsigned &n_plot)
1198 outfile <<
"ZONE I=" << n_plot <<
", J=" << n_plot << std::endl;
1201 for(
unsigned l2=0;l2<n_plot;l2++)
1203 s[1] = -1.0 + l2*2.0/(n_plot-1);
1204 for(
unsigned l1=0;l1<n_plot;l1++)
1206 s[0] = -1.0 + l1*2.0/(n_plot-1);
1221 outfile << std::endl;
1234 outfile <<
"ZONE I=" << n_plot <<
", J=" << n_plot << std::endl;
1237 for(
unsigned l2=0;l2<n_plot;l2++)
1239 s[1] = -1.0 + l2*2.0/(n_plot-1);
1240 for(
unsigned l1=0;l1<n_plot;l1++)
1242 s[0] = -1.0 + l1*2.0/(n_plot-1);
1251 outfile << std::endl;
1264 fprintf(file_pt,
"ZONE I=%i, J=%i \n",n_plot,n_plot);
1267 for(
unsigned l2=0;l2<n_plot;l2++)
1269 s[1] = -1.0 + l2*2.0/(n_plot-1);
1270 for(
unsigned l1=0;l1<n_plot;l1++)
1272 s[0] = -1.0 + l1*2.0/(n_plot-1);
1275 fprintf(file_pt,
"%g %g %g ",
1279 fprintf(file_pt,
"%g %g \n ",
1284 fprintf(file_pt,
"\n");
1303 "Undeformed_midplane_pt has not been set",
1304 "FSIDiagHermiteShellElement::dposition_dlagrangian_at_local_coordinate()",
1305 OOMPH_EXCEPTION_LOCATION);
1316 unsigned n_node =
nnode();
1322 Shape psi(n_node,n_position_type);
1323 DShape dpsidxi(n_node,n_position_type,n_lagrangian);
1333 for(
unsigned l=0;l<n_node;l++)
1336 for(
unsigned k=0;k<n_position_type;k++)
1339 for(
unsigned i=0;
i<n_dim;
i++)
1342 for(
unsigned j=0;j<n_lagrangian;j++)
1363 std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list)
const 1367 std::pair<unsigned long,unsigned> dof_lookup;
1370 const unsigned n_node = this->
nnode();
1377 int local_unknown=0;
1380 for(
unsigned n=0;n<n_node;n++)
1383 for(
unsigned k=0;k<n_position_type;k++)
1386 for(
unsigned i=0;
i<nodal_dim;
i++)
1392 if (local_unknown >= 0)
1396 dof_lookup.first = this->
eqn_number(local_unknown);
1397 dof_lookup.second = 0;
1400 dof_lookup_list.push_front(dof_lookup);
1424 const int &face_index) :
1478 nadditional_data_values[0]=2;
1479 nadditional_data_values[1]=2;
1507 const unsigned n_node =
nnode();
1519 Shape psi(n_node,n_type);
1525 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
1541 for(
unsigned j=0;j<n_node;j++)
1543 for(
unsigned k=0;k<n_type;k++)
1561 double constraint_residual=
1571 for(
unsigned j=0;j<n_node;j++)
1574 for(
unsigned k=0;k<n_type;k++)
1582 residuals[local_eqn]+=constraint_residual*psi(j,k)*
W;
1593 double fd_step=1.0e-8;
1596 for(
unsigned j=0;j<n_node;j++)
1601 for (
unsigned i=0;
i<3;
i++)
1604 for(
unsigned k=0;k<4;k++)
1612 double backup=nod_pt->
x_gen(k,
i);
1615 nod_pt->
x_gen(k,
i)+=fd_step;
1618 bulk_el_pt->
get_normal(s_bulk,shell_normal_plus);
1621 double constraint_residual_plus=
1622 shell_normal_plus[0]*Normal_to_clamping_plane[0]+
1623 shell_normal_plus[1]*Normal_to_clamping_plane[1]+
1624 shell_normal_plus[2]*Normal_to_clamping_plane[2];
1628 double dres_dx=(constraint_residual_plus-constraint_residual)/
1632 residuals[local_eqn]+=lambda*dres_dx*
W;
1635 nod_pt->
x_gen(k,
i)=backup;
1653 output(std::ostream &outfile,
const unsigned &n_plot)
1673 outfile <<
"ZONE I=" << n_plot << std::endl;
1676 for(
unsigned l=0;l<n_plot;l++)
1678 s[0] = -1.0 + l*2.0/(n_plot-1);
1691 for(
unsigned j=0;j<2;j++)
1693 for(
unsigned k=0;k<2;k++)
1707 outfile << s[0] <<
" " 1720 << shell_normal[0] <<
" " 1721 << shell_normal[1] <<
" " 1722 << shell_normal[2] <<
" " 1723 << Normal_to_clamping_plane[0] <<
" " 1724 << Normal_to_clamping_plane[1] <<
" " 1725 << Normal_to_clamping_plane[2] <<
" " 1726 << dot_product <<
" " 1732 const bool check_error=
false;
1735 double max_error=0.0;
1741 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
1753 double error=std::fabs(J_via_s-J_via_ipt);
1754 if (error>max_error) max_error=error;
1756 if (max_error>1.0
e-14)
1758 oomph_info <<
"Warning: Max. error between J_via_s J_via_ipt " 1759 << max_error << std::endl;
1774 std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list)
const 1778 std::pair<unsigned long,unsigned> dof_lookup;
1781 const unsigned n_node = this->
nnode();
1788 int local_unknown=0;
1791 for(
unsigned n=0;n<n_node;n++)
1797 for(
unsigned k=0;k<n_position_type;k++)
1800 for(
unsigned i=0;
i<nodal_dim;
i++)
1806 if (local_unknown >= 0)
1810 dof_lookup.first = this->
eqn_number(local_unknown);
1811 dof_lookup.second = 0;
1814 dof_lookup_list.push_front(dof_lookup);
1821 unsigned n_val=nod_pt->
nvalue();
1822 for(
unsigned j=0;j<n_val;j++)
1828 if (local_unknown >= 0)
1832 dof_lookup.first = this->
eqn_number(local_unknown);
1833 dof_lookup.second = 0;
1836 dof_lookup_list.push_front(dof_lookup);
double dshape_lagrangian(const Vector< double > &s, Shape &psi, DShape &dpsidxi) const
Calculate shape functions and derivatives w.r.t. Lagrangian coordinates at local coordinate s...
virtual void get_residuals(Vector< double > &residuals)
Calculate the vector of residuals of the equations in the element. By default initialise the vector t...
double load_rate_of_work()
Get integral of instantaneous rate of work done on the wall due to the load returned by the virtual f...
Class of matrices containing doubles, and stored as a DenseMatrix<double>, but with solving functiona...
double J_eulerian_at_knot(const unsigned &ipt) const
Return the Jacobian of the mapping from local to global coordinates at the ipt-th integration point O...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the element's contribution to its residual vector.
static double Default_lambda_sq_value
Static default value for the timescale ratio (1.0 for natural scaling)
void initialise(const T &val)
Initialize all values in the matrix to val.
void output_with_time_dep_quantities(std::ostream &outfile, const unsigned &n_plot)
Output position veloc and accel.
void resize_nodes(Vector< unsigned > &nadditional_data_values)
Provide additional storage for a specified number of values at the nodes of the FaceElement. (This is needed, for instance, in free-surface elements, if the non-penetration condition is imposed by Lagrange multipliers whose values are only stored at the surface nodes but not in the interior of the bulk element). nadditional_data_values[n] specifies the number of additional values required at node n of the FaceElement. Note: Since this function is executed separately for each FaceElement, nodes that are common to multiple elements might be resized repeatedly. To avoid this, we only allow a single resize operation by comparing the number of values stored at each node to the number of values the node had when it was simply a member of the associated "bulk" element. There are cases where this will break! – e.g. if a node is common to two FaceElements which require additional storage for distinct quantities. Such cases need to be handled by "hand-crafted" face elements.
virtual double d2shape_lagrangian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidxi, DShape &d2psidxi) const
Return the geometric shape functions and also first and second derivatives w.r.t. Lagrangian coordina...
static void Zero_traction_fct(const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Default load function (zero traction)
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Return the jacobian is calculated by finite differences by default,.
double dnodal_position_gen_dt(const unsigned &n, const unsigned &k, const unsigned &i) const
i-th component of time derivative (velocity) of the generalised position, dx(k,i)/dt at local node n...
const double & lambda_sq() const
Return the timescale ratio (non-dimensional density)
double raw_dnodal_position_gen_dt(const unsigned &n, const unsigned &k, const unsigned &i) const
i-th component of time derivative (velocity) of the generalised position, dx(k,i)/dt at local node n...
A general Finite Element class.
virtual double interpolated_dxdt(const Vector< double > &s, const unsigned &i, const unsigned &t)
Return t-th time-derivative of the i-th FE-interpolated Eulerian coordinate at local coordinate s...
double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s. Overloaded to get information from bulk...
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
bool Ignore_membrane_terms
Boolean flag to ignore membrane terms.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned > > &dof_lookup_list) const
Create a list of pairs for all unknowns in this element, so that the first entry in each pair contain...
void fill_in_jacobian_from_external_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Calculate the contributions to the jacobian from the external degrees of freedom using finite differe...
static double Zero_prestress
Static default for prestress (set to zero)
double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s...
double raw_nodal_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Return the value of the k-th type of the i-th positional variable at the local node n...
double calculate_contravariant(double A[2][2], double Aup[2][2])
Invert a DIM by DIM matrix.
unsigned nnodal_position_type() const
Return the number of coordinate types that the element requires to interpolate the geometry between t...
GeomObject * Undeformed_midplane_pt
Pointer to the GeomObject that specifies the undeformed midplane of the shell.
double interpolated_xi(const Vector< double > &s, const unsigned &i) const
Return i-th FE-interpolated Lagrangian coordinate xi[i] at local coordinate s. Overloaded from SolidF...
std::pair< double, double > get_strain_and_bend(const Vector< double > &s, DenseDoubleMatrix &strain, DenseDoubleMatrix &bend)
Get strain and bending tensors; returns pair comprising the determinant of the undeformed (*...
unsigned ndof() const
Return the number of equations/dofs in the element.
unsigned nlagrangian() const
Access function to # of Lagrangian coordinates.
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
void bulk_position_type_resize(const unsigned &i)
Resize the storage for bulk_position_type to i entries.
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
static double Default_nu_value
Static default value for the Poisson's ratio.
static double Default_h_value
Static default value for the thickness ratio.
virtual void d2position(const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
2nd derivative of position Vector w.r.t. to coordinates: = ddrdzeta(alpha,beta,i). Evaluated at current time.
double lagrangian_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Return Generalised Lagrangian coordinate at local node n. `Direction' i, `Type' k.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
virtual void fill_in_jacobian_from_solid_position_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Use finite differences to calculate the Jacobian entries corresponding to the solid positions...
DenseMatrix< double * > Prestress_pt
Pointer to membrane pre-stress terms – should probably generalise this to function pointers at some ...
virtual void load_vector(const unsigned &intpt, const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Get the load vector: Pass number of integration point (dummy), Lagr. coordinate and normal vector and...
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number...
const double & nu() const
Return the Poisson's ratio.
void set_nnodal_position_type(const unsigned &nposition_type)
Set the number of types required to interpolate the coordinate.
const double & h() const
Return the wall thickness to undeformed radius ratio.
Vector< unsigned > Nbulk_value
A vector that will hold the number of data values at the nodes that are associated with the "bulk" el...
double & x_gen(const unsigned &k, const unsigned &i)
Reference to the generalised position x(k,i).
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
void dposition_dlagrangian_at_local_coordinate(const Vector< double > &s, DenseMatrix< double > &drdxi) const
Derivative of position vector w.r.t. the SolidFiniteElement's.
int position_local_eqn(const unsigned &n, const unsigned &k, const unsigned &j) const
Access function that returns the local equation number that corresponds to the j-th coordinate of the...
virtual double interpolated_xi(const Vector< double > &s, const unsigned &i) const
Return i-th FE-interpolated Lagrangian coordinate xi[i] at local coordinate s.
unsigned & bulk_position_type(const unsigned &i)
Return the position type in the "bulk" element that corresponds to position type i on the FaceElement...
void shape(const Vector< double > &s, Shape &psi) const
Calculate the geometric shape functions at local coordinate s. Set any "superfluous" shape functions ...
unsigned ndim() const
Access function to # of Eulerian coordinates.
void fill_in_jacobian_for_newmark_accel(DenseMatrix< double > &jacobian)
Fill in the contributions of the Jacobian matrix for the consistent assignment of the initial "accele...
double nodal_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Return the value of the k-th type of the i-th positional variable at the local node n...
Vector< double > Normal_to_clamping_plane
Normal vector to the clamping plane.
bool Solve_for_consistent_newmark_accel_flag
Flag to indicate which system of equations to solve when assigning initial conditions for time-depend...
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
double prestress(const unsigned &i, const unsigned &j)
Return (i,j)-th component of second Piola Kirchhoff membrane prestress.
void output(std::ostream &outfile)
Overload the output function.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
void fill_in_contribution_to_residuals_shell(Vector< double > &residuals)
Return the residuals for the equations of KL shell theory.
virtual void build_face_element(const int &face_index, FaceElement *face_element_pt)
Function for building a lower dimensional FaceElement on the specified face of the FiniteElement...
double d2shape_lagrangian(const Vector< double > &s, Shape &psi, DShape &dpsidxi, DShape &d2psidxi) const
Compute the geometric shape functions and also first and second derivatives w.r.t. Lagrangian coordinates at local coordinate s; Returns Jacobian of mapping from Lagrangian to local coordinates. Numbering: 1D: d2pidxi(i,0) = 2D: d2psidxi(i,0) = d2psidxi(i,1) = d2psidxi(i,2) = 3D: d2psidxi(i,0) = d2psidxi(i,1) = d2psidxi(i,2) = d2psidxi(i,3) = d2psidxi(i,4) = d2psidxi(i,5) = .
ClampedHermiteShellBoundaryConditionElement()
Broken empty constructor.
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned > > &dof_lookup_list) const
Create a list of pairs for all unknowns in this element, so that the first entry in each pair contain...
virtual void load_vector_for_rate_of_work_computation(const unsigned &intpt, const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Get the load vector for the computation of the rate of work done by the load. Here we simply forward ...
unsigned nnode() const
Return the number of nodes.
Vector< double > local_coordinate_in_bulk(const Vector< double > &s) const
Return vector of local coordinates in bulk element, given the local coordinates in this FaceElement...
void get_energy(double &pot_en, double &kin_en)
Get potential (strain) and kinetic energy of the element.
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation...
void get_normal(const Vector< double > &s, Vector< double > &N)
Get normal vector.
void output(std::ostream &outfile)
double raw_lagrangian_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Return Generalised Lagrangian coordinate at local node n. `Direction' i, `Type' k. Does not use the hanging node representation.
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Return the local equation number corresponding to the i-th value at the n-th local node...