42 namespace Missing_masters_functions
47 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
80 int& n_cont_inter_values,
109 Mesh*
const& mesh_pt,
110 int& n_cont_inter_values,
115 for (
int i_cont = -1; i_cont < n_cont_inter_values; i_cont++)
121 send_unsigneds.push_back(1);
122 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
129 unsigned n_master = hang_pt->
nmaster();
132 send_unsigneds.push_back(n_master);
133 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
136 for (
unsigned m = 0; m < n_master; m++)
163 send_unsigneds.push_back(0);
164 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
176 Mesh*
const& mesh_pt,
177 int& n_cont_inter_values,
183 bool found_internally =
false;
184 unsigned shared_node_index = 0;
192 std::find(shared_node_pt.begin(), shared_node_pt.end(), nod_pt);
195 if (it != shared_node_pt.end())
198 found_internally =
true;
200 shared_node_index = it - shared_node_pt.begin();
217 if (found_internally)
221 send_unsigneds.push_back(0);
222 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
223 std::stringstream junk;
224 junk <<
"Node was already added [size=" << send_unsigneds.size()
225 <<
"]; last entry: " << send_unsigneds[send_unsigneds.size() - 1];
232 send_unsigneds.push_back(1);
233 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
236 send_unsigneds.push_back(shared_node_index);
237 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
245 unsigned external_haloed_node_index;
246 external_haloed_node_index =
251 if (external_haloed_node_index == n_ext_haloed_nod)
255 send_unsigneds.push_back(1);
256 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
257 std::stringstream junk;
258 junk <<
"Node needs to be constructed [size=" << send_unsigneds.size()
260 << send_unsigneds[send_unsigneds.size() - 1];
278 send_unsigneds.push_back(0);
279 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
280 std::stringstream junk;
281 junk <<
"Node was already added [size=" << send_unsigneds.size()
283 << send_unsigneds[send_unsigneds.size() - 1];
290 send_unsigneds.push_back(0);
291 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
293 "haloed node found externally");
295 send_unsigneds.push_back(external_haloed_node_index);
296 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
310 Mesh*
const& mesh_pt,
311 int& n_cont_inter_values,
317 bool found_internally =
false;
318 unsigned shared_node_index = 0;
326 std::find(shared_node_pt.begin(), shared_node_pt.end(), master_nod_pt);
329 if (it != shared_node_pt.end())
332 found_internally =
true;
334 shared_node_index = it - shared_node_pt.begin();
351 if (found_internally)
355 send_unsigneds.push_back(0);
356 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
357 std::stringstream junk;
358 junk <<
"Node was already added [size=" << send_unsigneds.size()
359 <<
"]; last entry: " << send_unsigneds[send_unsigneds.size() - 1];
366 send_unsigneds.push_back(1);
367 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
370 send_unsigneds.push_back(shared_node_index);
371 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
379 unsigned external_haloed_node_index;
380 external_haloed_node_index =
385 if (external_haloed_node_index == n_ext_haloed_nod)
389 send_unsigneds.push_back(1);
390 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
392 "Node needs to be constructed[2]");
409 send_unsigneds.push_back(0);
410 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
416 send_unsigneds.push_back(0);
417 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
419 "haloed node found externally");
421 send_unsigneds.push_back(external_haloed_node_index);
422 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
424 "external haloed node index[2]");
438 Mesh*
const& mesh_pt,
439 int& n_cont_inter_values,
446 unsigned n_val = nod_pt->
nvalue();
447 send_unsigneds.push_back(n_val);
448 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
452 unsigned n_dim = nod_pt->
ndim();
457 if (time_stepper_pt != 0)
466 send_unsigneds.push_back(1);
467 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
474 for (
unsigned i_bnd = 0; i_bnd < n_bnd; i_bnd++)
479 boundaries.push_back(i_bnd);
482 unsigned nb = boundaries.size();
483 send_unsigneds.push_back(nb);
484 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
485 std::stringstream junk;
486 junk <<
"Node is on " << nb <<
" boundaries";
489 for (
unsigned i = 0;
i < nb;
i++)
491 send_unsigneds.push_back(boundaries[
i]);
492 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
493 std::stringstream junk;
494 junk <<
"Node is on boundary " << boundaries[
i] <<
" of " << n_bnd;
505 throw OomphLibError(
"Failed to cast new node to boundary node\n",
506 OOMPH_CURRENT_FUNCTION,
507 OOMPH_EXCEPTION_LOCATION);
510 std::map<unsigned, unsigned>* map_pt =
516 send_unsigneds.push_back(0);
517 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
518 std::stringstream junk;
520 "No additional values were created by face element");
527 send_unsigneds.push_back(map_pt->size());
528 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
529 std::stringstream junk;
530 junk <<
"Map size " << map_pt->size() << n_bnd;
534 for (std::map<unsigned, unsigned>::iterator p = map_pt->begin();
538 send_unsigneds.push_back((*p).first);
539 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
540 std::stringstream junk;
543 send_unsigneds.push_back((*p).second);
544 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
553 send_unsigneds.push_back(0);
554 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
570 send_unsigneds.push_back(update_id);
571 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
576 unsigned n_ref_val = alg_nod_pt->
nref_value();
577 send_unsigneds.push_back(n_ref_val);
578 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
581 for (
unsigned i_ref_val = 0; i_ref_val < n_ref_val; i_ref_val++)
583 send_doubles.push_back(alg_nod_pt->
ref_value(i_ref_val));
588 send_unsigneds.push_back(n_geom_obj);
589 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
592 for (
unsigned i_geom = 0; i_geom < n_geom_obj; i_geom++)
600 unsigned found_geom_object = 0;
601 for (
unsigned i_list = 0; i_list < n_geom_list; i_list++)
605 found_geom_object = i_list;
608 send_unsigneds.push_back(found_geom_object);
609 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
620 if (solid_nod_pt != 0)
623 for (
unsigned i_val = 0; i_val < n_solid_val; i_val++)
625 for (
unsigned t = 0;
t < n_prev;
t++)
627 send_doubles.push_back(
634 for (
unsigned i_val = 0; i_val < n_val; i_val++)
636 for (
unsigned t = 0;
t < n_prev;
t++)
638 send_doubles.push_back(nod_pt->
value(
t, i_val));
643 for (
unsigned idim = 0; idim < n_dim; idim++)
645 for (
unsigned t = 0;
t < n_prev;
t++)
647 send_doubles.push_back(nod_pt->
x(
t, idim));
661 Mesh*
const& mesh_pt,
662 int& n_cont_inter_values,
667 send_unsigneds.push_back(master_nod_pt->
ndim());
668 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
672 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
675 send_unsigneds.push_back(master_nod_pt->
nvalue());
676 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
687 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
689 "Master node non-halo processor ID");
694 if (solid_nod_pt != 0)
696 send_unsigneds.push_back(solid_nod_pt->
nlagrangian());
697 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
701 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
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
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";
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 " << boundaries[
i] <<
" of "
760 throw OomphLibError(
"Failed to cast new node to boundary node\n",
761 OOMPH_CURRENT_FUNCTION,
762 OOMPH_EXCEPTION_LOCATION);
765 std::map<unsigned, unsigned>* map_pt =
771 send_unsigneds.push_back(0);
772 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
773 std::stringstream junk;
775 "No additional values were created by face element for this master "
783 send_unsigneds.push_back(map_pt->size());
784 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
785 std::stringstream junk;
786 junk <<
"Map size for master node " << map_pt->size() << n_bnd;
790 for (std::map<unsigned, unsigned>::iterator p = map_pt->begin();
794 send_unsigneds.push_back((*p).first);
795 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
796 std::stringstream junk;
798 "Key of map entry for master node");
800 send_unsigneds.push_back((*p).second);
801 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
803 "Value of map entry for master node");
811 send_unsigneds.push_back(0);
812 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
814 "Master node is not on any boundary");
829 send_unsigneds.push_back(update_id);
830 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
835 unsigned n_ref_val = alg_nod_pt->
nref_value();
836 send_unsigneds.push_back(n_ref_val);
837 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
840 for (
unsigned i_ref_val = 0; i_ref_val < n_ref_val; i_ref_val++)
842 send_doubles.push_back(alg_nod_pt->
ref_value(i_ref_val));
847 send_unsigneds.push_back(n_geom_obj);
848 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
850 "Master Alg Node n geom objects");
852 for (
unsigned i_geom = 0; i_geom < n_geom_obj; i_geom++)
858 unsigned found_geom_object = 0;
859 for (
unsigned i_list = 0; i_list < n_geom_list; i_list++)
863 found_geom_object = i_list;
866 send_unsigneds.push_back(found_geom_object);
867 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
869 "Master node Found geom object");
877 if (macro_nod_pt != 0)
879 oomph_info <<
"Adding external haloed master node: " << master_nod_pt
880 <<
" at " << master_nod_pt->
x(0) <<
", "
881 << master_nod_pt->
x(1) <<
" ]" << std::endl;
889 oomph_info <<
"Master node's macro update element:" << std::endl;
890 bool really_bad =
true;
893 for (
unsigned j = 0; j < mac_el_pt->
nnode(); j++)
896 << mac_el_pt->
node_pt(j)->
x(0) <<
", "
897 << mac_el_pt->
node_pt(j)->
x(1) <<
" ] " << std::endl;
898 if (mac_el_pt->
node_pt(j) == master_nod_pt)
904 if (really_bad ==
true)
906 oomph_info <<
"This is REALLY BAD! The master node is not part of "
907 "its own update element..."
916 std::find(int_haloed_el_pt.begin(),
917 int_haloed_el_pt.end(),
918 macro_node_update_el_pt);
919 if (it != int_haloed_el_pt.end())
922 unsigned int_haloed_el_index = it - int_haloed_el_pt.begin();
923 oomph_info <<
"Found internally at index " << int_haloed_el_index
927 macro_node_update_el_pt)
929 oomph_info <<
"Found wrong index!!!" << std::endl;
934 oomph_info <<
"index and proc are correct in internal storage."
938 iproc))[int_haloed_el_index]
939 <<
"==" << macro_node_update_el_pt << std::endl;
944 send_unsigneds.push_back(0);
945 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
947 "External haloed element already exists");
950 send_unsigneds.push_back(1);
951 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
953 "Haloed element found internally");
956 send_unsigneds.push_back(int_haloed_el_index);
957 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
959 "Index of existing internal haloed element");
964 oomph_info <<
"Internal haloed element (" << tmp_el_pt
965 <<
") already exists..." << std::endl;
966 oomph_info <<
"on proc " << iproc <<
" at index "
967 << int_haloed_el_index << std::endl;
968 for (
unsigned j = 0; j < tmp_el_pt->
nnode(); j++)
973 iproc))[int_haloed_el_index])
975 <<
" at [ " << tmp_el_pt->
node_pt(j)->
x(0) <<
", "
976 << tmp_el_pt->
node_pt(j)->
x(1) <<
" ]" << std::endl;
1030 unsigned external_haloed_el_index;
1032 iproc, macro_node_update_el_pt);
1035 if (external_haloed_el_index == n_ext_haloed_el)
1037 send_unsigneds.push_back(1);
1038 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1040 "Master Node needs to be constructed");
1049 if (macro_mesh_pt != 0)
1051 send_unsigneds.push_back(1);
1052 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1054 "Mesh is macro element mesh");
1060 send_unsigneds.push_back(macro_el_num);
1061 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1073 unsigned el_dim = q_el_pt->
dim();
1074 for (
unsigned i_dim = 0; i_dim < el_dim; i_dim++)
1076 send_doubles.push_back(q_el_pt->
s_macro_ll(i_dim));
1077 send_doubles.push_back(q_el_pt->
s_macro_ur(i_dim));
1082 std::ostringstream error_stream;
1083 error_stream <<
"You are using a MacroElement node update\n"
1084 <<
"in a case with non-QElements. This has not\n"
1085 <<
"yet been implemented.\n";
1087 OOMPH_CURRENT_FUNCTION,
1088 OOMPH_EXCEPTION_LOCATION);
1095 send_unsigneds.push_back(0);
1096 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1098 "Mesh is not a macro element mesh");
1106 if (p_refineable_el_pt != 0)
1108 send_unsigneds.push_back(1);
1109 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1113 unsigned p_order = p_refineable_el_pt->
p_order();
1114 send_unsigneds.push_back(p_order);
1115 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1121 send_unsigneds.push_back(0);
1122 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1124 "Element is not p-refineable");
1130 unsigned n_node = macro_node_update_finite_el_pt->
nnode();
1131 for (
unsigned j = 0; j < n_node; j++)
1133 Node* new_nod_pt = macro_node_update_finite_el_pt->
node_pt(j);
1137 n_cont_inter_values,
1145 send_unsigneds.push_back(0);
1146 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1148 "External haloed element already exists");
1151 send_unsigneds.push_back(0);
1152 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1154 "Haloed element found externally");
1156 send_unsigneds.push_back(external_haloed_el_index);
1157 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1159 "Index of existing external haloed element");
1162 oomph_info <<
"External haloed element already exists..."
1166 iproc, external_haloed_el_index));
1167 oomph_info <<
"on proc " << iproc <<
" at index "
1168 << external_haloed_el_index << std::endl;
1169 for (
unsigned j = 0; j < tmp_el_pt->
nnode(); j++)
1172 << tmp_el_pt->
node_pt(j)->
x(0) <<
", "
1173 << tmp_el_pt->
node_pt(j)->
x(1) <<
" ]" << std::endl;
1181 if (solid_nod_pt != 0)
1184 for (
unsigned i_val = 0; i_val < n_val; i_val++)
1186 for (
unsigned t = 0;
t < n_prev;
t++)
1188 send_doubles.push_back(
1197 unsigned n_val = master_nod_pt->
nvalue();
1198 for (
unsigned i_val = 0; i_val < n_val; i_val++)
1200 for (
unsigned t = 0;
t < n_prev;
t++)
1202 send_doubles.push_back(master_nod_pt->
value(
t, i_val));
1207 for (
unsigned idim = 0; idim < n_dim; idim++)
1209 for (
unsigned t = 0;
t < n_prev;
t++)
1211 send_doubles.push_back(master_nod_pt->
x(
t, idim));
1221 Mesh*
const& mesh_pt,
1223 unsigned& node_index,
1225 int& n_cont_inter_values,
1226 unsigned& counter_for_recv_unsigneds,
1228 unsigned& counter_for_recv_doubles,
1233 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1234 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1235 <<
" Bool: New node needs to be constructed "
1236 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1238 if (recv_unsigneds[counter_for_recv_unsigneds++] == 1)
1246 counter_for_recv_unsigneds,
1248 counter_for_recv_doubles,
1254 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1255 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1256 <<
" Existing external halo node was found externally (0) "
1257 "or internally (1): "
1258 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1260 unsigned node_found_internally =
1261 recv_unsigneds[counter_for_recv_unsigneds++];
1262 if (node_found_internally)
1264 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1265 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1266 <<
" index of existing (internal) halo master node "
1267 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1272 loc_p, recv_unsigneds[counter_for_recv_unsigneds++]);
1274 new_el_pt->
node_pt(node_index) = new_nod_pt;
1278 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1279 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1280 <<
" Index of existing external halo node "
1281 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1286 loc_p, recv_unsigneds[counter_for_recv_unsigneds++]);
1288 new_el_pt->
node_pt(node_index) = new_nod_pt;
1301 unsigned& node_index,
1303 Mesh*
const& mesh_pt,
1304 unsigned& counter_for_recv_unsigneds,
1306 unsigned& counter_for_recv_doubles,
1312 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1313 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1314 <<
" Number of values of external halo node "
1315 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1317 unsigned n_val = recv_unsigneds[counter_for_recv_unsigneds++];
1322 unsigned n_prev = 1;
1331 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1332 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1333 <<
" Is node on boundary? "
1334 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1336 if (recv_unsigneds[counter_for_recv_unsigneds++] == 1)
1339 if (time_stepper_pt != 0)
1350 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1351 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1352 <<
" Number of boundaries the node is on: "
1353 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1355 unsigned nb = recv_unsigneds[counter_for_recv_unsigneds++];
1356 for (
unsigned i = 0;
i < nb;
i++)
1359 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1360 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1361 <<
" Node is on boundary "
1362 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1364 unsigned i_bnd = recv_unsigneds[counter_for_recv_unsigneds++];
1369 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1370 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1371 <<
" Number of additional values created by face element "
1372 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1374 unsigned n_entry = recv_unsigneds[counter_for_recv_unsigneds++];
1383 if (bnew_nod_pt == 0)
1385 throw OomphLibError(
"Failed to cast new node to boundary node\n",
1386 OOMPH_CURRENT_FUNCTION,
1387 OOMPH_EXCEPTION_LOCATION);
1394 new std::map<unsigned, unsigned>;
1399 std::map<unsigned, unsigned>* map_pt =
1403 for (
unsigned i = 0;
i < n_entry;
i++)
1407 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1408 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1409 <<
" Key of map entry"
1410 << recv_unsigneds[counter_for_recv_unsigneds]
1413 unsigned first = recv_unsigneds[counter_for_recv_unsigneds++];
1415 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1416 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1417 <<
" Value of map entry"
1418 << recv_unsigneds[counter_for_recv_unsigneds]
1421 unsigned second = recv_unsigneds[counter_for_recv_unsigneds++];
1424 (*map_pt)[first] = second;
1431 if (time_stepper_pt != 0)
1433 new_nod_pt = new_el_pt->
construct_node(node_index, time_stepper_pt);
1449 if (new_alg_nod_pt != 0)
1458 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1459 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1460 <<
" Alg node update id "
1461 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1464 unsigned update_id = recv_unsigneds[counter_for_recv_unsigneds++];
1470 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1471 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1472 <<
" Alg node # of ref values "
1473 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1475 unsigned n_ref_val = recv_unsigneds[counter_for_recv_unsigneds++];
1479 ref_value.resize(n_ref_val);
1480 for (
unsigned i_ref = 0; i_ref < n_ref_val; i_ref++)
1482 ref_value[i_ref] = recv_doubles[counter_for_recv_doubles++];
1492 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1493 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1494 <<
" Alg node # of geom objects "
1495 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1497 unsigned n_geom_obj = recv_unsigneds[counter_for_recv_unsigneds++];
1501 geom_object_pt.resize(n_geom_obj);
1502 for (
unsigned i_geom = 0; i_geom < n_geom_obj; i_geom++)
1504 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1505 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1506 <<
" Alg node: geom object index "
1507 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1509 unsigned geom_index = recv_unsigneds[counter_for_recv_unsigneds++];
1522 update_id, alg_mesh_pt, geom_object_pt, ref_value);
1532 if (macro_nod_pt != 0)
1547 s_in_macro_node_update_element);
1551 new_el_pt, s_in_macro_node_update_element, geom_object_vector_pt);
1556 if (solid_nod_pt != 0)
1559 for (
unsigned i_val = 0; i_val < n_solid_val; i_val++)
1561 for (
unsigned t = 0;
t < n_prev;
t++)
1564 t, i_val, recv_doubles[counter_for_recv_doubles++]);
1570 unsigned n_new_val = new_nod_pt->
nvalue();
1571 if (n_val > n_new_val)
1573 new_nod_pt->
resize(n_val);
1578 for (
unsigned i_val = 0; i_val < n_val; i_val++)
1580 for (
unsigned t = 0;
t < n_prev;
t++)
1583 t, i_val, recv_doubles[counter_for_recv_doubles++]);
1588 unsigned n_dim = new_nod_pt->
ndim();
1589 for (
unsigned idim = 0; idim < n_dim; idim++)
1591 for (
unsigned t = 0;
t < n_prev;
t++)
1594 new_nod_pt->
x(
t, idim) = recv_doubles[counter_for_recv_doubles++];
////////////////////////////////////////////////////////////////////
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 ...
GeomObject * geom_object_list_pt(const unsigned &i)
Access function to the ith GeomObject.
unsigned ngeom_object_list_pt()
Return number of geometric objects associated with AlgebraicMesh.
////////////////////////////////////////////////////////////////////
unsigned ngeom_object(const int &id)
Number of geometric objects involved in id-th update function.
unsigned nref_value(const int &id)
Number of reference values involved in id-th update function.
GeomObject * geom_object_pt(const unsigned &i)
Return pointer to i-th geometric object involved in default (usually first) update function.
int node_update_fct_id()
Default (usually first if there are multiple ones) node update fct id.
double ref_value(const unsigned &i)
Return i-th reference value involved in default (usually first) update function.
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 ...
A class that contains the information required by Nodes that are located on Mesh boundaries....
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.
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
bool is_halo() const
Is this Data a halo?
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...
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
double value(const unsigned &i) const
Return i-th stored value. This function is not virtual so that it can be inlined. This means that if ...
int non_halo_proc_ID()
ID of processor ID that holds non-halo counterpart of halo node; negative if not a halo.
A general Finite 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)
virtual Node * construct_node(const unsigned &n)
Construct the local node n and return a pointer to the newly created node object.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
unsigned nnode() const
Return the number of nodes.
MacroElement * macro_elem_pt()
Access function to pointer to macro element.
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...
A Generalised Element class.
/////////////////////////////////////////////////////////////////////
Class that contains data for hanging nodes.
double const & master_weight(const unsigned &i) const
Return weight for dofs on i-th master node.
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
unsigned nmaster() const
Return the number of master nodes.
MacroElementNodeUpdateMeshes contain MacroElementNodeUpdateNodes which have their own node update fun...
Vector< GeomObject * > geom_object_vector_pt()
Access function to the vector of GeomObject.
////////////////////////////////////////////////////////////////////
FiniteElement *& node_update_element_pt()
Pointer to finite element that performs the update by referring to its macro-element representation (...
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...
Base class for MacroElement s that are used during mesh refinement in domains with curvlinear and/or ...
unsigned & macro_element_number()
Access function to the Macro_element_number.
void add_boundary_node(const unsigned &b, Node *const &node_pt)
Add a (pointer to) a node to the b-th boundary.
unsigned nexternal_haloed_element()
Total number of external haloed elements in this Mesh.
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...
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.
OomphCommunicator * communicator_pt() const
Read-only access fct to communicator (Null if mesh is not distributed, i.e. if we don't have mpi).
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...
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
Vector< GeneralisedElement * > haloed_element_pt(const unsigned &p)
Return vector of haloed elements in this Mesh whose haloing counterpart is held on processor p.
unsigned nboundary() const
Return number of boundaries.
unsigned add_external_haloed_element_pt(const unsigned &p, GeneralisedElement *&el_pt)
Add external haloed element whose non-halo counterpart is held on processor p to the storage scheme f...
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...
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...
unsigned nexternal_haloed_node()
Total number of external haloed nodes in this Mesh.
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...
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
double & x(const unsigned &i)
Return the i-th nodal coordinate.
HangInfo *const & hanging_pt() const
Return pointer to hanging node data (this refers to the geometric hanging node status) (const version...
virtual bool is_on_boundary() const
Test whether the Node lies on a boundary. The "bulk" Node cannot lie on a boundary,...
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
void resize(const unsigned &n_value)
Resize the number of equations.
unsigned nposition_type() const
Number of coordinate types needed in the mapping between local and global coordinates.
bool is_hanging() const
Test whether the node is geometrically hanging.
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation....
An OomphLibError object which should be thrown when an run-time error is encountered....
/////////////////////////////////////////////////////////////////// /////////////////////////////////...
unsigned & p_order()
Access function to P_order.
/////////////////////////////////////////////////////////////////// /////////////////////////////////...
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 & s_macro_ur(const unsigned &i)
Access fct to the i-th coordinate of the element's "upper right" vertex in the associated MacroElemen...
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
unsigned nlagrangian_type() const
Number of types of Lagrangian coordinates used to interpolate the Lagrangian coordinates within the e...
Data *const & variable_position_pt() const
Pointer to variable_position data (const version)
unsigned nlagrangian() const
Return number of lagrangian coordinates.
////////////////////////////////////////////////////////////////////// //////////////////////////////...
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
bool Doc_full_stats
Boolean to indicate whether to output further info during setup_multi_domain_interaction() routines.
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.
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...
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.
bool Doc_stats
Boolean to indicate whether to output basic info during setup_multi_domain_interaction() routines.
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.
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 nodes.
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...
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.
bool Doc_timings
Boolean to indicate whether to doc timings or not.
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 new element) with the required informat...
Vector< std::string > Flat_packed_unsigneds_string
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...