29 #ifndef OOMPH_MISSING_MASTERS_CC
30 #define OOMPH_MISSING_MASTERS_CC
34 #include <oomph-lib-config.h>
61 template<
class EXT_ELEMENT>
68 int& n_cont_inter_values,
69 unsigned& counter_for_recv_unsigneds,
71 unsigned& counter_for_recv_doubles,
81 counter_for_recv_unsigneds,
83 counter_for_recv_doubles,
87 recursively_add_masters_of_external_halo_node_to_storage<EXT_ELEMENT>(
93 counter_for_recv_unsigneds,
95 counter_for_recv_doubles,
104 template<
class EXT_ELEMENT>
108 Mesh*
const& mesh_pt,
110 unsigned& node_index,
111 int& n_cont_inter_values,
112 unsigned& counter_for_recv_unsigneds,
114 unsigned& counter_for_recv_doubles,
117 for (
int i_cont = -1; i_cont < n_cont_inter_values; i_cont++)
119 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
120 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
121 <<
" Boolean to indicate that continuously interpolated "
123 << i_cont <<
" is hanging "
124 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
126 if (recv_unsigneds[counter_for_recv_unsigneds++] == 1)
128 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
129 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
130 <<
" Number of master nodes "
131 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
133 unsigned n_master = recv_unsigneds[counter_for_recv_unsigneds++];
137 for (
unsigned m = 0; m < n_master; m++)
139 Node* master_nod_pt = 0;
141 add_external_halo_master_node_helper<EXT_ELEMENT>(
147 counter_for_recv_unsigneds,
149 counter_for_recv_doubles,
153 double master_weight = recv_doubles[counter_for_recv_doubles++];
157 recursively_add_masters_of_external_halo_node_to_storage<EXT_ELEMENT>(
163 counter_for_recv_unsigneds,
165 counter_for_recv_doubles,
176 template<
class EXT_ELEMENT>
178 Node*& new_master_nod_pt,
180 Mesh*
const& mesh_pt,
182 int& ncont_inter_values,
183 unsigned& counter_for_recv_unsigneds,
185 unsigned& counter_for_recv_doubles,
190 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
192 <<
"Rec:" << counter_for_recv_unsigneds
193 <<
" Boolean to trigger construction of new external halo master node "
194 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
196 if (recv_unsigneds[counter_for_recv_unsigneds++] == 1)
199 construct_new_external_halo_master_node_helper<EXT_ELEMENT>(
204 counter_for_recv_unsigneds,
206 counter_for_recv_doubles,
212 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
213 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
214 <<
" Existing external halo node was found externally (0) or "
216 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
218 unsigned node_found_internally =
219 recv_unsigneds[counter_for_recv_unsigneds++];
220 if (node_found_internally)
222 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
223 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
224 <<
" index of existing (internal) halo master node "
225 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
229 loc_p, recv_unsigneds[counter_for_recv_unsigneds++]);
233 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
234 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
235 <<
" index of existing external halo master node "
236 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
240 loc_p, recv_unsigneds[counter_for_recv_unsigneds++]);
249 template<
class EXT_ELEMENT>
252 Node*& new_master_nod_pt,
255 Mesh*
const& mesh_pt,
256 unsigned& counter_for_recv_unsigneds,
258 unsigned& counter_for_recv_doubles,
263 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
264 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
265 <<
" ndim for external halo master node "
266 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
268 unsigned n_dim = recv_unsigneds[counter_for_recv_unsigneds++];
269 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
270 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
271 <<
" nposition type for external halo master node "
272 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
274 unsigned n_position_type = recv_unsigneds[counter_for_recv_unsigneds++];
275 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
276 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
277 <<
" nvalue for external halo master node "
278 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
280 unsigned n_value = recv_unsigneds[counter_for_recv_unsigneds++];
281 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
282 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
283 <<
" non-halo processor ID for external halo master node "
284 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
286 unsigned non_halo_proc_ID = recv_unsigneds[counter_for_recv_unsigneds++];
292 if (solid_nod_pt != 0)
294 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
295 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
296 <<
" nlagrdim for external halo master solid node "
297 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
299 n_lag_dim = recv_unsigneds[counter_for_recv_unsigneds++];
300 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
301 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
302 <<
" nlagrtype for external halo master solid node "
303 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
305 n_lag_type = recv_unsigneds[counter_for_recv_unsigneds++];
327 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
328 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
329 <<
" Boolean for algebraic boundary node "
330 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
334 if (recv_unsigneds[counter_for_recv_unsigneds++] == 1)
337 if (time_stepper_pt != 0)
340 time_stepper_pt, n_dim, n_position_type, n_value);
349 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
350 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
351 <<
" Number of boundaries the algebraic master node is on: "
352 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
354 unsigned nb = recv_unsigneds[counter_for_recv_unsigneds++];
355 for (
unsigned i = 0;
i < nb;
i++)
358 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
359 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
360 <<
" Algebraic master node is on boundary "
361 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
363 unsigned i_bnd = recv_unsigneds[counter_for_recv_unsigneds++];
369 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
370 oomph_info <<
"Rec:" << counter_for_recv_unsigneds <<
" "
371 <<
"Number of additional values created by face element "
372 <<
"for master node "
373 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
375 unsigned n_entry = recv_unsigneds[counter_for_recv_unsigneds++];
384 if (bnew_master_nod_pt == 0)
386 throw OomphLibError(
"Failed to cast new node to boundary node\n",
387 OOMPH_CURRENT_FUNCTION,
388 OOMPH_EXCEPTION_LOCATION);
391 if (bnew_master_nod_pt
392 ->index_of_first_value_assigned_by_face_element_pt() == 0)
396 new std::map<unsigned, unsigned>;
401 std::map<unsigned, unsigned>* map_pt =
406 for (
unsigned i = 0;
i < n_entry;
i++)
410 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
411 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
412 <<
" Key of map entry for master node"
413 << recv_unsigneds[counter_for_recv_unsigneds]
416 unsigned first = recv_unsigneds[counter_for_recv_unsigneds++];
418 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
419 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
420 <<
" Value of map entry for master node"
421 << recv_unsigneds[counter_for_recv_unsigneds]
424 unsigned second = recv_unsigneds[counter_for_recv_unsigneds++];
427 (*map_pt)[first] = second;
434 if (time_stepper_pt != 0)
437 new AlgebraicNode(time_stepper_pt, n_dim, n_position_type, n_value);
452 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
453 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
454 <<
" algebraic node update id for master node "
455 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
458 unsigned update_id = recv_unsigneds[counter_for_recv_unsigneds++];
463 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
464 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
465 <<
" algebraic node number of ref values for master node "
466 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
469 unsigned n_ref_val = recv_unsigneds[counter_for_recv_unsigneds++];
472 ref_value.resize(n_ref_val);
473 for (
unsigned i_ref = 0; i_ref < n_ref_val; i_ref++)
475 ref_value[i_ref] = recv_doubles[counter_for_recv_doubles++];
481 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
482 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
483 <<
" algebraic node number of geom objects for master node "
484 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
488 unsigned n_geom_obj = recv_unsigneds[counter_for_recv_unsigneds++];
492 geom_object_pt.resize(n_geom_obj);
493 for (
unsigned i_geom = 0; i_geom < n_geom_obj; i_geom++)
495 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
496 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
497 <<
" algebraic node: " << i_geom <<
"-th out of "
498 << n_geom_obj <<
"-th geom index "
499 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
501 unsigned geom_index = recv_unsigneds[counter_for_recv_unsigneds++];
514 update_id, alg_mesh_pt, geom_object_pt, ref_value);
519 else if (macro_nod_pt != 0)
524 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
525 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
526 <<
" Boolean for master algebraic node is boundary node "
527 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
529 if (recv_unsigneds[counter_for_recv_unsigneds++] == 1)
532 if (time_stepper_pt != 0)
535 time_stepper_pt, n_dim, n_position_type, n_value);
540 n_dim, n_position_type, n_value);
545 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
547 <<
"Rec:" << counter_for_recv_unsigneds
548 <<
" Number of boundaries the macro element master node is on: "
549 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
551 unsigned nb = recv_unsigneds[counter_for_recv_unsigneds++];
552 for (
unsigned i = 0;
i < nb;
i++)
555 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
556 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
557 <<
" Macro element master node is on boundary "
558 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
560 unsigned i_bnd = recv_unsigneds[counter_for_recv_unsigneds++];
565 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
566 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
567 <<
" Number of additional values created by face element "
568 <<
"for macro element master node "
569 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
571 unsigned n_entry = recv_unsigneds[counter_for_recv_unsigneds++];
580 if (bnew_master_nod_pt == 0)
582 throw OomphLibError(
"Failed to cast new node to boundary node\n",
583 OOMPH_CURRENT_FUNCTION,
584 OOMPH_EXCEPTION_LOCATION);
587 if (bnew_master_nod_pt
588 ->index_of_first_value_assigned_by_face_element_pt() == 0)
592 new std::map<unsigned, unsigned>;
597 std::map<unsigned, unsigned>* map_pt =
602 for (
unsigned i = 0;
i < n_entry;
i++)
606 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
607 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
608 <<
" Key of map entry for macro element master node"
609 << recv_unsigneds[counter_for_recv_unsigneds]
612 unsigned first = recv_unsigneds[counter_for_recv_unsigneds++];
614 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
615 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
616 <<
" Value of map entry for macro element master node"
617 << recv_unsigneds[counter_for_recv_unsigneds]
620 unsigned second = recv_unsigneds[counter_for_recv_unsigneds++];
623 (*map_pt)[first] = second;
630 if (time_stepper_pt != 0)
633 time_stepper_pt, n_dim, n_position_type, n_value);
644 oomph_info <<
"Added external halo master node:" << new_master_nod_pt
645 <<
" at [ " << new_master_nod_pt->
x(0) <<
", "
646 << new_master_nod_pt->
x(1) <<
" ]" << std::endl;
650 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
651 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
652 <<
" Bool: need new external halo element "
653 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
655 if (recv_unsigneds[counter_for_recv_unsigneds++] == 1)
658 std::ostringstream warn_stream;
660 <<
"You are adding a MacroElementNodeUpdate element to the\n"
661 <<
"external storage. This functionality is still being\n"
662 <<
"developed and may cause problems later on, say during\n"
663 <<
"Problem::remove_duplicate_data().";
665 "Missing_masters_functions::construct_new_external_"
666 "halo_master_node_helper()",
667 OOMPH_EXCEPTION_LOCATION);
675 new_node_update_f_el_pt =
679 int n_cont_inter_values;
682 n_cont_inter_values =
684 ->ncont_interpolated_values();
688 n_cont_inter_values = -1;
690 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
691 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
692 <<
" Bool: we have a macro element mesh "
693 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
696 if (recv_unsigneds[counter_for_recv_unsigneds++] == 1)
702 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
703 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
704 <<
" Number of macro element "
705 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
707 unsigned macro_el_num = recv_unsigneds[counter_for_recv_unsigneds++];
717 unsigned el_dim = q_el_pt->
dim();
718 for (
unsigned i_dim = 0; i_dim < el_dim; i_dim++)
721 recv_doubles[counter_for_recv_doubles++];
723 recv_doubles[counter_for_recv_doubles++];
728 std::ostringstream error_stream;
729 error_stream <<
"You are using a MacroElement node update\n"
730 <<
"in a case with non-QElements. This has not\n"
731 <<
"yet been implemented.\n";
733 OOMPH_CURRENT_FUNCTION,
734 OOMPH_EXCEPTION_LOCATION);
739 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
740 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
741 <<
" Element was p-refineable "
742 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
744 unsigned el_was_p_refineable =
745 recv_unsigneds[counter_for_recv_unsigneds++];
746 if (el_was_p_refineable)
751 if (p_refineable_el_pt != 0)
754 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
755 oomph_info <<
"Rec:" << counter_for_recv_unsigneds <<
" p-order: "
756 << recv_unsigneds[counter_for_recv_unsigneds]
759 unsigned p_order = recv_unsigneds[counter_for_recv_unsigneds++];
765 oomph_info <<
"New node update element: " << new_node_update_el_pt
766 <<
" (p-order = " << p_order <<
")" << std::endl;
770 std::ostringstream error_stream;
771 error_stream <<
"Created MacroElement node update element is not "
773 <<
"but the haloed version is.\n";
775 "Missing_masters_functions::construct_new_"
776 "external_halo_master_...()",
777 OOMPH_EXCEPTION_LOCATION);
781 unsigned n_node = new_node_update_f_el_pt->
nnode();
782 for (
unsigned j = 0; j < n_node; j++)
784 Node* new_nod_pt = 0;
785 add_external_halo_node_to_storage<EXT_ELEMENT>(
790 new_node_update_f_el_pt,
792 counter_for_recv_unsigneds,
794 counter_for_recv_doubles,
797 oomph_info <<
"Added node " << new_nod_pt <<
" at [ "
798 << new_nod_pt->
x(0) <<
", " << new_nod_pt->
x(1) <<
" ]"
803 oomph_info <<
"New node update element: " << new_node_update_f_el_pt
804 <<
" (nnode_1d = " << new_node_update_f_el_pt->
nnode_1d()
809 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
810 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
811 <<
" Found internally? "
812 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
814 unsigned found_internally =
815 recv_unsigneds[counter_for_recv_unsigneds++];
816 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
817 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
818 <<
" Number of already existing external halo element "
819 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
821 unsigned halo_element_index =
822 recv_unsigneds[counter_for_recv_unsigneds++];
823 if (found_internally != 0)
828 oomph_info <<
"Existing node update element: "
829 << new_node_update_f_el_pt
830 <<
" (nnode_1d = " << new_node_update_f_el_pt->
nnode_1d()
832 oomph_info <<
"on proc " << loc_p <<
" at (internal) index "
833 << halo_element_index << std::endl;
888 oomph_info <<
"Existing node update element: "
889 << new_node_update_f_el_pt
890 <<
" (nnode_1d = " << new_node_update_f_el_pt->
nnode_1d()
892 oomph_info <<
"on proc " << loc_p <<
" at (external) index "
893 << recv_unsigneds[counter_for_recv_unsigneds - 1]
934 unsigned local_node_index = 0;
936 unsigned n_node = new_node_update_f_el_pt->
nnode();
937 for (
unsigned j = 0; j < n_node; j++)
939 if (macro_master_nod_pt == new_node_update_f_el_pt->
node_pt(j))
943 local_node_index = j;
963 "Missing_masters_functions::construct_new_"
964 "external_halo_master_node_helper()",
965 OOMPH_EXCEPTION_LOCATION);
972 local_node_index, s_in_macro_node_update_element);
975 s_in_macro_node_update_element,
976 geom_object_vector_pt);
978 else if (solid_nod_pt != 0)
983 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
984 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
985 <<
" Bool master is a boundary (solid) node "
986 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
988 if (recv_unsigneds[counter_for_recv_unsigneds++] == 1)
991 if (time_stepper_pt != 0)
1003 n_lag_dim, n_lag_type, n_dim, n_position_type, n_value);
1008 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1009 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1010 <<
" Number of boundaries the solid master node is on: "
1011 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1013 unsigned nb = recv_unsigneds[counter_for_recv_unsigneds++];
1014 for (
unsigned i = 0;
i < nb;
i++)
1017 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1018 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1019 <<
" Solid master node is on boundary "
1020 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1022 unsigned i_bnd = recv_unsigneds[counter_for_recv_unsigneds++];
1027 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1028 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1029 <<
" Number of additional values created by face element "
1030 <<
"for solid master node "
1031 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1033 unsigned n_entry = recv_unsigneds[counter_for_recv_unsigneds++];
1042 if (bnew_master_nod_pt == 0)
1044 throw OomphLibError(
"Failed to cast new node to boundary node\n",
1045 OOMPH_CURRENT_FUNCTION,
1046 OOMPH_EXCEPTION_LOCATION);
1049 if (bnew_master_nod_pt
1050 ->index_of_first_value_assigned_by_face_element_pt() == 0)
1054 new std::map<unsigned, unsigned>;
1059 std::map<unsigned, unsigned>* map_pt =
1064 for (
unsigned i = 0;
i < n_entry;
i++)
1068 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1069 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1070 <<
" Key of map entry for solid master node"
1071 << recv_unsigneds[counter_for_recv_unsigneds]
1074 unsigned first = recv_unsigneds[counter_for_recv_unsigneds++];
1076 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1077 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1078 <<
" Value of map entry for solid master node"
1079 << recv_unsigneds[counter_for_recv_unsigneds]
1082 unsigned second = recv_unsigneds[counter_for_recv_unsigneds++];
1085 (*map_pt)[first] = second;
1092 if (time_stepper_pt != 0)
1094 new_master_nod_pt =
new SolidNode(time_stepper_pt,
1104 n_lag_dim, n_lag_type, n_dim, n_position_type, n_value);
1114 dynamic_cast<SolidNode*
>(new_master_nod_pt);
1115 unsigned n_solid_val =
1117 for (
unsigned i_val = 0; i_val < n_solid_val; i_val++)
1119 for (
unsigned t = 0;
t < n_prev;
t++)
1122 t, i_val, recv_doubles[counter_for_recv_doubles++]);
1128 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1129 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1130 <<
" Bool node is on boundary "
1131 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1136 if (recv_unsigneds[counter_for_recv_unsigneds++] == 1)
1139 if (time_stepper_pt != 0)
1142 time_stepper_pt, n_dim, n_position_type, n_value);
1151 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1152 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1153 <<
" Number of boundaries the master node is on: "
1154 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1156 unsigned nb = recv_unsigneds[counter_for_recv_unsigneds++];
1157 for (
unsigned i = 0;
i < nb;
i++)
1160 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1161 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1162 <<
" Master node is on boundary "
1163 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1165 unsigned i_bnd = recv_unsigneds[counter_for_recv_unsigneds++];
1171 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1172 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1173 <<
" Number of additional values created by face element "
1174 <<
"for master node "
1175 << recv_unsigneds[counter_for_recv_unsigneds] << std::endl;
1177 unsigned n_entry = recv_unsigneds[counter_for_recv_unsigneds++];
1186 if (bnew_master_nod_pt == 0)
1188 throw OomphLibError(
"Failed to cast new node to boundary node\n",
1189 OOMPH_CURRENT_FUNCTION,
1190 OOMPH_EXCEPTION_LOCATION);
1193 if (bnew_master_nod_pt
1194 ->index_of_first_value_assigned_by_face_element_pt() == 0)
1198 new std::map<unsigned, unsigned>;
1203 std::map<unsigned, unsigned>* map_pt =
1208 for (
unsigned i = 0;
i < n_entry;
i++)
1212 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1213 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1214 <<
" Key of map entry for master node"
1215 << recv_unsigneds[counter_for_recv_unsigneds]
1218 unsigned first = recv_unsigneds[counter_for_recv_unsigneds++];
1220 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1221 oomph_info <<
"Rec:" << counter_for_recv_unsigneds
1222 <<
" Value of map entry for master node"
1223 << recv_unsigneds[counter_for_recv_unsigneds]
1226 unsigned second = recv_unsigneds[counter_for_recv_unsigneds++];
1229 (*map_pt)[first] = second;
1236 if (time_stepper_pt != 0)
1239 new Node(time_stepper_pt, n_dim, n_position_type, n_value);
1243 new_master_nod_pt =
new Node(n_dim, n_position_type, n_value);
1254 for (
unsigned i_val = 0; i_val < n_value; i_val++)
1256 for (
unsigned t = 0;
t < n_prev;
t++)
1259 t, i_val, recv_doubles[counter_for_recv_doubles++]);
1264 unsigned n_nod_dim = new_master_nod_pt->
ndim();
1265 for (
unsigned idim = 0; idim < n_nod_dim; idim++)
1267 for (
unsigned t = 0;
t < n_prev;
t++)
1270 new_master_nod_pt->
x(
t, idim) =
1271 recv_doubles[counter_for_recv_doubles++];
1276 new_master_nod_pt->
set_halo(non_halo_proc_ID);
////////////////////////////////////////////////////////////////////
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.
////////////////////////////////////////////////////////////////////
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.
A template Class for BoundaryNodes; that is Nodes that MAY live on the boundary of a Mesh....
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
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).
void set_halo(const unsigned &non_halo_proc_ID)
Label the node as halo and specify processor that holds non-halo counterpart.
MacroElement * macro_element_pt(const unsigned &i)
Access to i-th macro element.
A general Finite Element class.
virtual void set_macro_elem_pt(MacroElement *macro_elem_pt)
Set pointer to macro element – can be overloaded in derived elements to perform additional tasks.
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)
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.
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overload...
A Generalised Element class.
Class that contains data for hanging nodes.
void set_master_node_pt(const unsigned &i, Node *const &master_node_pt, const double &weight)
Set the pointer to the i-th master node and its weight.
MacroElementNodeUpdateMeshes contain MacroElementNodeUpdateNodes which have their own node update fun...
Vector< GeomObject * > geom_object_vector_pt()
Access function to the vector of GeomObject.
Domain *& macro_domain_pt()
Broken assignment operator.
////////////////////////////////////////////////////////////////////
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...
void add_boundary_node(const unsigned &b, Node *const &node_pt)
Add a (pointer to) a node to the b-th boundary.
void add_external_halo_element_pt(const unsigned &p, GeneralisedElement *&el_pt)
Add external halo element whose non-halo counterpart is held on processor p to this Mesh.
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.
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).
GeneralisedElement *& external_halo_element_pt(const unsigned &p, const unsigned &e)
Access fct to the e-th external halo element in this Mesh whose non-halo counterpart is held on proce...
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...
Vector< GeneralisedElement * > halo_element_pt(const unsigned &p)
Return vector of halo elements in this Mesh whose non-halo counterpart is held on processor p.
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.
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
void set_hanging_pt(HangInfo *const &hang_pt, const int &i)
Set the hanging data for the i-th value. (hang_pt=0 to make non-hanging)
An OomphLibError object which should be thrown when an run-time error is encountered....
An OomphLibWarning object which should be created as a temporary object to issue a warning....
/////////////////////////////////////////////////////////////////// /////////////////////////////////...
/////////////////////////////////////////////////////////////////// /////////////////////////////////...
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...
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
virtual void initial_setup(Tree *const &adopted_father_pt=0, const unsigned &initial_p_order=0)
Initial setup of the element: e.g. set the appropriate internal p-order. If an adopted father is spec...
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
Data *const & variable_position_pt() const
Pointer to variable_position data (const version)
////////////////////////////////////////////////////////////////////// //////////////////////////////...
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 recursively_add_masters_of_external_halo_node_to_storage(Node *&new_nod_pt, Mesh *const &mesh_pt, unsigned &loc_p, unsigned &node_index, int &n_cont_inter_values, unsigned &counter_for_recv_unsigneds, Vector< unsigned > &recv_unsigneds, unsigned &counter_for_recv_doubles, Vector< double > &recv_doubles)
Recursively add masters of external halo nodes (and their masters, etc) based on information received...
void add_external_halo_node_to_storage(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 function to add external halo nodes, including any masters, based on information received from...
void construct_new_external_halo_master_node_helper(Node *&new_master_nod_pt, Node *&nod_pt, unsigned &loc_p, 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 master node with the information sent from the h...
void add_external_halo_master_node_helper(Node *&new_master_nod_pt, Node *&new_nod_pt, Mesh *const &mesh_pt, unsigned &loc_p, int &n_cont_inter_values, unsigned &counter_for_recv_unsigneds, Vector< unsigned > &recv_unsigneds, unsigned &counter_for_recv_doubles, Vector< double > &recv_doubles)
Helper function to add external halo node that is a master.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...