30 #ifndef OOMPH_PML_MESH_HEADER 31 #define OOMPH_PML_MESH_HEADER 35 #include <oomph-lib-config.h> 39 #include "../meshes/rectangular_quadmesh.template.h" 40 #include "../meshes/rectangular_quadmesh.template.cc" 51 namespace TwoDimensionalPMLHelper
91 template<
class ELEMENT>
99 const double& x_pml_start,
const double& x_pml_end,
100 const double& y_pml_start,
const double& y_pml_end,
103 x_pml_start,x_pml_end,
104 y_pml_start,y_pml_end,
120 const double x_min=this->x_min();
123 const double x_max=this->x_max();
126 const double y_min=this->y_min();
129 const double y_max=this->y_max();
138 if ((x[0]<x_min-tol)||(x[0]>x_max+tol)||(x[1]<y_min-tol)||(x[1]>y_max+tol))
141 std::ostringstream error_message_stream;
144 error_message_stream <<
"Point does not lie in the mesh." << std::endl;
148 OOMPH_CURRENT_FUNCTION,
149 OOMPH_EXCEPTION_LOCATION);
156 const unsigned nx=this->nx();
159 const unsigned ny=this->ny();
162 unsigned nnode_1d=this->finite_element_pt(0)->nnode_1d();
165 unsigned nnode=this->finite_element_pt(0)->nnode();
189 bottom_boundary_x_coordinates[0]=x_min;
192 bottom_boundary_x_coordinates[nx]=x_max;
195 right_boundary_y_coordinates[0]=y_min;
198 right_boundary_y_coordinates[ny]=y_max;
206 unsigned lower_boundary_id=0;
209 unsigned right_boundary_id=1;
212 for (
unsigned i=0;
i<nx;
i++)
215 el_pt=this->boundary_element_pt(lower_boundary_id,
i);
218 bottom_boundary_x_coordinates[
i+1]=el_pt->
node_pt(nnode_1d-1)->
x(0);
227 for (
unsigned i=0;
i<ny;
i++)
230 el_pt=this->boundary_element_pt(right_boundary_id,
i);
233 right_boundary_y_coordinates[
i+1]=el_pt->
node_pt(nnode-1)->
x(1);
242 bool element_x_id_has_been_found=
false;
247 bool element_y_id_has_been_found=
false;
250 unsigned element_x_id=0;
253 unsigned element_y_id=0;
256 for (
unsigned i=0;
i<nx;
i++)
259 if ((x[0]>=bottom_boundary_x_coordinates[
i])&&
260 (x[0]<=bottom_boundary_x_coordinates[i+1]))
266 element_x_id_has_been_found=
true;
271 if (!element_x_id_has_been_found)
274 std::ostringstream error_message_stream;
277 error_message_stream <<
"The ID of the element in the x-direction " 278 <<
"has not been found." << std::endl;
282 OOMPH_CURRENT_FUNCTION,
283 OOMPH_EXCEPTION_LOCATION);
287 for (
unsigned i=0;
i<ny;
i++)
290 if ((x[1]>=right_boundary_y_coordinates[
i])&&
291 (x[1]<=right_boundary_y_coordinates[i+1]))
297 element_y_id_has_been_found=
true;
302 if (!element_y_id_has_been_found)
305 std::ostringstream error_message_stream;
308 error_message_stream <<
"The ID of the element in the y-direction " 309 <<
"has not been found." << std::endl;
313 OOMPH_CURRENT_FUNCTION,
314 OOMPH_EXCEPTION_LOCATION);
318 unsigned el_id=element_y_id*nx+element_x_id;
321 coarse_mesh_el_pt=
dynamic_cast<FiniteElement*
>(this->element_pt(el_id));
328 template<
class ELEMENT>
343 const unsigned& boundary_id,
const unsigned& quad_boundary_id,
344 const unsigned& n_pml_x,
const unsigned& n_pml_y,
345 const double& x_pml_start,
const double& x_pml_end,
346 const double& y_pml_start,
const double& y_pml_end,
349 x_pml_start,x_pml_end,
350 y_pml_start,y_pml_end,
353 unsigned n_boundary_node = bulk_mesh_pt -> nboundary_node(boundary_id);
359 for (
unsigned n=0; n<n_boundary_node; n++)
361 ordered_boundary_node_pt[n] =
362 bulk_mesh_pt -> boundary_node_pt(boundary_id, n);
368 if (quad_boundary_id == 3)
370 std::sort(ordered_boundary_node_pt.begin(),
371 ordered_boundary_node_pt.end(),
376 if (quad_boundary_id == 0)
378 std::sort(ordered_boundary_node_pt.begin(),
379 ordered_boundary_node_pt.end(),
384 if (quad_boundary_id == 1)
386 std::sort(ordered_boundary_node_pt.begin(),
387 ordered_boundary_node_pt.end(),
392 if (quad_boundary_id == 2)
394 std::sort(ordered_boundary_node_pt.begin(),
395 ordered_boundary_node_pt.end(),
399 unsigned nnode_1d = this->finite_element_pt(0)->nnode_1d();
405 unsigned interior_node_nr_helper_1 = nnode_1d * (nnode_1d - 1);
407 unsigned interior_node_nr_helper_2 = nnode_1d - 1;
409 unsigned interior_node_nr_helper_3 = nnode_1d * (nnode_1d - 1) - 1;
413 unsigned nnod =
this -> nboundary_node(quad_boundary_id);
414 for (
unsigned j=0;j<nnod;j++)
416 this -> boundary_node_pt(quad_boundary_id,j)->set_obsolete();
420 this -> prune_dead_nodes();
423 unsigned n_pml_element =
this -> nelement();
428 unsigned interior_element_nr_helper_1 = n_pml_element-1;
437 if (quad_boundary_id == 3) {
438 for(
unsigned e=0;
e<n_pml_element;
e++)
441 if ((
e % n_pml_x) == 0)
444 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(
445 this -> element_pt(
e));
448 unsigned n_node = el_pt -> nnode();
449 for (
unsigned inod = 0; inod<n_node; inod++)
451 if (inod % nnode_1d == 0 )
454 el_pt->node_pt(inod) = ordered_boundary_node_pt[count];
458 if (inod == interior_node_nr_helper_1) {count--;}
466 if (quad_boundary_id == 0) {
467 for(
unsigned e=0;
e<n_pml_element;
e++)
470 if ((
int)(
e / n_pml_x) == 0)
473 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(
474 this -> element_pt(
e));
477 unsigned n_node = el_pt -> nnode();
478 for (
unsigned inod = 0; inod<n_node; inod++)
480 if ((
int) (inod / nnode_1d) == 0 )
483 el_pt->node_pt(inod) = ordered_boundary_node_pt[count];
487 if (inod == interior_node_nr_helper_2) {count--;}
495 if (quad_boundary_id == 1) {
496 for(
unsigned e=interior_element_nr_helper_1;
e < n_pml_element;
e--)
499 if ((
e % n_pml_x) == (n_pml_x-1))
502 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(
503 this -> element_pt(
e));
506 unsigned n_node = el_pt -> nnode();
507 unsigned starter = n_node-1;
508 for (
unsigned inod = starter; inod<=starter; inod--)
510 if (inod % nnode_1d == interior_node_nr_helper_2 )
513 el_pt->node_pt(inod) = ordered_boundary_node_pt[count];
517 if (inod == interior_node_nr_helper_2) {count--;}
525 if (quad_boundary_id == 2) {
526 for(
unsigned e=interior_element_nr_helper_1;
e < n_pml_element;
e--)
529 if (
e >= (n_pml_x*(n_pml_y-1)))
532 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(
533 this -> element_pt(
e));
536 unsigned n_node = el_pt -> nnode();
537 unsigned starter = n_node-1;
538 for (
unsigned inod = starter; inod<=starter; inod--)
540 if (inod > interior_node_nr_helper_3 )
543 el_pt->node_pt(inod) = ordered_boundary_node_pt[count];
547 if (inod == interior_node_nr_helper_1) {count--;}
562 for(
unsigned e=0;
e<n_pml_element;
e++)
566 dynamic_cast<ELEMENT*
>(
this -> element_pt(
e));
567 unsigned n_node = el_pt -> nnode();
570 double temp_coordinate = 0.0;
571 for (
unsigned inod = 0; inod<n_node; inod++)
574 if (quad_boundary_id == 3) {
576 if (inod % nnode_1d == 0)
579 temp_coordinate = el_pt -> node_pt(inod) -> x(1);
584 el_pt -> node_pt(inod) -> x(1) = temp_coordinate;
589 if (quad_boundary_id == 0) {
591 if (inod > interior_node_nr_helper_2)
594 el_pt -> node_pt(inod) -> x(0) =
595 el_pt -> node_pt(inod - nnode_1d) -> x(0);
602 for(
unsigned e=interior_element_nr_helper_1;
e<n_pml_element;
e--)
606 dynamic_cast<ELEMENT*
>(
this -> element_pt(
e));
607 unsigned n_node = el_pt -> nnode();
610 double temp_coordinate = 0.0;
611 unsigned starter = n_node-1;
612 for (
unsigned inod = starter; inod <= starter; inod--)
615 if (quad_boundary_id == 1) {
617 if (inod % nnode_1d == interior_node_nr_helper_2)
620 temp_coordinate = el_pt -> node_pt(inod) -> x(1);
625 el_pt -> node_pt(inod) -> x(1) = temp_coordinate;
630 if (quad_boundary_id == 2) {
632 if (inod < interior_node_nr_helper_1)
635 el_pt -> node_pt(inod) -> x(0) =
636 el_pt -> node_pt(inod + nnode_1d) -> x(0);
657 template<
class ELEMENT>
667 Mesh* PMLQuad_mesh_y_pt,
669 Node* special_corner_node_pt,
670 const unsigned& parent_boundary_x_id,
671 const unsigned& parent_boundary_y_id,
672 const unsigned& current_boundary_x_id,
673 const unsigned& current_boundary_y_id,
674 const unsigned& n_pml_x,
const unsigned& n_pml_y,
675 const double& x_pml_start,
const double& x_pml_end,
676 const double& y_pml_start,
const double& y_pml_end,
679 x_pml_start,x_pml_end,
680 y_pml_start,y_pml_end,
683 unsigned nnode_1d = this->finite_element_pt(0)->nnode_1d();
689 unsigned interior_node_nr_helper_1 = nnode_1d * (nnode_1d - 1);
691 unsigned interior_node_nr_helper_2 = nnode_1d - 1;
693 unsigned interior_node_nr_helper_3 = nnode_1d * nnode_1d - 1;
697 if ((parent_boundary_x_id == 2) && (parent_boundary_y_id == 1)){
700 unsigned n_boundary_x_node =
701 PMLQuad_mesh_x_pt -> nboundary_node(parent_boundary_x_id);
707 for (
unsigned n=0; n<n_boundary_x_node; n++)
709 ordered_boundary_x_node_pt[n] =
710 PMLQuad_mesh_x_pt -> boundary_node_pt(parent_boundary_x_id, n);
714 if (parent_boundary_x_id == 2)
716 std::sort(ordered_boundary_x_node_pt.begin(),
717 ordered_boundary_x_node_pt.end(),
722 unsigned n_boundary_y_node =
723 PMLQuad_mesh_y_pt -> nboundary_node(parent_boundary_y_id);
729 for (
unsigned n=0; n<n_boundary_y_node; n++)
731 ordered_boundary_y_node_pt[n] =
732 PMLQuad_mesh_y_pt -> boundary_node_pt(parent_boundary_y_id, n);
736 if (parent_boundary_y_id == 1)
738 std::sort(ordered_boundary_y_node_pt.begin(),
739 ordered_boundary_y_node_pt.end(),
743 unsigned x_nnod =
this -> nboundary_node(current_boundary_x_id);
744 for (
unsigned j=0;j<x_nnod;j++)
746 this -> boundary_node_pt(current_boundary_x_id,j)->set_obsolete();
749 unsigned y_nnod =
this -> nboundary_node(current_boundary_y_id);
750 for (
unsigned j=0;j<y_nnod;j++)
752 this -> boundary_node_pt(current_boundary_y_id,j)->set_obsolete();
756 this -> prune_dead_nodes();
758 unsigned n_pml_element =
this -> nelement();
764 if (parent_boundary_y_id == 1) {
765 for(
unsigned e=0;
e<n_pml_element;
e++)
768 if ((
e % n_pml_x) == 0)
771 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(
772 this -> element_pt(
e));
775 unsigned n_node = el_pt -> nnode();
776 for (
unsigned inod = 0; inod<n_node; inod++)
781 if (inod==0) el_pt->node_pt(inod) = special_corner_node_pt;
782 if ((inod % nnode_1d == 0) && (inod>0)) {
785 el_pt->node_pt(inod) = ordered_boundary_y_node_pt[count];
789 if (inod == interior_node_nr_helper_1) {count--;}
794 if ((inod % nnode_1d) == 0){
796 el_pt->node_pt(inod) = ordered_boundary_y_node_pt[count];
800 if (inod == interior_node_nr_helper_1) {count--;}
810 if (parent_boundary_x_id == 2) {
811 for(
unsigned e=0;
e<n_pml_element;
e++)
814 if ((
int)(
e / n_pml_x) == 0)
817 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(
818 this -> element_pt(
e));
821 unsigned n_node = el_pt -> nnode();
822 for (
unsigned inod = 0; inod<n_node; inod++)
825 if (((
int) (inod / nnode_1d) == 0 ) && (inod > 0))
828 el_pt->node_pt(inod) = ordered_boundary_x_node_pt[count];
832 if (inod == interior_node_nr_helper_2) {count--;}
836 if ((
int) (inod / nnode_1d) == 0 )
839 el_pt->node_pt(inod) = ordered_boundary_x_node_pt[count];
843 if (inod == interior_node_nr_helper_2) {count--;}
854 if ((parent_boundary_x_id == 0) && (parent_boundary_y_id == 1)){
856 unsigned n_boundary_x_node =
857 PMLQuad_mesh_x_pt -> nboundary_node(parent_boundary_x_id);
863 for (
unsigned n=0; n<n_boundary_x_node; n++)
865 ordered_boundary_x_node_pt[n] =
866 PMLQuad_mesh_x_pt -> boundary_node_pt(parent_boundary_x_id, n);
870 if (parent_boundary_x_id == 0)
872 std::sort(ordered_boundary_x_node_pt.begin(),
873 ordered_boundary_x_node_pt.end(),
878 unsigned n_boundary_y_node =
879 PMLQuad_mesh_y_pt -> nboundary_node(parent_boundary_y_id);
885 for (
unsigned n=0; n<n_boundary_y_node; n++)
887 ordered_boundary_y_node_pt[n] =
888 PMLQuad_mesh_y_pt -> boundary_node_pt(parent_boundary_y_id, n);
892 if (parent_boundary_y_id == 1)
894 std::sort(ordered_boundary_y_node_pt.begin(),
895 ordered_boundary_y_node_pt.end(),
899 unsigned x_nnod =
this -> nboundary_node(current_boundary_x_id);
900 for (
unsigned j=0;j<x_nnod;j++)
902 this -> boundary_node_pt(current_boundary_x_id,j)->set_obsolete();
905 unsigned y_nnod =
this -> nboundary_node(current_boundary_y_id);
906 for (
unsigned j=0;j<y_nnod;j++)
908 this -> boundary_node_pt(current_boundary_y_id,j)->set_obsolete();
912 this -> prune_dead_nodes();
915 unsigned n_pml_element =
this -> nelement();
921 if (parent_boundary_y_id == 1) {
922 for(
unsigned e=0;
e<n_pml_element;
e++)
925 if ((
e % n_pml_x) == 0)
928 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(
929 this -> element_pt(
e));
932 unsigned n_node = el_pt -> nnode();
933 for (
unsigned inod = 0; inod<n_node; inod++)
935 if (
e==((n_pml_x) * (n_pml_y-1)))
938 if (inod==interior_node_nr_helper_1) {
939 el_pt->node_pt(inod) = special_corner_node_pt;
941 if ((inod%nnode_1d == 0) && (inod<interior_node_nr_helper_1) ) {
943 el_pt->node_pt(inod) = ordered_boundary_y_node_pt[count];
947 if (inod == interior_node_nr_helper_1) {count--;}
952 if ((inod % nnode_1d) == 0){
954 el_pt->node_pt(inod) = ordered_boundary_y_node_pt[count];
958 if (inod == interior_node_nr_helper_1) {count--;}
968 if (parent_boundary_x_id == 0) {
969 for(
unsigned e=0;
e<n_pml_element;
e++)
972 if (
e>=((n_pml_x-0) * (n_pml_y-1)))
975 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(
976 this -> element_pt(
e));
979 unsigned n_node = el_pt -> nnode();
980 for (
unsigned inod = 0; inod<n_node; inod++)
982 if (
e==((n_pml_x) * (n_pml_y-1))){
983 if (((
unsigned) (inod / nnode_1d) == interior_node_nr_helper_2 )
984 && (inod > interior_node_nr_helper_1))
987 el_pt->node_pt(inod) = ordered_boundary_x_node_pt[count];
991 if (inod == interior_node_nr_helper_3) {count--;}
995 if ((
unsigned) (inod / nnode_1d) == interior_node_nr_helper_2 )
998 el_pt->node_pt(inod) = ordered_boundary_x_node_pt[count];
1002 if (inod == interior_node_nr_helper_3) {count--;}
1013 if ((parent_boundary_x_id == 2) && (parent_boundary_y_id == 3)){
1015 unsigned n_boundary_x_node =
1016 PMLQuad_mesh_x_pt -> nboundary_node(parent_boundary_x_id);
1019 Vector<Node*> ordered_boundary_x_node_pt(n_boundary_x_node);
1022 for (
unsigned n=0; n<n_boundary_x_node; n++)
1024 ordered_boundary_x_node_pt[n] =
1025 PMLQuad_mesh_x_pt -> boundary_node_pt(parent_boundary_x_id, n);
1029 if (parent_boundary_x_id == 2)
1031 std::sort(ordered_boundary_x_node_pt.begin(),
1032 ordered_boundary_x_node_pt.end(),
1037 unsigned n_boundary_y_node =
1038 PMLQuad_mesh_y_pt -> nboundary_node(parent_boundary_y_id);
1041 Vector<Node*> ordered_boundary_y_node_pt(n_boundary_y_node);
1044 for (
unsigned n=0; n<n_boundary_y_node; n++)
1046 ordered_boundary_y_node_pt[n] =
1047 PMLQuad_mesh_y_pt -> boundary_node_pt(parent_boundary_y_id, n);
1051 if (parent_boundary_y_id == 1)
1053 std::sort(ordered_boundary_y_node_pt.begin(),
1054 ordered_boundary_y_node_pt.end(),
1058 unsigned x_nnod =
this -> nboundary_node(current_boundary_x_id);
1059 for (
unsigned j=0;j<x_nnod;j++)
1061 this -> boundary_node_pt(current_boundary_x_id,j)->set_obsolete();
1064 unsigned y_nnod =
this -> nboundary_node(current_boundary_y_id);
1065 for (
unsigned j=0;j<y_nnod;j++)
1067 this -> boundary_node_pt(current_boundary_y_id,j)->set_obsolete();
1071 this -> prune_dead_nodes();
1074 unsigned n_pml_element =
this -> nelement();
1080 if (parent_boundary_y_id == 3) {
1081 for(
unsigned e=0;
e<n_pml_element;
e++)
1084 if ((
e % n_pml_x) == (n_pml_x-1))
1087 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(
1088 this -> element_pt(
e));
1091 unsigned n_node = el_pt -> nnode();
1092 for (
unsigned inod = 0; inod<n_node; inod++)
1096 if (inod == interior_node_nr_helper_2)
1097 el_pt->node_pt(inod) = special_corner_node_pt;
1098 if ((inod % nnode_1d == interior_node_nr_helper_2)
1099 && (inod > (nnode_1d - 1))) {
1102 el_pt->node_pt(inod) = ordered_boundary_y_node_pt[count];
1106 if (inod == interior_node_nr_helper_3) {count--;}
1111 if ((inod % nnode_1d) == interior_node_nr_helper_2){
1113 el_pt->node_pt(inod) = ordered_boundary_y_node_pt[count];
1117 if (inod == interior_node_nr_helper_3) {count--;}
1127 if (parent_boundary_x_id == 2) {
1128 for(
unsigned e=0;
e<n_pml_element;
e++)
1131 if ((
int)(
e / n_pml_x) == 0)
1134 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(
1135 this -> element_pt(
e));
1138 unsigned n_node = el_pt -> nnode();
1139 for (
unsigned inod = 0; inod<n_node; inod++)
1142 if (
e==(n_pml_x-1)){
1143 if (((
int) (inod / nnode_1d) == 0 )
1144 && (inod < interior_node_nr_helper_2))
1147 el_pt->node_pt(inod) = ordered_boundary_x_node_pt[count];
1151 if (inod == (nnode_1d - 1)) {count--;}
1155 if ((
int) (inod / nnode_1d) == 0 )
1158 el_pt->node_pt(inod) = ordered_boundary_x_node_pt[count];
1162 if (inod == interior_node_nr_helper_2) {count--;}
1173 if ((parent_boundary_x_id == 0) && (parent_boundary_y_id == 3)){
1175 unsigned n_boundary_x_node =
1176 PMLQuad_mesh_x_pt -> nboundary_node(parent_boundary_x_id);
1179 Vector<Node*> ordered_boundary_x_node_pt(n_boundary_x_node);
1182 for (
unsigned n=0; n<n_boundary_x_node; n++)
1184 ordered_boundary_x_node_pt[n] =
1185 PMLQuad_mesh_x_pt -> boundary_node_pt(parent_boundary_x_id, n);
1189 if (parent_boundary_x_id == 0)
1191 std::sort(ordered_boundary_x_node_pt.begin(),
1192 ordered_boundary_x_node_pt.end(),
1197 unsigned n_boundary_y_node =
1198 PMLQuad_mesh_y_pt -> nboundary_node(parent_boundary_y_id);
1201 Vector<Node*> ordered_boundary_y_node_pt(n_boundary_y_node);
1204 for (
unsigned n=0; n<n_boundary_y_node; n++)
1206 ordered_boundary_y_node_pt[n] =
1207 PMLQuad_mesh_y_pt -> boundary_node_pt(parent_boundary_y_id, n);
1211 if (parent_boundary_y_id == 3)
1213 std::sort(ordered_boundary_y_node_pt.begin(),
1214 ordered_boundary_y_node_pt.end(),
1218 unsigned x_nnod =
this -> nboundary_node(current_boundary_x_id);
1219 for (
unsigned j=0;j<x_nnod;j++)
1221 this -> boundary_node_pt(current_boundary_x_id,j)->set_obsolete();
1224 unsigned y_nnod =
this -> nboundary_node(current_boundary_y_id);
1225 for (
unsigned j=0;j<y_nnod;j++)
1227 this -> boundary_node_pt(current_boundary_y_id,j)->set_obsolete();
1231 this -> prune_dead_nodes();
1233 unsigned n_pml_element =
this -> nelement();
1239 if (parent_boundary_y_id == 3) {
1240 for(
unsigned e=0;
e<n_pml_element;
e++)
1243 if ((
e % n_pml_x) == (n_pml_x-1))
1246 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(
1247 this -> element_pt(
e));
1250 unsigned n_node = el_pt -> nnode();
1251 for (
unsigned inod = 0; inod<n_node; inod++)
1253 if (
e==(n_pml_element-1))
1255 if (inod == interior_node_nr_helper_3) {
1256 el_pt->node_pt(inod) = special_corner_node_pt;
1258 if ((inod % nnode_1d == interior_node_nr_helper_2)
1259 && (inod < interior_node_nr_helper_3 )) {
1262 el_pt->node_pt(inod) = ordered_boundary_y_node_pt[count];
1266 if (inod == interior_node_nr_helper_3) {count--;}
1271 if ((inod % nnode_1d) == interior_node_nr_helper_2){
1273 el_pt->node_pt(inod) = ordered_boundary_y_node_pt[count];
1277 if (inod == interior_node_nr_helper_3) {count--;}
1287 if (parent_boundary_x_id == 0) {
1288 for(
unsigned e=0;
e<n_pml_element;
e++)
1291 if (
e>=((n_pml_x) * (n_pml_y-1)))
1294 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(
1295 this -> element_pt(
e));
1298 unsigned n_node = el_pt -> nnode();
1299 for (
unsigned inod = 0; inod<n_node; inod++)
1301 if (
e==(n_pml_element-1)){
1302 if (((
unsigned) (inod / nnode_1d) == interior_node_nr_helper_2 )
1303 && (inod < interior_node_nr_helper_3))
1306 el_pt->node_pt(inod) = ordered_boundary_x_node_pt[count];
1310 if (inod == interior_node_nr_helper_3) {count--;}
1314 if ((
unsigned) (inod / nnode_1d) == interior_node_nr_helper_2 )
1317 el_pt->node_pt(inod) = ordered_boundary_x_node_pt[count];
1321 if (inod == interior_node_nr_helper_3) {count--;}
1341 namespace TwoDimensionalPMLHelper
1347 template<
class ASSOCIATED_PML_QUAD_ELEMENT>
1349 const unsigned& right_boundary_id,
1350 const unsigned& n_x_right_pml,
1351 const double& width_x_right_pml,
1356 unsigned n_right_boundary_node =
1357 bulk_mesh_pt -> nboundary_node(right_boundary_id);
1360 Vector<Node*> ordered_right_boundary_node_pt(n_right_boundary_node);
1363 for (
unsigned n=0; n<n_right_boundary_node; n++)
1365 ordered_right_boundary_node_pt[n] =
1370 std::sort(ordered_right_boundary_node_pt.begin(),
1371 ordered_right_boundary_node_pt.end(),
1375 unsigned n_y_right_pml =
1376 bulk_mesh_pt -> nboundary_element(right_boundary_id);
1379 double l_pml_right_x_start =
1380 ordered_right_boundary_node_pt[0] -> x(0);
1382 double l_pml_right_x_end =
1384 + ordered_right_boundary_node_pt[0] -> x(0);
1385 double l_pml_right_y_start =
1386 ordered_right_boundary_node_pt[0] -> x(1);
1387 double l_pml_right_y_end =
1388 ordered_right_boundary_node_pt[n_right_boundary_node-1] -> x(1);
1391 unsigned right_quadPML_boundary_id = 3;
1394 Mesh* pml_right_mesh_pt = 0;
1399 (bulk_mesh_pt, right_boundary_id, right_quadPML_boundary_id,
1400 n_x_right_pml, n_y_right_pml,
1401 l_pml_right_x_start, l_pml_right_x_end,
1402 l_pml_right_y_start, l_pml_right_y_end,
1406 unsigned n_element_pml_right = pml_right_mesh_pt->
nelement();
1407 for(
unsigned e=0;
e<n_element_pml_right;
e++)
1412 el_pt -> enable_pml(0, l_pml_right_x_start, l_pml_right_x_end);
1421 unsigned npin=values_to_pin.
size();
1425 unsigned n_bound_pml_right = pml_right_mesh_pt->
nboundary();
1426 for(
unsigned b=0;b<n_bound_pml_right;b++)
1428 unsigned n_node = pml_right_mesh_pt -> nboundary_node(b);
1429 for (
unsigned n=0;n<n_node;n++)
1431 Node* nod_pt=pml_right_mesh_pt -> boundary_node_pt(b,n);
1434 for (
unsigned j=0;j<npin;j++)
1436 unsigned j_val=values_to_pin[j];
1446 return pml_right_mesh_pt;
1452 template<
class ASSOCIATED_PML_QUAD_ELEMENT>
1454 const unsigned& top_boundary_id,
1455 const unsigned& n_y_top_pml,
1456 const double& width_y_top_pml,
1461 unsigned n_top_boundary_node =
1462 bulk_mesh_pt -> nboundary_node(top_boundary_id);
1465 Vector<Node*> ordered_top_boundary_node_pt(n_top_boundary_node);
1468 for (
unsigned n=0; n<n_top_boundary_node; n++)
1470 ordered_top_boundary_node_pt[n] =
1475 std::sort(ordered_top_boundary_node_pt.begin(),
1476 ordered_top_boundary_node_pt.end(),
1480 unsigned n_x_top_pml = bulk_mesh_pt -> nboundary_element(top_boundary_id);
1483 double l_pml_top_x_start =
1484 ordered_top_boundary_node_pt[0] -> x(0);
1485 double l_pml_top_x_end =
1486 ordered_top_boundary_node_pt[n_top_boundary_node-1] -> x(0);
1487 double l_pml_top_y_start =
1488 ordered_top_boundary_node_pt[0] -> x(1);
1490 double l_pml_top_y_end =
1492 + ordered_top_boundary_node_pt[0] -> x(1);
1494 unsigned top_quadPML_boundary_id = 0;
1497 Mesh* pml_top_mesh_pt = 0;
1502 (bulk_mesh_pt, top_boundary_id, top_quadPML_boundary_id,
1503 n_x_top_pml, n_y_top_pml,
1504 l_pml_top_x_start, l_pml_top_x_end,
1505 l_pml_top_y_start, l_pml_top_y_end,
1509 unsigned n_element_pml_top = pml_top_mesh_pt->
nelement();
1510 for(
unsigned e=0;
e<n_element_pml_top;
e++)
1515 el_pt -> enable_pml(1, l_pml_top_y_start, l_pml_top_y_end);
1524 unsigned npin=values_to_pin.
size();
1529 unsigned n_bound_pml_top = pml_top_mesh_pt->
nboundary();
1530 for(
unsigned b=0;b<n_bound_pml_top;b++)
1532 unsigned n_node = pml_top_mesh_pt -> nboundary_node(b);
1533 for (
unsigned n=0;n<n_node;n++)
1535 Node* nod_pt=pml_top_mesh_pt -> boundary_node_pt(b,n);
1538 for (
unsigned j=0;j<npin;j++)
1540 unsigned j_val=values_to_pin[j];
1550 return pml_top_mesh_pt;
1556 template<
class ASSOCIATED_PML_QUAD_ELEMENT>
1558 const unsigned& left_boundary_id,
1559 const unsigned& n_x_left_pml,
1560 const double& width_x_left_pml,
1565 unsigned n_left_boundary_node =
1566 bulk_mesh_pt -> nboundary_node(left_boundary_id);
1569 Vector<Node*> ordered_left_boundary_node_pt(n_left_boundary_node);
1572 for (
unsigned n=0; n<n_left_boundary_node; n++)
1574 ordered_left_boundary_node_pt[n] =
1579 std::sort(ordered_left_boundary_node_pt.begin(),
1580 ordered_left_boundary_node_pt.end(),
1584 unsigned n_y_left_pml = bulk_mesh_pt -> nboundary_element(left_boundary_id);
1588 double l_pml_left_x_start =
1590 + ordered_left_boundary_node_pt[n_left_boundary_node-1] -> x(0);
1591 double l_pml_left_x_end =
1592 ordered_left_boundary_node_pt[n_left_boundary_node-1] -> x(0);
1593 double l_pml_left_y_start =
1594 ordered_left_boundary_node_pt[n_left_boundary_node-1] -> x(1);
1595 double l_pml_left_y_end =
1596 ordered_left_boundary_node_pt[0] -> x(1);
1598 unsigned left_quadPML_boundary_id = 1;
1601 Mesh* pml_left_mesh_pt = 0;
1606 (bulk_mesh_pt, left_boundary_id, left_quadPML_boundary_id,
1607 n_x_left_pml, n_y_left_pml,
1608 l_pml_left_x_start, l_pml_left_x_end,
1609 l_pml_left_y_start, l_pml_left_y_end,
1613 unsigned n_element_pml_left = pml_left_mesh_pt->
nelement();
1614 for(
unsigned e=0;
e<n_element_pml_left;
e++)
1619 el_pt -> enable_pml(0, l_pml_left_x_end, l_pml_left_x_start);
1628 unsigned npin=values_to_pin.
size();
1633 unsigned n_bound_pml_left = pml_left_mesh_pt->
nboundary();
1634 for(
unsigned b=0;b<n_bound_pml_left;b++)
1636 unsigned n_node = pml_left_mesh_pt -> nboundary_node(b);
1637 for (
unsigned n=0;n<n_node;n++)
1639 Node* nod_pt=pml_left_mesh_pt -> boundary_node_pt(b,n);
1642 for (
unsigned j=0;j<npin;j++)
1644 unsigned j_val=values_to_pin[j];
1654 return pml_left_mesh_pt;
1660 template<
class ASSOCIATED_PML_QUAD_ELEMENT>
1662 const unsigned& bottom_boundary_id,
1663 const unsigned& n_y_bottom_pml,
1664 const double& width_y_bottom_pml,
1669 unsigned n_bottom_boundary_node =
1670 bulk_mesh_pt -> nboundary_node(bottom_boundary_id);
1673 Vector<Node*> ordered_bottom_boundary_node_pt(n_bottom_boundary_node);
1676 for (
unsigned n=0; n<n_bottom_boundary_node; n++)
1678 ordered_bottom_boundary_node_pt[n] =
1683 std::sort(ordered_bottom_boundary_node_pt.begin(),
1684 ordered_bottom_boundary_node_pt.end(),
1688 unsigned n_x_bottom_pml =
1689 bulk_mesh_pt -> nboundary_element(bottom_boundary_id);
1692 double l_pml_bottom_x_start =
1693 ordered_bottom_boundary_node_pt[n_bottom_boundary_node-1] -> x(0);
1694 double l_pml_bottom_x_end =
1695 ordered_bottom_boundary_node_pt[0] -> x(0);
1698 double l_pml_bottom_y_start =
1699 - width_y_bottom_pml
1700 + ordered_bottom_boundary_node_pt[0] -> x(1);
1701 double l_pml_bottom_y_end =
1702 ordered_bottom_boundary_node_pt[0] -> x(1);
1704 unsigned bottom_quadPML_boundary_id = 2;
1707 Mesh* pml_bottom_mesh_pt = 0;
1712 (bulk_mesh_pt, bottom_boundary_id, bottom_quadPML_boundary_id,
1713 n_x_bottom_pml, n_y_bottom_pml,
1714 l_pml_bottom_x_start, l_pml_bottom_x_end,
1715 l_pml_bottom_y_start, l_pml_bottom_y_end,
1719 unsigned n_element_pml_bottom = pml_bottom_mesh_pt->
nelement();
1720 for(
unsigned e=0;
e<n_element_pml_bottom;
e++)
1725 el_pt -> enable_pml(1, l_pml_bottom_y_end, l_pml_bottom_y_start);
1734 unsigned npin=values_to_pin.
size();
1739 unsigned n_bound_pml_bottom = pml_bottom_mesh_pt->
nboundary();
1740 for(
unsigned b=0;b<n_bound_pml_bottom;b++)
1742 unsigned n_node = pml_bottom_mesh_pt -> nboundary_node(b);
1743 for (
unsigned n=0;n<n_node;n++)
1745 Node* nod_pt=pml_bottom_mesh_pt -> boundary_node_pt(b,n);
1748 for (
unsigned j=0;j<npin;j++)
1750 unsigned j_val=values_to_pin[j];
1760 return pml_bottom_mesh_pt;
1767 template<
class ASSOCIATED_PML_QUAD_ELEMENT>
1769 Mesh* pml_top_mesh_pt,
1771 const unsigned& right_boundary_id,
1778 unsigned parent_boundary_x_id = 2;
1779 unsigned parent_boundary_y_id = 1;
1781 unsigned current_boundary_x_id = 0;
1782 unsigned current_boundary_y_id = 3;
1785 unsigned n_right_boundary_node =
1786 bulk_mesh_pt -> nboundary_node(right_boundary_id);
1789 Vector<Node*> ordered_right_boundary_node_pt(n_right_boundary_node);
1792 for (
unsigned n=0; n<n_right_boundary_node; n++)
1794 ordered_right_boundary_node_pt[n] =
1799 std::sort(ordered_right_boundary_node_pt.begin(),
1800 ordered_right_boundary_node_pt.end(),
1805 unsigned n_x_right_pml =
1806 pml_right_mesh_pt -> nboundary_element(parent_boundary_x_id);
1807 unsigned n_y_top_pml =
1808 pml_top_mesh_pt -> nboundary_element(parent_boundary_y_id);
1809 unsigned n_x_boundary_nodes =
1810 pml_right_mesh_pt -> nboundary_node(parent_boundary_x_id);
1811 unsigned n_y_boundary_nodes =
1812 pml_top_mesh_pt -> nboundary_node(parent_boundary_y_id);
1816 double l_pml_right_x_start =
1817 ordered_right_boundary_node_pt[n_right_boundary_node-1] -> x(0);
1818 double l_pml_right_x_end =
1819 pml_right_mesh_pt ->
1820 boundary_node_pt(parent_boundary_x_id, n_x_boundary_nodes-1)-> x(0);
1821 double l_pml_top_y_start =
1822 ordered_right_boundary_node_pt[n_right_boundary_node-1] -> x(1);
1823 double l_pml_top_y_end =
1825 boundary_node_pt(parent_boundary_y_id, n_y_boundary_nodes-1)-> x(1);
1828 Mesh* pml_top_right_mesh_pt = 0;
1832 (pml_right_mesh_pt, pml_top_mesh_pt, bulk_mesh_pt,
1833 ordered_right_boundary_node_pt[n_right_boundary_node-1],
1834 parent_boundary_x_id, parent_boundary_y_id,
1835 current_boundary_x_id, current_boundary_y_id,
1836 n_x_right_pml, n_y_top_pml,
1837 l_pml_right_x_start, l_pml_right_x_end,
1838 l_pml_top_y_start, l_pml_top_y_end,
1844 unsigned n_element_pml_top_right = pml_top_right_mesh_pt->
nelement();
1845 for(
unsigned e=0;
e<n_element_pml_top_right;
e++)
1850 el_pt -> enable_pml(0, l_pml_right_x_start, l_pml_right_x_end);
1851 el_pt -> enable_pml(1, l_pml_top_y_start, l_pml_top_y_end);
1860 unsigned npin=values_to_pin.
size();
1865 unsigned n_bound_pml_top_right = pml_top_right_mesh_pt->
nboundary();
1866 for(
unsigned b=0;b<n_bound_pml_top_right;b++)
1868 unsigned n_node = pml_top_right_mesh_pt -> nboundary_node(b);
1869 for (
unsigned n=0;n<n_node;n++)
1871 Node* nod_pt=pml_top_right_mesh_pt -> boundary_node_pt(b,n);
1874 for (
unsigned j=0;j<npin;j++)
1876 unsigned j_val=values_to_pin[j];
1886 return pml_top_right_mesh_pt;
1893 template<
class ASSOCIATED_PML_QUAD_ELEMENT>
1895 Mesh* pml_bottom_mesh_pt,
1897 const unsigned& right_boundary_id,
1904 unsigned parent_boundary_x_id = 0;
1905 unsigned parent_boundary_y_id = 1;
1907 unsigned current_boundary_x_id = 2;
1908 unsigned current_boundary_y_id = 3;
1911 unsigned n_right_boundary_node =
1912 bulk_mesh_pt -> nboundary_node(right_boundary_id);
1915 Vector<Node*> ordered_right_boundary_node_pt(n_right_boundary_node);
1918 for (
unsigned n=0; n<n_right_boundary_node; n++)
1920 ordered_right_boundary_node_pt[n] =
1925 std::sort(ordered_right_boundary_node_pt.begin(),
1926 ordered_right_boundary_node_pt.end(),
1931 unsigned n_x_right_pml =
1932 pml_right_mesh_pt -> nboundary_element(parent_boundary_x_id);
1933 unsigned n_y_bottom_pml =
1934 pml_bottom_mesh_pt -> nboundary_element(parent_boundary_y_id);
1935 unsigned n_x_boundary_nodes =
1936 pml_right_mesh_pt -> nboundary_node(parent_boundary_x_id);
1940 double l_pml_right_x_start =
1941 ordered_right_boundary_node_pt[0] -> x(0);
1942 double l_pml_right_x_end =
1943 pml_right_mesh_pt ->
1944 boundary_node_pt(parent_boundary_x_id, n_x_boundary_nodes-1)-> x(0);
1945 double l_pml_bottom_y_start =
1946 pml_bottom_mesh_pt -> boundary_node_pt(parent_boundary_y_id, 0)-> x(1);
1947 double l_pml_bottom_y_end =
1948 ordered_right_boundary_node_pt[0] -> x(1);
1951 Mesh* pml_bottom_right_mesh_pt = 0;
1954 pml_bottom_right_mesh_pt=
1956 (pml_right_mesh_pt, pml_bottom_mesh_pt, bulk_mesh_pt,
1957 ordered_right_boundary_node_pt[0],
1958 parent_boundary_x_id, parent_boundary_y_id,
1959 current_boundary_x_id, current_boundary_y_id,
1960 n_x_right_pml, n_y_bottom_pml,
1961 l_pml_right_x_start, l_pml_right_x_end,
1962 l_pml_bottom_y_start, l_pml_bottom_y_end,
1968 unsigned n_element_pml_bottom_right =
1969 pml_bottom_right_mesh_pt->
nelement();
1971 for(
unsigned e=0;
e<n_element_pml_bottom_right;
e++)
1976 el_pt -> enable_pml(0, l_pml_right_x_start, l_pml_right_x_end);
1977 el_pt -> enable_pml(1, l_pml_bottom_y_end, l_pml_bottom_y_start);
1986 unsigned npin=values_to_pin.
size();
1991 unsigned n_bound_pml_bottom_right = pml_bottom_right_mesh_pt->
nboundary();
1992 for(
unsigned b=0;b<n_bound_pml_bottom_right;b++)
1994 unsigned n_node = pml_bottom_right_mesh_pt -> nboundary_node(b);
1995 for (
unsigned n=0;n<n_node;n++)
1997 Node* nod_pt=pml_bottom_right_mesh_pt -> boundary_node_pt(b,n);
2000 for (
unsigned j=0;j<npin;j++)
2002 unsigned j_val=values_to_pin[j];
2012 return pml_bottom_right_mesh_pt;
2019 template<
class ASSOCIATED_PML_QUAD_ELEMENT>
2021 Mesh* pml_top_mesh_pt,
2023 const unsigned& left_boundary_id,
2030 unsigned parent_boundary_x_id = 2;
2031 unsigned parent_boundary_y_id = 3;
2033 unsigned current_boundary_x_id = 0;
2034 unsigned current_boundary_y_id = 1;
2037 unsigned n_left_boundary_node =
2038 bulk_mesh_pt -> nboundary_node(left_boundary_id);
2041 Vector<Node*> ordered_left_boundary_node_pt(n_left_boundary_node);
2044 for (
unsigned n=0; n<n_left_boundary_node; n++)
2046 ordered_left_boundary_node_pt[n] =
2053 std::sort(ordered_left_boundary_node_pt.begin(),
2054 ordered_left_boundary_node_pt.end(),
2059 unsigned n_x_left_pml =
2060 pml_left_mesh_pt -> nboundary_element(parent_boundary_x_id);
2061 unsigned n_y_top_pml =
2062 pml_top_mesh_pt -> nboundary_element(parent_boundary_y_id);
2063 unsigned n_y_boundary_nodes =
2064 pml_top_mesh_pt -> nboundary_node(parent_boundary_y_id);
2068 double l_pml_left_x_start =
2069 pml_left_mesh_pt -> boundary_node_pt(parent_boundary_x_id, 0)-> x(0);
2070 double l_pml_left_x_end =
2071 ordered_left_boundary_node_pt[n_left_boundary_node-1] -> x(0);
2072 double l_pml_top_y_start =
2073 ordered_left_boundary_node_pt[n_left_boundary_node-1] -> x(1);
2074 double l_pml_top_y_end =
2076 boundary_node_pt(parent_boundary_y_id, n_y_boundary_nodes-1)-> x(1);
2079 Mesh* pml_top_left_mesh_pt = 0;
2082 pml_top_left_mesh_pt=
2084 (pml_left_mesh_pt, pml_top_mesh_pt, bulk_mesh_pt,
2085 ordered_left_boundary_node_pt[n_left_boundary_node-1],
2086 parent_boundary_x_id, parent_boundary_y_id,
2087 current_boundary_x_id, current_boundary_y_id,
2088 n_x_left_pml, n_y_top_pml,
2089 l_pml_left_x_start, l_pml_left_x_end,
2090 l_pml_top_y_start, l_pml_top_y_end,
2096 unsigned n_element_pml_top_left = pml_top_left_mesh_pt->
nelement();
2098 for(
unsigned e=0;
e<n_element_pml_top_left;
e++)
2103 el_pt -> enable_pml(0, l_pml_left_x_end, l_pml_left_x_start);
2104 el_pt -> enable_pml(1, l_pml_top_y_start, l_pml_top_y_end);
2113 unsigned npin=values_to_pin.
size();
2118 unsigned n_bound_pml_top_left = pml_top_left_mesh_pt->
nboundary();
2119 for(
unsigned b=0;b<n_bound_pml_top_left;b++)
2121 unsigned n_node = pml_top_left_mesh_pt -> nboundary_node(b);
2122 for (
unsigned n=0;n<n_node;n++)
2124 Node* nod_pt=pml_top_left_mesh_pt -> boundary_node_pt(b,n);
2127 for (
unsigned j=0;j<npin;j++)
2129 unsigned j_val=values_to_pin[j];
2139 return pml_top_left_mesh_pt;
2146 template<
class ASSOCIATED_PML_QUAD_ELEMENT>
2148 Mesh* pml_bottom_mesh_pt,
2150 const unsigned& left_boundary_id,
2157 unsigned parent_boundary_x_id = 0;
2158 unsigned parent_boundary_y_id = 3;
2160 unsigned current_boundary_x_id = 2;
2161 unsigned current_boundary_y_id = 1;
2164 unsigned n_left_boundary_node =
2165 bulk_mesh_pt -> nboundary_node(left_boundary_id);
2168 Vector<Node*> ordered_left_boundary_node_pt(n_left_boundary_node);
2171 for (
unsigned n=0; n<n_left_boundary_node; n++)
2173 ordered_left_boundary_node_pt[n] =
2180 std::sort(ordered_left_boundary_node_pt.begin(),
2181 ordered_left_boundary_node_pt.end(),
2186 unsigned n_x_left_pml =
2187 pml_left_mesh_pt -> nboundary_element(parent_boundary_x_id);
2188 unsigned n_y_bottom_pml =
2189 pml_bottom_mesh_pt -> nboundary_element(parent_boundary_y_id);
2193 double l_pml_left_x_start =
2194 pml_left_mesh_pt -> boundary_node_pt(parent_boundary_x_id, 0)-> x(0);
2195 double l_pml_left_x_end =
2196 ordered_left_boundary_node_pt[n_left_boundary_node-1] -> x(0);
2197 double l_pml_bottom_y_start =
2198 pml_bottom_mesh_pt -> boundary_node_pt(parent_boundary_y_id, 0)-> x(1);
2199 double l_pml_bottom_y_end =
2200 ordered_left_boundary_node_pt[0] -> x(1);
2203 Mesh* pml_bottom_left_mesh_pt = 0;
2206 pml_bottom_left_mesh_pt=
2208 (pml_left_mesh_pt, pml_bottom_mesh_pt, bulk_mesh_pt,
2209 ordered_left_boundary_node_pt[0],
2210 parent_boundary_x_id, parent_boundary_y_id,
2211 current_boundary_x_id, current_boundary_y_id,
2212 n_x_left_pml, n_y_bottom_pml,
2213 l_pml_left_x_start, l_pml_left_x_end,
2214 l_pml_bottom_y_start, l_pml_bottom_y_end,
2220 unsigned n_element_pml_bottom_left = pml_bottom_left_mesh_pt->
nelement();
2221 for(
unsigned e=0;
e<n_element_pml_bottom_left;
e++)
2226 el_pt -> enable_pml(0, l_pml_left_x_end, l_pml_left_x_start);
2227 el_pt -> enable_pml(1, l_pml_bottom_y_end, l_pml_bottom_y_start);
2236 unsigned npin=values_to_pin.
size();
2241 unsigned n_bound_pml_bottom_left = pml_bottom_left_mesh_pt->
nboundary();
2242 for(
unsigned b=0;b<n_bound_pml_bottom_left;b++)
2244 unsigned n_node = pml_bottom_left_mesh_pt -> nboundary_node(b);
2245 for (
unsigned n=0;n<n_node;n++)
2247 Node* nod_pt=pml_bottom_left_mesh_pt -> boundary_node_pt(b,n);
2250 for (
unsigned j=0;j<npin;j++)
2252 unsigned j_val=values_to_pin[j];
2262 return pml_bottom_left_mesh_pt;
void pml_locate_zeta(const Vector< double > &x, FiniteElement *&coarse_mesh_el_pt)
Overloaded function to allow the user to locate an element in mesh given the (Eulerian) position of a...
bool sorter_left_boundary(Node *nod_i_pt, Node *nod_j_pt)
helper function for sorting the left boundary nodes
Node *& boundary_node_pt(const unsigned &b, const unsigned &n)
Return pointer to node n on boundary b.
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors. ...
bool sorter_bottom_boundary(Node *nod_i_pt, Node *nod_j_pt)
helper function for sorting the bottom boundary nodes
A general Finite Element class.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
Mesh * create_top_pml_mesh(Mesh *bulk_mesh_pt, const unsigned &top_boundary_id, const unsigned &n_y_top_pml, const double &width_y_top_pml, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML mesh, aligned with the top physical domain boundary
void pin(const unsigned &i)
Pin the i-th stored variable.
PML mesh, derived from RectangularQuadMesh.
unsigned long nelement() const
Return number of elements in the mesh.
double & x(const unsigned &i)
Return the i-th nodal coordinate.
virtual void values_to_be_pinned_on_outer_pml_boundary(Vector< unsigned > &values_to_pin)=0
Pure virtual function in which we have to specify the values to be pinned (and set to zero) on the ou...
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
unsigned nboundary() const
Return number of boundaries.
void set_value(const unsigned &i, const double &value_)
Set the i-th stored data value to specified value. The only reason that we require an explicit set fu...
bool sorter_right_boundary(Node *nod_i_pt, Node *nod_j_pt)
helper function for sorting the right boundary nodes
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
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
PMLCornerQuadMesh(Mesh *PMLQuad_mesh_x_pt, Mesh *PMLQuad_mesh_y_pt, Mesh *bulk_mesh_pt, Node *special_corner_node_pt, const unsigned &parent_boundary_x_id, const unsigned &parent_boundary_y_id, const unsigned ¤t_boundary_x_id, const unsigned ¤t_boundary_y_id, const unsigned &n_pml_x, const unsigned &n_pml_y, const double &x_pml_start, const double &x_pml_end, const double &y_pml_start, const double &y_pml_end, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to "bulk" mesh and the two existing PML meshes in order to construct the co...
bool sorter_top_boundary(Node *nod_i_pt, Node *nod_j_pt)
helper function for sorting the top boundary nodes
Mesh * create_bottom_pml_mesh(Mesh *bulk_mesh_pt, const unsigned &bottom_boundary_id, const unsigned &n_y_bottom_pml, const double &width_y_bottom_pml, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML mesh,aligned with the bottom physical domain boundary
Mesh * create_left_pml_mesh(Mesh *bulk_mesh_pt, const unsigned &left_boundary_id, const unsigned &n_x_left_pml, const double &width_x_left_pml, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML mesh, aligned with the left physical domain boundary
PMLQuadMeshBase(const unsigned &n_pml_x, const unsigned &n_pml_y, const double &x_pml_start, const double &x_pml_end, const double &y_pml_start, const double &y_pml_end, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Create the underlying rectangular quad mesh.
PML mesh class. Policy class for 2D PML meshes.
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_right_pml_mesh(Mesh *bulk_mesh_pt, const unsigned &right_boundary_id, const unsigned &n_x_right_pml, const double &width_x_right_pml, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML mesh,aligned with the right physical domain boundary
PMLQuadMesh(Mesh *bulk_mesh_pt, const unsigned &boundary_id, const unsigned &quad_boundary_id, const unsigned &n_pml_x, const unsigned &n_pml_y, const double &x_pml_start, const double &x_pml_end, const double &y_pml_start, const double &y_pml_end, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to "bulk" mesh, the boundary ID of axis aligned boundary to which the mesh ...
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 ...
PML mesh, derived from RectangularQuadMesh.
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 ...
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...