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// Version 1.0; svn revision $LastChangedRevision: 1097 $
7 //LIC//
8 //LIC// $LastChangedDate: 2015-12-17 11:53:17 +0000 (Thu, 17 Dec 2015) $
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 #ifndef SAMPLE_POINT_PARAMETERS_HEADER
31 #define SAMPLE_POINT_PARAMETERS_HEADER
32 
33 
34 // oomph-lib includes
35 #include "elements.h"
36 #include "mesh.h"
37 
38 namespace oomph
39 {
40 
41 //=========================================================
42 /// Enumeration to identify type of sample point container
43 //=========================================================
45  {
48 #ifdef OOMPH_HAS_CGAL
50 #endif
51  };
52 
53 
54 ////////////////////////////////////////////////////////////////////
55 ////////////////////////////////////////////////////////////////////
56 ////////////////////////////////////////////////////////////////////
57 
58 
59  // Forward references
60  class RefineableBinArray;
62 
63 
64 
65 ////////////////////////////////////////////////////////////////////
66 ////////////////////////////////////////////////////////////////////
67 ////////////////////////////////////////////////////////////////////
68 
69 
70 
71 
72 
73 
74 //=========================================================================
75 /// \short Helper object for dealing with the parameters used for the
76 /// SamplePointContainer objects
77 //=========================================================================
79  {
80 
81  public:
82 
83  /// \short Constructor is private and only accessible by friends
84  /// to ensure that parameters are set correctly
85  friend class BinArrayParameters;
88 #ifdef OOMPH_HAS_CGAL
90 #endif
91 
92  /// \short Broken copy constructor.
94  {
95  BrokenCopy::broken_copy("SamplePointContainerParameters");
96  }
97 
98  /// Broken assignment operator.
100  {
101  BrokenCopy::broken_assign("SamplePointContainerParameters");
102  }
103 
104 
105  /// Empty destructor
107 
108  /// Pointer to mesh from whose FiniteElements sample points are created
109  Mesh* mesh_pt() const
110  {
111  return Mesh_pt;
112  }
113 
114  /// \short Vector of pairs of doubles for min and maximum coordinates.
115  /// Call: Min_and_max_coordinates[j] gives me the
116  /// pair of min (first) and max. (second) coordinates in the j-th
117  /// coordinate direction.
119  {
121  }
122 
123  /// \short Vector of pairs of doubles for min and maximum coordinates.
124  /// Call: Min_and_max_coordinates[j] gives me the
125  /// pair of min (first) and max. (second) coordinates in the j-th
126  /// coordinate direction. Const version
128  {
130  }
131 
132  /// \short "Measure of" number of sample points generated in each element
133  /// const version
135  {
137  }
138 
139  /// "Measure of" number of sample points generated in each element
141  {
143  }
144 
145  /// \short Use eulerian coordinates (via interpolated_x) during
146  /// setup (otherwise use interpolated_zeta())?
148  {
150  }
151 
152  /// Enable use of eulerian coordinates (via interpolated_x) during
153  /// setup (otherwise use interpolated_zeta())
155  {
157  }
158 
159  /// Disable use of eulerian coordinates (via interpolated_x) during
160  /// setup (otherwise use interpolated_zeta())
162  {
164  }
165 
166  /// Ignore halo elements? (MPI only)
168  {
170  }
171 
172  /// Enable Ignore halo elements? (MPI only)
174  {
176  }
177 
178  /// Disable Ignore halo elements? (MPI only)
180  {
182  }
183 
184  /// Default for "measure of" number of sample points per element
186 
187  protected:
188 
189  /// Pointer to mesh from whose FiniteElements sample points are created
191 
192  /// Vector of pairs of doubles for min and maximum coordinates.
193  /// Call: Min_and_max_coordinates[j] gives me the
194  /// pair of min (first) and max. (second) coordinates in the j-th
195  /// coordinate direction.
197 
198  /// "Measure of" number of sample points generated in each element
200 
201  /// \short Use Eulerian coordinates to setup bin (i.e. use interpolated_x()
202  /// rather than interpolated_zeta() when setting up and searching sample
203  /// point container)
205 
206  /// \short Ignore halo elements? Accepting halo elements can drastically
207  /// reduce the number of external halo elements in multidomain
208  /// problems -- currently not aware of any problems with doing this
209  /// therefore set to false by default but retention
210  /// of this flag allows easy return to previous implementation.
212 
213 
214  private:
215 
216  /// \short Constructor: Pass mesh.
217  /// Constructor is private and can only be called
218  /// by the derived friends.
220  Mesh_pt(mesh_pt),
221  Nsample_points_generated_per_element(
222  Default_nsample_points_generated_per_element),
223  Use_eulerian_coordinates_during_setup(false),
224  Ignore_halo_elements_during_locate_zeta_search(false)
225  {}
226 
227  /// \short Broken default constructor; needed for broken
228  /// copy constructors. Don't call. It will die.
230  {
231  //Throw the error
232  throw OomphLibError("Broken default constructor. Don't call this!",
233  OOMPH_CURRENT_FUNCTION,
234  OOMPH_EXCEPTION_LOCATION);
235  }
236 
237  };
238 
239 
240 //////////////////////////////////////////////////////////////////////////////
241 //////////////////////////////////////////////////////////////////////////////
242 //////////////////////////////////////////////////////////////////////////////
243 
244 #ifdef OOMPH_HAS_CGAL
245 
246 //=========================================================================
247 /// \short Helper object for dealing with the parameters used for the
248 /// CGALSamplePointContainer objects
249 //=========================================================================
250  class CGALSamplePointContainerParameters: public virtual
252  {
253 
254  public:
255 
256  /// Constructor: Pass mesh.
259  {}
260 
261 
262  /// \short Broken copy constructor.
265  {
266  BrokenCopy::broken_copy("CGALSamplePointContainerParameters");
267  }
268 
269  /// Broken assignment operator.
271  {
272  BrokenCopy::broken_assign("CGALSamplePointContainerParameters");
273  }
274 
275  };
276 
277 #endif
278 
279 //////////////////////////////////////////////////////////////////////////////
280 //////////////////////////////////////////////////////////////////////////////
281 //////////////////////////////////////////////////////////////////////////////
282 
283 
284 //=========================================================================
285 /// \short Helper object for dealing with the parameters used for the
286 /// BinArray objects
287 //=========================================================================
289  {
290 
291  public:
292 
293  /// Constructor is private and only accessible by friends
296 
297  /// \short Broken copy constructor.
299  const BinArrayParameters& data)
300  {
301  BrokenCopy::broken_copy("BinArrayParameters");
302  }
303 
304  /// Broken assignment operator.
306  {
307  BrokenCopy::broken_assign("BinArrayParameters");
308  }
309 
310  /// Empty destructor
311  virtual ~BinArrayParameters() { }
312 
313  /// \short Number of bins in each coordinate direction
315  {
316  return Dimensions_of_bin_array;
317  }
318 
319  /// \short Number of bins in each coordinate direction. Const version
321  {
322  return Dimensions_of_bin_array;
323  }
324 
325  protected:
326 
327  /// \short Number of bins in each coordinate direction
329 
330  private:
331 
332  /// \short Constructor: Pass mesh. Constructor is private and can only
333  /// be called by the derived friends.
335  {}
336 
337  /// \short Broken default constructor; needed for broken
338  /// copy constructors. Don't call. It will die.
340  {
341  //Throw the error
342  throw OomphLibError("Broken default constructor. Don't call this!",
343  OOMPH_CURRENT_FUNCTION,
344  OOMPH_EXCEPTION_LOCATION);
345  }
346 
347  };
348 
349 
350 //////////////////////////////////////////////////////////////////////////////
351 //////////////////////////////////////////////////////////////////////////////
352 //////////////////////////////////////////////////////////////////////////////
353 
354 
355 //=========================================================================
356 /// \short Helper object for dealing with the parameters used for the
357 /// RefineableBinArray objects
358 //=========================================================================
360  {
361 
362  public:
363 
364  /// Constructor: Pass mesh
367  BinArrayParameters(mesh_pt),
368  Bin_array_is_recursive(true),
369  Depth(0),
370  Max_depth(Default_max_depth),
371  Max_number_of_sample_point_per_bin(
372  Default_max_number_of_sample_point_per_bin),
373  Root_bin_array_pt(0)
374  {}
375 
376  /// \short Broken copy constructor.
378  const RefineableBinArrayParameters& data)
379  {
380  BrokenCopy::broken_copy("RefineableBinArrayParameters");
381  }
382 
383  /// Broken assignment operator.
385  {
386  BrokenCopy::broken_assign("RefineableBinArrayParameters");
387  }
388 
389  /// Empty destructor
391  {}
392 
393 
394  /// Is bin recursive?
396  {
397  return Bin_array_is_recursive;
398  }
399 
400  /// Enable recursiveness
402  {
403  Bin_array_is_recursive=true;
404  }
405 
406  /// Disable recursiveness
408  {
409  Bin_array_is_recursive=false;
410  }
411 
412  /// \short Variable which stores the Depth value of the bin_array.
413  unsigned& depth()
414  {
415  return Depth;
416  }
417 
418  /// \short Variable which stores the Depth value of the bin_array.
419  /// const version
420  unsigned depth() const
421  {
422  return Depth;
423  }
424 
425  /// \short Max. depth value of the bin_array.
426  unsigned& max_depth()
427  {
428  return Max_depth;
429  }
430 
431  /// \short Max. depth value of the bin_array.
432  /// const version
433  unsigned max_depth() const
434  {
435  return Max_depth;
436  }
437 
438  /// \short Maximum number of sample points in bin (before it's subdivided
439  /// recursively)
441  {
442  return Max_number_of_sample_point_per_bin;
443  }
444 
445  /// \short Maximum number of sample points in bin (before it's subdivided
446  /// recursively; const version
448  {
449  return Max_number_of_sample_point_per_bin;
450  }
451 
452  /// Pointer to root bin array
454  {
455  return Root_bin_array_pt;
456  }
457 
458  /// Pointer to root bin array; const version
460  {
461  return Root_bin_array_pt;
462  }
463 
464  /// Default value for max. depth
465  static unsigned Default_max_depth;
466 
467  /// Default value for max. number of sample points before refinement
469 
470  private:
471 
472  /// \short Variable which stores if the RefineableBinArray is
473  /// recursive or not.
475 
476  /// \short Variable which stores the Depth value of the bin_array. Useful for
477  /// debugging and for preventing "infinite" recursion in case if there is
478  /// a problem.
479  unsigned Depth;
480 
481  /// \short Max. depth value of the bin_array.
482  unsigned Max_depth;
483 
484  /// \short Maximum number of sample points in bin (before its subdivided
485  /// recursively
487 
488  /// Pointer to root bin array
490 
491  };
492 
493 
494 
495 
496 
497 
498 
499 //////////////////////////////////////////////////////////////////////////////
500 //////////////////////////////////////////////////////////////////////////////
501 //////////////////////////////////////////////////////////////////////////////
502 
503 
504 //=========================================================================
505 /// \short Helper object for dealing with the parameters used for the
506 /// NonRefineableBinArray objects
507 //=========================================================================
509  {
510 
511  public:
512 
513  /// Constructor: Pass mesh
516  BinArrayParameters(mesh_pt),
517  Nspiral_chunk(Default_nspiral_chunk)
518  {}
519 
520  /// \short Broken copy constructor.
523  {
524  BrokenCopy::broken_copy("NonRefineableBinArrayParameters");
525  }
526 
527  /// Broken assignment operator.
529  {
530  BrokenCopy::broken_assign("NonRefineableBinArrayParameters");
531  }
532 
533  /// Empty destructor
535  {}
536 
537  /// \short Number of spirals that are being
538  /// visited before doing another circular mpi communication
539  /// const version
540  unsigned nspiral_chunk() const
541  {
542  return Nspiral_chunk;
543  }
544  /// \short Number of spirals that are being
545  /// visited before doing another circular mpi communication
546  unsigned& nspiral_chunk()
547  {
548  return Nspiral_chunk;
549  }
550 
551  /// \short Default value for number of spirals that are being
552  /// visited before doing another circular mpi communication
553  static unsigned Default_nspiral_chunk;
554 
555  private:
556 
557  /// \short Number of spirals that are being
558  /// visited before doing another circular mpi communication
559  unsigned Nspiral_chunk;
560 
561 
562  };
563 
564 }
565 
566 #endif
virtual ~SamplePointContainerParameters()
Empty destructor.
unsigned Max_number_of_sample_point_per_bin
Maximum number of sample points in bin (before its subdivided recursively.
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
void operator=(const RefineableBinArrayParameters &)
Broken assignment operator.
virtual ~NonRefineableBinArrayParameters()
Empty destructor.
RefineableBinArray * Root_bin_array_pt
Pointer to root bin array.
bool use_eulerian_coordinates_during_setup() const
Use eulerian coordinates (via interpolated_x) during setup (otherwise use interpolated_zeta())?
BinArrayParameters(const BinArrayParameters &data)
Broken copy constructor.
unsigned Max_depth
Max. depth value of the bin_array.
unsigned max_number_of_sample_point_per_bin() const
Maximum number of sample points in bin (before it's subdivided recursively; const version...
static unsigned Default_nsample_points_generated_per_element
Default for "measure of" number of sample points per element.
RefineableBinArray * root_bin_array_pt() const
Pointer to root bin array; const version.
Helper object for dealing with the parameters used for the SamplePointContainer objects.
void operator=(const CGALSamplePointContainerParameters &)
Broken assignment operator.
bool bin_array_is_recursive() const
Is bin recursive?
Helper object for dealing with the parameters used for the NonRefineableBinArray objects.
virtual ~BinArrayParameters()
Empty destructor.
unsigned & max_number_of_sample_point_per_bin()
Maximum number of sample points in bin (before it's subdivided recursively)
Helper object for dealing with the parameters used for the CGALSamplePointContainer objects...
unsigned Nspiral_chunk
Number of spirals that are being visited before doing another circular mpi communication.
RefineableBinArray class.
Helper object for dealing with the parameters used for the RefineableBinArray objects.
bool Bin_array_is_recursive
Variable which stores if the RefineableBinArray is recursive or not.
void enable_bin_array_is_recursive()
Enable recursiveness.
unsigned & depth()
Variable which stores the Depth value of the bin_array.
RefineableBinArray *& root_bin_array_pt()
Pointer to root bin array.
unsigned max_depth() const
Max. depth value of the bin_array. const version.
BinArrayParameters()
Broken default constructor; needed for broken copy constructors. Don't call. It will die...
static unsigned Default_max_number_of_sample_point_per_bin
Default value for max. number of sample points before refinement.
RefineableBinArrayParameters(const RefineableBinArrayParameters &data)
Broken copy constructor.
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...
unsigned depth() const
Variable which stores the Depth value of the bin_array. const version.
Vector< std::pair< double, double > > Min_and_max_coordinates
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 enable_ignore_halo_elements_during_locate_zeta_search()
Enable Ignore halo elements? (MPI only)
NonRefineableBinArrayParameters(const NonRefineableBinArrayParameters &data)
Broken copy constructor.
CGALSamplePointContainerParameters(const CGALSamplePointContainerParameters &data)
Broken copy constructor.
void disable_ignore_halo_elements_during_locate_zeta_search()
Disable Ignore halo elements? (MPI only)
Mesh * Mesh_pt
Pointer to mesh from whose FiniteElements sample points are created.
SamplePointContainerParameters(const SamplePointContainerParameters &data)
Broken copy constructor.
void disable_bin_array_is_recursive()
Disable recursiveness.
Vector< unsigned > & dimensions_of_bin_array()
Number of bins in each coordinate direction.
unsigned & max_depth()
Max. depth value of the bin_array.
Sample_Point_Container_Type
Enumeration to identify type of sample point container.
virtual ~RefineableBinArrayParameters()
Empty destructor.
NonRefineableBinArrayParameters(Mesh *mesh_pt)
Constructor: Pass mesh.
static unsigned Default_max_depth
Default value for max. depth.
bool Use_eulerian_coordinates_during_setup
Use Eulerian coordinates to setup bin (i.e. use interpolated_x() rather than interpolated_zeta() when...
unsigned Depth
Variable which stores the Depth value of the bin_array. Useful for debugging and for preventing "infi...
void operator=(const BinArrayParameters &)
Broken assignment operator.
bool ignore_halo_elements_during_locate_zeta_search() const
Ignore halo elements? (MPI only)
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
NonRefineableBinArray class.
unsigned & nsample_points_generated_per_element()
"Measure of" number of sample points generated in each element
CGALSamplePointContainerParameters(Mesh *mesh_pt)
Constructor: Pass mesh.
static unsigned Default_nspiral_chunk
Default value for number of spirals that are being visited before doing another circular mpi communic...
unsigned Nsample_points_generated_per_element
"Measure of" number of sample points generated in each element
void operator=(const NonRefineableBinArrayParameters &)
Broken assignment operator.
unsigned nspiral_chunk() const
Number of spirals that are being visited before doing another circular mpi communication const versio...
Vector< unsigned > dimensions_of_bin_array() const
Number of bins in each coordinate direction. Const version.
SamplePointContainerParameters(Mesh *mesh_pt)
Constructor: Pass mesh. Constructor is private and can only be called by the derived friends...
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...
void operator=(const SamplePointContainerParameters &)
Broken assignment operator.
unsigned & nspiral_chunk()
Number of spirals that are being visited before doing another circular mpi communication.
unsigned nsample_points_generated_per_element() const
"Measure of" number of sample points generated in each element const version
SamplePointContainerParameters()
Broken default constructor; needed for broken copy constructors. Don&#39;t call. It will die...
A general mesh class.
Definition: mesh.h:74
Helper object for dealing with the parameters used for the BinArray objects.
Mesh * mesh_pt() const
Pointer to mesh from whose FiniteElements sample points are created.
RefineableBinArrayParameters(Mesh *mesh_pt)
Constructor: Pass mesh.
bool Ignore_halo_elements_during_locate_zeta_search
Ignore halo elements? Accepting halo elements can drastically reduce the number of external halo elem...