55 unsigned n_dim = load.size();
56 for (
unsigned i = 0;
i < n_dim;
i++)
76 const unsigned n_dim = 3;
79 const unsigned n_lagrangian = 2;
82 const unsigned n_node =
nnode();
88 Shape psi(n_node, n_position_type);
89 DShape dpsidxi(n_node, n_position_type, n_lagrangian);
92 DShape d2psidxi(n_node, n_position_type, 3);
106 for (
unsigned i = 0;
i < n_dim;
i++)
108 for (
unsigned j = 0; j < n_lagrangian; j++)
110 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++)
158 const unsigned n_dim = 3;
161 const unsigned n_lagrangian = 2;
164 const unsigned n_node =
nnode();
170 Shape psi(n_node, n_position_type);
171 DShape dpsidxi(n_node, n_position_type, n_lagrangian);
174 DShape d2psidxi(n_node, n_position_type, 3);
191 for (
unsigned i = 0;
i < n_dim;
i++)
193 for (
unsigned j = 0; j < n_lagrangian; j++)
195 interpolated_A(j,
i) = 0.0;
197 for (
unsigned j = 0; j < 3; j++)
199 interpolated_dAdxi(
i, j) = 0.0;
204 for (
unsigned l = 0; l < n_node; l++)
207 for (
unsigned k = 0; k < n_position_type; k++)
210 for (
unsigned i = 0;
i < n_lagrangian;
i++)
217 for (
unsigned i = 0;
i < n_dim;
i++)
228 for (
unsigned j = 0; j < n_lagrangian; j++)
230 interpolated_A(j,
i) += x_value * dpsidxi(l, k, j);
233 for (
unsigned j = 0; j < 3; j++)
235 interpolated_dAdxi(j,
i) += x_value * d2psidxi(l, k, j);
254 for (
unsigned i = 0;
i < 3;
i++)
256 interpolated_dadxi(0,
i) = dadxi(0, 0,
i);
257 interpolated_dadxi(1,
i) = dadxi(1, 1,
i);
258 interpolated_dadxi(2,
i) = dadxi(0, 1,
i);
262 double a[2][2], A[2][2], aup[2][2], Aup[2][2];
265 for (
unsigned al = 0; al < 2; al++)
267 for (
unsigned be = 0; be < 2; be++)
273 for (
unsigned k = 0; k < 3; k++)
275 a[al][be] += interpolated_a(al, k) * interpolated_a(be, k);
276 A[al][be] += interpolated_A(al, k) * interpolated_A(be, k);
279 strain(al, be) = 0.5 * (A[al][be] - a[al][be]);
288 double sqrt_adet = sqrt(adet);
289 double sqrt_Adet = sqrt(Adet);
293 n[0] = (interpolated_a(0, 1) * interpolated_a(1, 2) -
294 interpolated_a(0, 2) * interpolated_a(1, 1)) /
296 n[1] = (interpolated_a(0, 2) * interpolated_a(1, 0) -
297 interpolated_a(0, 0) * interpolated_a(1, 2)) /
299 n[2] = (interpolated_a(0, 0) * interpolated_a(1, 1) -
300 interpolated_a(0, 1) * interpolated_a(1, 0)) /
302 N[0] = (interpolated_A(0, 1) * interpolated_A(1, 2) -
303 interpolated_A(0, 2) * interpolated_A(1, 1)) /
305 N[1] = (interpolated_A(0, 2) * interpolated_A(1, 0) -
306 interpolated_A(0, 0) * interpolated_A(1, 2)) /
308 N[2] = (interpolated_A(0, 0) * interpolated_A(1, 1) -
309 interpolated_A(0, 1) * interpolated_A(1, 0)) /
314 double b[2][2],
B[2][2];
316 b[0][0] = n[0] * interpolated_dadxi(0, 0) +
317 n[1] * interpolated_dadxi(0, 1) + n[2] * interpolated_dadxi(0, 2);
320 b[0][1] = b[1][0] = n[0] * interpolated_dadxi(2, 0) +
321 n[1] * interpolated_dadxi(2, 1) +
322 n[2] * interpolated_dadxi(2, 2);
324 b[1][1] = n[0] * interpolated_dadxi(1, 0) +
325 n[1] * interpolated_dadxi(1, 1) + n[2] * interpolated_dadxi(1, 2);
328 B[0][0] =
N[0] * interpolated_dAdxi(0, 0) +
329 N[1] * interpolated_dAdxi(0, 1) +
N[2] * interpolated_dAdxi(0, 2);
332 B[0][1] =
B[1][0] =
N[0] * interpolated_dAdxi(2, 0) +
333 N[1] * interpolated_dAdxi(2, 1) +
334 N[2] * interpolated_dAdxi(2, 2);
336 B[1][1] =
N[0] * interpolated_dAdxi(1, 0) +
337 N[1] * interpolated_dAdxi(1, 1) +
N[2] * interpolated_dAdxi(1, 2);
340 for (
unsigned i = 0;
i < 2;
i++)
342 for (
unsigned j = 0; j < 2; j++)
344 bend(
i, j) = b[
i][j] -
B[
i][j];
350 return std::make_pair(adet, Adet);
361 const unsigned n_dim = 3;
364 const unsigned n_lagrangian = 2;
367 const unsigned n_node =
nnode();
373 Shape psi(n_node, n_position_type);
374 DShape dpsidxi(n_node, n_position_type, n_lagrangian);
377 DShape d2psidxi(n_node, n_position_type, 3);
384 const double nu_cached =
nu();
385 const double h_cached =
h();
386 const double lambda_sq_cached =
lambda_sq();
391 const double bending_scale = (1.0 / 12.0) * h_cached * h_cached;
394 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
416 for (
unsigned i = 0;
i < n_dim;
i++)
418 for (
unsigned j = 0; j < n_lagrangian; j++)
420 interpolated_A(j,
i) = 0.0;
422 for (
unsigned j = 0; j < 3; j++)
424 interpolated_dAdxi(
i, j) = 0.0;
429 for (
unsigned l = 0; l < n_node; l++)
432 for (
unsigned k = 0; k < n_position_type; k++)
435 for (
unsigned i = 0;
i < n_lagrangian;
i++)
442 for (
unsigned i = 0;
i < n_dim;
i++)
453 for (
unsigned j = 0; j < n_lagrangian; j++)
455 interpolated_A(j,
i) += x_value * dpsidxi(l, k, j);
458 for (
unsigned j = 0; j < 3; j++)
460 interpolated_dAdxi(j,
i) += x_value * d2psidxi(l, k, j);
479 for (
unsigned i = 0;
i < 3;
i++)
481 interpolated_dadxi(0,
i) = dadxi(0, 0,
i);
482 interpolated_dadxi(1,
i) = dadxi(1, 1,
i);
483 interpolated_dadxi(2,
i) = dadxi(0, 1,
i);
488 double a[2][2], A[2][2], aup[2][2], Aup[2][2], gamma[2][2];
491 for (
unsigned al = 0; al < 2; al++)
493 for (
unsigned be = 0; be < 2; be++)
499 for (
unsigned k = 0; k < 3; k++)
501 a[al][be] += interpolated_a(al, k) * interpolated_a(be, k);
502 A[al][be] += interpolated_A(al, k) * interpolated_A(be, k);
505 gamma[al][be] = 0.5 * (A[al][be] - a[al][be]);
514 double sqrt_adet = sqrt(adet);
515 double sqrt_Adet = sqrt(Adet);
519 n[0] = (interpolated_a(0, 1) * interpolated_a(1, 2) -
520 interpolated_a(0, 2) * interpolated_a(1, 1)) /
522 n[1] = (interpolated_a(0, 2) * interpolated_a(1, 0) -
523 interpolated_a(0, 0) * interpolated_a(1, 2)) /
525 n[2] = (interpolated_a(0, 0) * interpolated_a(1, 1) -
526 interpolated_a(0, 1) * interpolated_a(1, 0)) /
528 N[0] = (interpolated_A(0, 1) * interpolated_A(1, 2) -
529 interpolated_A(0, 2) * interpolated_A(1, 1)) /
531 N[1] = (interpolated_A(0, 2) * interpolated_A(1, 0) -
532 interpolated_A(0, 0) * interpolated_A(1, 2)) /
534 N[2] = (interpolated_A(0, 0) * interpolated_A(1, 1) -
535 interpolated_A(0, 1) * interpolated_A(1, 0)) /
540 double b[2][2],
B[2][2];
542 b[0][0] = n[0] * interpolated_dadxi(0, 0) +
543 n[1] * interpolated_dadxi(0, 1) +
544 n[2] * interpolated_dadxi(0, 2);
547 b[0][1] = b[1][0] = n[0] * interpolated_dadxi(2, 0) +
548 n[1] * interpolated_dadxi(2, 1) +
549 n[2] * interpolated_dadxi(2, 2);
551 b[1][1] = n[0] * interpolated_dadxi(1, 0) +
552 n[1] * interpolated_dadxi(1, 1) +
553 n[2] * interpolated_dadxi(1, 2);
556 B[0][0] =
N[0] * interpolated_dAdxi(0, 0) +
557 N[1] * interpolated_dAdxi(0, 1) +
558 N[2] * interpolated_dAdxi(0, 2);
561 B[0][1] =
B[1][0] =
N[0] * interpolated_dAdxi(2, 0) +
562 N[1] * interpolated_dAdxi(2, 1) +
563 N[2] * interpolated_dAdxi(2, 2);
565 B[1][1] =
N[0] * interpolated_dAdxi(1, 0) +
566 N[1] * interpolated_dAdxi(1, 1) +
567 N[2] * interpolated_dAdxi(1, 2);
572 for (
unsigned i = 0;
i < 2;
i++)
574 for (
unsigned j = 0; j < 2; j++)
576 kappa[
i][j] = b[
i][j] -
B[
i][j];
581 double Et[2][2][2][2];
589 double C1 = 0.5 * (1.0 - nu_cached);
590 double C2 = nu_cached;
593 for (
unsigned i = 0;
i < 2;
i++)
595 for (
unsigned j = 0; j < 2; j++)
597 for (
unsigned k = 0; k < 2; k++)
599 for (
unsigned l = 0; l < 2; l++)
604 C1 * (aup[
i][k] * aup[j][l] + aup[
i][l] * aup[j][k]) +
605 C2 * aup[
i][j] * aup[k][l];
621 double normal_var[3][3];
627 unsigned mix[2][2] = {{0, 2}, {2, 1}};
630 for (
unsigned l = 0; l < n_node; l++)
633 for (
unsigned k = 0; k < n_position_type; k++)
636 normal_var[0][0] = 0.0;
637 normal_var[0][1] = (-interpolated_A(1, 2) * dpsidxi(l, k, 0) +
638 interpolated_A(0, 2) * dpsidxi(l, k, 1)) /
640 normal_var[0][2] = (interpolated_A(1, 1) * dpsidxi(l, k, 0) -
641 interpolated_A(0, 1) * dpsidxi(l, k, 1)) /
644 normal_var[1][0] = (interpolated_A(1, 2) * dpsidxi(l, k, 0) -
645 interpolated_A(0, 2) * dpsidxi(l, k, 1)) /
647 normal_var[1][1] = 0.0;
648 normal_var[1][2] = (-interpolated_A(1, 0) * dpsidxi(l, k, 0) +
649 interpolated_A(0, 0) * dpsidxi(l, k, 1)) /
652 normal_var[2][0] = (-interpolated_A(1, 1) * dpsidxi(l, k, 0) +
653 interpolated_A(0, 1) * dpsidxi(l, k, 1)) /
655 normal_var[2][1] = (interpolated_A(1, 0) * dpsidxi(l, k, 0) -
656 interpolated_A(0, 0) * dpsidxi(l, k, 1)) /
658 normal_var[2][2] = 0.0;
661 for (
unsigned i = 0;
i < 3;
i++)
670 double bending_dot_product_multiplier =
671 ((A[1][1] * interpolated_A(0,
i) -
672 A[1][0] * interpolated_A(1,
i)) *
674 (A[0][0] * interpolated_A(1,
i) -
675 A[0][1] * interpolated_A(0,
i)) *
680 for (
unsigned i2 = 0; i2 < 3; i2++)
682 normal_var[
i][i2] -=
N[i2] * bending_dot_product_multiplier;
686 residuals[local_eqn] -=
687 f[
i] / h_cached * psi(l, k) *
W * sqrt_Adet;
692 double other_residual_terms =
693 lambda_sq_cached * accel[
i] * psi(l, k);
696 for (
unsigned al = 0; al < 2; al++)
698 for (
unsigned be = 0; be < 2; be++)
702 interpolated_A(al,
i) *
706 for (
unsigned ga = 0; ga < 2; ga++)
708 for (
unsigned de = 0; de < 2; de++)
713 other_residual_terms +=
714 Et[al][be][ga][de] * gamma[al][be] *
715 interpolated_A(ga,
i) * dpsidxi(l, k, de);
719 other_residual_terms -=
720 bending_scale * Et[al][be][ga][de] * kappa[al][be] *
721 (
N[
i] * d2psidxi(l, k, mix[ga][de])
724 normal_var[
i][0] * interpolated_dAdxi(mix[ga][de], 0) +
725 normal_var[
i][1] * interpolated_dAdxi(mix[ga][de], 1) +
726 normal_var[
i][2] * interpolated_dAdxi(mix[ga][de], 2));
732 residuals[local_eqn] += other_residual_terms *
W * sqrt_adet;
758 unsigned n_dof =
ndof();
766 full_residuals, jacobian);
790 const unsigned n_node =
nnode();
796 Shape psi(n_node, n_position_type);
797 DShape dpsidxi(n_node, n_position_type, n_lagrangian);
798 DShape d2psidxi(n_node, n_position_type, 3);
805 const double nu_cached =
nu();
806 const double h_cached =
h();
807 const double lambda_sq_cached =
lambda_sq();
815 "Warning: Not sure if the energy is computed correctly\n";
816 error_message +=
" for nonzero prestress\n";
832 const double bending_scale = (1.0 / 12.0) * h_cached * h_cached;
835 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
847 for (
unsigned i = 0;
i < n_dim;
i++)
850 for (
unsigned j = 0; j < n_lagrangian; j++)
852 interpolated_A(j,
i) = 0.0;
854 for (
unsigned j = 0; j < 3; j++)
856 interpolated_dAdxi(
i, j) = 0.0;
859 for (
unsigned j = 0; j < n_lagrangian; j++)
865 for (
unsigned l = 0; l < n_node; l++)
868 for (
unsigned k = 0; k < n_position_type; k++)
871 for (
unsigned i = 0;
i < n_lagrangian;
i++)
877 for (
unsigned i = 0;
i < n_dim;
i++)
884 for (
unsigned j = 0; j < n_lagrangian; j++)
886 interpolated_A(j,
i) += x_value * dpsidxi(l, k, j);
889 for (
unsigned j = 0; j < 3; j++)
891 interpolated_dAdxi(j,
i) += x_value * d2psidxi(l, k, j);
899 for (
unsigned i = 0;
i < n_dim;
i++)
901 veloc_sq += veloc[
i] * veloc[
i];
917 for (
unsigned i = 0;
i < 3;
i++)
919 interpolated_dadxi(0,
i) = dadxi(0, 0,
i);
920 interpolated_dadxi(1,
i) = dadxi(1, 1,
i);
921 interpolated_dadxi(2,
i) = dadxi(0, 1,
i);
926 double a[2][2], A[2][2], aup[2][2], Aup[2][2], gamma[2][2];
929 for (
unsigned al = 0; al < 2; al++)
931 for (
unsigned be = 0; be < 2; be++)
937 for (
unsigned k = 0; k < n_dim; k++)
939 a[al][be] += interpolated_a(al, k) * interpolated_a(be, k);
940 A[al][be] += interpolated_A(al, k) * interpolated_A(be, k);
943 gamma[al][be] = 0.5 * (A[al][be] - a[al][be]);
952 double sqrt_adet = sqrt(adet);
953 double sqrt_Adet = sqrt(Adet);
957 n[0] = (interpolated_a(0, 1) * interpolated_a(1, 2) -
958 interpolated_a(0, 2) * interpolated_a(1, 1)) /
960 n[1] = (interpolated_a(0, 2) * interpolated_a(1, 0) -
961 interpolated_a(0, 0) * interpolated_a(1, 2)) /
963 n[2] = (interpolated_a(0, 0) * interpolated_a(1, 1) -
964 interpolated_a(0, 1) * interpolated_a(1, 0)) /
966 N[0] = (interpolated_A(0, 1) * interpolated_A(1, 2) -
967 interpolated_A(0, 2) * interpolated_A(1, 1)) /
969 N[1] = (interpolated_A(0, 2) * interpolated_A(1, 0) -
970 interpolated_A(0, 0) * interpolated_A(1, 2)) /
972 N[2] = (interpolated_A(0, 0) * interpolated_A(1, 1) -
973 interpolated_A(0, 1) * interpolated_A(1, 0)) /
978 double b[2][2],
B[2][2];
980 b[0][0] = n[0] * interpolated_dadxi(0, 0) +
981 n[1] * interpolated_dadxi(0, 1) +
982 n[2] * interpolated_dadxi(0, 2);
985 b[0][1] = b[1][0] = n[0] * interpolated_dadxi(2, 0) +
986 n[1] * interpolated_dadxi(2, 1) +
987 n[2] * interpolated_dadxi(2, 2);
989 b[1][1] = n[0] * interpolated_dadxi(1, 0) +
990 n[1] * interpolated_dadxi(1, 1) +
991 n[2] * interpolated_dadxi(1, 2);
994 B[0][0] =
N[0] * interpolated_dAdxi(0, 0) +
995 N[1] * interpolated_dAdxi(0, 1) +
996 N[2] * interpolated_dAdxi(0, 2);
999 B[0][1] =
B[1][0] =
N[0] * interpolated_dAdxi(2, 0) +
1000 N[1] * interpolated_dAdxi(2, 1) +
1001 N[2] * interpolated_dAdxi(2, 2);
1003 B[1][1] =
N[0] * interpolated_dAdxi(1, 0) +
1004 N[1] * interpolated_dAdxi(1, 1) +
1005 N[2] * interpolated_dAdxi(1, 2);
1010 for (
unsigned i = 0;
i < 2;
i++)
1012 for (
unsigned j = 0; j < 2; j++)
1014 kappa[
i][j] = b[
i][j] -
B[
i][j];
1019 double Et[2][2][2][2];
1022 double C1 = 0.5 * (1.0 - nu_cached);
1023 double C2 = nu_cached;
1026 for (
unsigned i = 0;
i < 2;
i++)
1028 for (
unsigned j = 0; j < 2; j++)
1030 for (
unsigned k = 0; k < 2; k++)
1032 for (
unsigned l = 0; l < 2; l++)
1035 C1 * (aup[
i][k] * aup[j][l] + aup[
i][l] * aup[j][k]) +
1036 C2 * aup[
i][j] * aup[k][l];
1043 double pot_en_cont = 0.0;
1045 for (
unsigned i = 0;
i < 2;
i++)
1047 for (
unsigned j = 0; j < 2; j++)
1049 for (
unsigned k = 0; k < 2; k++)
1051 for (
unsigned l = 0; l < 2; l++)
1054 Et[
i][j][k][l] * (gamma[
i][j] * gamma[k][l] +
1055 bending_scale * kappa[
i][j] * kappa[k][l]);
1060 pot_en += pot_en_cont * 0.5 *
W * sqrt_adet;
1063 kin_en += 0.5 * lambda_sq_cached * veloc_sq *
W * sqrt_adet;
1083 double rate_of_work_integral = 0.0;
1086 const unsigned n_dim = 3;
1089 const unsigned n_lagrangian = 2;
1092 const unsigned n_node =
nnode();
1104 Shape psi(n_node, n_position_type);
1105 DShape dpsidxi(n_node, n_position_type, n_lagrangian);
1127 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
1133 for (
unsigned i = 0;
i < n_lagrangian;
i++)
1145 for (
unsigned i = 0;
i < n_dim;
i++)
1149 for (
unsigned j = 0; j < n_lagrangian; j++)
1151 interpolated_A(j,
i) = 0.0;
1156 for (
unsigned i = 0;
i < n_lagrangian;
i++)
1162 for (
unsigned l = 0; l < n_node; l++)
1165 for (
unsigned k = 0; k < n_position_type; k++)
1168 for (
unsigned i = 0;
i < n_lagrangian;
i++)
1174 for (
unsigned i = 0;
i < n_dim;
i++)
1179 x[
i] += x_value * psi(l, k);
1182 for (
unsigned j = 0; j < n_lagrangian; j++)
1184 interpolated_A(j,
i) += x_value * dpsidxi(l, k, j);
1192 for (
unsigned al = 0; al < 2; al++)
1194 for (
unsigned be = 0; be < 2; be++)
1199 for (
unsigned k = 0; k < n_dim; k++)
1201 A[al][be] += interpolated_A(al, k) * interpolated_A(be, k);
1207 double A_det = A[0][0] * A[1][1] - A[0][1] * A[1][0];
1216 double rate_of_work = 0.0;
1217 for (
unsigned i = 0;
i < n_dim;
i++)
1219 rate_of_work += load[
i] * velocity[
i];
1223 rate_of_work_integral += rate_of_work /
h() *
W * A_det;
1226 return rate_of_work_integral;
1234 std::ostream& outfile,
const unsigned& n_plot)
1240 outfile <<
"ZONE I=" << n_plot <<
", J=" << n_plot << std::endl;
1243 for (
unsigned l2 = 0; l2 < n_plot; l2++)
1245 s[1] = -1.0 + l2 * 2.0 / (n_plot - 1);
1246 for (
unsigned l1 = 0; l1 < n_plot; l1++)
1248 s[0] = -1.0 + l1 * 2.0 / (n_plot - 1);
1260 outfile << std::endl;
1268 const unsigned& n_plot)
1274 outfile <<
"ZONE I=" << n_plot <<
", J=" << n_plot << std::endl;
1277 for (
unsigned l2 = 0; l2 < n_plot; l2++)
1279 s[1] = -1.0 + l2 * 2.0 / (n_plot - 1);
1280 for (
unsigned l1 = 0; l1 < n_plot; l1++)
1282 s[0] = -1.0 + l1 * 2.0 / (n_plot - 1);
1291 outfile << std::endl;
1304 fprintf(file_pt,
"ZONE I=%i, J=%i \n", n_plot, n_plot);
1307 for (
unsigned l2 = 0; l2 < n_plot; l2++)
1309 s[1] = -1.0 + l2 * 2.0 / (n_plot - 1);
1310 for (
unsigned l1 = 0; l1 < n_plot; l1++)
1312 s[0] = -1.0 + l1 * 2.0 / (n_plot - 1);
1324 fprintf(file_pt,
"\n");
1338 throw OomphLibError(
"Undeformed_midplane_pt has not been set",
1339 "FSIDiagHermiteShellElement::dposition_dlagrangian_"
1340 "at_local_coordinate()",
1341 OOMPH_EXCEPTION_LOCATION);
1352 unsigned n_node =
nnode();
1358 Shape psi(n_node, n_position_type);
1359 DShape dpsidxi(n_node, n_position_type, n_lagrangian);
1369 for (
unsigned l = 0; l < n_node; l++)
1372 for (
unsigned k = 0; k < n_position_type; k++)
1375 for (
unsigned i = 0;
i < n_dim;
i++)
1378 for (
unsigned j = 0; j < n_lagrangian; j++)
1399 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list)
const
1402 std::pair<unsigned long, unsigned> dof_lookup;
1405 const unsigned n_node = this->
nnode();
1412 int local_unknown = 0;
1415 for (
unsigned n = 0; n < n_node; n++)
1418 for (
unsigned k = 0; k < n_position_type; k++)
1421 for (
unsigned i = 0;
i < nodal_dim;
i++)
1427 if (local_unknown >= 0)
1431 dof_lookup.first = this->
eqn_number(local_unknown);
1432 dof_lookup.second = 0;
1435 dof_lookup_list.push_front(dof_lookup);
1510 nadditional_data_values[0] = 2;
1511 nadditional_data_values[1] = 2;
1537 const unsigned n_node =
nnode();
1541 unsigned n_type = 2;
1549 Shape psi(n_node, n_type);
1555 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
1570 double lambda = 0.0;
1571 for (
unsigned j = 0; j < n_node; j++)
1573 for (
unsigned k = 0; k < n_type; k++)
1585 bulk_el_pt->
get_normal(s_bulk, shell_normal);
1591 double constraint_residual =
1601 for (
unsigned j = 0; j < n_node; j++)
1604 for (
unsigned k = 0; k < n_type; k++)
1612 residuals[local_eqn] += constraint_residual * psi(j, k) *
W;
1623 double fd_step = 1.0e-8;
1626 for (
unsigned j = 0; j < n_node; j++)
1631 for (
unsigned i = 0;
i < 3;
i++)
1634 for (
unsigned k = 0; k < 4; k++)
1641 double backup = nod_pt->
x_gen(k,
i);
1644 nod_pt->
x_gen(k,
i) += fd_step;
1647 bulk_el_pt->
get_normal(s_bulk, shell_normal_plus);
1650 double constraint_residual_plus =
1658 (constraint_residual_plus - constraint_residual) / fd_step;
1661 residuals[local_eqn] += lambda * dres_dx *
W;
1664 nod_pt->
x_gen(k,
i) = backup;
1679 std::ostream& outfile,
const unsigned& n_plot)
1698 outfile <<
"ZONE I=" << n_plot << std::endl;
1701 for (
unsigned l = 0; l < n_plot; l++)
1703 s[0] = -1.0 + l * 2.0 / (n_plot - 1);
1709 bulk_el_pt->
get_normal(s_bulk, shell_normal);
1715 double lambda = 0.0;
1716 for (
unsigned j = 0; j < 2; j++)
1718 for (
unsigned k = 0; k < 2; k++)
1739 << shell_normal[0] <<
" " << shell_normal[1] <<
" "
1748 const bool check_error =
false;
1751 double max_error = 0.0;
1757 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
1768 double error = std::fabs(J_via_s - J_via_ipt);
1769 if (error > max_error) max_error = error;
1771 if (max_error > 1.0e-14)
1773 oomph_info <<
"Warning: Max. error between J_via_s J_via_ipt "
1774 << max_error << std::endl;
1790 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list)
const
1793 std::pair<unsigned long, unsigned> dof_lookup;
1796 const unsigned n_node = this->
nnode();
1803 int local_unknown = 0;
1806 for (
unsigned n = 0; n < n_node; n++)
1811 for (
unsigned k = 0; k < n_position_type; k++)
1814 for (
unsigned i = 0;
i < nodal_dim;
i++)
1820 if (local_unknown >= 0)
1824 dof_lookup.first = this->
eqn_number(local_unknown);
1825 dof_lookup.second = 0;
1828 dof_lookup_list.push_front(dof_lookup);
1834 unsigned n_val = nod_pt->
nvalue();
1835 for (
unsigned j = 0; j < n_val; j++)
1841 if (local_unknown >= 0)
1845 dof_lookup.first = this->
eqn_number(local_unknown);
1846 dof_lookup.second = 0;
1849 dof_lookup_list.push_front(dof_lookup);
void output(std::ostream &outfile)
Output function – forward to broken version in FiniteElement until somebody decides what exactly they...
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...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the element's contribution to its residual vector.
Vector< double > Normal_to_clamping_plane
Normal vector to the clamping plane.
void shape(const Vector< double > &s, Shape &psi) const
Calculate the geometric shape functions at local coordinate s. Set any "superfluous" shape functions ...
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Class of matrices containing doubles, and stored as a DenseMatrix<double>, but with solving functiona...
void initialise(const T &val)
Initialize all values in the matrix to val.
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 dposition_dlagrangian_at_local_coordinate(const Vector< double > &s, DenseMatrix< double > &drdxi) const
Derivative of position vector w.r.t. the SolidFiniteElement's Lagrangian coordinates; evaluated at cu...
FaceElements are elements that coincide with the faces of higher-dimensional "bulk" elements....
unsigned & bulk_position_type(const unsigned &i)
Return the position type in the "bulk" element that corresponds to position type i on the FaceElement...
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
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.
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
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...
void bulk_position_type_resize(const unsigned &i)
Resize the storage for bulk_position_type to i entries.
double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s....
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...
Vector< unsigned > Nbulk_value
A vector that will hold the number of data values at the nodes that are associated with the "bulk" el...
void resize_nodes(Vector< unsigned > &nadditional_data_values)
Provide additional storage for a specified number of values at the nodes of the FaceElement....
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
A general Finite Element class.
void set_nnodal_position_type(const unsigned &nposition_type)
Set the number of types required to interpolate the coordinate.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
unsigned nnodal_position_type() const
Return the number of coordinate types that the element requires to interpolate the geometry between t...
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....
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
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.
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.
unsigned nnode() const
Return the number of nodes.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
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.
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 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....
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
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....
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...
unsigned ndof() const
Return the number of equations/dofs in the element.
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number.
virtual void get_residuals(Vector< double > &residuals)
Calculate the vector of residuals of the equations in the element. By default initialise the vector t...
unsigned ndim() const
Access function to # of Eulerian coordinates.
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)....
unsigned nlagrangian() const
Access function to # of Lagrangian coordinates.
An element that solves the Kirchhoff-Love shell theory equations using Hermite interpolation (displac...
void output_with_time_dep_quantities(std::ostream &outfile, const unsigned &n_plot)
Output position veloc and accel.
void output(std::ostream &outfile)
Overload the output function.
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
void fill_in_contribution_to_residuals_shell(Vector< double > &residuals)
Helper function to Return the residuals for the equations of KL shell theory. This is used to prevent...
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)
const double & nu() const
Return the Poisson's ratio.
bool Ignore_membrane_terms
Boolean flag to ignore membrane terms.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Return the jacobian is calculated by finite differences by default,.
double prestress(const unsigned &i, const unsigned &j)
Return (i,j)-th component of second Piola Kirchhoff membrane prestress.
static double Default_lambda_sq_value
Static default value for the timescale ratio (1.0 for natural scaling)
double calculate_contravariant(double A[2][2], double Aup[2][2])
Invert a DIM by DIM matrix.
DenseMatrix< double * > Prestress_pt
Pointer to membrane pre-stress terms – should probably generalise this to function pointers at some p...
static double Zero_prestress
Static default for prestress (set to zero)
void get_energy(double &pot_en, double &kin_en)
Get potential (strain) and kinetic energy of the element.
void get_normal(const Vector< double > &s, Vector< double > &N)
Get normal vector.
const double & lambda_sq() const
Return the timescale ratio (non-dimensional density)
static double Default_h_value
Static default value for the thickness ratio.
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...
static double Default_nu_value
Static default value for the Poisson's ratio.
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...
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 (*....
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 ...
const double & h() const
Return the wall thickness to undeformed radius ratio.
GeomObject * Undeformed_midplane_pt
Pointer to the GeomObject that specifies the undeformed midplane of the shell.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
double & x_gen(const unsigned &k, const unsigned &i)
Reference to the generalised position x(k,i). ‘Type’: k; Coordinate direction: i.
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation....
An OomphLibError object which should be thrown when an run-time error is encountered....
////////////////////////////////////////////////////////////////// //////////////////////////////////...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
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...
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.
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....
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....
bool Solve_for_consistent_newmark_accel_flag
Flag to indicate which system of equations to solve when assigning initial conditions for time-depend...
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...
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.
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....
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....
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...
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...