33 #ifndef OOMPH_MISSING_MASTERS_CC    34 #define OOMPH_MISSING_MASTERS_CC    38 #include <oomph-lib-config.h>    66  template<
class EXT_ELEMENT>
    68   (
Node* &new_nod_pt, 
Mesh* 
const &mesh_pt, 
unsigned& loc_p,
    70    int& n_cont_inter_values,
    71    unsigned &counter_for_recv_unsigneds,
    73    unsigned &counter_for_recv_doubles,
    80                                  counter_for_recv_unsigneds,
    82                                  counter_for_recv_doubles,
    86    recursively_add_masters_of_external_halo_node_to_storage<EXT_ELEMENT>
    87     (new_nod_pt, mesh_pt, loc_p,
    90      counter_for_recv_unsigneds,
    92      counter_for_recv_doubles,
   103  template<
class EXT_ELEMENT>
   106  (
Node* &new_nod_pt, 
Mesh* 
const &mesh_pt, 
unsigned& loc_p,
   107   unsigned& node_index,
   108   int& n_cont_inter_values,
   109   unsigned &counter_for_recv_unsigneds,
   111   unsigned &counter_for_recv_doubles,
   115   for (
int i_cont=-1;i_cont<n_cont_inter_values;i_cont++)
   117 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   119      << 
"Rec:" << counter_for_recv_unsigneds 
   120      << 
" Boolean to indicate that continuously interpolated variable i_cont "   121      << i_cont << 
" is hanging "    122      << recv_unsigneds[counter_for_recv_unsigneds]
   125     if (recv_unsigneds[counter_for_recv_unsigneds++]==1)
   127 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   129        << 
"Rec:" << counter_for_recv_unsigneds 
   130        << 
"  Number of master nodes "   131        << recv_unsigneds[counter_for_recv_unsigneds]
   134       unsigned n_master=recv_unsigneds
   135        [counter_for_recv_unsigneds++];
   139       for (
unsigned m=0;m<n_master;m++)
   141         Node* master_nod_pt=0;
   143         add_external_halo_master_node_helper<EXT_ELEMENT>
   144          (master_nod_pt,new_nod_pt,mesh_pt,loc_p,
   146           counter_for_recv_unsigneds,
   148           counter_for_recv_doubles,
   152         double master_weight=recv_doubles
   153          [counter_for_recv_doubles++];
   157         recursively_add_masters_of_external_halo_node_to_storage<EXT_ELEMENT>
   158          (master_nod_pt, mesh_pt, loc_p,
   161           counter_for_recv_unsigneds,
   163           counter_for_recv_doubles,
   175 template<
class EXT_ELEMENT>
   178    unsigned& loc_p, 
int& ncont_inter_values,
   179    unsigned &counter_for_recv_unsigneds,
   181    unsigned &counter_for_recv_doubles,
   186 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   188    << 
"Rec:" << counter_for_recv_unsigneds 
   189    << 
"  Boolean to trigger construction of new external halo master node "   190    << recv_unsigneds[counter_for_recv_unsigneds]
   193   if (recv_unsigneds[counter_for_recv_unsigneds++]==1)
   196     construct_new_external_halo_master_node_helper<EXT_ELEMENT>
   197      (new_master_nod_pt,new_nod_pt,loc_p,mesh_pt,
   198       counter_for_recv_unsigneds,
   200       counter_for_recv_doubles,
   206 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   207     oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
   208                << 
"  Existing external halo node was found externally (0) or internally (1): "    209                << recv_unsigneds[counter_for_recv_unsigneds]
   212     unsigned node_found_internally
   213      = recv_unsigneds[counter_for_recv_unsigneds++];
   214     if(node_found_internally)
   216 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   218      << 
"Rec:" << counter_for_recv_unsigneds 
   219      << 
"  index of existing (internal) halo master node "   220      << recv_unsigneds[counter_for_recv_unsigneds]
   225      (loc_p,recv_unsigneds[counter_for_recv_unsigneds++]);
   229 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   231      << 
"Rec:" << counter_for_recv_unsigneds 
   232      << 
"  index of existing external halo master node "   233      << recv_unsigneds[counter_for_recv_unsigneds]
   238      (loc_p,recv_unsigneds[counter_for_recv_unsigneds++]);
   247 template<
class EXT_ELEMENT>
   249  (
Node* &new_master_nod_pt, 
Node* &nod_pt, 
unsigned& loc_p,
   250   Mesh* 
const &mesh_pt,
   251   unsigned &counter_for_recv_unsigneds,
   253   unsigned &counter_for_recv_doubles,
   258 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   260    << 
"Rec:" << counter_for_recv_unsigneds 
   261    << 
"  ndim for external halo master node "   262    << recv_unsigneds[counter_for_recv_unsigneds]
   265   unsigned n_dim=recv_unsigneds[counter_for_recv_unsigneds++];
   266 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   268    << 
"Rec:" << counter_for_recv_unsigneds 
   269    << 
"  nposition type for external halo master node "   270    << recv_unsigneds[counter_for_recv_unsigneds]
   273   unsigned n_position_type=recv_unsigneds
   274    [counter_for_recv_unsigneds++];
   275 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   277    << 
"Rec:" << counter_for_recv_unsigneds 
   278    << 
"  nvalue for external halo master node "   279    << recv_unsigneds[counter_for_recv_unsigneds]
   282   unsigned n_value=recv_unsigneds
   283    [counter_for_recv_unsigneds++];
   284 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   286    << 
"Rec:" << counter_for_recv_unsigneds 
   287    << 
"  non-halo processor ID for external halo master node "   288    << recv_unsigneds[counter_for_recv_unsigneds]
   291   unsigned non_halo_proc_ID=recv_unsigneds
   292    [counter_for_recv_unsigneds++];
   300 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   302      << 
"Rec:" << counter_for_recv_unsigneds 
   303      << 
"  nlagrdim for external halo master solid node "   304      << recv_unsigneds[counter_for_recv_unsigneds]
   307     n_lag_dim=recv_unsigneds[counter_for_recv_unsigneds++];
   308 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   310      << 
"Rec:" << counter_for_recv_unsigneds 
   311      << 
"  nlagrtype for external halo master solid node "   312      << recv_unsigneds[counter_for_recv_unsigneds]
   315     n_lag_type=recv_unsigneds[counter_for_recv_unsigneds++];
   325   time_stepper_pt=mesh_pt->
   337 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   339      << 
"Rec:" << counter_for_recv_unsigneds 
   340      << 
"  Boolean for algebraic boundary node "   341      << recv_unsigneds[counter_for_recv_unsigneds]
   346     if (recv_unsigneds[counter_for_recv_unsigneds++]==1)
   349       if (time_stepper_pt!=0)
   352          (time_stepper_pt,n_dim,n_position_type,n_value);
   357          (n_dim,n_position_type,n_value);
   361 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   362       oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
   363                  << 
" Number of boundaries the algebraic master node is on: "    364                  << recv_unsigneds[counter_for_recv_unsigneds]
   367       unsigned nb=recv_unsigneds[counter_for_recv_unsigneds++];
   368       for (
unsigned i=0;
i<nb;
i++)
   371 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   372         oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
   373                    << 
"  Algebraic master node is on boundary "    374                    << recv_unsigneds[counter_for_recv_unsigneds]
   378          recv_unsigneds[counter_for_recv_unsigneds++];
   384 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   386        << 
"Rec:" << counter_for_recv_unsigneds << 
" "   387        << 
"Number of additional values created by face element "   388        << 
"for master node "    389        << recv_unsigneds[counter_for_recv_unsigneds]
   392       unsigned n_entry=recv_unsigneds[
   393        counter_for_recv_unsigneds++];
   402         if (bnew_master_nod_pt==0)
   405            "Failed to cast new node to boundary node\n",
   406            OOMPH_CURRENT_FUNCTION,
   407            OOMPH_EXCEPTION_LOCATION);
   410         if(bnew_master_nod_pt->
   411            index_of_first_value_assigned_by_face_element_pt()==0)
   414            index_of_first_value_assigned_by_face_element_pt()= 
   415            new std::map<unsigned, unsigned>; 
   420         std::map<unsigned, unsigned>* map_pt=
   424         for (
unsigned i=0;
i<n_entry;
i++)
   428 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   429           oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
   430                      << 
" Key of map entry for master node"    431                      << recv_unsigneds[counter_for_recv_unsigneds]
   434           unsigned first=recv_unsigneds[
   435            counter_for_recv_unsigneds++];
   437 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   438           oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
   439                      << 
" Value of map entry for master node"    440                      << recv_unsigneds[counter_for_recv_unsigneds]
   443           unsigned second=recv_unsigneds[
   444            counter_for_recv_unsigneds++];
   447           (*map_pt)[first]=second;
   455       if (time_stepper_pt!=0)
   458          (time_stepper_pt,n_dim,n_position_type,n_value);
   463          (n_dim,n_position_type,n_value);
   474 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION       476      << 
"Rec:" << counter_for_recv_unsigneds 
   477      << 
"  algebraic node update id for master node "    478      << recv_unsigneds[counter_for_recv_unsigneds]
   482     unsigned update_id=recv_unsigneds
   483      [counter_for_recv_unsigneds++];
   488 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   490      << 
"Rec:" << counter_for_recv_unsigneds 
   491      << 
"  algebraic node number of ref values for master node "    492      << recv_unsigneds[counter_for_recv_unsigneds]
   496     unsigned n_ref_val=recv_unsigneds
   497      [counter_for_recv_unsigneds++];
   500     ref_value.resize(n_ref_val);
   501     for (
unsigned i_ref=0;i_ref<n_ref_val;i_ref++)
   503       ref_value[i_ref]=recv_doubles
   504        [counter_for_recv_doubles++];
   510 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   512      << 
"Rec:" << counter_for_recv_unsigneds 
   513      << 
"  algebraic node number of geom objects for master node "    514      << recv_unsigneds[counter_for_recv_unsigneds]
   519     unsigned n_geom_obj=recv_unsigneds
   520      [counter_for_recv_unsigneds++];
   524     geom_object_pt.resize(n_geom_obj);
   525     for (
unsigned i_geom=0;i_geom<n_geom_obj;i_geom++)
   527 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   529        << 
"Rec:" << counter_for_recv_unsigneds 
   530        << 
"  algebraic node: " << i_geom << 
"-th out of "   531        << n_geom_obj << 
"-th geom index "    532        << recv_unsigneds[counter_for_recv_unsigneds]
   535       unsigned geom_index=recv_unsigneds
   536        [counter_for_recv_unsigneds++];
   549      (update_id,alg_mesh_pt,geom_object_pt,ref_value);
   554   else if (macro_nod_pt!=0)
   559 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   560     oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
   561                << 
"  Boolean for master algebraic node is boundary node "   562                << recv_unsigneds[counter_for_recv_unsigneds]
   565     if (recv_unsigneds[counter_for_recv_unsigneds++]==1)
   568       if (time_stepper_pt!=0)
   571          (time_stepper_pt,n_dim,n_position_type,n_value);
   576          (n_dim,n_position_type,n_value);
   581 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   583        << 
"Rec:" << counter_for_recv_unsigneds 
   584        << 
" Number of boundaries the macro element master node is on: "    585        << recv_unsigneds[counter_for_recv_unsigneds]
   588       unsigned nb=recv_unsigneds[counter_for_recv_unsigneds++];
   589       for (
unsigned i=0;
i<nb;
i++)
   592 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   593         oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
   594                    << 
"  Macro element master node is on boundary "    595                    << recv_unsigneds[counter_for_recv_unsigneds]
   599          recv_unsigneds[counter_for_recv_unsigneds++];
   604 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   606        << 
"Rec:" << counter_for_recv_unsigneds 
   607        << 
" Number of additional values created by face element "   608        << 
"for macro element master node "    609        << recv_unsigneds[counter_for_recv_unsigneds]
   612       unsigned n_entry=recv_unsigneds[
   613        counter_for_recv_unsigneds++];
   622         if (bnew_master_nod_pt==0)
   625            "Failed to cast new node to boundary node\n",
   626            OOMPH_CURRENT_FUNCTION,
   627            OOMPH_EXCEPTION_LOCATION);
   630         if(bnew_master_nod_pt->
   631            index_of_first_value_assigned_by_face_element_pt()==0)
   634            index_of_first_value_assigned_by_face_element_pt()= 
   635            new std::map<unsigned, unsigned>; 
   640         std::map<unsigned, unsigned>* map_pt=
   644         for (
unsigned i=0;
i<n_entry;
i++)
   648 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   649           oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
   650                      << 
" Key of map entry for macro element master node"    651                      << recv_unsigneds[counter_for_recv_unsigneds]
   654           unsigned first=recv_unsigneds[
   655            counter_for_recv_unsigneds++];
   657 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   658           oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
   659                      << 
" Value of map entry for macro element master node"    660                      << recv_unsigneds[counter_for_recv_unsigneds]
   663           unsigned second=recv_unsigneds[
   664            counter_for_recv_unsigneds++];
   667           (*map_pt)[first]=second;
   675       if (time_stepper_pt!=0)
   678          (time_stepper_pt,n_dim,n_position_type,n_value);
   683          (n_dim,n_position_type,n_value);
   689     oomph_info << 
"Added external halo master node:" << new_master_nod_pt << 
" at [ " << new_master_nod_pt->
x(0) << 
", " << new_master_nod_pt->
x(1) << 
" ]" << std::endl;
   693 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   694     oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
   695                << 
"  Bool: need new external halo element "   696                << recv_unsigneds[counter_for_recv_unsigneds]
   699     if (recv_unsigneds[counter_for_recv_unsigneds++]==1)
   702       std::ostringstream warn_stream;
   703       warn_stream << 
"You are adding a MacroElementNodeUpdate element to the\n"   704                   << 
"external storage. This functionality is still being\n"   705                   << 
"developed and may cause problems later on, say during\n"   706                   << 
"Problem::remove_duplicate_data().";
   709        "Missing_masters_functions::construct_new_external_halo_master_node_helper()",
   710        OOMPH_EXCEPTION_LOCATION);
   716        loc_p,new_node_update_el_pt);
   719       new_node_update_f_el_pt = 
   723       int n_cont_inter_values;
   724       if (dynamic_cast<RefineableElement*>(new_node_update_f_el_pt)!=0)
   727          (new_node_update_f_el_pt)->ncont_interpolated_values();
   731         n_cont_inter_values=-1;
   733 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   734       oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
   735                  << 
"  Bool: we have a macro element mesh "   736                  << recv_unsigneds[counter_for_recv_unsigneds]
   740       if (recv_unsigneds[counter_for_recv_unsigneds++]==1)
   747 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   748       oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
   749                  << 
"  Number of macro element "   750                  << recv_unsigneds[counter_for_recv_unsigneds]
   753         unsigned macro_el_num=
   754          recv_unsigneds[counter_for_recv_unsigneds++];
   764           unsigned el_dim=q_el_pt->
dim();
   765           for (
unsigned i_dim=0;i_dim<el_dim;i_dim++)
   768              [counter_for_recv_doubles++];
   770              [counter_for_recv_doubles++];
   775           std::ostringstream error_stream;
   776           error_stream << 
"You are using a MacroElement node update\n"   777                        << 
"in a case with non-QElements. This has not\n"   778                        << 
"yet been implemented.\n";
   781             OOMPH_CURRENT_FUNCTION,
   782             OOMPH_EXCEPTION_LOCATION);
   787 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   788       oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
   789                  << 
"  Element was p-refineable "   790                  << recv_unsigneds[counter_for_recv_unsigneds]
   793       unsigned el_was_p_refineable=
   794        recv_unsigneds[counter_for_recv_unsigneds++];
   795       if(el_was_p_refineable)
   800         if(p_refineable_el_pt!=0)
   803 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   804           oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
   806                      << recv_unsigneds[counter_for_recv_unsigneds]
   810            recv_unsigneds[counter_for_recv_unsigneds++];
   815           oomph_info << 
"New node update element: " << new_node_update_el_pt << 
" (p-order = " << p_order << 
")" << std::endl;
   819           std::ostringstream error_stream;
   820           error_stream << 
"Created MacroElement node update element is not p-refineable\n"   821                        << 
"but the haloed version is.\n";
   824             "Missing_masters_functions::construct_new_external_halo_master_...()",
   825             OOMPH_EXCEPTION_LOCATION);
   829       unsigned n_node=new_node_update_f_el_pt->
nnode();
   830       for (
unsigned j=0;j<n_node;j++)
   833         add_external_halo_node_to_storage<EXT_ELEMENT>
   834          (new_nod_pt,mesh_pt,loc_p,j,new_node_update_f_el_pt,
   836           counter_for_recv_unsigneds,
   838           counter_for_recv_doubles,
   841         oomph_info << 
"Added node " << new_nod_pt << 
" at [ " << new_nod_pt->x(0) << 
", " << new_nod_pt->x(1) << 
" ]" << std::endl;
   845       oomph_info << 
"New node update element: " << new_node_update_f_el_pt << 
" (nnode_1d = " << new_node_update_f_el_pt->
nnode_1d() << 
")" << std::endl;
   849 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   850       oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
   851                  << 
"  Found internally? "   852                  << recv_unsigneds[counter_for_recv_unsigneds]
   855       unsigned found_internally = recv_unsigneds[counter_for_recv_unsigneds++];
   856 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION   857       oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
   858                  << 
"  Number of already existing external halo element "   859                  << recv_unsigneds[counter_for_recv_unsigneds]
   862       unsigned halo_element_index = recv_unsigneds[counter_for_recv_unsigneds++];
   863       if(found_internally!=0)
   868         oomph_info << 
"Existing node update element: " << new_node_update_f_el_pt << 
" (nnode_1d = " << new_node_update_f_el_pt->
nnode_1d() << 
")" << std::endl;
   869         oomph_info << 
"on proc " << loc_p << 
" at (internal) index " << halo_element_index << std::endl;
   913          (loc_p,halo_element_index));
   915         oomph_info << 
"Existing node update element: " << new_node_update_f_el_pt << 
" (nnode_1d = " << new_node_update_f_el_pt->
nnode_1d() << 
")" << std::endl;
   916         oomph_info << 
"on proc " << loc_p << 
" at (external) index " << recv_unsigneds[counter_for_recv_unsigneds-1] << std::endl;
   939      new_node_update_f_el_pt;
   955     unsigned local_node_index=0;
   957     unsigned n_node=new_node_update_f_el_pt->
nnode();
   958     for (
unsigned j=0;j<n_node;j++)
   960       if (macro_master_nod_pt==new_node_update_f_el_pt->
node_pt(j))
   982                "Node not found in update element!",
   983                "Missing_masters_functions::construct_new_external_halo_master_node_helper()",
   984                OOMPH_EXCEPTION_LOCATION);
   991      (local_node_index,s_in_macro_node_update_element);
   994      (new_node_update_f_el_pt,s_in_macro_node_update_element,
   995       geom_object_vector_pt);
   997   else if (solid_nod_pt!=0)
  1002 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION  1003       oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
  1004                  << 
