30 #include "../generic/pml_meshes.h"
65 for (
unsigned i = 0;
i < 2;
i++)
68 point_centre[
i] = 0.5 * (point_left[
i] + point_right[
i]);
110 for (
unsigned i = 0;
i < 2;
i++)
113 point_centre[
i] = 0.5 * (point_left[
i] + point_right[
i]);
130 const unsigned& direction,
134 #ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
137 "Order of function arguments has changed ";
140 error_message_string +=
"between versions 0.8 and 0.85";
144 error_message_string, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
157 using namespace QuadTreeNames;
170 xi[0] = 3.0 * atan(1.0);
172 time, xi, point_on_annular_ring);
177 xi[0] = -3.0 * atan(1.0);
179 time, xi, point_on_annular_ring);
188 xi[0] = 5.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
194 std::ostringstream error_stream;
195 error_stream <<
"Direction is incorrect: " << direction
198 OOMPH_CURRENT_FUNCTION,
199 OOMPH_EXCEPTION_LOCATION);
215 xi[0] = 3.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
220 xi[0] = 3.0 * atan(1.0);
222 time, xi, point_on_annular_ring);
227 xi[0] = 1.0 * atan(1.0);
229 time, xi, point_on_annular_ring);
235 std::ostringstream error_stream;
236 error_stream <<
"Direction is incorrect: " << direction
239 OOMPH_CURRENT_FUNCTION,
240 OOMPH_EXCEPTION_LOCATION);
252 xi[0] = 1.0 * atan(1.0);
254 time, xi, point_on_annular_ring);
259 xi[0] = -1.0 * atan(1.0);
261 time, xi, point_on_annular_ring);
266 xi[0] = -atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
276 std::ostringstream error_stream;
277 error_stream <<
"Direction is incorrect: " << direction
280 OOMPH_CURRENT_FUNCTION,
281 OOMPH_EXCEPTION_LOCATION);
293 xi[0] = -3.0 * atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
302 xi[0] = -3.0 * atan(1.0);
304 time, xi, point_on_annular_ring);
309 xi[0] = -1.0 * atan(1.0);
311 time, xi, point_on_annular_ring);
317 std::ostringstream error_stream;
318 error_stream <<
"Direction is incorrect: " << direction
321 OOMPH_CURRENT_FUNCTION,
322 OOMPH_EXCEPTION_LOCATION);
335 xi[0] = 3.0 * atan(1.0);
338 time, xi, point_on_annular_ring);
343 xi[0] = -3.0 * atan(1.0);
346 time, xi, point_on_annular_ring);
351 xi[0] = 5.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
356 xi[0] = 5.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
362 std::ostringstream error_stream;
363 error_stream <<
"Direction is incorrect: " << direction
366 OOMPH_CURRENT_FUNCTION,
367 OOMPH_EXCEPTION_LOCATION);
379 xi[0] = 3.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
384 xi[0] = 3.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
389 xi[0] = 3.0 * atan(1.0);
392 time, xi, point_on_annular_ring);
397 xi[0] = 1.0 * atan(1.0);
400 time, xi, point_on_annular_ring);
406 std::ostringstream error_stream;
407 error_stream <<
"Direction is incorrect: " << direction
410 OOMPH_CURRENT_FUNCTION,
411 OOMPH_EXCEPTION_LOCATION);
423 xi[0] = 1.0 * atan(1.0);
426 time, xi, point_on_annular_ring);
431 xi[0] = -1.0 * atan(1.0);
434 time, xi, point_on_annular_ring);
439 xi[0] = -atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
444 xi[0] = -atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
450 std::ostringstream error_stream;
451 error_stream <<
"Direction is incorrect: " << direction
454 OOMPH_CURRENT_FUNCTION,
455 OOMPH_EXCEPTION_LOCATION);
467 xi[0] = -3.0 * atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
472 xi[0] = -3.0 * atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
477 xi[0] = -3.0 * atan(1.0);
480 time, xi, point_on_annular_ring);
485 xi[0] = -1.0 * atan(1.0);
488 time, xi, point_on_annular_ring);
494 std::ostringstream error_stream;
495 error_stream <<
"Direction is incorrect: " << direction
498 OOMPH_CURRENT_FUNCTION,
499 OOMPH_EXCEPTION_LOCATION);
506 std::ostringstream error_stream;
507 error_stream <<
"Wrong macro element number" << m << std::endl;
509 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
518 const unsigned& time,
520 const unsigned& direction,
524 #ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
527 "Order of function arguments has changed between versions 0.8 and 0.85",
528 "RectangleWithHoleAndAnnularRegionDomain::macro_element_boundary(...)",
529 OOMPH_EXCEPTION_LOCATION);
542 using namespace QuadTreeNames;
555 xi[0] = 3.0 * atan(1.0);
557 time, xi, point_on_annular_ring);
562 xi[0] = -3.0 * atan(1.0);
564 time, xi, point_on_annular_ring);
573 xi[0] = 5.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
579 std::ostringstream error_stream;
580 error_stream <<
"Direction is incorrect: " << direction
583 OOMPH_CURRENT_FUNCTION,
584 OOMPH_EXCEPTION_LOCATION);
600 xi[0] = 3.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
605 xi[0] = 3.0 * atan(1.0);
607 time, xi, point_on_annular_ring);
612 xi[0] = 1.0 * atan(1.0);
614 time, xi, point_on_annular_ring);
620 std::ostringstream error_stream;
621 error_stream <<
"Direction is incorrect: " << direction
624 OOMPH_CURRENT_FUNCTION,
625 OOMPH_EXCEPTION_LOCATION);
637 xi[0] = 1.0 * atan(1.0);
639 time, xi, point_on_annular_ring);
644 xi[0] = -1.0 * atan(1.0);
646 time, xi, point_on_annular_ring);
651 xi[0] = -atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
661 std::ostringstream error_stream;
662 error_stream <<
"Direction is incorrect: " << direction
665 OOMPH_CURRENT_FUNCTION,
666 OOMPH_EXCEPTION_LOCATION);
678 xi[0] = -3.0 * atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
687 xi[0] = -3.0 * atan(1.0);
689 time, xi, point_on_annular_ring);
694 xi[0] = -1.0 * atan(1.0);
696 time, xi, point_on_annular_ring);
702 std::ostringstream error_stream;
703 error_stream <<
"Direction is incorrect: " << direction
706 OOMPH_CURRENT_FUNCTION,
707 OOMPH_EXCEPTION_LOCATION);
720 xi[0] = 3.0 * atan(1.0);
723 time, xi, point_on_annular_ring);
728 xi[0] = -3.0 * atan(1.0);
731 time, xi, point_on_annular_ring);
736 xi[0] = 5.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
741 xi[0] = 5.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
747 std::ostringstream error_stream;
748 error_stream <<
"Direction is incorrect: " << direction
751 OOMPH_CURRENT_FUNCTION,
752 OOMPH_EXCEPTION_LOCATION);
764 xi[0] = 3.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
769 xi[0] = 3.0 * atan(1.0) - 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
774 xi[0] = 3.0 * atan(1.0);
777 time, xi, point_on_annular_ring);
782 xi[0] = 1.0 * atan(1.0);
785 time, xi, point_on_annular_ring);
791 std::ostringstream error_stream;
792 error_stream <<
"Direction is incorrect: " << direction
795 OOMPH_CURRENT_FUNCTION,
796 OOMPH_EXCEPTION_LOCATION);
808 xi[0] = 1.0 * atan(1.0);
811 time, xi, point_on_annular_ring);
816 xi[0] = -1.0 * atan(1.0);
819 time, xi, point_on_annular_ring);
824 xi[0] = -atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
829 xi[0] = -atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
835 std::ostringstream error_stream;
836 error_stream <<
"Direction is incorrect: " << direction
839 OOMPH_CURRENT_FUNCTION,
840 OOMPH_EXCEPTION_LOCATION);
852 xi[0] = -3.0 * atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
857 xi[0] = -3.0 * atan(1.0) + 2.0 * atan(1.0) * 0.5 * (1.0 +
s[0]);
862 xi[0] = -3.0 * atan(1.0);
865 time, xi, point_on_annular_ring);
870 xi[0] = -1.0 * atan(1.0);
873 time, xi, point_on_annular_ring);
879 std::ostringstream error_stream;
880 error_stream <<
"Direction is incorrect: " << direction
883 OOMPH_CURRENT_FUNCTION,
884 OOMPH_EXCEPTION_LOCATION);
891 std::ostringstream error_stream;
892 error_stream <<
"Wrong macro element number" << m << std::endl;
894 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
911 template<
class ELEMENT>
914 const double& annular_region_radius,
915 const double& length,
920 cylinder_pt, annular_region_radius, length);
923 unsigned long node_count = 0;
939 Element_pt.push_back(
new ELEMENT);
942 unsigned np =
dynamic_cast<ELEMENT*
>(finite_element_pt(
e))->nnode_1d();
945 for (
unsigned l1 = 0; l1 < np; l1++)
948 for (
unsigned l2 = 0; l2 < np; l2++)
951 tmp_node_pt.push_back(finite_element_pt(
e)->construct_node(
952 l1 * np + l2, time_stepper_pt));
955 s[0] = -1.0 + 2.0 * double(l2) / double(np - 1);
956 s[1] = -1.0 + 2.0 * double(l1) / double(np - 1);
960 Domain_pt->macro_element_pt(
e)->macro_map(
s, r);
963 tmp_node_pt[node_count]->x(0) = r[0];
964 tmp_node_pt[node_count]->x(1) = r[1];
978 unsigned np =
dynamic_cast<ELEMENT*
>(finite_element_pt(0))->nnode_1d();
982 for (
unsigned n = 1; n < np; n++)
985 finite_element_pt(1)->node_pt(n * np) =
986 finite_element_pt(0)->node_pt((np * np - 1) - n);
989 delete tmp_node_pt[np * np + n * np];
992 tmp_node_pt[np * np + n * np] = 0;
997 for (
unsigned n = 0; n < np - 1; n++)
1000 finite_element_pt(3)->node_pt(n * np) = finite_element_pt(0)->node_pt(n);
1003 delete tmp_node_pt[3 * np * np + n * np];
1006 tmp_node_pt[3 * np * np + n * np] = 0;
1011 for (
unsigned n = 1; n < np; n++)
1014 finite_element_pt(2)->node_pt(np * (np - 1) + n) =
1015 finite_element_pt(1)->node_pt((np - 1) + n * np);
1018 delete tmp_node_pt[2 * np * np + np * (np - 1) + n];
1021 tmp_node_pt[2 * np * np + np * (np - 1) + n] = 0;
1026 for (
unsigned n = 1; n < np; n++)
1029 finite_element_pt(2)->node_pt(n) =
1030 finite_element_pt(3)->node_pt((np * np - 1) - n * np);
1033 delete tmp_node_pt[2 * np * np + n];
1036 tmp_node_pt[2 * np * np + n] = 0;
1041 for (
unsigned n = 0; n < np - 1; n++)
1044 finite_element_pt(5)->node_pt(n * np) =
1045 finite_element_pt(4)->node_pt((np * np - 1) - n);
1048 delete tmp_node_pt[5 * np * np + n * np];
1051 tmp_node_pt[5 * np * np + n * np] = 0;
1056 for (
unsigned n = 1; n < np; n++)
1059 finite_element_pt(7)->node_pt(n * np) = finite_element_pt(4)->node_pt(n);
1062 delete tmp_node_pt[7 * np * np + n * np];
1065 tmp_node_pt[7 * np * np + n * np] = 0;
1070 for (
unsigned n = 0; n < np - 1; n++)
1073 finite_element_pt(6)->node_pt(np * (np - 1) + n) =
1074 finite_element_pt(5)->node_pt((n + 1) * np - 1);
1077 delete tmp_node_pt[6 * np * np + np * (np - 1) + n];
1080 tmp_node_pt[6 * np * np + np * (np - 1) + n] = 0;
1085 for (
unsigned n = 0; n < np - 1; n++)
1088 finite_element_pt(6)->node_pt(n) =
1089 finite_element_pt(7)->node_pt((np * np - 1) - n * np);
1092 delete tmp_node_pt[6 * np * np + n];
1095 tmp_node_pt[6 * np * np + n] = 0;
1100 for (
unsigned n = 1; n < np - 1; n++)
1103 finite_element_pt(0)->node_pt((np - 1) + n * np) =
1104 finite_element_pt(4)->node_pt(n * np);
1107 delete tmp_node_pt[(n + 1) * np - 1];
1110 tmp_node_pt[(n + 1) * np - 1] = 0;
1115 for (
unsigned n = 1; n < np - 1; n++)
1118 finite_element_pt(1)->node_pt(n) =
1119 finite_element_pt(5)->node_pt(np * (np - 1) + n);
1122 delete tmp_node_pt[np * np + n];
1125 tmp_node_pt[np * np + n] = 0;
1130 for (
unsigned n = 1; n < np - 1; n++)
1133 finite_element_pt(2)->node_pt(np * (np - 1) - n * np) =
1134 finite_element_pt(6)->node_pt((np * np - 1) - n * np);
1137 delete tmp_node_pt[2 * np * np + np * (np - 1) - n * np];
1140 tmp_node_pt[2 * np * np + np * (np - 1) - n * np] = 0;
1145 for (
unsigned n = 1; n < np - 1; n++)
1148 finite_element_pt(3)->node_pt((np * np - 1) - n) =
1149 finite_element_pt(7)->node_pt((np - 1) - n);
1152 delete tmp_node_pt[3 * np * np + (np * np - 1) - n];
1155 tmp_node_pt[3 * np * np + (np * np - 1) - n] = 0;
1171 finite_element_pt(3)->node_pt(np * (np - 1)) =
1172 finite_element_pt(0)->node_pt(np - 1);
1175 finite_element_pt(4)->node_pt(0) = finite_element_pt(0)->node_pt(np - 1);
1178 finite_element_pt(7)->node_pt(0) = finite_element_pt(0)->node_pt(np - 1);
1181 delete tmp_node_pt[3 * np * np + np * (np - 1)];
1184 tmp_node_pt[3 * np * np + np * (np - 1)] = 0;
1187 delete tmp_node_pt[4 * np * np];
1190 tmp_node_pt[4 * np * np] = 0;
1193 delete tmp_node_pt[7 * np * np];
1196 tmp_node_pt[7 * np * np] = 0;
1202 finite_element_pt(1)->node_pt(0) =
1203 finite_element_pt(0)->node_pt(np * np - 1);
1206 finite_element_pt(4)->node_pt(np * (np - 1)) =
1207 finite_element_pt(0)->node_pt(np * np - 1);
1210 finite_element_pt(5)->node_pt(np * (np - 1)) =
1211 finite_element_pt(0)->node_pt(np * np - 1);
1214 delete tmp_node_pt[np * np];
1217 tmp_node_pt[np * np] = 0;
1220 delete tmp_node_pt[4 * np * np + np * (np - 1)];
1223 tmp_node_pt[4 * np * np + np * (np - 1)] = 0;
1226 delete tmp_node_pt[5 * np * np + np * (np - 1)];
1229 tmp_node_pt[5 * np * np + np * (np - 1)] = 0;
1235 finite_element_pt(2)->node_pt(np * (np - 1)) =
1236 finite_element_pt(1)->node_pt(np - 1);
1239 finite_element_pt(5)->node_pt(np * np - 1) =
1240 finite_element_pt(1)->node_pt(np - 1);
1243 finite_element_pt(6)->node_pt(np * np - 1) =
1244 finite_element_pt(1)->node_pt(np - 1);
1247 delete tmp_node_pt[2 * np * np + np * (np - 1)];
1250 tmp_node_pt[2 * np * np + np * (np - 1)] = 0;
1253 delete tmp_node_pt[5 * np * np + np * np - 1];
1256 tmp_node_pt[5 * np * np + np * np - 1] = 0;
1259 delete tmp_node_pt[6 * np * np + np * np - 1];
1262 tmp_node_pt[6 * np * np + np * np - 1] = 0;
1268 finite_element_pt(3)->node_pt(np * np - 1) =
1269 finite_element_pt(2)->node_pt(0);
1272 finite_element_pt(6)->node_pt(np - 1) = finite_element_pt(2)->node_pt(0);
1275 finite_element_pt(7)->node_pt(np - 1) = finite_element_pt(2)->node_pt(0);
1278 delete tmp_node_pt[3 * np * np + np * np - 1];
1281 tmp_node_pt[3 * np * np + np * np - 1] = 0;
1284 delete tmp_node_pt[6 * np * np + np - 1];
1287 tmp_node_pt[6 * np * np + np - 1] = 0;
1290 delete tmp_node_pt[7 * np * np + np - 1];
1293 tmp_node_pt[7 * np * np + np - 1] = 0;
1302 for (
unsigned long n = 0; n < node_count; n++)
1305 if (tmp_node_pt[n] != 0)
1308 Node_pt.push_back(tmp_node_pt[n]);
1322 for (
unsigned n = 0; n < np; n++)
1325 Node* nod_pt = finite_element_pt(0)->node_pt(n * np);
1326 convert_to_boundary_node(nod_pt);
1327 add_boundary_node(3, nod_pt);
1330 nod_pt = finite_element_pt(1)->node_pt(np * (np - 1) + n);
1331 convert_to_boundary_node(nod_pt);
1332 add_boundary_node(2, nod_pt);
1335 nod_pt = finite_element_pt(2)->node_pt(n * np + np - 1);
1336 convert_to_boundary_node(nod_pt);
1337 add_boundary_node(1, nod_pt);
1340 nod_pt = finite_element_pt(3)->node_pt(n);
1341 convert_to_boundary_node(nod_pt);
1342 add_boundary_node(0, nod_pt);
1346 for (
unsigned n = 0; n < np - 1; n++)
1349 Node* nod_pt = finite_element_pt(4)->node_pt((np - 1) + n * np);
1350 convert_to_boundary_node(nod_pt);
1351 add_boundary_node(4, nod_pt);
1354 nod_pt = finite_element_pt(5)->node_pt(n);
1355 convert_to_boundary_node(nod_pt);
1356 add_boundary_node(4, nod_pt);
1359 nod_pt = finite_element_pt(6)->node_pt(np * (np - 1) - n * np);
1360 convert_to_boundary_node(nod_pt);
1361 add_boundary_node(4, nod_pt);
1364 nod_pt = finite_element_pt(7)->node_pt((np * np - 1) - n);
1365 convert_to_boundary_node(nod_pt);
1366 add_boundary_node(4, nod_pt);
1372 if (check_for_repeated_nodes())
1376 OOMPH_CURRENT_FUNCTION,
1377 OOMPH_EXCEPTION_LOCATION);
1394 template<
class ELEMENT>
1397 const double& annular_region_radius,
1398 const double& length_of_central_box,
1399 const double& x_left,
1400 const double& x_right,
1401 const double& height,
1405 Coarse_problem =
false;
1414 annular_region_radius,
1415 length_of_central_box,
1419 all_temp_mesh_pt.push_back(Central_mesh_pt);
1422 unsigned int left_boundary_id = 3;
1425 unsigned int top_boundary_id = 2;
1428 unsigned int right_boundary_id = 1;
1431 unsigned int bottom_boundary_id = 0;
1436 double l_right = x_right - 0.5 * length_of_central_box;
1438 std::max(
unsigned(1),
unsigned(l_right / length_of_central_box));
1444 Mesh* surrounding_right_mesh_pt =
1445 TwoDimensionalPMLHelper::create_right_pml_mesh<PMLLayerElement<ELEMENT>>(
1446 Central_mesh_pt, right_boundary_id, n_right, l_right, time_stepper_pt);
1448 all_temp_mesh_pt.push_back(surrounding_right_mesh_pt);
1451 for (
unsigned ibound_rm = 0; ibound_rm <= 2; ibound_rm += 2)
1453 unsigned num_nod = surrounding_right_mesh_pt->
nboundary_node(ibound_rm);
1454 for (
unsigned inod = 0; inod < num_nod; inod++)
1466 double l_top = 0.5 * height - 0.5 * length_of_central_box;
1468 std::max(
unsigned(1),
unsigned(l_top / length_of_central_box));
1473 Mesh* surrounding_top_mesh_pt =
1474 TwoDimensionalPMLHelper::create_top_pml_mesh<PMLLayerElement<ELEMENT>>(
1475 Central_mesh_pt, top_boundary_id, n_top, l_top, time_stepper_pt);
1476 all_temp_mesh_pt.push_back(surrounding_top_mesh_pt);
1479 for (
unsigned ibound_rm = 1; ibound_rm <= 3; ibound_rm += 2)
1481 unsigned num_nod = surrounding_top_mesh_pt->
nboundary_node(ibound_rm);
1482 for (
unsigned inod = 0; inod < num_nod; inod++)
1495 double l_left = -0.5 * length_of_central_box - x_left;
1497 std::max(
unsigned(1),
unsigned(l_left / length_of_central_box));
1502 Mesh* surrounding_left_mesh_pt =
1503 TwoDimensionalPMLHelper::create_left_pml_mesh<PMLLayerElement<ELEMENT>>(
1504 Central_mesh_pt, left_boundary_id, n_left, l_left, time_stepper_pt);
1505 all_temp_mesh_pt.push_back(surrounding_left_mesh_pt);
1508 for (
unsigned ibound_rm = 0; ibound_rm <= 2; ibound_rm += 2)
1510 unsigned num_nod = surrounding_left_mesh_pt->
nboundary_node(ibound_rm);
1511 for (
unsigned inod = 0; inod < num_nod; inod++)
1523 double l_bottom = 0.5 * height - 0.5 * length_of_central_box;
1525 std::max(
unsigned(1),
unsigned(l_bottom / length_of_central_box));
1530 Mesh* surrounding_bottom_mesh_pt =
1531 TwoDimensionalPMLHelper::create_bottom_pml_mesh<PMLLayerElement<ELEMENT>>(
1537 all_temp_mesh_pt.push_back(surrounding_bottom_mesh_pt);
1541 for (
unsigned ibound_rm = 1; ibound_rm <= 3; ibound_rm += 2)
1543 unsigned num_nod = surrounding_bottom_mesh_pt->
nboundary_node(ibound_rm);
1544 for (
unsigned inod = 0; inod < num_nod; inod++)
1556 Mesh* surrounding_top_right_mesh_pt =
1559 surrounding_top_mesh_pt,
1563 all_temp_mesh_pt.push_back(surrounding_top_right_mesh_pt);
1565 Mesh* surrounding_bottom_right_mesh_pt =
1568 surrounding_bottom_mesh_pt,
1572 all_temp_mesh_pt.push_back(surrounding_bottom_right_mesh_pt);
1574 Mesh* surrounding_top_left_mesh_pt =
1577 surrounding_top_mesh_pt,
1581 all_temp_mesh_pt.push_back(surrounding_top_left_mesh_pt);
1583 Mesh* surrounding_bottom_left_mesh_pt =
1586 surrounding_bottom_mesh_pt,
1590 all_temp_mesh_pt.push_back(surrounding_bottom_left_mesh_pt);
1594 unsigned n_mesh = all_temp_mesh_pt.size();
1597 for (
unsigned i = 0;
i < n_mesh;
i++)
1599 nel += all_temp_mesh_pt[
i]->nelement();
1600 nnod += all_temp_mesh_pt[
i]->nnode();
1602 this->Element_pt.resize(nel);
1603 this->Node_pt.resize(nnod);
1605 unsigned count_el = 0;
1606 unsigned count_nod = 0;
1607 for (
unsigned i = 0;
i < n_mesh;
i++)
1609 unsigned nel = all_temp_mesh_pt[
i]->nelement();
1610 for (
unsigned e = 0;
e < nel;
e++)
1612 this->Element_pt[count_el] = all_temp_mesh_pt[
i]->element_pt(
e);
1615 unsigned nnod = all_temp_mesh_pt[
i]->nnode();
1616 for (
unsigned j = 0; j < nnod; j++)
1618 this->Node_pt[count_nod] = all_temp_mesh_pt[
i]->node_pt(j);
1626 for (
unsigned b = 0; b < 4; b++)
1628 unsigned nnod = Central_mesh_pt->nboundary_node(b);
1629 for (
unsigned j = 0; j < nnod; j++)
1631 Node* nod_pt = Central_mesh_pt->boundary_node_pt(b, j);
1638 this->set_nboundary(5);
1647 unsigned ibound = 2;
1651 all_mesh_pt.push_back(surrounding_top_left_mesh_pt);
1652 all_mesh_pt.push_back(surrounding_top_mesh_pt);
1653 all_mesh_pt.push_back(surrounding_top_right_mesh_pt);
1654 unsigned n_mesh = all_mesh_pt.size();
1655 for (
unsigned m = 0; m < n_mesh; m++)
1657 pml_mesh_pt.push_back(all_mesh_pt[m]);
1658 unsigned num_nod = all_mesh_pt[m]->nboundary_node(ibound);
1659 for (
unsigned inod = 0; inod < num_nod; inod++)
1661 Node* nod_pt = all_mesh_pt[m]->boundary_node_pt(ibound, inod);
1662 this->add_boundary_node(ibound, nod_pt);
1671 unsigned ibound = 3;
1673 pml_mesh_pt.push_back(surrounding_left_mesh_pt);
1677 all_mesh_pt.push_back(surrounding_top_left_mesh_pt);
1678 all_mesh_pt.push_back(surrounding_left_mesh_pt);
1679 all_mesh_pt.push_back(surrounding_bottom_left_mesh_pt);
1680 unsigned n_mesh = all_mesh_pt.size();
1681 for (
unsigned m = 0; m < n_mesh; m++)
1683 unsigned num_nod = all_mesh_pt[m]->nboundary_node(ibound);
1684 for (
unsigned inod = 0; inod < num_nod; inod++)
1686 Node* nod_pt = all_mesh_pt[m]->boundary_node_pt(ibound, inod);
1687 this->add_boundary_node(ibound, nod_pt);
1696 unsigned ibound = 0;
1700 all_mesh_pt.push_back(surrounding_bottom_left_mesh_pt);
1701 all_mesh_pt.push_back(surrounding_bottom_mesh_pt);
1702 all_mesh_pt.push_back(surrounding_bottom_right_mesh_pt);
1703 unsigned n_mesh = all_mesh_pt.size();
1704 for (
unsigned m = 0; m < n_mesh; m++)
1706 pml_mesh_pt.push_back(all_mesh_pt[m]);
1707 unsigned num_nod = all_mesh_pt[m]->nboundary_node(ibound);
1708 for (
unsigned inod = 0; inod < num_nod; inod++)
1710 Node* nod_pt = all_mesh_pt[m]->boundary_node_pt(ibound, inod);
1711 this->add_boundary_node(ibound, nod_pt);
1720 unsigned ibound = 1;
1722 pml_mesh_pt.push_back(surrounding_right_mesh_pt);
1726 all_mesh_pt.push_back(surrounding_bottom_right_mesh_pt);
1727 all_mesh_pt.push_back(surrounding_right_mesh_pt);
1728 all_mesh_pt.push_back(surrounding_top_right_mesh_pt);
1729 unsigned n_mesh = all_mesh_pt.size();
1730 for (
unsigned m = 0; m < n_mesh; m++)
1732 unsigned num_nod = all_mesh_pt[m]->nboundary_node(ibound);
1733 for (
unsigned inod = 0; inod < num_nod; inod++)
1735 Node* nod_pt = all_mesh_pt[m]->boundary_node_pt(ibound, inod);
1736 this->add_boundary_node(ibound, nod_pt);
1745 unsigned ibound = 4;
1748 unsigned num_nod = Central_mesh_pt->nboundary_node(ibound);
1749 for (
unsigned inod = 0; inod < num_nod; inod++)
1751 Node* nod_pt = Central_mesh_pt->boundary_node_pt(ibound, inod);
1752 this->add_boundary_node(ibound, nod_pt);
1757 this->setup_quadtree_forest();
1760 this->setup_boundary_element_info();
1764 unsigned n_pml_mesh = pml_mesh_pt.size();
1765 for (
unsigned j = 0; j < n_pml_mesh; j++)
1767 pml_mesh_pt[j]->flush_element_and_node_storage();
1768 delete pml_mesh_pt[j];
1771 Central_mesh_pt->flush_element_and_node_storage();
unsigned nmacro_element()
Number of macro elements in domain.
/////////////////////////////////////////////////////////////////////
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
unsigned long nboundary_node(const unsigned &ibound) const
Return number of nodes on a particular boundary.
Node *& boundary_node_pt(const unsigned &b, const unsigned &n)
Return pointer to node n on boundary b.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
virtual bool is_on_boundary() const
Test whether the Node lies on a boundary. The "bulk" Node cannot lie on a boundary,...
virtual void remove_from_boundary(const unsigned &b)
Broken interface for removing the node from the mesh boundary b Here to provide error reporting.
An OomphLibError object which should be thrown when an run-time error is encountered....
An OomphLibWarning object which should be created as a temporary object to issue a warning....
General definition of policy class defining the elements to be used in the actual PML layers....
Vector< double > Upper_mid_left
Where the "radial" line from circle meets upper boundary on left.
void linear_interpolate(const Vector< double > &left, const Vector< double > &right, const double &s, Vector< double > &f)
Helper function to interpolate linearly between the "right" and "left" points; .
void macro_element_boundary(const double &time, const unsigned &m, const unsigned &direction, const Vector< double > &s, Vector< double > &f)
Parametrisation of macro element boundaries: f(s) is the position vector to macro-element m's boundar...
GeomObject * Cylinder_pt
Pointer to geometric object that represents the central cylinder.
void project_point_on_cylinder_to_annular_boundary(const unsigned &time, const Vector< double > &xi, Vector< double > &r)
Helper function that, given the Lagrangian coordinate, xi, (associated with a point on the cylinder),...
Vector< double > Lower_mid_left
Where the "radial" line from circle meets lower boundary on left.
Vector< double > Lower_mid_right
Where the "radial" line from circle meets lower boundary on right.
double Annular_region_radius
The radius of the outer boundary of the annular region whose inner boundary is described by Cylinder_...
Vector< double > Upper_mid_right
Where the "radial" line from circle meets upper boundary on right.
RectangleWithHoleAndAnnularRegionDomain(GeomObject *cylinder_pt, const double &annular_region_radius, const double &length)
Constructor. Pass pointer to geometric object that represents the cylinder, the length of the (square...
RectangleWithHoleAndAnnularRegionMesh(GeomObject *cylinder_pt, const double &annular_region_radius, const double &length, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to geometric object that represents the cylinder, the length and height of ...
RefineableQuadMeshWithMovingCylinder(GeomObject *cylinder_pt, const double &annular_region_radius, const double &length_of_central_box, const double &x_left, const double &x_right, const double &height, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor. Pass pointer to geometric object that represents the cylinder; hierher the length and he...
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
////////////////////////////////////////////////////////////////////// //////////////////////////////...
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
Mesh * create_bottom_right_pml_mesh(Mesh *pml_right_mesh_pt, Mesh *pml_bottom_mesh_pt, Mesh *bulk_mesh_pt, const unsigned &right_boundary_id, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML bottom right corner mesh, aligned with the existing PML meshes
Mesh * create_top_right_pml_mesh(Mesh *pml_right_mesh_pt, Mesh *pml_top_mesh_pt, Mesh *bulk_mesh_pt, const unsigned &right_boundary_id, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML top right corner mesh, aligned with the existing PML meshes
Mesh * create_top_left_pml_mesh(Mesh *pml_left_mesh_pt, Mesh *pml_top_mesh_pt, Mesh *bulk_mesh_pt, const unsigned &left_boundary_id, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML top left corner mesh, aligned with the existing PML meshes
Mesh * create_bottom_left_pml_mesh(Mesh *pml_left_mesh_pt, Mesh *pml_bottom_mesh_pt, Mesh *bulk_mesh_pt, const unsigned &left_boundary_id, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML bottom left corner mesh, aligned with the existing PML meshes
//////////////////////////////////////////////////////////////////// ////////////////////////////////...