sample_point_parameters.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-2023 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 #ifndef SAMPLE_POINT_PARAMETERS_HEADER
27 #define SAMPLE_POINT_PARAMETERS_HEADER
28 
29 
30 // oomph-lib includes
31 #include "elements.h"
32 #include "mesh.h"
33 
34 namespace oomph
35 {
36  //=========================================================
37  /// Enumeration to identify type of sample point container
38  //=========================================================
40  {
43 #ifdef OOMPH_HAS_CGAL
44  ,
46 #endif
47  };
48 
49 
50  /// /////////////////////////////////////////////////////////////////
51  /// /////////////////////////////////////////////////////////////////
52  /// /////////////////////////////////////////////////////////////////
53 
54 
55  // Forward references
56  class RefineableBinArray;
58 
59 
60  /// /////////////////////////////////////////////////////////////////
61  /// /////////////////////////////////////////////////////////////////
62  /// /////////////////////////////////////////////////////////////////
63 
64 
65  //=========================================================================
66  /// Helper object for dealing with the parameters used for the
67  /// SamplePointContainer objects
68  //=========================================================================
70  {
71  public:
72  /// Constructor is private and only accessible by friends
73  /// to ensure that parameters are set correctly
74  friend class BinArrayParameters;
77 #ifdef OOMPH_HAS_CGAL
79 #endif
80 
81  /// Broken copy constructor.
83  delete;
84 
85  /// Broken assignment operator.
87 
88  /// Empty destructor
90 
91  /// Pointer to mesh from whose FiniteElements sample points are created
92  Mesh* mesh_pt() const
93  {
94  return Mesh_pt;
95  }
96 
97  /// Vector of pairs of doubles for min and maximum coordinates.
98  /// Call: Min_and_max_coordinates[j] gives me the
99  /// pair of min (first) and max. (second) coordinates in the j-th
100  /// coordinate direction.
102  {
104  }
105 
106  /// Vector of pairs of doubles for min and maximum coordinates.
107  /// Call: Min_and_max_coordinates[j] gives me the
108  /// pair of min (first) and max. (second) coordinates in the j-th
109  /// coordinate direction. Const version
111  {
113  }
114 
115  /// "Measure of" number of sample points generated in each element
116  /// const version
118  {
120  }
121 
122  /// "Measure of" number of sample points generated in each element
124  {
126  }
127 
128  /// Use eulerian coordinates (via interpolated_x) during
129  /// setup (otherwise use interpolated_zeta())?
131  {
133  }
134 
135  /// Enable use of eulerian coordinates (via interpolated_x) during
136  /// setup (otherwise use interpolated_zeta())
138  {
140  }
141 
142  /// Disable use of eulerian coordinates (via interpolated_x) during
143  /// setup (otherwise use interpolated_zeta())
145  {
147  }
148 
149  /// Ignore halo elements? (MPI only)
151  {
153  }
154 
155  /// Enable Ignore halo elements? (MPI only)
157  {
159  }
160 
161  /// Disable Ignore halo elements? (MPI only)
163  {
165  }
166 
167  /// Default for "measure of" number of sample points per element
169 
170  protected:
171  /// Pointer to mesh from whose FiniteElements sample points are created
173 
174  /// Vector of pairs of doubles for min and maximum coordinates.
175  /// Call: Min_and_max_coordinates[j] gives me the
176  /// pair of min (first) and max. (second) coordinates in the j-th
177  /// coordinate direction.
179 
180  /// "Measure of" number of sample points generated in each element
182 
183  /// Use Eulerian coordinates to setup bin (i.e. use interpolated_x()
184  /// rather than interpolated_zeta() when setting up and searching sample
185  /// point container)
187 
188  /// Ignore halo elements? Accepting halo elements can drastically
189  /// reduce the number of external halo elements in multidomain
190  /// problems -- currently not aware of any problems with doing this
191  /// therefore set to false by default but retention
192  /// of this flag allows easy return to previous implementation.
194 
195 
196  private:
197  /// Constructor: Pass mesh.
198  /// Constructor is private and can only be called
199  /// by the derived friends.
201  : Mesh_pt(mesh_pt),
206  {
207  }
208 
209  /// Broken default constructor; needed for broken
210  /// copy constructors. Don't call. It will die.
212  {
213  // Throw the error
214  throw OomphLibError("Broken default constructor. Don't call this!",
215  OOMPH_CURRENT_FUNCTION,
216  OOMPH_EXCEPTION_LOCATION);
217  }
218  };
219 
220 
221  /// ///////////////////////////////////////////////////////////////////////////
222  /// ///////////////////////////////////////////////////////////////////////////
223  /// ///////////////////////////////////////////////////////////////////////////
224 
225 #ifdef OOMPH_HAS_CGAL
226 
227  //=========================================================================
228  /// Helper object for dealing with the parameters used for the
229  /// CGALSamplePointContainer objects
230  //=========================================================================
232  : public virtual SamplePointContainerParameters
233  {
234  public:
235  /// Constructor: Pass mesh.
238  {
239  }
240 
241 
242  /// Broken copy constructor.
244  const CGALSamplePointContainerParameters& data) = delete;
245 
246  /// Broken assignment operator.
248  };
249 
250 #endif
251 
252  /// ///////////////////////////////////////////////////////////////////////////
253  /// ///////////////////////////////////////////////////////////////////////////
254  /// ///////////////////////////////////////////////////////////////////////////
255 
256 
257  //=========================================================================
258  /// Helper object for dealing with the parameters used for the
259  /// BinArray objects
260  //=========================================================================
262  {
263  public:
264  /// Constructor is private and only accessible by friends
267 
268  /// Broken copy constructor.
269  BinArrayParameters(const BinArrayParameters& data) = delete;
270 
271  /// Broken assignment operator.
272  void operator=(const BinArrayParameters&) = delete;
273 
274  /// Empty destructor
275  virtual ~BinArrayParameters() {}
276 
277  /// Number of bins in each coordinate direction
279  {
281  }
282 
283  /// Number of bins in each coordinate direction. Const version
285  {
287  }
288 
289  protected:
290  /// Number of bins in each coordinate direction
292 
293  private:
294  /// Constructor: Pass mesh. Constructor is private and can only
295  /// be called by the derived friends.
297  {
298  }
299 
300  /// Broken default constructor; needed for broken
301  /// copy constructors. Don't call. It will die.
303  {
304  // Throw the error
305  throw OomphLibError("Broken default constructor. Don't call this!",
306  OOMPH_CURRENT_FUNCTION,
307  OOMPH_EXCEPTION_LOCATION);
308  }
309  };
310 
311 
312  /// ///////////////////////////////////////////////////////////////////////////
313  /// ///////////////////////////////////////////////////////////////////////////
314  /// ///////////////////////////////////////////////////////////////////////////
315 
316 
317  //=========================================================================
318  /// Helper object for dealing with the parameters used for the
319  /// RefineableBinArray objects
320  //=========================================================================
322  {
323  public:
324  /// Constructor: Pass mesh
329  Depth(0),
334  {
335  }
336 
337  /// Broken copy constructor.
339  delete;
340 
341  /// Broken assignment operator.
343 
344  /// Empty destructor
346 
347 
348  /// Is bin recursive?
350  {
351  return Bin_array_is_recursive;
352  }
353 
354  /// Enable recursiveness
356  {
357  Bin_array_is_recursive = true;
358  }
359 
360  /// Disable recursiveness
362  {
363  Bin_array_is_recursive = false;
364  }
365 
366  /// Variable which stores the Depth value of the bin_array.
367  unsigned& depth()
368  {
369  return Depth;
370  }
371 
372  /// Variable which stores the Depth value of the bin_array.
373  /// const version
374  unsigned depth() const
375  {
376  return Depth;
377  }
378 
379  /// Max. depth value of the bin_array.
380  unsigned& max_depth()
381  {
382  return Max_depth;
383  }
384 
385  /// Max. depth value of the bin_array.
386  /// const version
387  unsigned max_depth() const
388  {
389  return Max_depth;
390  }
391 
392  /// Maximum number of sample points in bin (before it's subdivided
393  /// recursively)
395  {
397  }
398 
399  /// Maximum number of sample points in bin (before it's subdivided
400  /// recursively; const version
402  {
404  }
405 
406  /// Pointer to root bin array
408  {
409  return Root_bin_array_pt;
410  }
411 
412  /// Pointer to root bin array; const version
414  {
415  return Root_bin_array_pt;
416  }
417 
418  /// Default value for max. depth
419  static unsigned Default_max_depth;
420 
421  /// Default value for max. number of sample points before refinement
423 
424  private:
425  /// Variable which stores if the RefineableBinArray is
426  /// recursive or not.
428 
429  /// Variable which stores the Depth value of the bin_array. Useful
430  /// for debugging and for preventing "infinite" recursion in case if there
431  /// is a problem.
432  unsigned Depth;
433 
434  /// Max. depth value of the bin_array.
435  unsigned Max_depth;
436 
437  /// Maximum number of sample points in bin (before its subdivided
438  /// recursively
440 
441  /// Pointer to root bin array
443  };
444 
445 
446  /// ///////////////////////////////////////////////////////////////////////////
447  /// ///////////////////////////////////////////////////////////////////////////
448  /// ///////////////////////////////////////////////////////////////////////////
449 
450 
451  //=========================================================================
452  /// Helper object for dealing with the parameters used for the
453  /// NonRefineableBinArray objects
454  //=========================================================================
456  {
457  public:
458  /// Constructor: Pass mesh
463  {
464  }
465 
466  /// Broken copy constructor.
468  const NonRefineableBinArrayParameters& data) = delete;
469 
470  /// Broken assignment operator.
472 
473  /// Empty destructor
475 
476  /// Number of spirals that are being
477  /// visited before doing another circular mpi communication
478  /// const version
479  unsigned nspiral_chunk() const
480  {
481  return Nspiral_chunk;
482  }
483  /// Number of spirals that are being
484  /// visited before doing another circular mpi communication
485  unsigned& nspiral_chunk()
486  {
487  return Nspiral_chunk;
488  }
489 
490  /// Default value for number of spirals that are being
491  /// visited before doing another circular mpi communication
492  static unsigned Default_nspiral_chunk;
493 
494  private:
495  /// Number of spirals that are being
496  /// visited before doing another circular mpi communication
497  unsigned Nspiral_chunk;
498  };
499 
500 } // namespace oomph
501 
502 #endif
///////////////////////////////////////////////////////////////////////////// ///////////////////////...
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
/////////////////////////////////////////////////////////////////////////// /////////////////////////...
BinArrayParameters()
Broken default constructor; needed for broken copy constructors. Don't call. It will die.
virtual ~BinArrayParameters()
Empty destructor.
void operator=(const BinArrayParameters &)=delete
Broken assignment operator.
BinArrayParameters(const BinArrayParameters &data)=delete
Broken copy constructor.
Vector< unsigned > dimensions_of_bin_array() const
Number of bins in each coordinate direction. Const version.
Vector< unsigned > & dimensions_of_bin_array()
Number of bins in each coordinate direction.
BinArrayParameters(Mesh *mesh_pt)
Constructor: Pass mesh. Constructor is private and can only be called by the derived friends.
Vector< unsigned > Dimensions_of_bin_array
Number of bins in each coordinate direction.
/////////////////////////////////////////////////////////////////////////// /////////////////////////...
void operator=(const CGALSamplePointContainerParameters &)=delete
Broken assignment operator.
CGALSamplePointContainerParameters(Mesh *mesh_pt)
Constructor: Pass mesh.
CGALSamplePointContainerParameters(const CGALSamplePointContainerParameters &data)=delete
Broken copy constructor.
A general mesh class.
Definition: mesh.h:67
/////////////////////////////////////////////////////////////////////////// /////////////////////////...
static unsigned Default_nspiral_chunk
Default value for number of spirals that are being visited before doing another circular mpi communic...
virtual ~NonRefineableBinArrayParameters()
Empty destructor.
void operator=(const NonRefineableBinArrayParameters &)=delete
Broken assignment operator.
unsigned Nspiral_chunk
Number of spirals that are being visited before doing another circular mpi communication.
unsigned & nspiral_chunk()
Number of spirals that are being visited before doing another circular mpi communication.
NonRefineableBinArrayParameters(Mesh *mesh_pt)
Constructor: Pass mesh.
NonRefineableBinArrayParameters(const NonRefineableBinArrayParameters &data)=delete
Broken copy constructor.
unsigned nspiral_chunk() const
Number of spirals that are being visited before doing another circular mpi communication const versio...
An OomphLibError object which should be thrown when an run-time error is encountered....
/////////////////////////////////////////////////////////////////////////// /////////////////////////...
unsigned max_number_of_sample_point_per_bin() const
Maximum number of sample points in bin (before it's subdivided recursively; const version.
bool bin_array_is_recursive() const
Is bin recursive?
static unsigned Default_max_number_of_sample_point_per_bin
Default value for max. number of sample points before refinement.
unsigned depth() const
Variable which stores the Depth value of the bin_array. const version.
bool Bin_array_is_recursive
Variable which stores if the RefineableBinArray is recursive or not.
RefineableBinArray * root_bin_array_pt() const
Pointer to root bin array; const version.
unsigned Depth
Variable which stores the Depth value of the bin_array. Useful for debugging and for preventing "infi...
RefineableBinArray *& root_bin_array_pt()
Pointer to root bin array.
unsigned Max_depth
Max. depth value of the bin_array.
unsigned & depth()
Variable which stores the Depth value of the bin_array.
static unsigned Default_max_depth
Default value for max. depth.
unsigned max_depth() const
Max. depth value of the bin_array. const version.
unsigned & max_depth()
Max. depth value of the bin_array.
RefineableBinArrayParameters(Mesh *mesh_pt)
Constructor: Pass mesh.
unsigned & max_number_of_sample_point_per_bin()
Maximum number of sample points in bin (before it's subdivided recursively)
void operator=(const RefineableBinArrayParameters &)=delete
Broken assignment operator.
RefineableBinArray * Root_bin_array_pt
Pointer to root bin array.
void enable_bin_array_is_recursive()
Enable recursiveness.
RefineableBinArrayParameters(const RefineableBinArrayParameters &data)=delete
Broken copy constructor.
void disable_bin_array_is_recursive()
Disable recursiveness.
unsigned Max_number_of_sample_point_per_bin
Maximum number of sample points in bin (before its subdivided recursively.
virtual ~RefineableBinArrayParameters()
Empty destructor.
///////////////////////////////////////////////////////////////// ///////////////////////////////////...
SamplePointContainerParameters(Mesh *mesh_pt)
Constructor: Pass mesh. Constructor is private and can only be called by the derived friends.
bool ignore_halo_elements_during_locate_zeta_search() const
Ignore halo elements? (MPI only)
SamplePointContainerParameters()
Broken default constructor; needed for broken copy constructors. Don't call. It will die.
virtual ~SamplePointContainerParameters()
Empty destructor.
unsigned & nsample_points_generated_per_element()
"Measure of" number of sample points generated in each element
void enable_ignore_halo_elements_during_locate_zeta_search()
Enable Ignore halo elements? (MPI only)
unsigned Nsample_points_generated_per_element
"Measure of" number of sample points generated in each element
unsigned nsample_points_generated_per_element() const
"Measure of" number of sample points generated in each element const version
SamplePointContainerParameters(const SamplePointContainerParameters &data)=delete
Broken copy constructor.
void operator=(const SamplePointContainerParameters &)=delete
Broken assignment operator.
void enable_use_eulerian_coordinates_during_setup()
Enable use of eulerian coordinates (via interpolated_x) during setup (otherwise use interpolated_zeta...
Mesh * Mesh_pt
Pointer to mesh from whose FiniteElements sample points are created.
Mesh * mesh_pt() const
Pointer to mesh from whose FiniteElements sample points are created.
bool use_eulerian_coordinates_during_setup() const
Use eulerian coordinates (via interpolated_x) during setup (otherwise use interpolated_zeta())?
Vector< std::pair< double, double > > Min_and_max_coordinates
Vector of pairs of doubles for min and maximum coordinates. Call: Min_and_max_coordinates[j] gives me...
void disable_use_eulerian_coordinates_during_setup()
Disable use of eulerian coordinates (via interpolated_x) during setup (otherwise use interpolated_zet...
bool Use_eulerian_coordinates_during_setup
Use Eulerian coordinates to setup bin (i.e. use interpolated_x() rather than interpolated_zeta() when...
Vector< std::pair< double, double > > min_and_max_coordinates() const
Vector of pairs of doubles for min and maximum coordinates. Call: Min_and_max_coordinates[j] gives me...
bool Ignore_halo_elements_during_locate_zeta_search
Ignore halo elements? Accepting halo elements can drastically reduce the number of external halo elem...
static unsigned Default_nsample_points_generated_per_element
Default for "measure of" number of sample points per element.
void disable_ignore_halo_elements_during_locate_zeta_search()
Disable Ignore halo elements? (MPI only)
Vector< std::pair< double, double > > & min_and_max_coordinates()
Vector of pairs of doubles for min and maximum coordinates. Call: Min_and_max_coordinates[j] gives me...
A slight extension to the standard template vector class so that we can include "graceful" array rang...
Definition: Vector.h:58
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
Sample_Point_Container_Type
Enumeration to identify type of sample point container.