"  Bool master is a boundary (solid) node "  1005                  << recv_unsigneds[counter_for_recv_unsigneds]
  1008     if (recv_unsigneds[counter_for_recv_unsigneds++]==1)
  1011       if (time_stepper_pt!=0)
  1014          (time_stepper_pt,n_lag_dim,n_lag_type,n_dim,n_position_type,n_value);
  1019          (n_lag_dim,n_lag_type,n_dim,n_position_type,n_value);
  1024 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION  1026        << 
"Rec:" << counter_for_recv_unsigneds 
  1027        << 
" Number of boundaries the solid master node is on: "   1028        << recv_unsigneds[counter_for_recv_unsigneds]
  1031       unsigned nb=recv_unsigneds[counter_for_recv_unsigneds++];
  1032       for (
unsigned i=0;
i<nb;
i++)
  1035 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION  1036         oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
  1037                    << 
" Solid master node is on boundary "   1038                    << recv_unsigneds[counter_for_recv_unsigneds]
  1042          recv_unsigneds[counter_for_recv_unsigneds++];
  1047 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION  1049        << 
"Rec:" << counter_for_recv_unsigneds 
  1050        << 
" Number of additional values created by face element "  1051        << 
"for solid master node "   1052        << recv_unsigneds[counter_for_recv_unsigneds]
  1055       unsigned n_entry=recv_unsigneds[
  1056        counter_for_recv_unsigneds++];
  1065       if (bnew_master_nod_pt==0)
  1068          "Failed to cast new node to boundary node\n",
  1069          OOMPH_CURRENT_FUNCTION,
  1070          OOMPH_EXCEPTION_LOCATION);
  1073       if(bnew_master_nod_pt->
  1074          index_of_first_value_assigned_by_face_element_pt()==0)
  1076         bnew_master_nod_pt->
  1077          index_of_first_value_assigned_by_face_element_pt()= 
  1078          new std::map<unsigned, unsigned>; 
  1083       std::map<unsigned, unsigned>* map_pt=
  1087       for (
unsigned i=0;
i<n_entry;
i++)
  1091 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION  1092         oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
  1093                    << 
