multi_domain.h
Go to the documentation of this file.
1 //LIC// ====================================================================
2 //LIC// This file forms part of oomph-lib, the object-oriented,
3 //LIC// multi-physics finite-element library, available
4 //LIC// at http://www.oomph-lib.org.
5 //LIC//
6 //LIC// Version 1.0; svn revision $LastChangedRevision$
7 //LIC//
8 //LIC// $LastChangedDate$
9 //LIC//
10 //LIC// Copyright (C) 2006-2016 Matthias Heil and Andrew Hazel
11 //LIC//
12 //LIC// This library is free software; you can redistribute it and/or
13 //LIC// modify it under the terms of the GNU Lesser General Public
14 //LIC// License as published by the Free Software Foundation; either
15 //LIC// version 2.1 of the License, or (at your option) any later version.
16 //LIC//
17 //LIC// This library is distributed in the hope that it will be useful,
18 //LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 //LIC// Lesser General Public License for more details.
21 //LIC//
22 //LIC// You should have received a copy of the GNU Lesser General Public
23 //LIC// License along with this library; if not, write to the Free Software
24 //LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 //LIC// 02110-1301 USA.
26 //LIC//
27 //LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
28 //LIC//
29 //LIC//====================================================================
30 //Header file for multi-domain functions, including the class
31 //ElementWithExternalElement which stores pointers to external elements
32 
33 // Temporary flag to enable full annotation of multi domain
34 // comms (but keep alive because it would be such a bloody pain to
35 // rewrite it if things ever go wrong again...)
36 //#define ANNOTATE_MULTI_DOMAIN_COMMUNICATION
37 
38 //Include guards to prevent multiple inclusion of the header
39 #ifndef OOMPH_MULTI_DOMAIN_HEADER
40 #define OOMPH_MULTI_DOMAIN_HEADER
41 
42 // Config header generated by autoconfig
43 #ifdef HAVE_CONFIG_H
44 #include <oomph-lib-config.h>
45 #endif
46 
47 //Oomph-lib headers
48 #include "geom_objects.h"
49 #include "problem.h"
50 #include "shape.h"
51 
52 #include "mesh.h"
54 #include "algebraic_elements.h"
56 #include "Qelements.h"
58 
59 
60 namespace oomph
61 {
62 
63 //======================================================================
64 // Namespace for global multi-domain functions
65 //======================================================================
66 namespace Multi_domain_functions
67  {
68 
69  /// \short Boolean to indicate that failure in setup multi domain
70  /// functions is acceptable; defaults to false. If set to true
71  /// external element pointers are set to null for those elements
72  /// for which external elements couldn't be located.
74 
75  /// \short Dimension of zeta tuples (set by get_dim_helper) -- needed
76  /// because we store the scalar coordinates in flat-packed form.
77  extern unsigned Dim;
78 
79  /// \short Lookup scheme for whether a local element's integration point
80  /// has had an external element assigned to it -- essentially boolean.
81  /// External_element_located[e][ipt] = {0,1} if external element
82  /// for ipt-th integration in local element e {has not, has} been found.
83  /// Used locally to ensure that we're not searching for the same
84  /// elements over and over again when we go around the spirals.
85  extern Vector<Vector<unsigned> > External_element_located;
86 
87  /// \short Vector of flat-packed zeta coordinates for which the external
88  /// element could not be found during current local search. These
89  /// will be sent to the next processor in the ring-like parallel search.
90  /// The zeta coordinates come in groups of Dim (scalar) coordinates.
91  extern Vector<double> Flat_packed_zetas_not_found_locally;
92 
93  /// \short Vector of flat-packed zeta coordinates for which the external
94  /// element could not be found on another processor and for which
95  /// we're currently searching here. Whatever can't be found here,
96  /// gets written into Flat_packed_zetas_not_found_locally and then
97  /// passed on to the next processor during the ring-like parallel search.
98  /// The zeta coordinates come in groups of Dim (scalar) coordinates.
99  extern Vector<double> Received_flat_packed_zetas_to_be_found;
100 
101  /// \short Proc_id_plus_one_of_external_element[i] contains the
102  /// processor id (plus one) of the processor
103  /// on which the i-th zeta coordinate tuple received from elsewhere
104  /// (in the order in which these are stored in
105  /// Received_flat_packed_zetas_to_be_found) was located; it's zero if
106  /// it wasn't found during the current stage of the ring-like parallel
107  /// search.
108  extern Vector<int> Proc_id_plus_one_of_external_element;
109 
110  /// \short Vector to indicate (to another processor) whether a
111  /// located element (that will have to represented as an external
112  /// halo element on that processor) should be newly created on that
113  /// processor (2), already exists on that processor (1), or
114  /// is not on the current processor either (0).
115  extern Vector<unsigned> Located_element_status;
116 
117  /// \short Vector of flat-packed local coordinates for zeta tuples
118  /// that have been located
119  extern Vector<double> Flat_packed_located_coordinates;
120 
121  /// \short Vector of flat-packed doubles to be communicated with
122  /// other processors
123  extern Vector<double> Flat_packed_doubles;
124 
125  /// \short Counter used when processing vector of flat-packed
126  /// doubles -- this is really "private" data, declared here
127  /// to avoid having to pass it (and the associated array)
128  /// between the various helper functions
129  extern unsigned Counter_for_flat_packed_doubles;
130 
131  /// \short Vector of flat-packed unsigneds to be communicated with
132  /// other processors -- this is really "private" data, declared here
133  /// to avoid having to pass the array between the various helper
134  /// functions
135  extern Vector<unsigned> Flat_packed_unsigneds;
136 
137 #ifdef ANNOTATE_MULTI_DOMAIN_COMMUNICATION
138 
139  // Temporary vector of strings to enable full annotation of multi domain
140  // comms (but keep alive because it would be such a bloody pain to
141  // rewrite it if things ever go wrong again...)
142  extern Vector<std::string> Flat_packed_unsigneds_string;
143 
144 #endif
145 
146  /// \short Counter used when processing vector of flat-packed
147  /// unsigneds -- this is really "private" data, declared here
148  /// to avoid having to pass it (and the associated array)
149  /// between the various helper functions
150  extern unsigned Counter_for_flat_packed_unsigneds;
151 
152  /// \short Enumerators for element status in location procedure
153  enum{ New, Exists, Not_found};
154 
155  /// \short Boolean to indicate when to use the bulk element as the
156  /// external element. Defaults to false, you must have set up FaceElements
157  /// properly first in order for it to work
158  extern bool Use_bulk_element_as_external;
159 
160  /// \short Boolean to indicate if we're allowed to use halo elements
161  /// as external elements. Can drastically reduce the number of
162  /// external halo elements -- currently not aware of any problems
163  /// therefore set to true by default but retention
164  /// of this flag allows easy return to previous implementation.
166 
167  /// \short Indicate whether we are allowed to use halo elements as
168  /// external elements for projection, possibly only required in
169  /// parallel unstructured mesh generation during the projection
170  /// stage. Default set to true
172 
173  /// \short Boolean to indicate whether to doc timings or not.
174  extern bool Doc_timings;
175 
176  /// \short Boolean to indicate whether to document basic info (to screen)
177  /// during setup_multi_domain_interaction() routines
178  extern bool Doc_stats;
179 
180  /// \short Boolean to indicate whether to document further info (to screen)
181  /// during setup_multi_domain_interaction() routines
182  extern bool Doc_full_stats;
183 
184  /// \short Output file to document the boundary coordinate
185  /// along the mesh boundary of the bulk mesh during call to
186  /// setup_bulk_elements_adjacent_to_face_mesh(...)
187  extern std::ofstream Doc_boundary_coordinate_file;
188 
189 
190  // Functions for multi-domain method
191 
192  /// \short Identify the \c FaceElements (stored in the mesh pointed to by
193  /// \c face_mesh_pt) that are adjacent to the bulk elements next to the
194  /// \c boundary_in_bulk_mesh -th boundary of the mesh pointed to by
195  /// \c bulk_mesh_pt. The \c FaceElements must be derived
196  /// from the \c ElementWithExternalElement base class and the adjacent
197  /// bulk elements are stored as their external elements.
198  ///
199  /// This is the vector-based version which deals with multiple bulk
200  /// mesh boundaries at the same time.
201  template<class BULK_ELEMENT, unsigned DIM>
203  Problem* problem_pt,
204  Vector<unsigned>& boundary_in_bulk_mesh,
205  Mesh* const &bulk_mesh_pt,
206  Vector<Mesh*>& face_mesh_pt,
207  const unsigned& interaction=0);
208 
209 
210  /// \short Identify the \c FaceElements (stored in the mesh pointed to by
211  /// \c face_mesh_pt) that are adjacent to the bulk elements next to the
212  /// \c boundary_in_bulk_mesh -th boundary of the mesh pointed to by
213  /// \c bulk_mesh_pt. The \c FaceElements must be derived
214  /// from the \c ElementWithExternalElement base class and the adjacent
215  /// bulk elements are stored as their external elements.
216  template<class BULK_ELEMENT,unsigned DIM>
218  Problem* problem_pt,
219  const unsigned& boundary_in_bulk_mesh,
220  Mesh* const& bulk_mesh_pt,
221  Mesh* const& face_mesh_pt,
222  const unsigned& interaction=0);
223 
224  /// \short Set up the two-way multi-domain interactions for the
225  /// problem pointed to by \c problem_pt.
226  /// Use this for cases where first_mesh_pt and second_mesh_pt
227  /// occupy the same physical space and are populated by
228  /// ELEMENT_0 and ELEMENT_1 respectively, and are combined to solve
229  /// a single problem. The elements in two meshes interact both ways
230  /// the elements in each mesh act as "external elements" for the
231  /// elements in the "other" mesh. The interaction indices allow the
232  /// specification of which interaction we're setting up in the two
233  /// meshes. They default to zero, which is appropriate if there's
234  /// only a single interaction.
235  template<class ELEMENT_0,class ELEMENT_1>
236  void setup_multi_domain_interactions(Problem* problem_pt,
237  Mesh* const &first_mesh_pt,
238  Mesh* const &second_mesh_pt,
239  const unsigned& first_interaction=0,
240  const unsigned& second_interaction=0);
241 
242  /// \short Function to set up the one-way multi-domain interaction for
243  /// problems where the meshes pointed to by \c mesh_pt and \c external_mesh_pt
244  /// occupy the same physical space, and the elements in \c external_mesh_pt
245  /// act as "external elements" for the \c ElementWithExternalElements
246  /// in \c mesh_pt (but not vice versa):
247  /// - \c mesh_pt points to the mesh of ElemenWithExternalElements for which
248  /// the interaction is set up.
249  /// - \c external_mesh_pt points to the mesh that contains the elements
250  /// of type EXT_ELEMENT that act as "external elements" for the
251  /// \c ElementWithExternalElements in \ mesh_pt.
252  /// - The interaction_index parameter defaults to zero and must be otherwise
253  /// set by the user if there is more than one mesh that provides sources
254  /// for the Mesh pointed to by mesh_pt.
255  template<class EXT_ELEMENT>
256  void setup_multi_domain_interaction(Problem* problem_pt,
257  Mesh* const &mesh_pt,
258  Mesh* const &external_mesh_pt,
259  const unsigned& interaction_index=0);
260 
261  /// \short Function to set up the one-way multi-domain interaction for
262  /// FSI-like problems.
263  /// - \c mesh_pt points to the mesh of \c ElemenWithExternalElements for which
264  /// the interaction is set up. In an FSI example, this mesh would contain
265  /// the \c FSIWallElements (either beam/shell elements or the
266  /// \c FSISolidTractionElements that apply the traction to
267  /// a "bulk" solid mesh that is loaded by the fluid.)
268  /// - \c external_mesh_pt points to the mesh that contains the elements
269  /// of type EXT_ELEMENT that provide the "source" for the
270  /// \c ElementWithExternalElements. In an FSI example, this
271  /// mesh would contain the "bulk" fluid elements.
272  /// - \c external_face_mesh_pt points to the mesh of \c FaceElements
273  /// attached to the \c external_mesh_pt. The mesh pointed to by
274  /// \c external_face_mesh_pt has the same dimension as \c mesh_pt.
275  /// The elements contained in \c external_face_mesh_pt are of type
276  /// FACE_ELEMENT_GEOM_OBJECT. In an FSI example, these elements
277  /// are usually the \c FaceElementAsGeomObjects (templated by the
278  /// type of the "bulk" fluid elements to which they are attached)
279  /// that define the FSI boundary of the fluid domain.
280  /// - The interaction_index parameter defaults to zero and must otherwise be
281  /// set by the user if there is more than one mesh that provides "external
282  /// elements" for the Mesh pointed to by mesh_pt (e.g. in the case
283  /// when a beam or shell structure is loaded by fluid from both sides.)
284  template<class EXT_ELEMENT, class FACE_ELEMENT_GEOM_OBJECT>
285  void setup_multi_domain_interaction(Problem* problem_pt,
286  Mesh* const &mesh_pt,
287  Mesh* const &external_mesh_pt,
288  Mesh* const &external_face_mesh_pt,
289  const unsigned& interaction_index=0);
290 
291 
292 
293  /// \short Function to set up the one-way multi-domain interaction for
294  /// FSI-like problems.
295  /// - \c mesh_pt points to the mesh of \c ElemenWithExternalElements for which
296  /// the interaction is set up. In an FSI example, this mesh would contain
297  /// the \c FSIWallElements (either beam/shell elements or the
298  /// \c FSISolidTractionElements that apply the traction to
299  /// a "bulk" solid mesh that is loaded by the fluid.)
300  /// - \c external_mesh_pt points to the mesh that contains the elements
301  /// of type EXT_ELEMENT that provide the "source" for the
302  /// \c ElementWithExternalElements. In an FSI example, this
303  /// mesh would contain the "bulk" fluid elements.
304  /// - \c external_face_mesh_pt points to the mesh of \c FaceElements
305  /// attached to the \c external_mesh_pt. The mesh pointed to by
306  /// \c external_face_mesh_pt has the same dimension as \c mesh_pt.
307  /// The elements contained in \c external_face_mesh_pt are of type
308  /// FACE_ELEMENT_GEOM_OBJECT. In an FSI example, these elements
309  /// are usually the \c FaceElementAsGeomObjects (templated by the
310  /// type of the "bulk" fluid elements to which they are attached)
311  /// that define the FSI boundary of the fluid domain.
312  /// - The interaction_index parameter defaults to zero and must otherwise be
313  /// set by the user if there is more than one mesh that provides "external
314  /// elements" for the Mesh pointed to by mesh_pt (e.g. in the case
315  /// when a beam or shell structure is loaded by fluid from both sides.)
316  /// .
317  /// This is the vector-based version which operates simultaneously
318  /// on the meshes contained in the Vector arguments.
319  template<class EXT_ELEMENT, class FACE_ELEMENT_GEOM_OBJECT>
321  Problem* problem_pt,
322  const Vector<Mesh*>& mesh_pt,
323  Mesh* const &external_mesh_pt,
324  const Vector<Mesh*>& external_face_mesh_pt,
325  const unsigned& interaction_index=0);
326 
327 
328  /// Auxiliary helper function
329  template<class EXT_ELEMENT, class GEOM_OBJECT>
331  Problem* problem_pt,
332  Mesh* const &mesh_pt,
333  Mesh* const &external_mesh_pt,
334  const unsigned& interaction_index,
335  Mesh* const &external_face_mesh_pt=0);
336 
337  /// Auxiliary helper function
338  template<class EXT_ELEMENT, class GEOM_OBJECT>
340  Problem* problem_pt,
341  const Vector<Mesh*>& mesh_pt,
342  Mesh* const &external_mesh_pt,
343  const unsigned& interaction_index,
344  const Vector<Mesh*>& external_face_mesh_pt);
345 
346  /// \short Helper function to locate "local" zeta coordinates
347  /// This is the vector-based version which operates simultaenously
348  /// on the meshes contained in the Vectors.
350  (const Vector<Mesh*>& mesh_pt, Mesh* const &external_mesh_pt,
351  Vector<MeshAsGeomObject*>& mesh_geom_obj_pt,
352  const unsigned& interaction_index);
353 
354 
355 #ifdef OOMPH_HAS_MPI
356 
357  /// \short Helper function to send any "missing" zeta coordinates to
358  /// the next process and receive any coordinates from previous process
359  void send_and_receive_missing_zetas(Problem* problem_pt);
360 
361  /// \short Helper function to locate these "missing" zeta coordinates.
362  /// This is the vector-based function which operates simultaneously
363  /// on the meshes contained in the vectors.
365  int& iproc, Mesh* const &external_mesh_pt,Problem* problem_pt,
366  Vector<MeshAsGeomObject*>& mesh_geom_obj_pt);
367 
368 
369  /// \short Helper function to send back any located information
370  void send_and_receive_located_info(int& iproc, Mesh* const &external_mesh_pt,
371  Problem* problem_pt);
372 
373  /// \short Create external (halo) elements on the loop process based on the
374  /// information received from each locate_zeta call on other processes
375  /// This is the vector-based function which operates simultaneously
376  /// on the meshes contained in the vectors.
377  template<class EXT_ELEMENT>
379  (int& iproc, const Vector<Mesh*>& mesh_pt, Mesh* const &external_mesh_pt,
380  Problem* problem_pt, const unsigned& interaction_index);
381 
382  // Helper functions for external haloed node identification
383 
384  /// \short Helper function to add external haloed nodes, inc. masters
385  /// of external haloed nodes
386  void add_external_haloed_node_to_storage(int& iproc, Node* nod_pt,
387  Problem* problem_pt,
388  Mesh* const &external_mesh_pt,
389  int& n_cont_inter_values);
390 
391 
392  /// \short Recursively add any master nodes (and their master nodes etc)
393  /// of external haloed nodes
395  int& iproc, Node* nod_pt,
396  Problem* problem_pt,
397  Mesh* const &external_mesh_pt,
398  int& n_cont_inter_values);
399 
400 
401  /// \short Helper function to add external haloed node that is not a master
402  void add_external_haloed_node_helper(int& iproc, Node* nod_pt,
403  Problem* problem_pt,
404  Mesh* const &external_mesh_pt,
405  int& n_cont_inter_values);
406 
407  /// \short Helper function to add external haloed node that is a master
408  void add_external_haloed_master_node_helper(int& iproc,Node* master_nod_pt,
409  Problem* problem_pt,
410  Mesh* const &external_mesh_pt,
411  int& n_cont_inter_values);
412 
413  /// \short Helper function to get the required nodal information from an
414  /// external haloed node so that a fully-functional external halo
415  /// node (and therefore element) can be created on the receiving process
416  void get_required_nodal_information_helper(int& iproc, Node* nod_pt,
417  Problem* problem_pt,
418  Mesh* const &external_mesh_pt,
419  int& n_cont_inter_values);
420 
421  /// \short Helper function to get the required master nodal information from
422  /// an external haloed master node so that a fully-functional external halo
423  /// master node (and possible element) can be created on the receiving proc
425  (int& iproc, Node* master_nod_pt, Problem* problem_pt,
426  Mesh* const &external_mesh_pt, int& n_cont_inter_values);
427 
428  // Helper functions for external halo node identification
429 
430  /// \short Helper function to add external halo nodes, including any masters,
431  /// based on information received from the haloed process
432  template<class EXT_ELEMENT>
433  void add_external_halo_node_to_storage(Node* &new_nod_pt,
434  Mesh* const &external_mesh_pt,
435  unsigned& loc_p,
436  unsigned& node_index,
437  FiniteElement* const &new_el_pt,
438  int& n_cont_inter_values,
439  Problem* problem_pt);
440 
441  /// \short Recursively add masters of external halo nodes (and their
442  /// masters, etc) based on information received from the haloed process
443  template<class EXT_ELEMENT>
445  (Node* &new_nod_pt, Mesh* const &external_mesh_pt, unsigned& loc_p,
446  unsigned& node_index, FiniteElement* const &new_el_pt,
447  int& n_cont_inter_values,
448  Problem* problem_pt);
449 
450 
451  /// \short Helper function to add external halo node that is not a master
452  void add_external_halo_node_helper(Node* &new_nod_pt,
453  Mesh* const &external_mesh_pt,
454  unsigned& loc_p,
455  unsigned& node_index,
456  FiniteElement* const &new_el_pt,
457  int& n_cont_inter_values,
458  Problem* problem_pt);
459 
460  /// \short Helper function to add external halo node that is a master
461  template<class EXT_ELEMENT>
462  void add_external_halo_master_node_helper(Node* &new_master_nod_pt,
463  Node* &new_nod_pt,
464  Mesh* const &external_mesh_pt,
465  unsigned& loc_p,
466  int& n_cont_inter_values,
467  Problem* problem_pt);
468 
469 
470  /// \short Helper function which constructs a new external halo node
471  /// (on an element) with the information sent from the haloed process
473  unsigned& loc_p,
474  unsigned& node_index,
475  FiniteElement* const
476  &new_el_pt,
477  Mesh* const &external_mesh_pt,
478  Problem* problem_pt);
479 
480  /// \short Helper function which constructs a new external halo master node
481  /// with the information sent from the haloed process
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);
486 
487 #endif
488 
489  /// \short Helper function that computes the dimension of the elements within
490  /// each of the specified meshes (and checks they are the same)
491  /// Stores result in Dim.
492  void get_dim_helper(Problem* problem_pt, Mesh* const &mesh_pt,
493  Mesh* const &external_mesh_pt);
494 
495  /// \short Helper function that clears all the intermediate information used
496  /// during the external storage creation at the end of the procedure
497  void clean_up();
498 
499  }
500 
501 
502 }
503 
504 #endif
505 
506 
507 
508 
509 
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...
Definition: multi_domain.cc:88
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 ...
The Problem class.
Definition: problem.h:152
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.
Definition: elements.h:1274
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...
Definition: multi_domain.cc:62
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
Definition: nodes.h:852
std::ofstream Doc_boundary_coordinate_file
Output file to document the boundary coordinate along the mesh boundary of the bulk mesh during call ...
Definition: multi_domain.cc:53
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...
Definition: multi_domain.cc:66
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&#39;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...
Definition: multi_domain.cc:97
Vector< Vector< unsigned > > External_element_located
Lookup scheme for whether a local element&#39;s integration point has had an external element assigned to...
Definition: multi_domain.cc:74
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...
Definition: multi_domain.cc:80
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...
A general mesh class.
Definition: mesh.h:74
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&#39;re setting up in the two meshes. They default to zero, which is appropriate if there&#39;s only a single interaction.