Public Member Functions | Protected Attributes | List of all members
BinArray Class Referenceabstract

///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// More...

#include <sample_point_container.h>

+ Inheritance diagram for BinArray:

Public Member Functions

 BinArray (Mesh *mesh_pt, const Vector< std::pair< double, double >> &min_and_max_coordinates, const Vector< unsigned > &dimensions_of_bin_array, const bool &use_eulerian_coordinates_during_setup, const bool &ignore_halo_elements_during_locate_zeta_search, const unsigned &nsample_points_generated_per_element)
 Constructor. More...
 
 BinArray ()
 Broken default constructor; needed for broken copy constructors. Don't call. It will die. More...
 
 BinArray (const BinArray &data)=delete
 Broken copy constructor. More...
 
void operator= (const BinArray &)=delete
 Broken assignment operator. More...
 
virtual ~BinArray ()
 Virtual destructor. More...
 
void get_neighbouring_bins_helper (const unsigned &bin_index, const unsigned &radius, Vector< unsigned > &neighbouring_bin_index, const bool &use_old_version=true)
 Helper function for computing the bin indices of neighbouring bins at a given "radius" of the specified bin. Final, optional boolean (default: true) chooses to use the old version which appears to be faster than Louis' new one after all (in the few cases where this functionality is still used – not all if we have cgal!) More...
 
void profile_get_neighbouring_bins_helper ()
 Profiling function to compare performance of two different versions of the get_neighbouring_bins_helper(...) function. More...
 
unsigned coords_to_bin_index (const Vector< double > &zeta)
 Get (linearly enumerated) bin index of bin that contains specified zeta. More...
 
void coords_to_vectorial_bin_index (const Vector< double > &zeta, Vector< unsigned > &bin_index)
 Get "coordinates" of bin that contains specified zeta. More...
 
virtual void output_bins (std::ofstream &outfile)=0
 Output bins (boundaries and number of sample points in them) More...
 
virtual void output_bin_vertices (std::ofstream &outfile)=0
 Output bin vertices (allowing display of bin boundaries as zones). More...
 
virtual unsigned nbin () const =0
 Number of bins (not taking recursion into account for refineable versions) More...
 
unsigned max_bin_dimension () const
 Max. bin dimension (number of bins in coordinate directions) More...
 
unsigned ndim_zeta () const
 Dimension of the zeta ( = dim of local coordinate of elements) More...
 
unsigned dimension_of_bin_array (const unsigned &i) const
 Number of bins in coordinate direction i. More...
 
Vector< unsigned > dimensions_of_bin_array () const
 Number of bins in coordinate directions. Const vector-based version. More...
 
unsigned dimensions_of_bin_array (const unsigned &i) const
 Number of bins in specified coordinate direction. More...
 
- Public Member Functions inherited from SamplePointContainer
 SamplePointContainer (Mesh *mesh_pt, const Vector< std::pair< double, double >> &min_and_max_coordinates, const bool &use_eulerian_coordinates_during_setup, const bool &ignore_halo_elements_during_locate_zeta_search, const unsigned &nsample_points_generated_per_element)
 Constructor. More...
 
 SamplePointContainer ()
 Broken default constructor; needed for broken copy constructors. Don't call. It will die. More...
 
 SamplePointContainer (const SamplePointContainer &data)=delete
 Broken copy constructor. More...
 
void operator= (const SamplePointContainer &)=delete
 Broken assignment operator. More...
 
virtual ~SamplePointContainer ()
 Virtual destructor. More...
 
virtual void locate_zeta (const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s)=0
 Find sub-GeomObject (finite element) and the local coordinate s within it that contains point with global coordinate zeta. sub_geom_object_pt=0 if point can't be found. More...
 
virtual unsigned & total_number_of_sample_points_visited_during_locate_zeta_from_top_level ()
 Counter to keep track of how many sample points we've visited during top level call to locate_zeta. Virtual so it can be overloaded for different versions. More...
 
virtual unsigned total_number_of_sample_points_computed_recursively () const =0
 Total number of sample points in sample point container, possibly computed recursively. More...
 
Mesh * mesh_pt () const
 Pointer to mesh from whose FiniteElements sample points are created. More...
 
const std::pair< double, double > & min_and_max_coordinates (const unsigned &i) const
 Pair of doubles for min and maximum coordinates in i-th direction: min (first) and max. (second) coordinates. More...
 
const Vector< std::pair< double, double > > & min_and_max_coordinates () const
 Vector of pair of doubles for min and maximum coordinates. min (first) and max. (second) coordinates. More...
 
