50 const unsigned n_node =
nnode();
57 unsigned u_nodal_index[6];
58 for (
unsigned i = 0;
i < 6; ++
i)
66 for (
unsigned i = 0;
i < 2;
i++)
73 bool pressure_dof_is_hanging[n_pres];
79 for (
unsigned l = 0; l < n_pres; ++l)
81 pressure_dof_is_hanging[l] =
88 for (
unsigned l = 0; l < n_pres; ++l)
90 pressure_dof_is_hanging[l] =
false;
96 Shape psif(n_node), testf(n_node);
97 DShape dpsifdx(n_node, 2), dtestfdx(n_node, 2);
100 Shape psip(n_pres), testp(n_pres);
116 int local_eqn = 0, local_unknown = 0;
119 HangInfo *hang_info_pt = 0, *hang_info2_pt = 0;
122 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
125 for (
unsigned i = 0;
i < 2;
i++)
136 ipt, psif, dpsifdx, testf, dtestfdx);
143 const double W = w * J;
167 for (
unsigned l = 0; l < n_pres; l++)
170 const double psip_ = psip(l);
173 for (
unsigned i = 0;
i < 2;
i++)
179 interpolated_p[
i] += p_value * psip_;
187 for (
unsigned l = 0; l < n_node; l++)
190 const double psif_ = psif(l);
193 for (
unsigned i = 0;
i < 2;
i++)
199 for (
unsigned i = 0;
i < 6;
i++)
202 const double u_value = this->
nodal_value(l, u_nodal_index[
i]);
205 interpolated_u[
i] += u_value * psif_;
211 for (
unsigned j = 0; j < 2; j++)
213 interpolated_dudx(
i, j) += u_value * dpsifdx(l, j);
222 for (
unsigned l = 0; l < n_node; l++)
225 for (
unsigned i = 0;
i < 2;
i++)
254 const double interpolated_ur = base_flow_u[0];
255 const double interpolated_uz = base_flow_u[1];
256 const double interpolated_utheta = base_flow_u[2];
257 const double interpolated_durdr = base_flow_dudx(0, 0);
258 const double interpolated_durdz = base_flow_dudx(0, 1);
259 const double interpolated_duzdr = base_flow_dudx(1, 0);
260 const double interpolated_duzdz = base_flow_dudx(1, 1);
261 const double interpolated_duthetadr = base_flow_dudx(2, 0);
262 const double interpolated_duthetadz = base_flow_dudx(2, 1);
268 const double interpolated_UC = interpolated_u[0];
269 const double interpolated_US = interpolated_u[1];
270 const double interpolated_WC = interpolated_u[2];
271 const double interpolated_WS = interpolated_u[3];
272 const double interpolated_VC = interpolated_u[4];
273 const double interpolated_VS = interpolated_u[5];
274 const double interpolated_PC = interpolated_p[0];
275 const double interpolated_PS = interpolated_p[1];
278 const double interpolated_dUCdr = interpolated_dudx(0, 0);
279 const double interpolated_dUCdz = interpolated_dudx(0, 1);
280 const double interpolated_dUSdr = interpolated_dudx(1, 0);
281 const double interpolated_dUSdz = interpolated_dudx(1, 1);
282 const double interpolated_dWCdr = interpolated_dudx(2, 0);
283 const double interpolated_dWCdz = interpolated_dudx(2, 1);
284 const double interpolated_dWSdr = interpolated_dudx(3, 0);
285 const double interpolated_dWSdz = interpolated_dudx(3, 1);
286 const double interpolated_dVCdr = interpolated_dudx(4, 0);
287 const double interpolated_dVCdz = interpolated_dudx(4, 1);
288 const double interpolated_dVSdr = interpolated_dudx(5, 0);
289 const double interpolated_dVSdz = interpolated_dudx(5, 1);
296 unsigned n_master = 1;
299 double hang_weight = 1.0;
302 for (
unsigned l = 0; l < n_node; l++)
305 const double testf_ = testf(l);
306 const double dtestfdr = dtestfdx(l, 0);
307 const double dtestfdz = dtestfdx(l, 1);
319 n_master = hang_info_pt->
nmaster();
328 for (
unsigned m = 0; m < n_master; m++)
331 for (
unsigned i = 0;
i < 6;
i++)
372 interpolated_PC * (testf_ + r * dtestfdr) *
W * hang_weight;
375 sum -= visc_ratio * r * (1.0 +
Gamma[0]) *
376 interpolated_dUCdr * dtestfdr *
W * hang_weight;
378 sum -= visc_ratio * r *
379 (interpolated_dUCdz +
Gamma[0] * interpolated_dWCdr) *
380 dtestfdz *
W * hang_weight;
383 ((k *
Gamma[0] * interpolated_dVSdr) -
384 (k * (2.0 +
Gamma[0]) * interpolated_VS / r) -
385 ((1.0 +
Gamma[0] + (k * k)) * interpolated_UC / r)) *
386 testf_ *
W * hang_weight;
389 sum -= scaled_re_st * r * dudt[0] * testf_ *
W * hang_weight;
393 (r * interpolated_ur * interpolated_dUCdr +
394 r * interpolated_durdr * interpolated_UC +
395 k * interpolated_utheta * interpolated_US -
396 2 * interpolated_utheta * interpolated_VC +
397 r * interpolated_uz * interpolated_dUCdz +
398 r * interpolated_durdz * interpolated_WC) *
399 testf_ *
W * hang_weight;
404 for (
unsigned j = 0; j < 2; j++)
406 sum += scaled_re_st * r * mesh_velocity[j] *
407 interpolated_dudx(0, j) * testf_ *
W * hang_weight;
421 interpolated_PS * (testf_ + r * dtestfdr) *
W * hang_weight;
424 sum -= visc_ratio * r * (1.0 +
Gamma[0]) *
425 interpolated_dUSdr * dtestfdr *
W * hang_weight;
427 sum -= visc_ratio * r *
428 (interpolated_dUSdz +
Gamma[0] * interpolated_dWSdr) *
429 dtestfdz *
W * hang_weight;
432 ((k *
Gamma[0] * interpolated_dVCdr) -
433 (k * (2.0 +
Gamma[0]) * interpolated_VC / r) +
434 ((1.0 +
Gamma[0] + (k * k)) * interpolated_US / r)) *
435 testf_ *
W * hang_weight;
438 sum -= scaled_re_st * r * dudt[1] * testf_ *
W * hang_weight;
442 (r * interpolated_ur * interpolated_dUSdr +
443 r * interpolated_durdr * interpolated_US -
444 k * interpolated_utheta * interpolated_UC -
445 2 * interpolated_utheta * interpolated_VS +
446 r * interpolated_uz * interpolated_dUSdz +
447 r * interpolated_durdz * interpolated_WS) *
448 testf_ *
W * hang_weight;
453 for (
unsigned j = 0; j < 2; j++)
455 sum += scaled_re_st * r * mesh_velocity[j] *
456 interpolated_dudx(1, j) * testf_ *
W * hang_weight;
469 sum += r * interpolated_PC * dtestfdz *
W * hang_weight;
472 sum -= visc_ratio * r *
473 (interpolated_dWCdr +
Gamma[1] * interpolated_dUCdz) *
474 dtestfdr *
W * hang_weight;
476 sum -= visc_ratio * r * (1.0 +
Gamma[1]) *
477 interpolated_dWCdz * dtestfdz *
W * hang_weight;
481 (
Gamma[1] * interpolated_dVSdz - k * interpolated_WC / r) *
482 testf_ *
W * hang_weight;
485 sum -= scaled_re_st * r * dudt[2] * testf_ *
W * hang_weight;
489 (r * interpolated_ur * interpolated_dWCdr +
490 r * interpolated_duzdr * interpolated_UC +
491 k * interpolated_utheta * interpolated_WS +
492 r * interpolated_uz * interpolated_dWCdz +
493 r * interpolated_duzdz * interpolated_WC) *
494 testf_ *
W * hang_weight;
499 for (
unsigned j = 0; j < 2; j++)
501 sum += scaled_re_st * r * mesh_velocity[j] *
502 interpolated_dudx(2, j) * testf_ *
W * hang_weight;
515 sum += r * interpolated_PS * dtestfdz *
W * hang_weight;
518 sum -= visc_ratio * r *
519 (interpolated_dWSdr +
Gamma[1] * interpolated_dUSdz) *
520 dtestfdr *
W * hang_weight;
522 sum -= visc_ratio * r * (1.0 +
Gamma[1]) *
523 interpolated_dWSdz * dtestfdz *
W * hang_weight;
527 (
Gamma[1] * interpolated_dVCdz + k * interpolated_WS / r) *
528 testf_ *
W * hang_weight;
531 sum -= scaled_re_st * r * dudt[3] * testf_ *
W * hang_weight;
535 (r * interpolated_ur * interpolated_dWSdr +
536 r * interpolated_duzdr * interpolated_US -
537 k * interpolated_utheta * interpolated_WC +
538 r * interpolated_uz * interpolated_dWSdz +
539 r * interpolated_duzdz * interpolated_WS) *
540 testf_ *
W * hang_weight;
545 for (
unsigned j = 0; j < 2; j++)
547 sum += scaled_re_st * r * mesh_velocity[j] *
548 interpolated_dudx(3, j) * testf_ *
W * hang_weight;
561 sum -= k * interpolated_PS * testf_ *
W * hang_weight;
566 (-r * interpolated_dVCdr - k *
Gamma[0] * interpolated_US +
567 Gamma[0] * interpolated_VC) *
568 dtestfdr *
W * hang_weight;
572 (k *
Gamma[0] * interpolated_WS + r * interpolated_dVCdz) *
573 dtestfdz *
W * hang_weight;
576 (
Gamma[0] * interpolated_dVCdr +
577 k * (2.0 +
Gamma[0]) * interpolated_US / r -
578 (1.0 + (k * k) + (k * k *
Gamma[0])) *
579 interpolated_VC / r) *
580 testf_ *
W * hang_weight;
583 sum -= scaled_re_st * r * dudt[4] * testf_ *
W * hang_weight;
587 (r * interpolated_ur * interpolated_dVCdr +
588 r * interpolated_duthetadr * interpolated_UC +
589 k * interpolated_utheta * interpolated_VS +
590 interpolated_utheta * interpolated_UC +
591 interpolated_ur * interpolated_VC +
592 r * interpolated_uz * interpolated_dVCdz +
593 r * interpolated_duthetadz * interpolated_WC) *
594 testf_ *
W * hang_weight;
599 for (
unsigned j = 0; j < 2; j++)
601 sum += scaled_re_st * r * mesh_velocity[j] *
602 interpolated_dudx(4, j) * testf_ *
W * hang_weight;
615 sum += k * interpolated_PC * testf_ *
W * hang_weight;
620 (-r * interpolated_dVSdr + k *
Gamma[0] * interpolated_UC +
621 Gamma[0] * interpolated_VS) *
622 dtestfdr *
W * hang_weight;
626 (k *
Gamma[0] * interpolated_WC - r * interpolated_dVSdz) *
627 dtestfdz *
W * hang_weight;
630 (
Gamma[0] * interpolated_dVSdr -
631 k * (2.0 +
Gamma[0]) * interpolated_UC / r -
632 (1.0 + (k * k) + (k * k *
Gamma[0])) *
633 interpolated_VS / r) *
634 testf_ *
W * hang_weight;
637 sum -= scaled_re_st * r * dudt[5] * testf_ *
W * hang_weight;
641 (r * interpolated_ur * interpolated_dVSdr +
642 r * interpolated_duthetadr * interpolated_US -
643 k * interpolated_utheta * interpolated_VC +
644 interpolated_utheta * interpolated_US +
645 interpolated_ur * interpolated_VS +
646 r * interpolated_uz * interpolated_dVSdz +
647 r * interpolated_duthetadz * interpolated_WS) *
648 testf_ *
W * hang_weight;
653 for (
unsigned j = 0; j < 2; j++)
655 sum += scaled_re_st * r * mesh_velocity[j] *
656 interpolated_dudx(5, j) * testf_ *
W * hang_weight;
665 residuals[local_eqn] += sum;
673 unsigned n_master2 = 1;
676 double hang_weight2 = 1.0;
679 for (
unsigned l2 = 0; l2 < n_node; l2++)
682 const double psif_ = psif[l2];
683 const double dpsifdr = dpsifdx(l2, 0);
684 const double dpsifdz = dpsifdx(l2, 1);
690 if (is_node2_hanging)
696 n_master2 = hang_info2_pt->
nmaster();
705 for (
unsigned m2 = 0; m2 < n_master2; m2++)
708 for (
unsigned i2 = 0; i2 < 6; i2++)
714 if (is_node2_hanging)
718 hang_info2_pt->master_node_pt(m2), u_nodal_index[i2]);
721 hang_weight2 = hang_info2_pt->master_weight(m2);
735 if (local_unknown >= 0)
755 mass_matrix(local_eqn, local_unknown) +=
756 scaled_re_st * r * psif_ * testf_ *
W *
757 hang_weight * hang_weight2 * hang_weight *
764 jacobian(local_eqn, local_unknown) -=
765 visc_ratio * r * (1.0 +
Gamma[0]) * dpsifdr *
766 dtestfdr *
W * hang_weight * hang_weight2;
768 jacobian(local_eqn, local_unknown) -=
769 visc_ratio * r * dpsifdz * dtestfdz *
W *
770 hang_weight * hang_weight2;
772 jacobian(local_eqn, local_unknown) -=
773 visc_ratio * (1.0 +
Gamma[0] + (k * k)) *
774 psif_ * testf_ *
W * hang_weight *
778 jacobian(local_eqn, local_unknown) -=
781 psif_ * testf_ *
W * hang_weight *
785 jacobian(local_eqn, local_unknown) -=
787 (psif_ * interpolated_durdr +
788 interpolated_ur * dpsifdr +
789 interpolated_uz * dpsifdz) *
790 testf_ *
W * hang_weight * hang_weight2;
795 for (
unsigned j = 0; j < 2; j++)
797 jacobian(local_eqn, local_unknown) +=
798 scaled_re_st * r * mesh_velocity[j] *
799 dpsifdx(l2, j) * testf_ *
W *
800 hang_weight * hang_weight2;
811 jacobian(local_eqn, local_unknown) -=
812 scaled_re * k * interpolated_utheta * psif_ *
813 testf_ *
W * hang_weight * hang_weight2;
822 jacobian(local_eqn, local_unknown) -=
823 visc_ratio *
Gamma[0] * r * dpsifdr *
824 dtestfdz *
W * hang_weight * hang_weight2;
827 jacobian(local_eqn, local_unknown) -=
828 scaled_re * r * interpolated_durdz * psif_ *
829 testf_ *
W * hang_weight * hang_weight2;
845 jacobian(local_eqn, local_unknown) +=
846 scaled_re * 2 * interpolated_utheta * psif_ *
847 testf_ *
W * hang_weight * hang_weight2;
857 jacobian(local_eqn, local_unknown) +=
859 ((
Gamma[0] * k * dpsifdr) -
860 (k * (2.0 +
Gamma[0]) * psif_ / r)) *
861 testf_ *
W * hang_weight * hang_weight2;
881 jacobian(local_eqn, local_unknown) +=
882 scaled_re * k * interpolated_utheta * psif_ *
883 testf_ *
W * hang_weight * hang_weight2;
894 mass_matrix(local_eqn, local_unknown) +=
895 scaled_re_st * r * psif_ * testf_ *
W *
896 hang_weight * hang_weight2;
902 jacobian(local_eqn, local_unknown) -=
903 visc_ratio * r * (1.0 +
Gamma[0]) * dpsifdr *
904 dtestfdr *
W * hang_weight * hang_weight2;
906 jacobian(local_eqn, local_unknown) -=
907 visc_ratio * r * dpsifdz * dtestfdz *
W *
908 hang_weight * hang_weight2;
910 jacobian(local_eqn, local_unknown) -=
911 visc_ratio * (1.0 +
Gamma[0] + (k * k)) *
912 psif_ * testf_ *
W * hang_weight *
916 jacobian(local_eqn, local_unknown) -=
919 psif_ * testf_ *
W * hang_weight *
923 jacobian(local_eqn, local_unknown) -=
925 (psif_ * interpolated_durdr +
926 interpolated_ur * dpsifdr +
927 interpolated_uz * dpsifdz) *
928 testf_ *
W * hang_weight * hang_weight2;
933 for (
unsigned j = 0; j < 2; j++)
935 jacobian(local_eqn, local_unknown) +=
936 scaled_re_st * r * mesh_velocity[j] *
937 dpsifdx(l2, j) * testf_ *
W *
938 hang_weight * hang_weight2;
955 jacobian(local_eqn, local_unknown) -=
956 visc_ratio *
Gamma[0] * r * dpsifdr *
957 dtestfdz *
W * hang_weight * hang_weight2;
960 jacobian(local_eqn, local_unknown) -=
961 scaled_re * r * interpolated_durdz * psif_ *
962 testf_ *
W * hang_weight * hang_weight2;
972 jacobian(local_eqn, local_unknown) -=
974 ((
Gamma[0] * k * dpsifdr) -
975 (k * (2.0 +
Gamma[0]) * psif_ / r)) *
976 testf_ *
W * hang_weight * hang_weight2;
986 jacobian(local_eqn, local_unknown) +=
987 scaled_re * 2 * interpolated_utheta * psif_ *
988 testf_ *
W * hang_weight * hang_weight2;
1008 jacobian(local_eqn, local_unknown) -=
1009 visc_ratio * r *
Gamma[1] * dpsifdz *
1010 dtestfdr *
W * hang_weight * hang_weight2;
1013 jacobian(local_eqn, local_unknown) -=
1014 scaled_re * r * psif_ * interpolated_duzdr *
1015 testf_ *
W * hang_weight * hang_weight2;
1032 mass_matrix(local_eqn, local_unknown) +=
1033 scaled_re_st * r * psif_ * testf_ *
W *
1034 hang_weight * hang_weight2;
1040 jacobian(local_eqn, local_unknown) -=
1041 visc_ratio * r * dpsifdr * dtestfdr *
W *
1042 hang_weight * hang_weight2;
1044 jacobian(local_eqn, local_unknown) -=
1045 visc_ratio * r * (1.0 +
Gamma[1]) * dpsifdz *
1046 dtestfdz *
W * hang_weight * hang_weight2;
1048 jacobian(local_eqn, local_unknown) -=
1049 visc_ratio * k * k * psif_ * testf_ *
W *
1050 hang_weight * hang_weight2 / r;
1053 jacobian(local_eqn, local_unknown) -=
1056 psif_ * testf_ *
W * hang_weight *
1060 jacobian(local_eqn, local_unknown) -=
1062 (interpolated_ur * dpsifdr +
1063 psif_ * interpolated_duzdz +
1064 interpolated_uz * dpsifdz) *
1065 testf_ *
W * hang_weight * hang_weight2;
1071 for (
unsigned j = 0; j < 2; j++)
1073 jacobian(local_eqn, local_unknown) +=
1074 scaled_re_st * r * mesh_velocity[j] *
1075 dpsifdx(l2, j) * testf_ *
W *
1076 hang_weight * hang_weight2;
1087 jacobian(local_eqn, local_unknown) -=
1088 scaled_re * k * interpolated_utheta * psif_ *
1089 testf_ *
W * hang_weight * hang_weight2;
1105 jacobian(local_eqn, local_unknown) +=
1106 visc_ratio *
Gamma[1] * k * dpsifdz * testf_ *
1107 W * hang_weight * hang_weight2;
1133 jacobian(local_eqn, local_unknown) -=
1134 visc_ratio * r *
Gamma[1] * dpsifdz *
1135 dtestfdr *
W * hang_weight * hang_weight2;
1138 jacobian(local_eqn, local_unknown) -=
1139 scaled_re * r * psif_ * interpolated_duzdr *
1140 testf_ *
W * hang_weight * hang_weight2;
1149 jacobian(local_eqn, local_unknown) +=
1150 scaled_re * k * interpolated_utheta * psif_ *
1151 testf_ *
W * hang_weight * hang_weight2;
1162 mass_matrix(local_eqn, local_unknown) +=
1163 scaled_re_st * r * psif_ * testf_ *
W *
1164 hang_weight * hang_weight2;
1170 jacobian(local_eqn, local_unknown) -=
1171 visc_ratio * r * dpsifdr * dtestfdr *
W *
1172 hang_weight * hang_weight2;
1174 jacobian(local_eqn, local_unknown) -=
1175 visc_ratio * r * (1.0 +
Gamma[1]) * dpsifdz *
1176 dtestfdz *
W * hang_weight * hang_weight2;
1178 jacobian(local_eqn, local_unknown) -=
1179 visc_ratio * k * k * psif_ * testf_ *
W *
1180 hang_weight * hang_weight2 / r;
1183 jacobian(local_eqn, local_unknown) -=
1186 psif_ * testf_ *
W * hang_weight *
1190 jacobian(local_eqn, local_unknown) -=
1192 (interpolated_ur * dpsifdr +
1193 psif_ * interpolated_duzdz +
1194 interpolated_uz * dpsifdz) *
1195 testf_ *
W * hang_weight * hang_weight2;
1201 for (
unsigned j = 0; j < 2; j++)
1203 jacobian(local_eqn, local_unknown) +=
1204 scaled_re_st * r * mesh_velocity[j] *
1205 dpsifdx(l2, j) * testf_ *
W *
1206 hang_weight * hang_weight2;
1218 jacobian(local_eqn, local_unknown) -=
1219 visc_ratio *
Gamma[1] * k * dpsifdz * testf_ *
1220 W * hang_weight * hang_weight2;
1246 jacobian(local_eqn, local_unknown) -=
1248 (r * interpolated_duthetadr +
1249 interpolated_utheta) *
1250 psif_ * testf_ *
W * hang_weight *
1260 jacobian(local_eqn, local_unknown) +=
1261 visc_ratio * k * psif_ *
1262 (((2.0 +
Gamma[0]) * testf_ / r) -
1263 (
Gamma[0] * dtestfdr)) *
1264 W * hang_weight * hang_weight2;
1273 jacobian(local_eqn, local_unknown) -=
1274 scaled_re * r * psif_ *
1275 interpolated_duthetadz * testf_ *
W *
1276 hang_weight * hang_weight2;
1285 jacobian(local_eqn, local_unknown) -=
1286 visc_ratio * k *
Gamma[0] * psif_ * dtestfdz *
1287 W * hang_weight * hang_weight2;
1299 mass_matrix(local_eqn, local_unknown) +=
1300 scaled_re_st * r * psif_ * testf_ *
W *
1301 hang_weight * hang_weight2;
1307 jacobian(local_eqn, local_unknown) +=
1309 (
Gamma[0] * psif_ - r * dpsifdr) * dtestfdr *
1310 W * hang_weight * hang_weight2;
1312 jacobian(local_eqn, local_unknown) -=
1313 visc_ratio * r * dpsifdz * dtestfdz *
W *
1314 hang_weight * hang_weight2;
1316 jacobian(local_eqn, local_unknown) +=
1318 (
Gamma[0] * dpsifdr -
1319 (1.0 + (k * k) + (k * k *
Gamma[0])) *
1321 testf_ *
W * hang_weight * hang_weight2;
1324 jacobian(local_eqn, local_unknown) -=
1327 psif_ * testf_ *
W * hang_weight *
1331 jacobian(local_eqn, local_unknown) -=
1333 (r * interpolated_ur * dpsifdr +
1334 interpolated_ur * psif_ +
1335 r * interpolated_uz * dpsifdz) *
1336 testf_ *
W * hang_weight * hang_weight2;
1341 for (
unsigned j = 0; j < 2; j++)
1343 jacobian(local_eqn, local_unknown) +=
1344 scaled_re_st * r * mesh_velocity[j] *
1345 dpsifdx(l2, j) * testf_ *
W *
1346 hang_weight * hang_weight2;
1358 jacobian(local_eqn, local_unknown) -=
1359 scaled_re * k * interpolated_utheta * psif_ *
1360 testf_ *
W * hang_weight * hang_weight2;
1380 jacobian(local_eqn, local_unknown) +=
1381 visc_ratio * k * psif_ *
1382 ((
Gamma[0] * dtestfdr) -
1383 ((2.0 +
Gamma[0]) * testf_ / r)) *
1384 W * hang_weight * hang_weight2;
1393 jacobian(local_eqn, local_unknown) -=
1395 (r * interpolated_duthetadr +
1396 interpolated_utheta) *
1397 psif_ * testf_ *
W * hang_weight *
1407 jacobian(local_eqn, local_unknown) +=
1408 visc_ratio * k *
Gamma[0] * psif_ * dtestfdz *
1409 W * hang_weight * hang_weight2;
1418 jacobian(local_eqn, local_unknown) -=
1419 scaled_re * r * psif_ *
1420 interpolated_duthetadz * testf_ *
W *
1421 hang_weight * hang_weight2;
1431 jacobian(local_eqn, local_unknown) +=
1432 scaled_re * k * interpolated_utheta * psif_ *
1433 testf_ *
W * hang_weight * hang_weight2;
1445 mass_matrix(local_eqn, local_unknown) +=
1446 scaled_re_st * r * psif_ * testf_ *
W *
1447 hang_weight * hang_weight2;
1453 jacobian(local_eqn, local_unknown) +=
1455 (
Gamma[0] * psif_ - r * dpsifdr) * dtestfdr *
1456 W * hang_weight * hang_weight2;
1458 jacobian(local_eqn, local_unknown) -=
1459 visc_ratio * r * dpsifdz * dtestfdz *
W *
1460 hang_weight * hang_weight2;
1462 jacobian(local_eqn, local_unknown) +=
1464 (
Gamma[0] * dpsifdr -
1465 (1.0 + (k * k) + (k * k *
Gamma[0])) *
1467 testf_ *
W * hang_weight * hang_weight2;
1470 jacobian(local_eqn, local_unknown) -=
1473 psif_ * testf_ *
W * hang_weight *
1477 jacobian(local_eqn, local_unknown) -=
1479 (r * interpolated_ur * dpsifdr +
1480 interpolated_ur * psif_ +
1481 r * interpolated_uz * dpsifdz) *
1482 testf_ *
W * hang_weight * hang_weight2;
1487 for (
unsigned j = 0; j < 2; j++)
1489 jacobian(local_eqn, local_unknown) +=
1490 scaled_re_st * r * mesh_velocity[j] *
1491 dpsifdx(l2, j) * testf_ *
W *
1492 hang_weight * hang_weight2;
1508 for (
unsigned l2 = 0; l2 < n_pres; l2++)
1511 if (pressure_dof_is_hanging[l2])
1518 n_master2 = hang_info2_pt->
nmaster();
1527 for (
unsigned m2 = 0; m2 < n_master2; m2++)
1530 for (
unsigned i2 = 0; i2 < 2; i2++)
1536 if (pressure_dof_is_hanging[l2])
1540 hang_info2_pt->master_node_pt(m2), p_index[i2]);
1543 hang_weight2 = hang_info2_pt->master_weight(m2);
1552 if (local_unknown >= 0)
1568 jacobian(local_eqn, local_unknown) +=
1569 psip[l2] * (testf_ + r * dtestfdr) *
W *
1570 hang_weight * hang_weight2;
1596 jacobian(local_eqn, local_unknown) +=
1597 psip[l2] * (testf_ + r * dtestfdr) *
W *
1598 hang_weight * hang_weight2;
1616 jacobian(local_eqn, local_unknown) +=
1617 r * psip[l2] * dtestfdz *
W * hang_weight *
1644 jacobian(local_eqn, local_unknown) +=
1645 r * psip[l2] * dtestfdz *
W * hang_weight *
1668 jacobian(local_eqn, local_unknown) -=
1669 k * psip[l2] * testf_ *
W * hang_weight *
1688 jacobian(local_eqn, local_unknown) +=
1689 k * psip[l2] * testf_ *
W * hang_weight *
1714 for (
unsigned l = 0; l < n_pres; l++)
1717 const double testp_ = testp[l];
1720 if (pressure_dof_is_hanging[l])
1726 n_master = hang_info_pt->
nmaster();
1735 for (
unsigned m = 0; m < n_master; m++)
1738 for (
unsigned i = 0;
i < 2;
i++)
1744 if (pressure_dof_is_hanging[l])
1774 residuals[local_eqn] +=
1775 (interpolated_UC + r * interpolated_dUCdr +
1776 k * interpolated_VS + r * interpolated_dWCdz) *
1777 testp_ *
W * hang_weight;
1788 residuals[local_eqn] +=
1789 (interpolated_US + r * interpolated_dUSdr -
1790 k * interpolated_VC + r * interpolated_dWSdz) *
1791 testp_ *
W * hang_weight;
1802 unsigned n_master2 = 1;
1805 double hang_weight2 = 1.0;
1808 for (
unsigned l2 = 0; l2 < n_node; l2++)
1811 const double psif_ = psif[l2];
1812 const double dpsifdr = dpsifdx(l2, 0);
1813 const double dpsifdz = dpsifdx(l2, 1);
1819 if (is_node2_hanging)
1825 n_master2 = hang_info2_pt->
nmaster();
1834 for (
unsigned m2 = 0; m2 < n_master2; m2++)
1837 for (
unsigned i2 = 0; i2 < 6; i2++)
1843 if (is_node2_hanging)
1847 hang_info2_pt->master_node_pt(m2), u_nodal_index[i2]);
1850 hang_weight2 = hang_info2_pt->master_weight(m2);
1864 if (local_unknown >= 0)
1881 jacobian(local_eqn, local_unknown) +=
1882 (psif_ + r * dpsifdr) * testp_ *
W *
1883 hang_weight * hang_weight2;
1897 jacobian(local_eqn, local_unknown) +=
1898 r * dpsifdz * testp_ *
W * hang_weight *
1920 jacobian(local_eqn, local_unknown) +=
1921 k * psif_ * testp_ *
W * hang_weight *
1947 jacobian(local_eqn, local_unknown) +=
1948 (psif_ + r * dpsifdr) * testp_ *
W *
1949 hang_weight * hang_weight2;
1963 jacobian(local_eqn, local_unknown) +=
1964 r * dpsifdz * testp_ *
W * hang_weight *
1974 jacobian(local_eqn, local_unknown) -=
1975 k * psif_ * testp_ *
W * hang_weight *
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
double nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n. Produces suitably interpolated values for hanging nodes...
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.
unsigned nnode() const
Return the number of nodes.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
double nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. If the node is hanging, the appropriate interpolation is ...
double dnodal_position_dt(const unsigned &n, const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt at local node n.
Class that contains data for hanging nodes.
double const & master_weight(const unsigned &i) const
Return weight for dofs on i-th master node.
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
unsigned nmaster() const
Return the number of master nodes.
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.
const double & viscosity_ratio() const
Viscosity ratio for element: element's viscosity relative to the viscosity used in the definition of ...
const double & re_st() const
Product of Reynolds and Strouhal number (=Womersley number)
static Vector< double > Gamma
Vector to decide whether the stress-divergence form is used or not.
double du_dt_linearised_axi_nst(const unsigned &n, const unsigned &i) const
Return the i-th component of du/dt at local node n. Uses suitably interpolated value for hanging node...
const double & re() const
Reynolds number.
virtual void get_base_flow_u(const double &time, const unsigned &ipt, const Vector< double > &x, Vector< double > &result) const
Calculate the velocity components of the base flow solution at a given time and Eulerian position.
virtual int p_local_eqn(const unsigned &n, const unsigned &i)=0
Access function for the local equation number information for the i-th component of the pressure....
bool ALE_is_disabled
Boolean flag to indicate if ALE formulation is disabled when the time-derivatives are computed....
virtual void pshape_linearised_axi_nst(const Vector< double > &s, Shape &psi) const =0
Compute the pressure shape functions at local coordinate s.
virtual void get_base_flow_dudx(const double &time, const unsigned &ipt, const Vector< double > &x, DenseMatrix< double > &result) const
Calculate the derivatives of the velocity components of the base flow solution w.r....
virtual double dshape_and_dtest_eulerian_at_knot_linearised_axi_nst(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
Compute the shape functions and their derivatives w.r.t. global coordinates at the ipt-th integration...
virtual unsigned npres_linearised_axi_nst() const =0
Return the number of pressure degrees of freedom associated with a single pressure component in the e...
const double & density_ratio() const
Density ratio for element: element's density relative to the viscosity used in the definition of the ...
virtual unsigned u_index_linearised_axi_nst(const unsigned &i) const
Return the index at which the i-th unknown velocity component is stored. The default value,...
const int & azimuthal_mode_number() const
Azimuthal mode number k in e^ik(theta) decomposition.
virtual double p_linearised_axi_nst(const unsigned &n_p, const unsigned &i) const =0
Return the i-th pressure value at local pressure "node" n_p. Uses suitably interpolated value for han...
virtual int p_index_linearised_axi_nst(const unsigned &i) const
Which nodal value represents the pressure?
HangInfo *const & hanging_pt() const
Return pointer to hanging node data (this refers to the geometric hanging node status) (const version...
bool is_hanging() const
Test whether the node is geometrically hanging.
int local_hang_eqn(Node *const &node_pt, const unsigned &i)
Access function that returns the local equation number for the hanging node variables (values stored ...
virtual Node * pressure_node_pt(const unsigned &n_p)
Pointer to n_p-th pressure node (Default: NULL, indicating that pressure is not based on nodal interp...
void fill_in_generic_residual_contribution_linearised_axi_nst(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Add element's contribution to the elemental residual vector and/or Jacobian matrix flag=1: compute bo...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
double & time()
Return current value of continous time.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...