missing_masters.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// Copyright (C) 2006-2022 Matthias Heil and Andrew Hazel
7 // LIC//
8 // LIC// This library is free software; you can redistribute it and/or
9 // LIC// modify it under the terms of the GNU Lesser General Public
10 // LIC// License as published by the Free Software Foundation; either
11 // LIC// version 2.1 of the License, or (at your option) any later version.
12 // LIC//
13 // LIC// This library is distributed in the hope that it will be useful,
14 // LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // LIC// Lesser General Public License for more details.
17 // LIC//
18 // LIC// You should have received a copy of the GNU Lesser General Public
19 // LIC// License along with this library; if not, write to the Free Software
20 // LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 // LIC// 02110-1301 USA.
22 // LIC//
23 // LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24 // LIC//
25 // LIC//====================================================================
26 // Header file for multi-domain functions, including the class
27 // ElementWithExternalElement which stores pointers to external elements
28 
29 // Temporary flag to enable full annotation of multi domain
30 // comms (but keep alive because it would be such a bloody pain to
31 // rewrite it if things ever go wrong again...)
32 //#define ANNOTATE_MULTI_DOMAIN_COMMUNICATION
33 
34 // Include guards to prevent multiple inclusion of the header
35 #ifndef OOMPH_MISSING_MASTERS_HEADER
36 #define OOMPH_MISSING_MASTERS_HEADER
37 
38 // Config header generated by autoconfig
39 #ifdef HAVE_CONFIG_H
40 #include <oomph-lib-config.h>
41 #endif
42 
43 // Oomph-lib headers
44 #include "geom_objects.h"
45 #include "problem.h"
46 #include "shape.h"
47 
48 #include "mesh.h"
50 #include "algebraic_elements.h"
52 #include "Qelements.h"
54 
55 
56 namespace oomph
57 {
58  //======================================================================
59  // Namespace for global missing master constructing functions
60  //======================================================================
61  namespace Missing_masters_functions
62  {
63 #ifdef ANNOTATE_MISSING_MASTERS_COMMUNICATION
64 
65  // Temporary vector of strings to enable full annotation of multi domain
66  // comms (but keep alive because it would be such a bloody pain to
67  // rewrite it if things ever go wrong again...)
68  // This is left over from the multi-domain stuff and should work
69  // in the same way, but it has not been tested.
70  extern Vector<std::string> Flat_packed_unsigneds_string;
71 
72 #endif
73 
75  extern bool Doc_timings;
76 
79  extern bool Doc_stats;
80 
83  extern bool Doc_full_stats;
84 
85 
86  // Functions for multi-domain method
87 
88 #ifdef OOMPH_HAS_MPI
89  // Helper functions for external haloed node identification
90 
91 
94  void add_external_haloed_node_to_storage(int& iproc,
95  Node* nod_pt,
96  Mesh* const& mesh_pt,
97  int& n_cont_inter_values,
98  Vector<unsigned>& send_unsigneds,
99  Vector<double>& send_doubles);
100 
101 
104  void recursively_add_masters_of_external_haloed_node(
105  int& iproc,
106  Node* nod_pt,
107  Mesh* const& mesh_pt,
108  int& n_cont_inter_values,
109  Vector<unsigned>& send_unsigneds,
110  Vector<double>& send_doubles);
111 
112 
114  void add_external_haloed_node_helper(int& iproc,
115  Node* nod_pt,
116  Mesh* const& mesh_pt,
117  int& n_cont_inter_values,
118  Vector<unsigned>& send_unsigneds,
119  Vector<double>& send_doubles);
120 
122  void add_external_haloed_master_node_helper(
123  int& iproc,
124  Node* master_nod_pt,
125  Mesh* const& mesh_pt,
126  int& n_cont_inter_values,
127  Vector<unsigned>& send_unsigneds,
128  Vector<double>& send_doubles);
129 
133  void get_required_nodal_information_helper(int& iproc,
134  Node* nod_pt,
135  Mesh* const& mesh_pt,
136  int& n_cont_inter_values,
137  Vector<unsigned>& send_unsigneds,
138  Vector<double>& send_doubles);
139 
143  void get_required_master_nodal_information_helper(
144  int& iproc,
145  Node* master_nod_pt,
146  Mesh* const& mesh_pt,
147  int& n_cont_inter_values,
148  Vector<unsigned>& send_unsigneds,
149  Vector<double>& send_doubles);
150 
151  // Helper functions for external halo node identification
152 
155  template<class EXT_ELEMENT>
156  void add_external_halo_node_to_storage(Node*& new_nod_pt,
157  Mesh* const& mesh_pt,
158  unsigned& loc_p,
159  unsigned& node_index,
160  FiniteElement* const& new_el_pt,
161  int& n_cont_inter_values,
162  unsigned& counter_for_recv_unsigneds,
163  Vector<unsigned>& recv_unsigneds,
164  unsigned& counter_for_recv_doubles,
165  Vector<double>& recv_doubles);
166 
169  template<class EXT_ELEMENT>
170  void recursively_add_masters_of_external_halo_node_to_storage(
171  Node*& new_nod_pt,
172  Mesh* const& mesh_pt,
173  unsigned& loc_p,
174  unsigned& node_index,
175  int& n_cont_inter_values,
176  unsigned& counter_for_recv_unsigneds,
177  Vector<unsigned>& recv_unsigneds,
178  unsigned& counter_for_recv_doubles,
179  Vector<double>& recv_doubles);
180 
181 
183  void add_external_halo_node_helper(Node*& new_nod_pt,
184  Mesh* const& mesh_pt,
185  unsigned& loc_p,
186  unsigned& node_index,
187  FiniteElement* const& new_el_pt,
188  int& n_cont_inter_values,
189  unsigned& counter_for_recv_unsigneds,
190  Vector<unsigned>& recv_unsigneds,
191  unsigned& counter_for_recv_doubles,
192  Vector<double>& recv_doubles);
193 
195  template<class EXT_ELEMENT>
196  void add_external_halo_master_node_helper(
197  Node*& new_master_nod_pt,
198  Node*& new_nod_pt,
199  Mesh* const& mesh_pt,
200  unsigned& loc_p,
201  int& n_cont_inter_values,
202  unsigned& counter_for_recv_unsigneds,
203  Vector<unsigned>& recv_unsigneds,
204  unsigned& counter_for_recv_doubles,
205  Vector<double>& recv_doubles);
206 
207 
210  void construct_new_external_halo_node_helper(
211  Node*& new_nod_pt,
212  unsigned& loc_p,
213  unsigned& node_index,
214  FiniteElement* const& new_el_pt,
215  Mesh* const& mesh_pt,
216  unsigned& counter_for_recv_unsigneds,
217  Vector<unsigned>& recv_unsigneds,
218  unsigned& counter_for_recv_doubles,
219  Vector<double>& recv_doubles);
220 
223  template<class EXT_ELEMENT>
224  void construct_new_external_halo_master_node_helper(
225  Node*& new_master_nod_pt,
226  Node*& nod_pt,
227  unsigned& loc_p,
228  Mesh* const& mesh_pt,
229  unsigned& counter_for_recv_unsigneds,
230  Vector<unsigned>& recv_unsigneds,
231  unsigned& counter_for_recv_doubles,
232  Vector<double>& recv_doubles);
233 
234 #endif
235 
236  } // namespace Missing_masters_functions
237 
238 
239 } // namespace oomph
240 
241 #endif
bool Doc_full_stats
Definition: missing_masters.cc:67
bool Doc_stats
Definition: missing_masters.cc:63
bool Doc_timings
Boolean to indicate whether to doc timings or not.
Definition: missing_masters.cc:59
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10