" Key of map entry for solid master node"   1094                    << recv_unsigneds[counter_for_recv_unsigneds]
  1097         unsigned first=recv_unsigneds[
  1098          counter_for_recv_unsigneds++];
  1100 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION  1101         oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
  1102                    << 
" Value of map entry for solid master node"   1103                    << recv_unsigneds[counter_for_recv_unsigneds]
  1106         unsigned second=recv_unsigneds[
  1107          counter_for_recv_unsigneds++];
  1110         (*map_pt)[first]=second;
  1118       if (time_stepper_pt!=0)
  1121          (time_stepper_pt,n_lag_dim,n_lag_type,n_dim,n_position_type,n_value);
  1126          (n_lag_dim,n_lag_type,n_dim,n_position_type,n_value);
  1137     for (
unsigned i_val=0;i_val<n_solid_val;i_val++)
  1139       for (
unsigned t=0;
t<n_prev;
t++)
  1143                    recv_doubles[counter_for_recv_doubles++]);
  1149 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION  1150     oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
  1151                << 
"  Bool node is on boundary "  1152                << recv_unsigneds[counter_for_recv_unsigneds]
  1158     if (recv_unsigneds[counter_for_recv_unsigneds++]==1)
  1161       if (time_stepper_pt!=0)
  1164          (time_stepper_pt,n_dim,n_position_type,n_value);
  1169          (n_dim,n_position_type,n_value);
  1173 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION  1174       oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
  1175                  << 