bool ignore_halo_elements_during_locate_zeta_search () const
 Ignore halo elements? More...
 
bool use_eulerian_coordinates_during_setup () const
 Use Eulerian coordinates (i.e. interpolated_x) rather than zeta itself (i.e. interpolated_zeta) to identify point. More...
 
unsigned & nsample_points_generated_per_element ()
 "Measure of" number of sample points generated in each element More...
 
double & max_search_radius ()
 Set maximum search radius for locate zeta. This is initialised do DBL_MAX so we brutally search through the entire bin structure, no matter how big it is until we've found the required point (or failed to do so. This can be VERY costly with fine meshes. Here the user takes full responsibility and states that we have no chance in hell to find the required point in a bin whose closest vertex is further than the specified max search radius. More...
 

Protected Attributes

Vector< unsigned > Dimensions_of_bin_array
 Number of bins in each coordinate direction. More...
 
- Protected Attributes inherited from SamplePointContainer
Mesh * Mesh_pt
 Pointer to mesh from whose FiniteElements sample points are created. More...
 
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 the pair of min (first) and max. (second) coordinates in the j-th coordinate direction. More...
 
bool Use_eulerian_coordinates_during_setup
 Use Eulerian coordinates (i.e. interpolated_x) rather than zeta itself (i.e. interpolated_zeta) to identify point. More...
 
bool Ignore_halo_elements_during_locate_zeta_search
 Ignore halo elements? More...
 
unsigned Nsample_points_generated_per_element
 "Measure of" number of sample points generated in each element More...
 
unsigned Total_number_of_sample_points_visited_during_locate_zeta_from_top_level
 Counter to keep track of how many sample points we've visited during top level call to locate_zeta. More...
 
double Max_search_radius
 Max radius beyond which we stop searching the bin. Initialised to DBL_MAX so keep going until the point is found or until we've searched every single bin. Overwriting this means we won't search in bins whose closest vertex is at a distance greater than Max_search_radius from the point to be located. More...
 

Additional Inherited Members

- Static Public Attributes inherited from SamplePointContainer
static std::ofstream Visited_sample_points_file
 File to record sequence of visited sample points in. Used for debugging/ illustration of search procedures. More...
 
static bool Always_fail_elemental_locate_zeta = false
 Boolean flag to make to make locate zeta fail. Used for debugging/ illustration of search procedures. More...
 
