47 namespace Multi_domain_functions
126 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 196 int send_to_proc=my_rank+1;
197 int recv_from_proc=my_rank-1;
198 if (send_to_proc==n_proc) { send_to_proc=0; }
199 if (recv_from_proc<0) { recv_from_proc=n_proc-1; }
203 int n_missing_local_zetas=Flat_packed_zetas_not_found_locally.size();
204 MPI_Isend(&n_missing_local_zetas,1,MPI_INT,send_to_proc,4,
205 comm_pt->mpi_comm(),&request);
210 MPI_Recv(&count_zetas,1,MPI_INT,recv_from_proc,
211 4,comm_pt->mpi_comm(),&status);
213 MPI_Wait(&request,MPI_STATUS_IGNORE);
217 if (n_missing_local_zetas!=0)
219 MPI_Isend(&Flat_packed_zetas_not_found_locally[0],
220 n_missing_local_zetas,MPI_DOUBLE,
221 send_to_proc,5,comm_pt->mpi_comm(),&request);
228 Received_flat_packed_zetas_to_be_found.resize(count_zetas);
229 MPI_Recv(&Received_flat_packed_zetas_to_be_found[0],
230 count_zetas,MPI_DOUBLE,recv_from_proc,5,
231 comm_pt->mpi_comm(),&status);
232 MPI_Wait(&request,MPI_STATUS_IGNORE);
236 Received_flat_packed_zetas_to_be_found.resize(0);
256 int n_proc=comm_pt->nproc();
257 int my_rank=comm_pt->my_rank();
263 Vector<int> received_proc_id_plus_one_of_external_element;
267 int orig_send_proc=my_rank-iproc;
268 if (my_rank<iproc) { orig_send_proc=n_proc+orig_send_proc; }
269 int orig_recv_proc=my_rank+iproc;
270 if ((my_rank+iproc)>=n_proc) { orig_recv_proc=orig_recv_proc-n_proc; }
274 unsigned send_count_double_values=Flat_packed_doubles.size();
275 MPI_Isend(&send_count_double_values,1,MPI_UNSIGNED,
276 orig_send_proc,1,comm_pt->mpi_comm(),&request);
277 int receive_count_double_values=0;
278 MPI_Recv(&receive_count_double_values,1,MPI_INT,
279 orig_recv_proc,1,comm_pt->mpi_comm(),&status);
280 MPI_Wait(&request,MPI_STATUS_IGNORE);
282 if (send_count_double_values!=0)
284 MPI_Isend(&Flat_packed_doubles[0],send_count_double_values,MPI_DOUBLE,
285 orig_send_proc,2,comm_pt->mpi_comm(),&request);
287 if (receive_count_double_values!=0)
289 received_double_values.resize(receive_count_double_values);
290 MPI_Recv(&received_double_values[0],receive_count_double_values,
291 MPI_DOUBLE,orig_recv_proc,2,comm_pt->mpi_comm(),&status);
293 if (send_count_double_values!=0)
295 MPI_Wait(&request,MPI_STATUS_IGNORE);
300 unsigned send_count_unsigned_values=Flat_packed_unsigneds.size();
301 MPI_Isend(&send_count_unsigned_values,1,MPI_UNSIGNED,
302 orig_send_proc,14,comm_pt->mpi_comm(),&request);
304 int receive_count_unsigned_values=0;
305 MPI_Recv(&receive_count_unsigned_values,1,MPI_INT,orig_recv_proc,14,
306 comm_pt->mpi_comm(),&status);
308 MPI_Wait(&request,MPI_STATUS_IGNORE);
310 if (send_count_unsigned_values!=0)
312 MPI_Isend(&Flat_packed_unsigneds[0],send_count_unsigned_values,MPI_UNSIGNED,
313 orig_send_proc,15,comm_pt->mpi_comm(),&request);
314 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 315 for (
unsigned i=0;
i<send_count_unsigned_values;
i++)
317 oomph_info <<
"Sent:" <<
i <<
" to orig_proc:" << orig_send_proc
318 <<
" " << Flat_packed_unsigneds_string[
i]
319 <<
": " << Flat_packed_unsigneds[
i] << std::endl;
323 if (receive_count_unsigned_values!=0)
325 received_unsigned_values.resize(receive_count_unsigned_values);
326 MPI_Recv(&received_unsigned_values[0],receive_count_unsigned_values,
327 MPI_UNSIGNED,orig_recv_proc,15,comm_pt->mpi_comm(),&status);
330 if (send_count_unsigned_values!=0)
332 MPI_Wait(&request,MPI_STATUS_IGNORE);
337 int send_count=Received_flat_packed_zetas_to_be_found.size()/
Dim;
338 MPI_Isend(&send_count,1,MPI_INT,orig_send_proc,
339 20,comm_pt->mpi_comm(),&request);
341 MPI_Recv(&receive_count,1,MPI_INT,orig_recv_proc,
342 20,comm_pt->mpi_comm(),&status);
343 MPI_Wait(&request,MPI_STATUS_IGNORE);
347 MPI_Isend(&Located_element_status[0],send_count,MPI_UNSIGNED,
348 orig_send_proc,3,comm_pt->mpi_comm(),&request);
351 if (receive_count!=0)
353 received_located_element_status.resize(receive_count);
354 MPI_Recv(&received_located_element_status[0],receive_count,
355 MPI_UNSIGNED,orig_recv_proc,3,
356 comm_pt->mpi_comm(),&status);
360 MPI_Wait(&request,MPI_STATUS_IGNORE);
367 MPI_Isend(&Proc_id_plus_one_of_external_element[0],send_count,MPI_INT,
368 orig_send_proc,13,comm_pt->mpi_comm(),&request);
370 if (receive_count!=0)
372 received_proc_id_plus_one_of_external_element.resize(receive_count);
373 MPI_Recv(&received_proc_id_plus_one_of_external_element[0],
374 receive_count,MPI_INT,orig_recv_proc,13,
375 comm_pt->mpi_comm(),&status);
379 MPI_Wait(&request,MPI_STATUS_IGNORE);
385 unsigned send_count_located_coord=Flat_packed_located_coordinates.size();
386 MPI_Isend(&send_count_located_coord,1,MPI_UNSIGNED,
387 orig_send_proc,4,comm_pt->mpi_comm(),&request);
388 unsigned receive_count_located_coord=0;
389 MPI_Recv(&receive_count_located_coord,1,MPI_UNSIGNED,orig_recv_proc,4,
390 comm_pt->mpi_comm(),&status);
391 MPI_Wait(&request,MPI_STATUS_IGNORE);
393 if (send_count_located_coord!=0)
395 MPI_Isend(&Flat_packed_located_coordinates[0],
396 send_count_located_coord,MPI_DOUBLE,
397 orig_send_proc,5,comm_pt->mpi_comm(),&request);
399 if (receive_count_located_coord!=0)
401 received_located_coord.resize(receive_count_located_coord);
402 MPI_Recv(&received_located_coord[0],receive_count_located_coord,MPI_DOUBLE,
403 orig_recv_proc,5,comm_pt->mpi_comm(),&status);
405 if (send_count_located_coord!=0)
407 MPI_Wait(&request,MPI_STATUS_IGNORE);
416 Flat_packed_doubles.resize(receive_count_double_values);
417 for (
int ii=0;ii<receive_count_double_values;ii++)
419 Flat_packed_doubles[ii]=received_double_values[ii];
421 Flat_packed_unsigneds.resize(receive_count_unsigned_values);
422 for (
int ii=0;ii<receive_count_unsigned_values;ii++)
424 Flat_packed_unsigneds[ii]=received_unsigned_values[ii];
426 Proc_id_plus_one_of_external_element.resize(receive_count);
427 Located_element_status.resize(receive_count);
428 for (
int ii=0;ii<receive_count;ii++)
430 Proc_id_plus_one_of_external_element[ii]=
431 received_proc_id_plus_one_of_external_element[ii];
432 Located_element_status[ii]=received_located_element_status[ii];
434 Flat_packed_located_coordinates.resize(receive_count_located_coord);
435 for (
int ii=0;ii<int(receive_count_located_coord);ii++)
437 Flat_packed_located_coordinates[ii]=received_located_coord[ii];
448 Mesh*
const &external_mesh_pt,
449 int& n_cont_inter_values)
453 n_cont_inter_values);
459 n_cont_inter_values);
469 int& iproc,
Node* nod_pt,
471 Mesh*
const &external_mesh_pt,
472 int& n_cont_inter_values)
476 for (
int i_cont=-1;i_cont<n_cont_inter_values;i_cont++)
482 Flat_packed_unsigneds.push_back(1);
483 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 484 Flat_packed_unsigneds_string.push_back(
"Is hanging");
490 unsigned n_master=hang_pt->
nmaster();
493 Flat_packed_unsigneds.push_back(n_master);
494 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 495 Flat_packed_unsigneds_string.push_back(
"nmaster");
497 for (
unsigned m=0;m<n_master;m++)
505 n_cont_inter_values);
514 n_cont_inter_values);
520 Flat_packed_unsigneds.push_back(0);
521 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 522 Flat_packed_unsigneds_string.push_back(
"Not hanging");
534 Mesh*
const &external_mesh_pt,
535 int& n_cont_inter_values)
539 unsigned external_haloed_node_index=
543 if (external_haloed_node_index==n_ext_haloed_nod)
545 Flat_packed_unsigneds.push_back(1);
547 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 548 std::stringstream junk;
549 junk <<
"Node needs to be constructed [size=" 550 << Flat_packed_unsigneds.size() <<
"]; last entry: " 551 << Flat_packed_unsigneds[Flat_packed_unsigneds.size()-1];
552 Flat_packed_unsigneds_string.push_back(junk.str());
559 problem_pt,external_mesh_pt,
560 n_cont_inter_values);
564 Flat_packed_unsigneds.push_back(0);
565 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 566 std::stringstream junk;
567 junk <<
"Node was already added [size=" 568 << Flat_packed_unsigneds.size() <<
"]; last entry: " 569 << Flat_packed_unsigneds[Flat_packed_unsigneds.size()-1];
571 Flat_packed_unsigneds_string.push_back(junk.str());
576 Flat_packed_unsigneds.push_back(external_haloed_node_index);
577 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 578 Flat_packed_unsigneds_string.push_back(
"external haloed node index");
592 Mesh*
const &external_mesh_pt,
593 int& n_cont_inter_values)
597 unsigned external_haloed_node_index;
598 external_haloed_node_index=
602 if (external_haloed_node_index==n_ext_haloed_nod)
606 Flat_packed_unsigneds.push_back(1);
607 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 608 Flat_packed_unsigneds_string.push_back(
"Node needs to be constructed[2]");
617 n_cont_inter_values);
621 Flat_packed_unsigneds.push_back(0);
622 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 623 Flat_packed_unsigneds_string.push_back(
"Node was already added[2]");
628 Flat_packed_unsigneds.push_back(external_haloed_node_index);
629 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 630 Flat_packed_unsigneds_string.push_back(
"external haloed node index[2]");
645 Mesh*
const &external_mesh_pt,
646 int& n_cont_inter_values)
651 unsigned n_val=nod_pt->
nvalue();
652 Flat_packed_unsigneds.push_back(n_val);
653 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 654 Flat_packed_unsigneds_string.push_back(
"Number of values");
657 unsigned n_dim=nod_pt->
ndim();
661 bool found_timestepper=
false;
662 unsigned time_stepper_index;
664 for (
unsigned i=0;
i<n_time_steppers;
i++)
669 found_timestepper=
true;
670 time_stepper_index=
i;
675 if (found_timestepper)
677 Flat_packed_unsigneds.push_back(1);
678 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 679 Flat_packed_unsigneds_string.push_back(
"Found timestepper");
681 Flat_packed_unsigneds.push_back(time_stepper_index);
682 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 683 Flat_packed_unsigneds_string.push_back(
"Timestepper index");
688 Flat_packed_unsigneds.push_back(0);
689 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 690 Flat_packed_unsigneds_string.push_back(
"Not found timestepper");
696 if (time_stepper_pt!=0)
705 Flat_packed_unsigneds.push_back(1);
706 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 707 Flat_packed_unsigneds_string.push_back(
"Node is on boundary");
712 unsigned n_bnd=external_mesh_pt->
nboundary();
713 for (
unsigned i_bnd=0;i_bnd<n_bnd;i_bnd++)
718 boundaries.push_back(i_bnd);
721 unsigned nb=boundaries.size();
722 Flat_packed_unsigneds.push_back(nb);
723 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 724 std::stringstream junk;
725 junk <<
"Node is on "<< nb <<
" boundaries";
726 Flat_packed_unsigneds_string.push_back(junk.str());
728 for (
unsigned i=0;
i<nb;
i++)
730 Flat_packed_unsigneds.push_back(boundaries[
i]);
731 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 732 std::stringstream junk;
733 junk <<
"Node is on boundary " << boundaries[
i] <<
" of " << n_bnd;
734 Flat_packed_unsigneds_string.push_back(junk.str());
746 "Failed to cast new node to boundary node\n",
747 OOMPH_CURRENT_FUNCTION,
748 OOMPH_EXCEPTION_LOCATION);
751 std::map<unsigned, unsigned>* map_pt=
757 Flat_packed_unsigneds.push_back(0);
758 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 759 std::stringstream junk;
760 Flat_packed_unsigneds_string.push_back(
"No additional values were created by face element");
767 Flat_packed_unsigneds.push_back(map_pt->size());
768 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 769 std::stringstream junk;
770 junk <<
"Map size " << map_pt->size() << n_bnd;
771 Flat_packed_unsigneds_string.push_back(junk.str());
774 for (std::map<unsigned, unsigned>::iterator p=
776 p!=map_pt->end();p++)
778 Flat_packed_unsigneds.push_back((*p).first);
779 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 780 std::stringstream junk;
781 Flat_packed_unsigneds_string.push_back(
"Key of map entry");
783 Flat_packed_unsigneds.push_back((*p).second);
784 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 785 Flat_packed_unsigneds_string.push_back(
"Value of map entry");
793 Flat_packed_unsigneds.push_back(0);
794 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 795 Flat_packed_unsigneds_string.push_back(
"Node is not on any boundary");
811 Flat_packed_unsigneds.push_back(update_id);
812 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 813 Flat_packed_unsigneds_string.push_back(
"Alg Node update id");
818 Flat_packed_unsigneds.push_back(n_ref_val);
819 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 820 Flat_packed_unsigneds_string.push_back(
"Alg Node n ref values");
822 for (
unsigned i_ref_val=0;i_ref_val<n_ref_val;i_ref_val++)
824 Flat_packed_doubles.push_back(alg_nod_pt->
ref_value(i_ref_val));
829 Flat_packed_unsigneds.push_back(n_geom_obj);
830 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 831 Flat_packed_unsigneds_string.push_back(
"Alg Node n geom objects");
833 for (
unsigned i_geom=0;i_geom<n_geom_obj;i_geom++)
841 unsigned found_geom_object=0;
842 for (
unsigned i_list=0;i_list<n_geom_list;i_list++)
846 found_geom_object=i_list;
849 Flat_packed_unsigneds.push_back(found_geom_object);
850 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 851 Flat_packed_unsigneds_string.push_back(
"Found geom object");
864 for (
unsigned i_val=0;i_val<n_solid_val;i_val++)
866 for (
unsigned t=0;
t<n_prev;
t++)
875 for (
unsigned i_val=0;i_val<n_val;i_val++)
877 for (
unsigned t=0;
t<n_prev;
t++)
879 Flat_packed_doubles.push_back(nod_pt->
value(
t,i_val));
884 for (
unsigned idim=0;idim<n_dim;idim++)
886 for (
unsigned t=0;
t<n_prev;
t++)
888 Flat_packed_doubles.push_back(nod_pt->
x(
t,idim));
900 Mesh*
const &external_mesh_pt,
int& n_cont_inter_values)
903 Flat_packed_unsigneds.push_back(master_nod_pt->
ndim());
904 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 905 Flat_packed_unsigneds_string.push_back(
"Master node ndim");
908 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 909 Flat_packed_unsigneds_string.push_back(
"Master node npos_type");
911 Flat_packed_unsigneds.push_back(master_nod_pt->
nvalue());
912 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 913 Flat_packed_unsigneds_string.push_back(
"Master node nvalue");
920 Flat_packed_unsigneds.push_back(solid_nod_pt->
nlagrangian());
921 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 922 Flat_packed_unsigneds_string.push_back(
"Master solid node nlagr");
925 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 926 Flat_packed_unsigneds_string.push_back(
"Master solid node nlagr_type");
930 unsigned n_dim=master_nod_pt->
ndim();
934 bool found_timestepper=
false;
935 unsigned time_stepper_index;
937 for (
unsigned i=0;
i<n_time_steppers;
i++)
943 found_timestepper=
true;
944 time_stepper_index=
i;
949 if (found_timestepper)
951 Flat_packed_unsigneds.push_back(1);
952 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 953 Flat_packed_unsigneds_string.push_back(
"Master node Found timestepper");
955 Flat_packed_unsigneds.push_back(time_stepper_index);
956 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 957 Flat_packed_unsigneds_string.push_back(
"Master node Timestepper index");
962 Flat_packed_unsigneds.push_back(0);
963 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 964 Flat_packed_unsigneds_string.push_back(
"Master node Not found timestepper");
970 if (time_stepper_pt!=0)
979 Flat_packed_unsigneds.push_back(1);
980 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 981 Flat_packed_unsigneds_string.push_back(
"Master node is on boundary");
985 unsigned n_bnd=external_mesh_pt->
nboundary();
986 for (
unsigned i_bnd=0;i_bnd<n_bnd;i_bnd++)
991 boundaries.push_back(i_bnd);
994 unsigned nb=boundaries.size();
995 Flat_packed_unsigneds.push_back(nb);
996 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 997 std::stringstream junk;
998 junk <<
"Master node is on "<< nb <<
" boundaries";
999 Flat_packed_unsigneds_string.push_back(junk.str());
1001 for (
unsigned i=0;
i<nb;
i++)
1003 Flat_packed_unsigneds.push_back(boundaries[
i]);
1004 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1005 std::stringstream junk;
1006 junk <<
"Master noode is on boundary " 1007 << boundaries[
i] <<
" of " << n_bnd;
1008 Flat_packed_unsigneds_string.push_back(junk.str());
1020 "Failed to cast new node to boundary node\n",
1021 OOMPH_CURRENT_FUNCTION,
1022 OOMPH_EXCEPTION_LOCATION);
1025 std::map<unsigned, unsigned>* map_pt=
1031 Flat_packed_unsigneds.push_back(0);
1032 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1033 std::stringstream junk;
1034 Flat_packed_unsigneds_string.push_back(
"No additional values were created by face element for this master node");
1041 Flat_packed_unsigneds.push_back(map_pt->size());
1042 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1043 std::stringstream junk;
1044 junk <<
"Map size for master node " << map_pt->size() << n_bnd;
1045 Flat_packed_unsigneds_string.push_back(junk.str());
1048 for (std::map<unsigned, unsigned>::iterator p=
1050 p!=map_pt->end();p++)
1052 Flat_packed_unsigneds.push_back((*p).first);
1053 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1054 std::stringstream junk;
1055 Flat_packed_unsigneds_string.push_back(
1056 "Key of map entry for master node");
1058 Flat_packed_unsigneds.push_back((*p).second);
1059 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1060 Flat_packed_unsigneds_string.push_back(
1061 "Value of map entry for master node");
1069 Flat_packed_unsigneds.push_back(0);
1070 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1071 Flat_packed_unsigneds_string.push_back(
"Master node is not on any boundary");
1087 Flat_packed_unsigneds.push_back(update_id);
1088 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1089 Flat_packed_unsigneds_string.push_back(
"Master Alg Node update id");
1094 Flat_packed_unsigneds.push_back(n_ref_val);
1095 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1096 Flat_packed_unsigneds_string.push_back(
"Master Alg Node n ref values");
1098 for (
unsigned i_ref_val=0;i_ref_val<n_ref_val;i_ref_val++)
1100 Flat_packed_doubles.push_back(alg_nod_pt->
ref_value(i_ref_val));
1105 Flat_packed_unsigneds.push_back(n_geom_obj);
1106 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1107 Flat_packed_unsigneds_string.push_back(
"Master Alg Node n geom objects");
1109 for (
unsigned i_geom=0;i_geom<n_geom_obj;i_geom++)
1115 unsigned found_geom_object=0;
1116 for (
unsigned i_list=0;i_list<n_geom_list;i_list++)
1120 found_geom_object=i_list;
1123 Flat_packed_unsigneds.push_back(found_geom_object);
1124 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1125 Flat_packed_unsigneds_string.push_back(
"Master node Found geom object");
1133 if (macro_nod_pt!=0)
1140 unsigned n_ext_haloed_el=external_mesh_pt->
1141 nexternal_haloed_element(iproc);
1142 unsigned external_haloed_el_index;
1143 external_haloed_el_index=external_mesh_pt->
1144 add_external_haloed_element_pt(iproc,macro_node_update_el_pt);
1147 if (external_haloed_el_index==n_ext_haloed_el)
1149 Flat_packed_unsigneds.push_back(1);
1150 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1151 Flat_packed_unsigneds_string.push_back(
"Master Node needs to be constructed");
1160 if (macro_mesh_pt!=0)
1162 Flat_packed_unsigneds.push_back(1);
1163 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1164 Flat_packed_unsigneds_string.push_back(
"Mesh is macro element mesh");
1167 MacroElement* macro_el_pt= macro_node_update_finite_el_pt
1170 Flat_packed_unsigneds.push_back(macro_el_num);
1171 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1172 Flat_packed_unsigneds_string.push_back(
"Number of macro element");
1177 (macro_node_update_el_pt);
1183 unsigned el_dim=q_el_pt->
dim();
1184 for (
unsigned i_dim=0;i_dim<el_dim;i_dim++)
1186 Flat_packed_doubles.push_back(q_el_pt->
s_macro_ll(i_dim));
1187 Flat_packed_doubles.push_back(q_el_pt->
s_macro_ur(i_dim));
1192 std::ostringstream error_stream;
1193 error_stream <<
"You are using a MacroElement node update\n" 1194 <<
"in a case with non-QElements. This has not\n" 1195 <<
"yet been implemented.\n";
1197 (error_stream.str(),
1198 OOMPH_CURRENT_FUNCTION,
1199 OOMPH_EXCEPTION_LOCATION);
1207 Flat_packed_unsigneds.push_back(0);
1208 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1209 Flat_packed_unsigneds_string.push_back(
"Mesh is not a macro element mesh");
1215 unsigned n_node=macro_node_update_finite_el_pt->
nnode();
1216 for (
unsigned j=0;j<n_node;j++)
1218 Node* new_nod_pt=macro_node_update_finite_el_pt->
node_pt(j);
1222 n_cont_inter_values);
1227 Flat_packed_unsigneds.push_back(0);
1228 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1229 Flat_packed_unsigneds_string.push_back(
"External haloed element already exists");
1231 Flat_packed_unsigneds.push_back(external_haloed_el_index);
1232 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1233 Flat_packed_unsigneds_string.push_back(
"Index of existing external haloed element");
1240 if (solid_nod_pt!=0)
1243 for (
unsigned i_val=0;i_val<n_val;i_val++)
1245 for (
unsigned t=0;
t<n_prev;
t++)
1256 unsigned n_val=master_nod_pt->
nvalue();
1257 for (
unsigned i_val=0;i_val<n_val;i_val++)
1259 for (
unsigned t=0;
t<n_prev;
t++)
1261 Flat_packed_doubles.push_back(master_nod_pt->
value(
t,i_val));
1266 for (
unsigned idim=0;idim<n_dim;idim++)
1268 for (
unsigned t=0;
t<n_prev;
t++)
1270 Flat_packed_doubles.push_back(master_nod_pt->
x(
t,idim));
1286 (
Node* &new_nod_pt,
Mesh*
const &external_mesh_pt,
unsigned& loc_p,
1288 int& n_cont_inter_values,
1293 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1294 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
1295 <<
" Bool: New node needs to be constructed " 1299 if (Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++]==1)
1303 node_index,new_el_pt,
1304 external_mesh_pt,problem_pt);
1308 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1309 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
1310 <<
" Index of existing external halo node " 1317 (loc_p,Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++]);
1319 new_el_pt->
node_pt(node_index)=new_nod_pt;
1333 (
Node* &new_nod_pt,
unsigned& loc_p,
unsigned& node_index,
1335 Mesh*
const &external_mesh_pt,
Problem* problem_pt)
1339 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1340 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
1341 <<
" Number of values of external halo node " 1345 unsigned n_val=Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
1354 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1355 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
1356 <<
" Timestepper req'd for node " 1360 if (Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++]==1)
1362 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1363 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
1364 <<
" Index of timestepper " 1370 (Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++]);
1378 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1379 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
1380 <<
" Is node on boundary? " 1384 if (Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++]==1)
1387 if (time_stepper_pt!=0)
1390 (node_index,time_stepper_pt);
1398 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1399 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
1400 <<
" Number of boundaries the node is on: " 1404 unsigned nb=Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
1405 for (
unsigned i=0;
i<nb;
i++)
1408 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1409 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
1410 <<
" Node is on boundary " 1415 Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
1420 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1421 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
1422 <<
" Number of additional values created by face element " 1426 unsigned n_entry=Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
1438 "Failed to cast new node to boundary node\n",
1439 OOMPH_CURRENT_FUNCTION,
1440 OOMPH_EXCEPTION_LOCATION);
1444 index_of_first_value_assigned_by_face_element_pt()==0)
1447 index_of_first_value_assigned_by_face_element_pt()=
1448 new std::map<unsigned, unsigned>;
1453 std::map<unsigned, unsigned>* map_pt=
1457 for (
unsigned i=0;
i<n_entry;
i++)
1461 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1462 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
1463 <<
" Key of map entry" 1467 unsigned first=Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
1469 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1470 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
1471 <<
" Value of map entry" 1475 unsigned second=Flat_packed_unsigneds[Counter_for_flat_packed_unsigneds++];
1478 (*map_pt)[first]=second;
1485 if (time_stepper_pt!=0)
1488 (node_index,time_stepper_pt);
1505 if (new_alg_nod_pt!=0)
1515 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1516 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
1517 <<
" Alg node update id " 1522 unsigned update_id=Flat_packed_unsigneds
1523 [Counter_for_flat_packed_unsigneds++];
1529 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1530 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
1531 <<
" Alg node # of ref values " 1535 unsigned n_ref_val=Flat_packed_unsigneds
1536 [Counter_for_flat_packed_unsigneds++];
1540 ref_value.resize(n_ref_val);
1541 for (
unsigned i_ref=0;i_ref<n_ref_val;i_ref++)
1543 ref_value[i_ref]=Flat_packed_doubles
1544 [Counter_for_flat_packed_doubles++];
1554 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1555 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
1556 <<
" Alg node # of geom objects " 1560 unsigned n_geom_obj=Flat_packed_unsigneds
1561 [Counter_for_flat_packed_unsigneds++];
1565 geom_object_pt.resize(n_geom_obj);
1566 for (
unsigned i_geom=0;i_geom<n_geom_obj;i_geom++)
1568 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1569 oomph_info <<
"Rec:" << Counter_for_flat_packed_unsigneds
1570 <<
" Alg node: geom object index " 1574 unsigned geom_index=Flat_packed_unsigneds
1575 [Counter_for_flat_packed_unsigneds++];
1582 geom_object_pt[i_geom]=alg_mesh_pt->
1583 geom_object_list_pt(geom_index);
1589 (update_id,alg_mesh_pt,geom_object_pt,ref_value);
1599 if (macro_nod_pt!=0)
1610 geom_object_vector_pt=
1616 (node_index,s_in_macro_node_update_element);
1620 (new_el_pt,s_in_macro_node_update_element,
1621 geom_object_vector_pt);
1626 if (solid_nod_pt!=0)
1629 for (
unsigned i_val=0;i_val<n_solid_val;i_val++)
1631 for (
unsigned t=0;
t<n_prev;
t++)
1635 Flat_packed_doubles[Counter_for_flat_packed_doubles++]);
1641 unsigned n_new_val=new_nod_pt->
nvalue();
1642 if (n_val>n_new_val)
1644 new_nod_pt->
resize(n_val);
1649 for (
unsigned i_val=0;i_val<n_val;i_val++)
1651 for (
unsigned t=0;
t<n_prev;
t++)
1653 new_nod_pt->
set_value(
t,i_val,Flat_packed_doubles
1654 [Counter_for_flat_packed_doubles++]);
1659 unsigned n_dim=new_nod_pt->
ndim();
1660 for (
unsigned idim=0;idim<n_dim;idim++)
1662 for (
unsigned t=0;
t<n_prev;
t++)
1665 new_nod_pt->
x(
t,idim)=Flat_packed_doubles
1666 [Counter_for_flat_packed_doubles++];
1681 unsigned n_mesh=mesh_geom_obj_pt.size();
1685 int n_proc=comm_pt->nproc();
1686 int my_rank=comm_pt->my_rank();
1689 Flat_packed_doubles.resize(0);
1690 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1691 Flat_packed_unsigneds_string.resize(0);
1693 Flat_packed_unsigneds.resize(0);
1694 Flat_packed_located_coordinates.resize(0);
1699 Flat_packed_zetas_not_found_locally.resize(0);
1702 unsigned n_zeta=Received_flat_packed_zetas_to_be_found.size()/
Dim;
1707 Proc_id_plus_one_of_external_element.resize(n_zeta,0);
1714 Located_element_status.resize(n_zeta,
Not_found);
1724 for (
unsigned i=0;
i<n_zeta;
i++)
1730 for (
unsigned ii=0;ii<
Dim;ii++)
1732 x_global[ii]=Received_flat_packed_zetas_to_be_found[count];
1737 bool reached_end_of_mesh=
false;
1738 unsigned dbl_max_count=0;
1739 for (
unsigned ii=0;ii<
Dim;ii++)
1741 if (x_global[ii]==DBL_MAX)
1744 reached_end_of_mesh=
true;
1749 if (reached_end_of_mesh)
1753 if (dbl_max_count!=Dim)
1755 std::ostringstream error_stream;
1756 error_stream <<
"Appear to have reached end of mesh " << i_mesh
1757 <<
" but only " << dbl_max_count <<
" out of " 1758 << Dim <<
" zeta coordinates have been set to DBX_MAX\n";
1760 (error_stream.str(),
1761 OOMPH_CURRENT_FUNCTION,
1762 OOMPH_EXCEPTION_LOCATION);
1766 for (
unsigned ii=0;ii<
Dim;ii++)
1768 Flat_packed_zetas_not_found_locally.push_back(DBL_MAX);
1784 if (!reached_end_of_mesh)
1786 mesh_geom_obj_pt[i_mesh]->locate_zeta(x_global,
1787 sub_geom_obj_pt,ss);
1790 if (sub_geom_obj_pt!=0)
1794 if (!Use_bulk_element_as_external)
1812 int halo_copy_proc=my_rank-iproc;
1815 if (my_rank<iproc) { halo_copy_proc=n_proc+halo_copy_proc; }
1818 Proc_id_plus_one_of_external_element[
i]=my_rank+1;
1825 unsigned n_extern_haloed=external_mesh_pt->
1826 nexternal_haloed_element(halo_copy_proc);
1827 unsigned external_haloed_el_index=
1833 if (external_haloed_el_index==n_extern_haloed)
1837 Located_element_status[
i]=
New;
1840 int n_cont_inter_values=-1;
1841 if (dynamic_cast<RefineableElement*>(source_el_pt)!=0)
1844 (source_el_pt)->ncont_interpolated_values();
1855 if (macro_mesh_pt!=0)
1857 Flat_packed_unsigneds.push_back(1);
1858 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1859 Flat_packed_unsigneds_string.push_back(
"Mesh is macro element mesh[2]");
1869 Flat_packed_unsigneds.push_back(macro_el_num);
1870 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1871 Flat_packed_unsigneds_string.push_back(
"Number of macro element[2]");
1881 unsigned el_dim=q_el_pt->
dim();
1882 for (
unsigned i_dim=0;i_dim<el_dim;i_dim++)
1884 Flat_packed_doubles.push_back(q_el_pt->
s_macro_ll(i_dim));
1885 Flat_packed_doubles.push_back(q_el_pt->
s_macro_ur(i_dim));
1890 std::ostringstream error_stream;
1891 error_stream <<
"You are using a MacroElement node update\n" 1892 <<
"in a case with non-QElements. This has not\n" 1893 <<
"yet been implemented.\n";
1895 (error_stream.str(),
1896 OOMPH_CURRENT_FUNCTION,
1897 OOMPH_EXCEPTION_LOCATION);
1903 Flat_packed_unsigneds.push_back(0);
1904 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1905 Flat_packed_unsigneds_string.push_back(
"Mesh is not a macro element mesh [2]");
1915 if(source_finite_el_pt==0)
1919 "Unable to cast source function to finite element\n",
1920 "Multi_domain_functions::locate_zeta_for_missing_coordinates()",
1921 OOMPH_EXCEPTION_LOCATION);
1927 unsigned n_node=source_finite_el_pt->
nnode();
1928 for (
unsigned j=0;j<n_node;j++)
1938 n_cont_inter_values);
1945 Located_element_status[
i]=
Exists;
1946 Flat_packed_unsigneds.push_back(external_haloed_el_index);
1947 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 1948 Flat_packed_unsigneds_string.push_back(
"Index of existing external haloed element[2]");
1954 if (!Use_bulk_element_as_external)
1956 for (
unsigned ii=0;ii<
Dim;ii++)
1958 Flat_packed_located_coordinates.push_back(ss[ii]);
1967 unsigned bulk_el_dim =
1971 for (
unsigned ii=0;ii<bulk_el_dim;ii++)
1973 Flat_packed_located_coordinates.push_back(s_trans[ii]);
1980 for (
unsigned ii=0;ii<
Dim;ii++)
1982 Flat_packed_zetas_not_found_locally.push_back(x_global[ii]);
1985 Proc_id_plus_one_of_external_element[
i]=0;
1995 for (
unsigned ii=0;ii<
Dim;ii++)
1997 Flat_packed_zetas_not_found_locally.push_back(x_global[ii]);
2000 Proc_id_plus_one_of_external_element[
i]=0;
2024 const unsigned& interaction_index)
2027 Flat_packed_zetas_not_found_locally.resize(0);
2030 unsigned n_mesh=mesh_pt.size();
2033 if (mesh_geom_obj_pt.size()!=n_mesh)
2035 std::ostringstream error_stream;
2036 error_stream <<
"Sizes of mesh_geom_obj_pt [ " 2037 << mesh_geom_obj_pt.size() <<
" ] and " 2038 <<
"mesh_pt [ " << n_mesh <<
" ] don't match.\n";
2040 (error_stream.str(),
2041 OOMPH_CURRENT_FUNCTION,
2042 OOMPH_EXCEPTION_LOCATION);
2050 for (
unsigned i_mesh=0;i_mesh<n_mesh;i_mesh++)
2053 unsigned n_element=mesh_pt[i_mesh]->nelement();
2056 for (
unsigned e=0;
e<n_element;
e++)
2061 #ifdef OOMPH_HAS_MPI 2069 unsigned el_dim=el_pt->
dim();
2075 std::ostringstream error_stream;
2077 <<
"Dimension of element " << el_dim
2078 <<
" is not consitent with dimension assumed \n" 2079 <<
" in multidomain namespace, " << Dim << std::endl;
2081 (error_stream.str(),
2082 OOMPH_CURRENT_FUNCTION,
2083 OOMPH_EXCEPTION_LOCATION);
2092 for (
unsigned ipt=0;ipt<n_intpt;ipt++)
2095 if (External_element_located[e_count][ipt]==0)
2098 for (
unsigned i=0;
i<el_dim;
i++)
2108 mesh_geom_obj_pt[i_mesh]->locate_zeta(x_global,
2109 sub_geom_obj_pt,s_ext);
2112 if (sub_geom_obj_pt!=0)
2120 if (!Use_bulk_element_as_external)
2135 s_source.resize(dynamic_cast<FiniteElement*>
2136 (source_el_pt)->dim());
2145 #ifdef OOMPH_HAS_MPI 2146 if (Allow_use_of_halo_elements_as_external_elements||
2156 = source_finite_el_pt;
2161 External_element_located[e_count][ipt]=1;
2163 #ifdef OOMPH_HAS_MPI 2169 for (
unsigned i=0;
i<el_dim;
i++)
2171 Flat_packed_zetas_not_found_locally.push_back(x_global[
i]);
2183 for (
unsigned i=0;
i<el_dim;
i++)
2185 Flat_packed_zetas_not_found_locally.push_back(x_global[
i]);
2198 for (
unsigned i=0;
i<
Dim;
i++)
2200 Flat_packed_zetas_not_found_locally.push_back(DBL_MAX);
2213 Mesh*
const &external_mesh_pt)
2215 #ifdef OOMPH_HAS_MPI 2221 unsigned mesh_dim=0;
2227 unsigned external_mesh_dim=0;
2228 if (external_mesh_pt->
nelement() > 0)
2235 #ifdef OOMPH_HAS_MPI 2236 int n_proc=comm_pt->nproc();
2239 unsigned mesh_dim_reduce;
2240 MPI_Allreduce(&mesh_dim,&mesh_dim_reduce,1,MPI_UNSIGNED,
2241 MPI_MAX,comm_pt->mpi_comm());
2242 mesh_dim=mesh_dim_reduce;
2244 unsigned external_mesh_dim_reduce;
2245 MPI_Allreduce(&external_mesh_dim,&external_mesh_dim_reduce,1,MPI_UNSIGNED,
2246 MPI_MAX,comm_pt->mpi_comm());
2247 external_mesh_dim=external_mesh_dim_reduce;
2252 if (mesh_dim!=external_mesh_dim)
2254 std::ostringstream error_stream;
2255 error_stream <<
"The elements within the two meshes do not\n" 2256 <<
"have the same dimension, so the multi-domain\n" 2257 <<
"method will not work.\n" 2258 <<
"For the mesh, dim=" << mesh_dim
2259 <<
", and the external mesh, dim=" << external_mesh_dim
2262 (error_stream.str(),
2263 OOMPH_CURRENT_FUNCTION,
2264 OOMPH_EXCEPTION_LOCATION);
2278 Flat_packed_zetas_not_found_locally.clear();
2279 Received_flat_packed_zetas_to_be_found.clear();
2280 Proc_id_plus_one_of_external_element.clear();
2281 Located_element_status.clear();
2282 Flat_packed_located_coordinates.clear();
2283 Flat_packed_doubles.clear();
2284 Flat_packed_unsigneds.clear();
2285 External_element_located.clear();
2305 double dist_squared1=0.0;
2306 for (
unsigned i=0;
i<
Dim;
i++)
2309 (zeta[
i]-Zeta_coords_for_further_away_comparison[
i])*
2310 (zeta[
i]-Zeta_coords_for_further_away_comparison[
i]);
2317 double dist_squared2=0.0;
2318 for (
unsigned i=0;
i<
Dim;
i++)
2321 (zeta[
i]-Zeta_coords_for_further_away_comparison[
i])*
2322 (zeta[
i]-Zeta_coords_for_further_away_comparison[
i]);
2326 if (dist_squared1<dist_squared2)
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) ...
void add_external_haloed_node_helper(int &iproc, Node *nod_pt, Problem *problem_pt, Mesh *const &external_mesh_pt, int &n_cont_inter_values)
Helper to add external haloed node that is not a master.
GeomObject * geom_object_pt(const unsigned &i)
Return pointer to i-th geometric object involved in default (usually first) update function...
Vector< double > & external_element_local_coord(const unsigned &interaction_index, const unsigned &ipt)
Access function to get source element's local coords for specified interaction index at specified int...
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...
Vector< double > Received_flat_packed_zetas_to_be_found
Vector of flat-packed zeta coordinates for which the external element could not be found on another p...
bool first_closer_than_second(const std::pair< FiniteElement *, Vector< double > > &p1, const std::pair< FiniteElement *, Vector< double > > &p2)
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 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 send_and_receive_located_info(int &iproc, Mesh *const &external_mesh_pt, Problem *problem_pt)
Helper function to send back any located information.
unsigned Counter_for_flat_packed_unsigneds
Counter used when processing vector of flat-packed unsigneds – this is really "private" data...
unsigned ntime_stepper() const
Return the number of time steppers.
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 add_external_haloed_master_node_helper(int &iproc, Node *master_nod_pt, Problem *problem_pt, Mesh *const &external_mesh_pt, int &n_cont_inter_values)
Helper function to add external haloed node that is a master.
void get_dim_helper(Problem *problem_pt, Mesh *const &mesh_pt, Mesh *const &external_mesh_pt)
Helper function that computes the dimension of the elements within each of the specified meshes (and ...
A general Finite Element class.
bool Doc_timings
Boolean to indicate whether to doc timings or not.
bool Accept_failed_locate_zeta_in_setup_multi_domain_interaction
Boolean to indicate that failure in setup multi domain functions is acceptable; defaults to false...
double const & master_weight(const unsigned &i) const
Return weight for dofs on i-th master node.
bool is_halo() const
Is this element a halo?
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...
unsigned nmaster() const
Return the number of master nodes.
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).
std::ofstream Doc_boundary_coordinate_file
Output file to document the boundary coordinate along the mesh boundary of the bulk mesh during call ...
OomphCommunicator * communicator_pt()
access function to the oomph-lib communicator
Vector< unsigned > Flat_packed_unsigneds
Vector of flat-packed unsigneds to be communicated with other processors – this is really "private" ...
GeomObject * geom_object_list_pt(const unsigned &i)
Access function to the ith GeomObject.
void get_local_coordinate_in_bulk(const Vector< double > &s, Vector< double > &s_bulk) const
Calculate the vector of local coordinate in the bulk element given the local coordinates in this Face...
int node_update_fct_id()
Default (usually first if there are multiple ones) node update fct id.
unsigned Dim
Dimension of zeta tuples (set by get_dim_helper) – needed because we store the scalar coordinates in...
unsigned long nelement() const
Return number of elements in the mesh.
bool Doc_full_stats
Boolean to indicate whether to output further info during setup_multi_domain_interaction() routines...
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_haloed_node_to_storage(int &iproc, Node *nod_pt, Problem *problem_pt, Mesh *const &external_mesh_pt, int &n_cont_inter_values)
Helper function to add external haloed nodes, including any masters.
bool Allow_use_of_halo_elements_as_external_elements
Boolean to indicate if we're allowed to use halo elements as external elements. Can drastically reduc...
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
Vector< double > Flat_packed_located_coordinates
Vector of flat-packed local coordinates for zeta tuples that have been located.
Vector< std::string > Flat_packed_unsigneds_string
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
virtual Node * construct_node(const unsigned &n)
Construct the local node n and return a pointer to the newly created node object. ...
void interpolated_zeta(const Vector< double > &s, Vector< double > &zeta) const
Calculate the interpolated value of zeta, the intrinsic coordinate of the element when viewed as a co...
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.
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
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...
void clean_up()
Helper function that clears all the intermediate information used during the external storage creatio...
unsigned nposition_type() const
Number of coordinate types needed in the mapping between local and global coordinates.
void get_required_master_nodal_information_helper(int &iproc, Node *master_nod_pt, Problem *problem_pt, Mesh *const &external_mesh_pt, int &n_cont_inter_values)
Helper function to get the required master nodal information from an external haloed master node so t...
void recursively_add_masters_of_external_haloed_node(int &iproc, Node *nod_pt, Problem *problem_pt, Mesh *const &external_mesh_pt, int &n_cont_inter_values)
Recursively add any master nodes (and their master nodes etc) of external haloed nodes.
Data *const & variable_position_pt() const
Pointer to variable_position data (const version)
TimeStepper *& time_stepper_pt()
Access function for the pointer to the first (presumably only) timestepper.
void send_and_receive_missing_zetas(Problem *problem_pt)
Helper function to send any "missing" zeta coordinates to the next process and receive any coordinate...
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.
Vector< double > Flat_packed_doubles
Vector of flat-packed doubles to be communicated with other processors.
Class that contains data for hanging nodes.
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
void construct_new_external_halo_node_helper(Node *&new_nod_pt, unsigned &loc_p, unsigned &node_index, FiniteElement *const &new_el_pt, Mesh *const &external_mesh_pt, Problem *problem_pt)
Helper function which constructs a new external halo node (on an element) with the information sent f...
void get_required_nodal_information_helper(int &iproc, Node *nod_pt, Problem *problem_pt, Mesh *const &external_mesh_pt, int &n_cont_inter_values)
Helper function to get the required nodal information from an external haloed node so that a fully-fu...
bool Use_bulk_element_as_external
Boolean to indicate when to use the bulk element as the external element. Defaults to false...
bool Allow_use_of_halo_elements_as_external_elements_for_projection
Indicate whether we are allowed to use halo elements as external elements for projection, possibly only required in parallel unstructured mesh generation during the projection stage. Default set to true.
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.
Vector< int > Proc_id_plus_one_of_external_element
Proc_id_plus_one_of_external_element[i] contains the processor id (plus one) of the processor on whic...
void resize(const unsigned &n_value)
Resize the number of equations.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
Vector< Vector< unsigned > > External_element_located
Lookup scheme for whether a local element's integration point has had an external element assigned to...
FiniteElement *& external_element_pt(const unsigned &interaction_index, const unsigned &ipt)
Access function to source element for specified interaction index at specified integration point...
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.
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
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.
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.
Vector< double > Flat_packed_zetas_not_found_locally
Vector of flat-packed zeta coordinates for which the external element could not be found during curre...
unsigned nnode() const
Return the number of nodes.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
bool Doc_stats
Boolean to indicate whether to output basic info during setup_multi_domain_interaction() routines...
Vector< unsigned > Located_element_status
Vector to indicate (to another processor) whether a located element (that will have to represented as...
Vector< GeomObject * > geom_object_vector_pt()
Access function to the vector of GeomObject.
void add_external_halo_node_helper(Node *&new_nod_pt, Mesh *const &external_mesh_pt, unsigned &loc_p, unsigned &node_index, FiniteElement *const &new_el_pt, int &n_cont_inter_values, Problem *problem_pt)
Helper functiono to add external halo node that is not a master.
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation...
void locate_zeta_for_missing_coordinates(int &iproc, Mesh *const &external_mesh_pt, Problem *problem_pt, Vector< MeshAsGeomObject *> &mesh_geom_obj_pt)
Locate zeta for current set of missing coordinates; vector-based version.
Vector< double > Zeta_coords_for_further_away_comparison
unsigned Counter_for_flat_packed_doubles
Counter used when processing vector of flat-packed doubles – this is really "private" data...
void locate_zeta_for_local_coordinates(const Vector< Mesh *> &mesh_pt, Mesh *const &external_mesh_pt, Vector< MeshAsGeomObject *> &mesh_geom_obj_pt, const unsigned &interaction_index)
Helper function to locate "local" zeta coordinates This is the vector-based version which operates si...
An oomph-lib wrapper to the MPI_Comm communicator object. Just contains an MPI_Comm object (which is ...