" Number of boundaries the master node is on: "   1176                  << recv_unsigneds[counter_for_recv_unsigneds]
  1179       unsigned nb=recv_unsigneds[counter_for_recv_unsigneds++];
  1180       for (
unsigned i=0;
i<nb;
i++)
  1183 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION  1184         oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
  1185                    << 
"  Master node is on boundary "   1186                    << recv_unsigneds[counter_for_recv_unsigneds]
  1190          recv_unsigneds[counter_for_recv_unsigneds++];
  1196 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION  1198        << 
"Rec:" << counter_for_recv_unsigneds 
  1199        << 
" Number of additional values created by face element "  1200        << 
"for master node "   1201        << recv_unsigneds[counter_for_recv_unsigneds]
  1204       unsigned n_entry=recv_unsigneds[
  1205        counter_for_recv_unsigneds++];
  1214         if (bnew_master_nod_pt==0)
  1217            "Failed to cast new node to boundary node\n",
  1218            OOMPH_CURRENT_FUNCTION,
  1219            OOMPH_EXCEPTION_LOCATION);
  1222         if(bnew_master_nod_pt->
  1223            index_of_first_value_assigned_by_face_element_pt()==0)
  1225           bnew_master_nod_pt->
  1226            index_of_first_value_assigned_by_face_element_pt()= 
  1227            new std::map<unsigned, unsigned>; 
  1232         std::map<unsigned, unsigned>* map_pt=
  1236         for (
unsigned i=0;
i<n_entry;
i++)
  1240 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION  1241           oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
  1242                      << 