static bool Use_equally_spaced_interior_sample_points = true
 Use equally spaced sample points? (otherwise vertices are sampled repeatedly. More...
 
static bool Enable_timing_of_setup = false
 Time setup? More...
 
static double Percentage_offset = 5.0
 Offset of sample point container boundaries beyond max/min coords. More...
 
- Protected Member Functions inherited from SamplePointContainer
void setup_min_and_max_coordinates ()
 Helper function to compute the min and max coordinates for the mesh, in each dimension. More...
 

Detailed Description

///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////

Base class for all bin arrays

Definition at line 401 of file sample_point_container.h.

Constructor & Destructor Documentation

◆ BinArray() [1/3]

BinArray::BinArray ( Mesh *  mesh_pt,
const Vector< std::pair< double, double >> &  min_and_max_coordinates,
const Vector< unsigned > &  dimensions_of_bin_array,
const bool &  use_eulerian_coordinates_during_setup,
const bool &  ignore_halo_elements_during_locate_zeta_search,
const unsigned &  nsample_points_generated_per_element 
)
inline

Constructor.

Definition at line 405 of file sample_point_container.h.

◆ BinArray() [2/3]

BinArray::BinArray ( )
inline

Broken default constructor; needed for broken copy constructors. Don't call. It will die.

Definition at line 425 of file sample_point_container.h.

◆ BinArray() [3/3]

BinArray::BinArray ( const BinArray data)
delete

Broken copy constructor.

◆ ~BinArray()

virtual BinArray::~BinArray ( )
inlinevirtual

Virtual destructor.

Definition at line 440 of file sample_point_container.h.

Member Function Documentation

◆ coords_to_bin_index()

unsigned BinArray::coords_to_bin_index ( const Vector< double > &  zeta)

Get (linearly enumerated) bin index of bin that contains specified zeta.

Update the coef and the bin index

Definition at line 1840 of file sample_point_container.cc.

References dimensions_of_bin_array(), SamplePointContainer::Min_and_max_coordinates, and ndim_zeta().

Referenced by RefineableBinArray::add_sample_point(), RefineableBinArray::fill_bin_array(), RefineableBinArray::locate_zeta(), and profile_get_neighbouring_bins_helper().

◆ coords_to_vectorial_bin_index()

void BinArray::coords_to_vectorial_bin_index ( const Vector< double > &  zeta,
Vector< unsigned > &  bin_index 
)

Get "coordinates" of bin that contains specified zeta.

Definition at line 1969 of file sample_point_container.cc.

References dimensions_of_bin_array(), SamplePointContainer::Min_and_max_coordinates, and ndim_zeta().

Referenced by RefineableBinArray::locate_zeta(), and profile_get_neighbouring_bins_helper().

◆ dimension_of_bin_array()

unsigned BinArray::dimension_of_bin_array ( const unsigned &  i) const
inline

Number of bins in coordinate direction i.

Definition at line 486 of file sample_point_container.h.

References Dimensions_of_bin_array, and i.

Referenced by RefineableBinArray::get_bin_boundaries().

◆ dimensions_of_bin_array() [1/2]

Vector<unsigned> BinArray::dimensions_of_bin_array ( ) const
inline

Number of bins in coordinate directions. Const vector-based version.

Definition at line 494 of file sample_point_container.h.

References Dimensions_of_bin_array.

Referenced by coords_to_bin_index(), and coords_to_vectorial_bin_index().

◆ dimensions_of_bin_array() [2/2]

unsigned BinArray::dimensions_of_bin_array ( const unsigned &  i) const
inline

Number of bins in specified coordinate direction.

Definition at line 501 of file sample_point_container.h.

References Dimensions_of_bin_array, and i.

◆ get_neighbouring_bins_helper()

void BinArray::get_neighbouring_bins_helper ( const unsigned &  bin_index,
const unsigned &  radius,
Vector< unsigned > &  neighbouring_bin_index,
const bool &  use_old_version = true 
)

Helper function for computing the bin indices of neighbouring bins at a given "radius" of the specified bin. Final, optional boolean (default: true) chooses to use the old version which appears to be faster than Louis' new one after all (in the few cases where this functionality is still used – not all if we have cgal!)

Helper function for computing the bin indices of neighbouring bins at a given "radius" of the specified bin.

Definition at line 1350 of file sample_point_container.cc.

References Dimensions_of_bin_array, i, and ndim_zeta().

Referenced by NonRefineableBinArray::fill_bin_by_diffusion(), RefineableBinArray::locate_zeta(), NonRefineableBinArray::locate_zeta(), RefineableBinArray::output_neighbouring_bins(), and profile_get_neighbouring_bins_helper().

◆ max_bin_dimension()

unsigned BinArray::max_bin_dimension ( ) const

Max. bin dimension (number of bins in coordinate directions)

Definition at line 659 of file sample_point_container.cc.

Referenced by oomph::Multi_domain_functions::aux_setup_multi_domain_interaction(), and NonRefineableBinArray::NonRefineableBinArray().

◆ nbin()

virtual unsigned BinArray::nbin ( ) const
pure virtual

Number of bins (not taking recursion into account for refineable versions)

Implemented in NonRefineableBinArray, and RefineableBinArray.

◆ ndim_zeta()

unsigned BinArray::ndim_zeta ( ) const
inlinevirtual

◆ operator=()

void BinArray::operator= ( const BinArray )
delete

Broken assignment operator.

◆ output_bin_vertices()

virtual void BinArray::output_bin_vertices ( std::ofstream &  outfile)
pure virtual

Output bin vertices (allowing display of bin boundaries as zones).

Implemented in NonRefineableBinArray, and RefineableBinArray.

◆ output_bins()

virtual void BinArray::output_bins ( std::ofstream &  outfile)
pure virtual

Output bins (boundaries and number of sample points in them)

Implemented in NonRefineableBinArray, and RefineableBinArray.

Referenced by oomph::Multi_domain_functions::aux_setup_multi_domain_interaction().

◆ profile_get_neighbouring_bins_helper()

void BinArray::profile_get_neighbouring_bins_helper ( )

Profiling function to compare performance of two different versions of the get_neighbouring_bins_helper(...) function.

Definition at line 1227 of file sample_point_container.cc.

References coords_to_bin_index(), coords_to_vectorial_bin_index(), Dimensions_of_bin_array, get_neighbouring_bins_helper(), i, SamplePointContainer::Min_and_max_coordinates, ndim_zeta(), oomph::oomph_info, and oomph::TimingHelpers::timer().

Member Data Documentation

◆ Dimensions_of_bin_array

Vector<unsigned> BinArray::Dimensions_of_bin_array
protected

The documentation for this class was generated from the following files: