39 #ifndef OOMPH_MULTI_DOMAIN_HEADER 40 #define OOMPH_MULTI_DOMAIN_HEADER 44 #include <oomph-lib-config.h> 66 namespace Multi_domain_functions
137 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION 201 template<
class BULK_ELEMENT,
unsigned DIM>
205 Mesh*
const &bulk_mesh_pt,
207 const unsigned& interaction=0);
216 template<
class BULK_ELEMENT,
unsigned DIM>
219 const unsigned& boundary_in_bulk_mesh,
220 Mesh*
const& bulk_mesh_pt,
221 Mesh*
const& face_mesh_pt,
222 const unsigned& interaction=0);
235 template<
class ELEMENT_0,
class ELEMENT_1>
237 Mesh*
const &first_mesh_pt,
238 Mesh*
const &second_mesh_pt,
239 const unsigned& first_interaction=0,
240 const unsigned& second_interaction=0);
255 template<
class EXT_ELEMENT>
257 Mesh*
const &mesh_pt,
258 Mesh*
const &external_mesh_pt,
259 const unsigned& interaction_index=0);
284 template<
class EXT_ELEMENT,
class FACE_ELEMENT_GEOM_OBJECT>
286 Mesh*
const &mesh_pt,
287 Mesh*
const &external_mesh_pt,
288 Mesh*
const &external_face_mesh_pt,
289 const unsigned& interaction_index=0);
319 template<
class EXT_ELEMENT,
class FACE_ELEMENT_GEOM_OBJECT>
323 Mesh*
const &external_mesh_pt,
325 const unsigned& interaction_index=0);
329 template<
class EXT_ELEMENT,
class GEOM_OBJECT>
332 Mesh*
const &mesh_pt,
333 Mesh*
const &external_mesh_pt,
334 const unsigned& interaction_index,
335 Mesh*
const &external_face_mesh_pt=0);
338 template<
class EXT_ELEMENT,
class GEOM_OBJECT>
342 Mesh*
const &external_mesh_pt,
343 const unsigned& interaction_index,
352 const unsigned& interaction_index);
365 int& iproc,
Mesh*
const &external_mesh_pt,
Problem* problem_pt,
377 template<
class EXT_ELEMENT>
380 Problem* problem_pt,
const unsigned& interaction_index);
388 Mesh*
const &external_mesh_pt,
389 int& n_cont_inter_values);
395 int& iproc,
Node* nod_pt,
397 Mesh*
const &external_mesh_pt,
398 int& n_cont_inter_values);
404 Mesh*
const &external_mesh_pt,
405 int& n_cont_inter_values);
410 Mesh*
const &external_mesh_pt,
411 int& n_cont_inter_values);
418 Mesh*
const &external_mesh_pt,
419 int& n_cont_inter_values);
425 (
int& iproc,
Node* master_nod_pt,
Problem* problem_pt,
426 Mesh*
const &external_mesh_pt,
int& n_cont_inter_values);
432 template<
class EXT_ELEMENT>
434 Mesh*
const &external_mesh_pt,
436 unsigned& node_index,
438 int& n_cont_inter_values,
443 template<
class EXT_ELEMENT>
445 (
Node* &new_nod_pt,
Mesh*
const &external_mesh_pt,
unsigned& loc_p,
447 int& n_cont_inter_values,
453 Mesh*
const &external_mesh_pt,
455 unsigned& node_index,
457 int& n_cont_inter_values,
461 template<
class EXT_ELEMENT>
464 Mesh*
const &external_mesh_pt,
466 int& n_cont_inter_values,
474 unsigned& node_index,
477 Mesh*
const &external_mesh_pt,
482 template<
class EXT_ELEMENT>
484 (
Node* &new_master_nod_pt,
Node* &nod_pt,
unsigned& loc_p,
485 Mesh*
const &external_mesh_pt,
Problem* problem_pt);
493 Mesh*
const &external_mesh_pt);
void setup_bulk_elements_adjacent_to_face_mesh(Problem *problem_pt, Vector< unsigned > &boundary_in_bulk_mesh, Mesh *const &bulk_mesh_pt, Vector< Mesh *> &face_mesh_pt, const unsigned &interaction=0)
Identify the FaceElements (stored in the mesh pointed to by face_mesh_pt) that are adjacent to the bu...
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.
void setup_multi_domain_interaction(Problem *problem_pt, Mesh *const &mesh_pt, Mesh *const &external_mesh_pt, const unsigned &interaction_index=0)
Function to set up the one-way multi-domain interaction for problems where the meshes pointed to by m...
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...
void aux_setup_multi_domain_interaction(Problem *problem_pt, Mesh *const &mesh_pt, Mesh *const &external_mesh_pt, const unsigned &interaction_index, Mesh *const &external_face_mesh_pt=0)
Auxiliary helper function.
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...
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 ...
void recursively_add_masters_of_external_halo_node_to_storage(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)
Recursively add masters of external halo nodes (and their masters, etc) based on information received...
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...
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
std::ofstream Doc_boundary_coordinate_file
Output file to document the boundary coordinate along the mesh boundary of the bulk mesh during call ...
Vector< unsigned > Flat_packed_unsigneds
Vector of flat-packed unsigneds to be communicated with other processors – this is really "private" ...
unsigned Dim
Dimension of zeta tuples (set by get_dim_helper) – needed because we store the scalar coordinates in...
bool Doc_full_stats
Boolean to indicate whether to output further info during setup_multi_domain_interaction() routines...
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...
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
void construct_new_external_halo_master_node_helper(Node *&new_master_nod_pt, Node *&nod_pt, unsigned &loc_p, Mesh *const &external_mesh_pt, Problem *problem_pt)
Helper function which constructs a new external halo master node with the information sent from the h...
void clean_up()
Helper function that clears all the intermediate information used during the external storage creatio...
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.
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...
Vector< double > Flat_packed_doubles
Vector of flat-packed doubles to be communicated with other processors.
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 add_external_halo_master_node_helper(Node *&new_master_nod_pt, Node *&new_nod_pt, Mesh *const &external_mesh_pt, unsigned &loc_p, int &n_cont_inter_values, Problem *problem_pt)
Helper function to add external halo node that is a master.
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...
Vector< Vector< unsigned > > External_element_located
Lookup scheme for whether a local element's integration point has had an external element assigned to...
void create_external_halo_elements(int &iproc, const Vector< Mesh *> &mesh_pt, Mesh *const &external_mesh_pt, Problem *problem_pt, const unsigned &interaction_index)
Create external (halo) elements on the loop process based on the information received from each locat...
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...
bool Doc_stats
Boolean to indicate whether to output basic info during setup_multi_domain_interaction() routines...
void add_external_halo_node_to_storage(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 function to add external halo nodes, including any masters, based on information received from...
Vector< unsigned > Located_element_status
Vector to indicate (to another processor) whether a located element (that will have to represented as...
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.
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.
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...
void setup_multi_domain_interactions(Problem *problem_pt, Mesh *const &first_mesh_pt, Mesh *const &second_mesh_pt, const unsigned &first_interaction=0, const unsigned &second_interaction=0)
Set up the two-way multi-domain interactions for the problem pointed to by problem_pt. Use this for cases where first_mesh_pt and second_mesh_pt occupy the same physical space and are populated by ELEMENT_0 and ELEMENT_1 respectively, and are combined to solve a single problem. The elements in two meshes interact both ways the elements in each mesh act as "external elements" for the elements in the "other" mesh. The interaction indices allow the specification of which interaction we're setting up in the two meshes. They default to zero, which is appropriate if there's only a single interaction.