" Key of map entry for master node"   1243                      << recv_unsigneds[counter_for_recv_unsigneds]
  1246           unsigned first=recv_unsigneds[
  1247            counter_for_recv_unsigneds++];
  1249 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION  1250           oomph_info << 
"Rec:" << counter_for_recv_unsigneds 
  1251                      << 
" Value of map entry for master node"   1252                      << recv_unsigneds[counter_for_recv_unsigneds]
  1255           unsigned second=recv_unsigneds[
  1256            counter_for_recv_unsigneds++];
  1259           (*map_pt)[first]=second;
  1266       if (time_stepper_pt!=0)
  1268         new_master_nod_pt=
new Node  1269          (time_stepper_pt,n_dim,n_position_type,n_value);
  1273         new_master_nod_pt=
new Node(n_dim,n_position_type,n_value);
  1284   for (
unsigned i_val=0;i_val<n_value;i_val++)
  1286     for (
unsigned t=0;
t<n_prev;
t++)
  1288       new_master_nod_pt->
set_value(
t,i_val,recv_doubles
  1289                                    [counter_for_recv_doubles++]);
  1294   unsigned n_nod_dim=new_master_nod_pt->
ndim();
  1295   for (
unsigned idim=0;idim<n_nod_dim;idim++)
  1297     for (
unsigned t=0;
t<n_prev;
t++)
  1300       new_master_nod_pt->
x(
t,idim)=recv_doubles
  1301        [counter_for_recv_doubles++];
  1306   new_master_nod_pt->
set_halo(non_halo_proc_ID);
 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) ...
 
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...
 
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_node_pt(const unsigned &p, Node *&nod_pt)
Add external halo node whose non-halo (external) counterpart is held on processor p to the storage sc...
 
virtual void 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...
 
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 ...
 
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 ...
 
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...
 
A general Finite Element class. 
 
MacroElement * macro_element_pt(const unsigned &i)
Access to i-th macro element. 
 
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
 
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones). 
 
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. 
 
GeomObject * geom_object_list_pt(const unsigned &i)
Access function to the ith GeomObject. 
 
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...
 
unsigned ndim() const
Return (Eulerian) spatial dimension of the node. 
 
Base class for Qelements. 
 
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...
 
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. 
 
A class that contains the information required by Nodes that are located on Mesh boundaries. A BoundaryNode of a particular type is obtained by combining a given Node with this class. By differentiating between Nodes and BoundaryNodes we avoid a lot of un-necessary storage in the bulk Nodes. 
 
void add_external_halo_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. 
 
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. 
 
A template Class for BoundaryNodes; that is Nodes that MAY live on the boundary of a Mesh...
 
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...
 
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...
 
Domain *& macro_domain_pt()
Broken assignment operator. 
 
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...
 
Data *const  & variable_position_pt() const
Pointer to variable_position data (const version) 
 
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. 
 
Class that contains data for hanging nodes. 
 
Node *& node_pt(const unsigned long &n)
Return pointer to global node n. 
 
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 set_halo(const unsigned &non_halo_proc_ID)
Label the node as halo and specify processor that holds non-halo counterpart. 
 
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) 
 
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...
 
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. 
 
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overloa...
 
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper. 
 
p-refineable version of RefineableElement 
 
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...
 
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. 
 
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...
 
unsigned nnode() const
Return the number of nodes. 
 
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
 
Vector< GeomObject * > geom_object_vector_pt()
Access function to the vector of GeomObject. 
 
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...