47 namespace Missing_masters_functions
54 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 86 int& n_cont_inter_values,
111 int& iproc,
Node* nod_pt,
112 Mesh*
const &mesh_pt,
113 int& n_cont_inter_values,
119 for (
int i_cont=-1;i_cont<n_cont_inter_values;i_cont++)
125 send_unsigneds.push_back(1);
126 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 127 Flat_packed_unsigneds_string.push_back(
"Is hanging");
133 unsigned n_master=hang_pt->
nmaster();
136 send_unsigneds.push_back(n_master);
137 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 138 Flat_packed_unsigneds_string.push_back(
"nmaster");
140 for (
unsigned m=0;m<n_master;m++)
165 send_unsigneds.push_back(0);
166 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 167 Flat_packed_unsigneds_string.push_back(
"Not hanging");
178 Mesh*
const &mesh_pt,
179 int& n_cont_inter_values,
185 bool found_internally =
false;
186 unsigned shared_node_index=0;
194 = std::find(shared_node_pt.begin(),
195 shared_node_pt.end(),
199 if(it != shared_node_pt.end())
202 found_internally =
true;
204 shared_node_index = it - shared_node_pt.begin();
225 send_unsigneds.push_back(0);
226 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 227 std::stringstream junk;
228 junk <<
"Node was already added [size=" 229 << send_unsigneds.size() <<
"]; last entry: " 230 << send_unsigneds[send_unsigneds.size()-1];
232 Flat_packed_unsigneds_string.push_back(junk.str());
237 send_unsigneds.push_back(1);
238 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 239 Flat_packed_unsigneds_string.push_back(
"haloed node found internally");
241 send_unsigneds.push_back(shared_node_index);
242 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 243 Flat_packed_unsigneds_string.push_back(
"(internal) haloed node index");
250 unsigned external_haloed_node_index;
251 external_haloed_node_index=
255 if (external_haloed_node_index==n_ext_haloed_nod)
259 send_unsigneds.push_back(1);
260 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 261 std::stringstream junk;
262 junk <<
"Node needs to be constructed [size=" 263 << send_unsigneds.size() <<
"]; last entry: " 264 << send_unsigneds[send_unsigneds.size()-1];
265 Flat_packed_unsigneds_string.push_back(junk.str());
281 send_unsigneds.push_back(0);
282 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 283 std::stringstream junk;
284 junk <<
"Node was already added [size=" 285 << send_unsigneds.size() <<
"]; last entry: " 286 << send_unsigneds[send_unsigneds.size()-1];
288 Flat_packed_unsigneds_string.push_back(junk.str());
293 send_unsigneds.push_back(0);
294 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 295 Flat_packed_unsigneds_string.push_back(
"haloed node found externally");
297 send_unsigneds.push_back(external_haloed_node_index);
298 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 299 Flat_packed_unsigneds_string.push_back(
"external haloed node index");
313 Mesh*
const &mesh_pt,
314 int& n_cont_inter_values,
320 bool found_internally =
false;
321 unsigned shared_node_index=0;
329 = std::find(shared_node_pt.begin(),
330 shared_node_pt.end(),
334 if(it != shared_node_pt.end())
337 found_internally =
true;
339 shared_node_index = it - shared_node_pt.begin();
360 send_unsigneds.push_back(0);
361 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 362 std::stringstream junk;
363 junk <<
"Node was already added [size=" 364 << send_unsigneds.size() <<
"]; last entry: " 365 << send_unsigneds[send_unsigneds.size()-1];
367 Flat_packed_unsigneds_string.push_back(junk.str());
372 send_unsigneds.push_back(1);
373 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 374 Flat_packed_unsigneds_string.push_back(
"haloed node found internally");
376 send_unsigneds.push_back(shared_node_index);
377 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 378 Flat_packed_unsigneds_string.push_back(
"(internal) haloed node index");
385 unsigned external_haloed_node_index;
386 external_haloed_node_index=
390 if (external_haloed_node_index==n_ext_haloed_nod)
394 send_unsigneds.push_back(1);
395 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 396 Flat_packed_unsigneds_string.push_back(
"Node needs to be constructed[2]");
412 send_unsigneds.push_back(0);
413 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 414 Flat_packed_unsigneds_string.push_back(
"Node was already added[2]");
419 send_unsigneds.push_back(0);
420 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 421 Flat_packed_unsigneds_string.push_back(
"haloed node found externally");
423 send_unsigneds.push_back(external_haloed_node_index);
424 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 425 Flat_packed_unsigneds_string.push_back(
"external haloed node index[2]");
440 Mesh*
const &mesh_pt,
441 int& n_cont_inter_values,
448 unsigned n_val=nod_pt->
nvalue();
449 send_unsigneds.push_back(n_val);
450 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 451 Flat_packed_unsigneds_string.push_back(
"Number of values");
454 unsigned n_dim=nod_pt->
ndim();
459 if (time_stepper_pt!=0)
468 send_unsigneds.push_back(1);
469 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 470 Flat_packed_unsigneds_string.push_back(
"Node is on boundary");
476 for (
unsigned i_bnd=0;i_bnd<n_bnd;i_bnd++)
481 boundaries.push_back(i_bnd);
484 unsigned nb=boundaries.size();
485 send_unsigneds.push_back(nb);
486 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 487 std::stringstream junk;
488 junk <<
"Node is on "<< nb <<
" boundaries";
489 Flat_packed_unsigneds_string.push_back(junk.str());
491 for (
unsigned i=0;
i<nb;
i++)
493 send_unsigneds.push_back(boundaries[
i]);
494 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 495 std::stringstream junk;
496 junk <<
"Node is on boundary " << boundaries[
i] <<
" of " << n_bnd;
497 Flat_packed_unsigneds_string.push_back(junk.str());
509 "Failed to cast new node to boundary node\n",
510 OOMPH_CURRENT_FUNCTION,
511 OOMPH_EXCEPTION_LOCATION);
514 std::map<unsigned, unsigned>* map_pt=
520 send_unsigneds.push_back(0);
521 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 522 std::stringstream junk;
523 Flat_packed_unsigneds_string.push_back(
"No additional values were created by face element");
530 send_unsigneds.push_back(map_pt->size());
531 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 532 std::stringstream junk;
533 junk <<
"Map size " << map_pt->size() << n_bnd;
534 Flat_packed_unsigneds_string.push_back(junk.str());
537 for (std::map<unsigned, unsigned>::iterator p=
539 p!=map_pt->end();p++)
541 send_unsigneds.push_back((*p).first);
542 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 543 std::stringstream junk;
544 Flat_packed_unsigneds_string.push_back(
"Key of map entry");
546 send_unsigneds.push_back((*p).second);
547 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 548 Flat_packed_unsigneds_string.push_back(
"Value of map entry");
556 send_unsigneds.push_back(0);
557 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 558 Flat_packed_unsigneds_string.push_back(
"Node is not on any boundary");
574 send_unsigneds.push_back(update_id);
575 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 576 Flat_packed_unsigneds_string.push_back(
"Alg Node update id");
581 send_unsigneds.push_back(n_ref_val);
582 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 583 Flat_packed_unsigneds_string.push_back(
"Alg Node n ref values");
585 for (
unsigned i_ref_val=0;i_ref_val<n_ref_val;i_ref_val++)
587 send_doubles.push_back(alg_nod_pt->
ref_value(i_ref_val));
592 send_unsigneds.push_back(n_geom_obj);
593 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 594 Flat_packed_unsigneds_string.push_back(
"Alg Node n geom objects");
596 for (
unsigned i_geom=0;i_geom<n_geom_obj;i_geom++)
604 unsigned found_geom_object=0;
605 for (
unsigned i_list=0;i_list<n_geom_list;i_list++)
609 found_geom_object=i_list;
612 send_unsigneds.push_back(found_geom_object);
613 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 614 Flat_packed_unsigneds_string.push_back(
"Found geom object");
627 for (
unsigned i_val=0;i_val<n_solid_val;i_val++)
629 for (
unsigned t=0;
t<n_prev;
t++)
638 for (
unsigned i_val=0;i_val<n_val;i_val++)
640 for (
unsigned t=0;
t<n_prev;
t++)
642 send_doubles.push_back(nod_pt->
value(
t,i_val));
647 for (
unsigned idim=0;idim<n_dim;idim++)
649 for (
unsigned t=0;
t<n_prev;
t++)
651 send_doubles.push_back(nod_pt->
x(
t,idim));
662 (
int& iproc,
Node* master_nod_pt,
663 Mesh*
const &mesh_pt,
int& n_cont_inter_values,
668 send_unsigneds.push_back(master_nod_pt->
ndim());
669 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 670 Flat_packed_unsigneds_string.push_back(
"Master node ndim");
673 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 674 Flat_packed_unsigneds_string.push_back(
"Master node npos_type");
676 send_unsigneds.push_back(master_nod_pt->
nvalue());
677 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 678 Flat_packed_unsigneds_string.push_back(
"Master node nvalue");
688 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 689 Flat_packed_unsigneds_string.push_back(
"Master node non-halo processor ID");
696 send_unsigneds.push_back(solid_nod_pt->
nlagrangian());
697 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 698 Flat_packed_unsigneds_string.push_back(
"Master solid node nlagr");
701 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 702 Flat_packed_unsigneds_string.push_back(
"Master solid node nlagr_type");
706 unsigned n_dim=master_nod_pt->
ndim();
711 if (time_stepper_pt!=0)
720 send_unsigneds.push_back(1);
721 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 722 Flat_packed_unsigneds_string.push_back(
"Master node is on boundary");
727 for (
unsigned i_bnd=0;i_bnd<n_bnd;i_bnd++)
732 boundaries.push_back(i_bnd);
735 unsigned nb=boundaries.size();
736 send_unsigneds.push_back(nb);
737 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 738 std::stringstream junk;
739 junk <<
"Master node is on "<< nb <<
" boundaries";
740 Flat_packed_unsigneds_string.push_back(junk.str());
742 for (
unsigned i=0;
i<nb;
i++)
744 send_unsigneds.push_back(boundaries[
i]);
745 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 746 std::stringstream junk;
747 junk <<
"Master noode is on boundary " 748 << boundaries[
i] <<
" of " << n_bnd;
749 Flat_packed_unsigneds_string.push_back(junk.str());
761 "Failed to cast new node to boundary node\n",
762 OOMPH_CURRENT_FUNCTION,
763 OOMPH_EXCEPTION_LOCATION);
766 std::map<unsigned, unsigned>* map_pt=
772 send_unsigneds.push_back(0);
773 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 774 std::stringstream junk;
775 Flat_packed_unsigneds_string.push_back(
"No additional values were created by face element for this master node");
782 send_unsigneds.push_back(map_pt->size());
783 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 784 std::stringstream junk;
785 junk <<
"Map size for master node " << map_pt->size() << n_bnd;
786 Flat_packed_unsigneds_string.push_back(junk.str());
789 for (std::map<unsigned, unsigned>::iterator p=
791 p!=map_pt->end();p++)
793 send_unsigneds.push_back((*p).first);
794 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 795 std::stringstream junk;
796 Flat_packed_unsigneds_string.push_back(
797 "Key of map entry for master node");
799 send_unsigneds.push_back((*p).second);
800 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 801 Flat_packed_unsigneds_string.push_back(
802 "Value of map entry for master node");
810 send_unsigneds.push_back(0);
811 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 812 Flat_packed_unsigneds_string.push_back(
"Master node is not on any boundary");
828 send_unsigneds.push_back(update_id);
829 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 830 Flat_packed_unsigneds_string.push_back(
"Master Alg Node update id");
835 send_unsigneds.push_back(n_ref_val);
836 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 837 Flat_packed_unsigneds_string.push_back(
"Master Alg Node n ref values");
839 for (
unsigned i_ref_val=0;i_ref_val<n_ref_val;i_ref_val++)
841 send_doubles.push_back(alg_nod_pt->
ref_value(i_ref_val));
846 send_unsigneds.push_back(n_geom_obj);
847 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 848 Flat_packed_unsigneds_string.push_back(
"Master Alg Node n geom objects");
850 for (
unsigned i_geom=0;i_geom<n_geom_obj;i_geom++)
856 unsigned found_geom_object=0;
857 for (
unsigned i_list=0;i_list<n_geom_list;i_list++)
861 found_geom_object=i_list;
864 send_unsigneds.push_back(found_geom_object);
865 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 866 Flat_packed_unsigneds_string.push_back(
"Master node Found geom object");
876 oomph_info <<
"Adding external haloed master node: " << master_nod_pt <<
" at " << master_nod_pt->
x(0) <<
", " << master_nod_pt->
x(1) <<
" ]" << std::endl;
883 oomph_info <<
"Master node's macro update element:" << std::endl;
884 bool really_bad =
true;
886 for(
unsigned j=0; j<mac_el_pt->
nnode(); j++)
889 if(mac_el_pt->
node_pt(j)==master_nod_pt)
897 oomph_info <<
"This is REALLY BAD! The master node is not part of its own update element..." << std::endl;
904 if(it != int_haloed_el_pt.end())
907 unsigned int_haloed_el_index = it - int_haloed_el_pt.begin();
908 oomph_info <<
"Found internally at index " << int_haloed_el_index << std::endl;
910 if((mesh_pt->
haloed_element_pt(iproc))[int_haloed_el_index]!=macro_node_update_el_pt)
912 oomph_info <<
"Found wrong index!!!" << std::endl;
917 oomph_info <<
"index and proc are correct in internal storage." << std::endl;
924 send_unsigneds.push_back(0);
925 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 926 Flat_packed_unsigneds_string.push_back(
"External haloed element already exists");
929 send_unsigneds.push_back(1);
930 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 931 Flat_packed_unsigneds_string.push_back(
"Haloed element found internally");
934 send_unsigneds.push_back(int_haloed_el_index);
935 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 936 Flat_packed_unsigneds_string.push_back(
"Index of existing internal haloed element");
940 oomph_info <<
"Internal haloed element (" << tmp_el_pt <<
") already exists..." << std::endl;
941 oomph_info <<
"on proc " << iproc <<
" at index " << int_haloed_el_index << std::endl;
942 for(
unsigned j=0; j<tmp_el_pt->
nnode(); j++)
986 unsigned n_ext_haloed_el=mesh_pt->
987 nexternal_haloed_element(iproc);
988 unsigned external_haloed_el_index;
989 external_haloed_el_index=mesh_pt->
990 add_external_haloed_element_pt(iproc,macro_node_update_el_pt);
993 if (external_haloed_el_index==n_ext_haloed_el)
995 send_unsigneds.push_back(1);
996 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 997 Flat_packed_unsigneds_string.push_back(
"Master Node needs to be constructed");
1006 if (macro_mesh_pt!=0)
1008 send_unsigneds.push_back(1);
1009 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1010 Flat_packed_unsigneds_string.push_back(
"Mesh is macro element mesh");
1013 MacroElement* macro_el_pt= macro_node_update_finite_el_pt
1016 send_unsigneds.push_back(macro_el_num);
1017 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1018 Flat_packed_unsigneds_string.push_back(
"Number of macro element");
1023 (macro_node_update_el_pt);
1029 unsigned el_dim=q_el_pt->
dim();
1030 for (
unsigned i_dim=0;i_dim<el_dim;i_dim++)
1032 send_doubles.push_back(q_el_pt->
s_macro_ll(i_dim));
1033 send_doubles.push_back(q_el_pt->
s_macro_ur(i_dim));
1038 std::ostringstream error_stream;
1039 error_stream <<
"You are using a MacroElement node update\n" 1040 <<
"in a case with non-QElements. This has not\n" 1041 <<
"yet been implemented.\n";
1043 (error_stream.str(),
1044 OOMPH_CURRENT_FUNCTION,
1045 OOMPH_EXCEPTION_LOCATION);
1053 send_unsigneds.push_back(0);
1054 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1055 Flat_packed_unsigneds_string.push_back(
"Mesh is not a macro element mesh");
1063 if(p_refineable_el_pt!=0)
1065 send_unsigneds.push_back(1);
1066 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1067 Flat_packed_unsigneds_string.push_back(
"Element is p-refineable");
1070 unsigned p_order = p_refineable_el_pt->
p_order();
1071 send_unsigneds.push_back(p_order);
1072 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1073 Flat_packed_unsigneds_string.push_back(
"p-order of element");
1078 send_unsigneds.push_back(0);
1079 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1080 Flat_packed_unsigneds_string.push_back(
"Element is not p-refineable");
1086 unsigned n_node=macro_node_update_finite_el_pt->
nnode();
1087 for (
unsigned j=0;j<n_node;j++)
1089 Node* new_nod_pt=macro_node_update_finite_el_pt->
node_pt(j);
1092 n_cont_inter_values,
1100 send_unsigneds.push_back(0);
1101 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1102 Flat_packed_unsigneds_string.push_back(
"External haloed element already exists");
1105 send_unsigneds.push_back(0);
1106 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1107 Flat_packed_unsigneds_string.push_back(
"Haloed element found externally");
1109 send_unsigneds.push_back(external_haloed_el_index);
1110 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1111 Flat_packed_unsigneds_string.push_back(
"Index of existing external haloed element");
1114 oomph_info <<
"External haloed element already exists..." << std::endl;
1116 oomph_info <<
"on proc " << iproc <<
" at index " << external_haloed_el_index << std::endl;
1117 for(
unsigned j=0; j<tmp_el_pt->
nnode(); j++)
1127 if (solid_nod_pt!=0)
1130 for (
unsigned i_val=0;i_val<n_val;i_val++)
1132 for (
unsigned t=0;
t<n_prev;
t++)
1143 unsigned n_val=master_nod_pt->
nvalue();
1144 for (
unsigned i_val=0;i_val<n_val;i_val++)
1146 for (
unsigned t=0;
t<n_prev;
t++)
1148 send_doubles.push_back(master_nod_pt->
value(
t,i_val));
1153 for (
unsigned idim=0;idim<n_dim;idim++)
1155 for (
unsigned t=0;
t<n_prev;
t++)
1157 send_doubles.push_back(master_nod_pt->
x(
t,idim));
1173 (
Node* &new_nod_pt,
Mesh*
const &mesh_pt,
unsigned& loc_p,
1175 int& n_cont_inter_values,
1176 unsigned &counter_for_recv_unsigneds,
1178 unsigned &counter_for_recv_doubles,
1183 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1184 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1185 <<
" Bool: New node needs to be constructed " 1186 << recv_unsigneds[counter_for_recv_unsigneds]
1189 if (recv_unsigneds[counter_for_recv_unsigneds++]==1)
1193 node_index,new_el_pt,
1195 counter_for_recv_unsigneds,
1197 counter_for_recv_doubles,
1203 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1204 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1205 <<
" Existing external halo node was found externally (0) or internally (1): " 1206 << recv_unsigneds[counter_for_recv_unsigneds]
1209 unsigned node_found_internally
1210 = recv_unsigneds[counter_for_recv_unsigneds++];
1211 if(node_found_internally)
1213 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1215 <<
"Rec:" << counter_for_recv_unsigneds
1216 <<
" index of existing (internal) halo master node " 1217 << recv_unsigneds[counter_for_recv_unsigneds]
1223 (loc_p,recv_unsigneds[counter_for_recv_unsigneds++]);
1225 new_el_pt->
node_pt(node_index)=new_nod_pt;
1229 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1230 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1231 <<
" Index of existing external halo node " 1232 << recv_unsigneds[counter_for_recv_unsigneds]
1238 (loc_p,recv_unsigneds[counter_for_recv_unsigneds++]);
1240 new_el_pt->
node_pt(node_index)=new_nod_pt;
1255 (
Node* &new_nod_pt,
unsigned& loc_p,
unsigned& node_index,
1257 Mesh*
const &mesh_pt,
1258 unsigned &counter_for_recv_unsigneds,
1260 unsigned &counter_for_recv_doubles,
1265 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1266 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1267 <<
" Number of values of external halo node " 1268 << recv_unsigneds[counter_for_recv_unsigneds]
1271 unsigned n_val=recv_unsigneds[counter_for_recv_unsigneds++];
1280 time_stepper_pt=mesh_pt->
1285 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1286 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1287 <<
" Is node on boundary? " 1288 << recv_unsigneds[counter_for_recv_unsigneds]
1291 if (recv_unsigneds[counter_for_recv_unsigneds++]==1)
1294 if (time_stepper_pt!=0)
1297 (node_index,time_stepper_pt);
1305 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1306 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1307 <<
" Number of boundaries the node is on: " 1308 << recv_unsigneds[counter_for_recv_unsigneds]
1311 unsigned nb=recv_unsigneds[counter_for_recv_unsigneds++];
1312 for (
unsigned i=0;
i<nb;
i++)
1315 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1316 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1317 <<
" Node is on boundary " 1318 << recv_unsigneds[counter_for_recv_unsigneds]
1322 recv_unsigneds[counter_for_recv_unsigneds++];
1327 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1328 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1329 <<
" Number of additional values created by face element " 1330 << recv_unsigneds[counter_for_recv_unsigneds]
1333 unsigned n_entry=recv_unsigneds[counter_for_recv_unsigneds++];
1345 "Failed to cast new node to boundary node\n",
1346 OOMPH_CURRENT_FUNCTION,
1347 OOMPH_EXCEPTION_LOCATION);
1351 index_of_first_value_assigned_by_face_element_pt()==0)
1354 index_of_first_value_assigned_by_face_element_pt()=
1355 new std::map<unsigned, unsigned>;
1360 std::map<unsigned, unsigned>* map_pt=
1364 for (
unsigned i=0;
i<n_entry;
i++)
1368 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1369 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1370 <<
" Key of map entry" 1371 << recv_unsigneds[counter_for_recv_unsigneds]
1374 unsigned first=recv_unsigneds[counter_for_recv_unsigneds++];
1376 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1377 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1378 <<
" Value of map entry" 1379 << recv_unsigneds[counter_for_recv_unsigneds]
1382 unsigned second=recv_unsigneds[counter_for_recv_unsigneds++];
1385 (*map_pt)[first]=second;
1392 if (time_stepper_pt!=0)
1395 (node_index,time_stepper_pt);
1412 if (new_alg_nod_pt!=0)
1422 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1423 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1424 <<
" Alg node update id " 1425 << recv_unsigneds[counter_for_recv_unsigneds]
1429 unsigned update_id=recv_unsigneds
1430 [counter_for_recv_unsigneds++];
1436 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1437 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1438 <<
" Alg node # of ref values " 1439 << recv_unsigneds[counter_for_recv_unsigneds]
1442 unsigned n_ref_val=recv_unsigneds
1443 [counter_for_recv_unsigneds++];
1447 ref_value.resize(n_ref_val);
1448 for (
unsigned i_ref=0;i_ref<n_ref_val;i_ref++)
1450 ref_value[i_ref]=recv_doubles
1451 [counter_for_recv_doubles++];
1461 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1462 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1463 <<
" Alg node # of geom objects " 1464 << recv_unsigneds[counter_for_recv_unsigneds]
1467 unsigned n_geom_obj=recv_unsigneds
1468 [counter_for_recv_unsigneds++];
1472 geom_object_pt.resize(n_geom_obj);
1473 for (
unsigned i_geom=0;i_geom<n_geom_obj;i_geom++)
1475 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION 1476 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1477 <<
" Alg node: geom object index " 1478 << recv_unsigneds[counter_for_recv_unsigneds]
1481 unsigned geom_index=recv_unsigneds
1482 [counter_for_recv_unsigneds++];
1489 geom_object_pt[i_geom]=alg_mesh_pt->
1490 geom_object_list_pt(geom_index);
1496 (update_id,alg_mesh_pt,geom_object_pt,ref_value);
1506 if (macro_nod_pt!=0)
1517 geom_object_vector_pt=
1523 (node_index,s_in_macro_node_update_element);
1527 (new_el_pt,s_in_macro_node_update_element,
1528 geom_object_vector_pt);
1533 if (solid_nod_pt!=0)
1536 for (
unsigned i_val=0;i_val<n_solid_val;i_val++)
1538 for (
unsigned t=0;
t<n_prev;
t++)
1542 recv_doubles[counter_for_recv_doubles++]);
1548 unsigned n_new_val=new_nod_pt->
nvalue();
1549 if (n_val>n_new_val)
1551 new_nod_pt->
resize(n_val);
1556 for (
unsigned i_val=0;i_val<n_val;i_val++)
1558 for (
unsigned t=0;
t<n_prev;
t++)
1561 [counter_for_recv_doubles++]);
1566 unsigned n_dim=new_nod_pt->
ndim();
1567 for (
unsigned idim=0;idim<n_dim;idim++)
1569 for (
unsigned t=0;
t<n_prev;
t++)
1572 new_nod_pt->
x(
t,idim)=recv_doubles
1573 [counter_for_recv_doubles++];
A Generalised Element class.
virtual void local_coordinate_of_node(const unsigned &j, Vector< double > &s) const
Get local coordinates of node j in the element; vector sets its own size (broken virtual) ...
GeomObject * geom_object_pt(const unsigned &i)
Return pointer to i-th geometric object involved in default (usually first) update function...
void get_shared_node_pt(const unsigned &p, Vector< Node *> &shared_node_pt)
Get vector of pointers to shared nodes with processor p. Required for faster search in Missing_master...
void add_external_haloed_node_helper(int &iproc, Node *nod_pt, Mesh *const &mesh_pt, int &n_cont_inter_values, Vector< unsigned > &send_unsigneds, Vector< double > &send_doubles)
Helper to add external haloed node that is not a master.
void add_boundary_node(const unsigned &b, Node *const &node_pt)
Add a (pointer to) a node to the b-th boundary.
unsigned & macro_element_number()
Access function to the Macro_element_number.
void add_external_halo_node_pt(const unsigned &p, Node *&nod_pt)
Add external halo node whose non-halo (external) counterpart is held on processor p to the storage sc...
virtual void update_node_update(AlgebraicNode *&node_pt)=0
Update the node update info for given node, following mesh adaptation. Must be implemented for every ...
HangInfo *const & hanging_pt() const
Return pointer to hanging node data (this refers to the geometric hanging node status) (const version...
unsigned & p_order()
Access function to P_order.
void add_node_update_info(const int &id, AlgebraicMesh *mesh_pt, const Vector< GeomObject *> &geom_object_pt, const Vector< double > &ref_value, const bool &called_from_constructor=false)
Add algebraic update information for node: What's the ID of the mesh update function (typically used ...
unsigned nref_value(const int &id)
Number of reference values involved in id-th update function.
void recursively_add_masters_of_external_haloed_node(int &iproc, Node *nod_pt, Mesh *const &mesh_pt, int &n_cont_inter_values, Vector< unsigned > &send_unsigneds, Vector< double > &send_doubles)
Recursively add any master nodes (and their master nodes etc) of external haloed nodes.
A general Finite Element class.
Vector< std::string > Flat_packed_unsigneds_string
int non_halo_proc_ID()
ID of processor ID that holds non-halo counterpart of halo node; negative if not a halo...
bool Doc_full_stats
Boolean to indicate whether to output further info during setup_multi_domain_interaction() routines...
double const & master_weight(const unsigned &i) const
Return weight for dofs on i-th master node.
virtual Node * construct_boundary_node(const unsigned &n)
Construct the local node n as a boundary node; that is a node that MAY be placed on a mesh boundary a...
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
void get_required_nodal_information_helper(int &iproc, Node *nod_pt, Mesh *const &mesh_pt, int &n_cont_inter_values, Vector< unsigned > &send_unsigneds, Vector< double > &send_doubles)
Helper function to get the required nodal information from an external haloed node so that a fully-fu...
unsigned nmaster() const
Return the number of master nodes.
Vector< GeneralisedElement * > haloed_element_pt(const unsigned &p)
Return vector of haloed elements in this Mesh whose haloing counterpart is held on processor p...
bool is_hanging() const
Test whether the node is geometrically hanging.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
GeomObject * geom_object_list_pt(const unsigned &i)
Access function to the ith GeomObject.
int node_update_fct_id()
Default (usually first if there are multiple ones) node update fct id.
bool Doc_timings
Boolean to indicate whether to doc timings or not.
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Base class for Qelements.
double & s_macro_ur(const unsigned &i)
Access fct to the i-th coordinate of the element's "upper right" vertex in the associated MacroElemen...
double & x(const unsigned &i)
Return the i-th nodal coordinate.
unsigned add_external_haloed_node_pt(const unsigned &p, Node *&nod_pt)
Add external haloed node whose halo (external) counterpart is held on processor p to the storage sche...
A class that contains the information required by Nodes that are located on Mesh boundaries. A BoundaryNode of a particular type is obtained by combining a given Node with this class. By differentiating between Nodes and BoundaryNodes we avoid a lot of un-necessary storage in the bulk Nodes.
void add_external_halo_node_helper(Node *&new_nod_pt, Mesh *const &mesh_pt, unsigned &loc_p, unsigned &node_index, FiniteElement *const &new_el_pt, int &n_cont_inter_values, unsigned &counter_for_recv_unsigneds, Vector< unsigned > &recv_unsigneds, unsigned &counter_for_recv_doubles, Vector< double > &recv_doubles)
Helper functiono to add external halo node that is not a master.
virtual Node * construct_node(const unsigned &n)
Construct the local node n and return a pointer to the newly created node object. ...
void get_required_master_nodal_information_helper(int &iproc, Node *master_nod_pt, Mesh *const &mesh_pt, int &n_cont_inter_values, Vector< unsigned > &send_unsigneds, Vector< double > &send_doubles)
Helper function to get the required master nodal information from an external haloed master node so t...
Node *& external_halo_node_pt(const unsigned &p, const unsigned &j)
Access fct to the j-th external halo node in this Mesh whose non-halo external counterpart is held on...
unsigned nboundary() const
Return number of boundaries.
unsigned nexternal_haloed_node()
Total number of external haloed nodes in this Mesh.
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...
Node * shared_node_pt(const unsigned &p, const unsigned &j)
Access fct to the j-th shared node in this Mesh who has a counterpart on processor p...
unsigned nposition_type() const
Number of coordinate types needed in the mapping between local and global coordinates.
Data *const & variable_position_pt() const
Pointer to variable_position data (const version)
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
FiniteElement *& node_update_element_pt()
Pointer to finite element that performs the update by referring to its macro-element representation (...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
unsigned nlagrangian_type() const
Number of types of Lagrangian coordinates used to interpolate the Lagrangian coordinates within the e...
MacroElement * macro_elem_pt()
Access function to pointer to macro element.
Class that contains data for hanging nodes.
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
void add_external_haloed_master_node_helper(int &iproc, Node *master_nod_pt, Mesh *const &mesh_pt, int &n_cont_inter_values, Vector< unsigned > &send_unsigneds, Vector< double > &send_doubles)
Helper function to add external haloed node that is a master.
void set_node_update_info(FiniteElement *node_update_element_pt, const Vector< double > &s_in_node_update_element, const Vector< GeomObject *> &geom_object_pt)
Set node update information for node: Pass the pointer to the element that performs the update operat...
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
double & s_macro_ll(const unsigned &i)
Access fct to the i-th coordinate of the element's "lower left" vertex in the associated MacroElement...
double ref_value(const unsigned &i)
Return i-th reference value involved in default (usually first) update function.
A Class for nodes that deform elastically (i.e. position is an unknown in the problem). The idea is that the Eulerian positions are stored in a Data object and the Lagrangian coordinates are stored in addition. The pointer that addresses the Eulerian positions is set to the pointer to Value in the Data object. Hence, SolidNode uses knowledge of the internal structure of Data and must be a friend of the Data class. In order to allow a mesh to deform via an elastic-style equation in deforming-domain problems, the positions are stored separately from the values, so that elastic problems may be combined with any other type of problem.
unsigned ngeom_object_list_pt()
Return number of geometric objects associated with AlgebraicMesh.
void resize(const unsigned &n_value)
Resize the number of equations.
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
unsigned ngeom_object(const int &id)
Number of geometric objects involved in id-th update function.
p-refineable version of RefineableElement
void add_external_haloed_node_to_storage(int &iproc, Node *nod_pt, Mesh *const &mesh_pt, int &n_cont_inter_values, Vector< unsigned > &send_unsigneds, Vector< double > &send_doubles)
Helper function to add external haloed nodes, including any masters.
bool Doc_stats
Boolean to indicate whether to output basic info during setup_multi_domain_interaction() routines...
virtual bool is_on_boundary() const
Test whether the Node lies on a boundary. The "bulk" Node cannot lie on a boundary, so return false. This will be overloaded by BoundaryNodes.
bool is_halo() const
Is this Data a halo?
void construct_new_external_halo_node_helper(Node *&new_nod_pt, unsigned &loc_p, unsigned &node_index, FiniteElement *const &new_el_pt, Mesh *const &mesh_pt, unsigned &counter_for_recv_unsigneds, Vector< unsigned > &recv_unsigneds, unsigned &counter_for_recv_doubles, Vector< double > &recv_doubles)
Helper function which constructs a new external halo node (on an element) with the information sent f...
unsigned nlagrangian() const
Return number of lagrangian coordinates.
std::map< unsigned, unsigned > *& index_of_first_value_assigned_by_face_element_pt()
Return pointer to the map giving the index of the first face element value.
OomphCommunicator * communicator_pt() const
unsigned nnode() const
Return the number of nodes.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
Vector< GeomObject * > geom_object_vector_pt()
Access function to the vector of GeomObject.
GeneralisedElement *& external_haloed_element_pt(const unsigned &p, const unsigned &e)
Access fct to the e-th external haloed element in this Mesh whose non-halo counterpart is held on pro...
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation...