29#ifndef OOMPH_MISSING_MASTERS_TEMPLATE_HEADER
30#define OOMPH_MISSING_MASTERS_TEMPLATE_HEADER
34#include <oomph-lib-config.h>
61 template<
class EXT_ELEMENT>
104 template<
class EXT_ELEMENT>
108 Mesh*
const& mesh_pt,
119#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
121 <<
" Boolean to indicate that continuously interpolated "
123 <<
i_cont <<
" is hanging "
128#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
130 <<
" Number of master nodes "
176 template<
class EXT_ELEMENT>
180 Mesh*
const& mesh_pt,
190#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
193 <<
" Boolean to trigger construction of new external halo master node "
212#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
214 <<
" Existing external halo node was found externally (0) or "
222#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
224 <<
" index of existing (internal) halo master node "
233#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
235 <<
" index of existing external halo master node "
249 template<
class EXT_ELEMENT>
255 Mesh*
const& mesh_pt,
263#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
265 <<
" ndim for external halo master node "
269#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
271 <<
" nposition type for external halo master node "
275#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
277 <<
" nvalue for external halo master node "
281#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
283 <<
" non-halo processor ID for external halo master node "
294#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
296 <<
" nlagrdim for external halo master solid node "
300#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
302 <<
" nlagrtype for external halo master solid node "
327#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
329 <<
" Boolean for algebraic boundary node "
337 if (time_stepper_pt != 0)
349#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
351 <<
" Number of boundaries the algebraic master node is on: "
355 for (
unsigned i = 0;
i <
nb;
i++)
358#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
360 <<
" Algebraic master node is on boundary "
369#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
371 <<
"Number of additional values created by face element "
372 <<
"for master node "
386 throw OomphLibError(
"Failed to cast new node to boundary node\n",
392 ->index_of_first_value_assigned_by_face_element_pt() == 0)
395 ->index_of_first_value_assigned_by_face_element_pt() =
396 new std::map<unsigned, unsigned>;
401 std::map<unsigned, unsigned>*
map_pt =
403 ->index_of_first_value_assigned_by_face_element_pt();
410#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
412 <<
" Key of map entry for master node"
418#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
420 <<
" Value of map entry for master node"
434 if (time_stepper_pt != 0)
452#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
454 <<
" algebraic node update id for master node "
463#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
465 <<
" algebraic node number of ref values for master node "
481#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
483 <<
" algebraic node number of geom objects for master node "
495#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
497 <<
" algebraic node: " <<
i_geom <<
"-th out of "
524#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
526 <<
" Boolean for master algebraic node is boundary node "
532 if (time_stepper_pt != 0)
545#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
548 <<
" Number of boundaries the macro element master node is on: "
552 for (
unsigned i = 0;
i <
nb;
i++)
555#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
557 <<
" Macro element master node is on boundary "
565#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
567 <<
" Number of additional values created by face element "
568 <<
"for macro element master node "
582 throw OomphLibError(
"Failed to cast new node to boundary node\n",
588 ->index_of_first_value_assigned_by_face_element_pt() == 0)
591 ->index_of_first_value_assigned_by_face_element_pt() =
592 new std::map<unsigned, unsigned>;
597 std::map<unsigned, unsigned>*
map_pt =
599 ->index_of_first_value_assigned_by_face_element_pt();
606#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
608 <<
" Key of map entry for macro element master node"
614#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
616 <<
" Value of map entry for macro element master node"
630 if (time_stepper_pt != 0)
650#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
652 <<
" Bool: need new external halo element "
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()",
684 ->ncont_interpolated_values();
690#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
692 <<
" Bool: we have a macro element mesh "
702#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
704 <<
" Number of macro element "
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";
739#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
741 <<
" Element was p-refineable "
754#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
766 <<
" (p-order = " << p_order <<
")" << std::endl;
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_...()",
809#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
811 <<
" Found internally? "
816#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
818 <<
" Number of already existing external halo element "
828 oomph_info <<
"Existing node update element: "
888 oomph_info <<
"Existing node update element: "
908 geom_object_vector_pt =
macro_mesh_pt->geom_object_vector_pt();
963 "Missing_masters_functions::construct_new_"
964 "external_halo_master_node_helper()",
976 geom_object_vector_pt);
983#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
985 <<
" Bool master is a boundary (solid) node "
991 if (time_stepper_pt != 0)
1008#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1010 <<
" Number of boundaries the solid master node is on: "
1014 for (
unsigned i = 0;
i <
nb;
i++)
1017#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1019 <<
" Solid master node is on boundary "
1027#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1029 <<
" Number of additional values created by face element "
1030 <<
"for solid master node "
1044 throw OomphLibError(
"Failed to cast new node to boundary node\n",
1050 ->index_of_first_value_assigned_by_face_element_pt() == 0)
1053 ->index_of_first_value_assigned_by_face_element_pt() =
1054 new std::map<unsigned, unsigned>;
1059 std::map<unsigned, unsigned>*
map_pt =
1061 ->index_of_first_value_assigned_by_face_element_pt();
1068#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1070 <<
" Key of map entry for solid master node"
1076#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1078 <<
" Value of map entry for solid master node"
1092 if (time_stepper_pt != 0)
1128#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1130 <<
" Bool node is on boundary "
1139 if (time_stepper_pt != 0)
1151#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1153 <<
" Number of boundaries the master node is on: "
1157 for (
unsigned i = 0;
i <
nb;
i++)
1160#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1162 <<
" Master node is on boundary "
1171#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1173 <<
" Number of additional values created by face element "
1174 <<
"for master node "
1188 throw OomphLibError(
"Failed to cast new node to boundary node\n",
1194 ->index_of_first_value_assigned_by_face_element_pt() == 0)
1197 ->index_of_first_value_assigned_by_face_element_pt() =
1198 new std::map<unsigned, unsigned>;
1203 std::map<unsigned, unsigned>*
map_pt =
1205 ->index_of_first_value_assigned_by_face_element_pt();
1212#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1214 <<
" Key of map entry for master node"
1220#ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
1222 <<
" Value of map entry for master node"
1236 if (time_stepper_pt != 0)
Algebraic meshes contain AlgebraicElements and AlgebraicNodes. They implement the node update functio...
Algebraic nodes are nodes with an algebraic positional update function.
A class that contains the information required by Nodes that are located on Mesh boundaries....
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
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)
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.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
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.
void set_halo(const unsigned &non_halo_proc_ID)
Label the element as halo and specify processor that holds non-halo counterpart.
unsigned ndim() const
Access function to # of Eulerian coordinates.
Class that contains data for hanging nodes.
MacroElementNodeUpdateMeshes contain MacroElementNodeUpdateNodes which have their own node update fun...
MacroElementNodeUpdate nodes are nodes with a positional update function, based on their element's Ma...
void add_boundary_node(const unsigned &b, Node *const &node_pt)
Add a (pointer to) a node to the b-th boundary.
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...
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_element_pt(const unsigned &p, GeneralisedElement *&el_pt)
Add external halo element whose non-halo counterpart is held on processor p to this Mesh.
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
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_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...
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.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
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....
p-refineable version of RefineableElement
Base class for Qelements.
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
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.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...