![]() |
|
RefineableBinArray class. More...
#include <sample_point_container.h>
Public Member Functions | |
RefineableBinArray (SamplePointContainerParameters *bin_array_parameters_pt) | |
Constructor. More... | |
RefineableBinArray (const RefineableBinArray &data)=delete | |
Broken copy constructor. More... | |
void | operator= (const RefineableBinArray &)=delete |
Broken assignment operator. More... | |
~RefineableBinArray () | |
Destructor. More... | |
RefineableBinArray * | root_bin_array_pt () const |
Root bin array. More... | |
RefineableBin * | bin_pt (const unsigned &i) const |
Pointer to i-th bin; can be null if bin is empty. More... | |
unsigned | nbin () const |
Number of bins (not taking recursion into account) More... | |
unsigned | total_number_of_sample_points_computed_recursively () const |
Compute total number of sample points recursively. More... | |
void | fill_bin_array (const Vector< SamplePoint * > &sample_point_pt) |
Fill the bin array with specified SamplePoints. More... | |
void | add_sample_point (SamplePoint *new_sample_point_pt, const Vector< double > &zeta) |
Add specified SamplePoint to RefineableBinArray. More... | |
void | locate_zeta (const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s) |
void | get_bin_boundaries (const unsigned &bin_index, Vector< std::pair< double, double >> &min_and_max_coordinates) |
unsigned | depth () const |
Depth of the hierarchical bin_array. More... | |
unsigned | max_depth () const |
Max depth of the hierarchical bin_array; const version. More... | |
unsigned & | max_depth () |
Max depth of the hierarchical bin_array. More... | |
bool | bin_array_is_recursive () const |
Is the BinArray recursive? More... | |
unsigned | max_number_of_sample_point_per_bin () const |
void | output_bins (std::ofstream &outfile) |
Output bins. More... | |
void | output_bin_vertices (std::ofstream &outfile) |
Output bin vertices (allowing display of bins as zones). More... | |
void | output_neighbouring_bins (const unsigned &bin_index, const unsigned &radius, std::ofstream &outfile) |
Output neighbouring bins at given "radius" of the specified bin. More... | |
unsigned & | total_number_of_sample_points_visited_during_locate_zeta_from_top_level () |
unsigned & | first_sample_point_to_actually_lookup_during_locate_zeta () |
unsigned & | last_sample_point_to_actually_lookup_during_locate_zeta () |
unsigned & | multiplier_for_max_sample_point_to_actually_lookup_during_locate_zeta () |
unsigned & | initial_last_sample_point_to_actually_lookup_during_locate_zeta () |
![]() | |
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 () | |
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) |
void | profile_get_neighbouring_bins_helper () |
unsigned | coords_to_bin_index (const Vector< double > &zeta) |
void | coords_to_vectorial_bin_index (const Vector< double > &zeta, Vector< unsigned > &bin_index) |
Get "coordinates" of bin that contains specified zeta. 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 |
unsigned | dimensions_of_bin_array (const unsigned &i) const |
Number of bins in specified coordinate direction. More... | |
![]() | |
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 () | |
SamplePointContainer (const SamplePointContainer &data)=delete | |
Broken copy constructor. More... | |
void | operator= (const SamplePointContainer &)=delete |
Broken assignment operator. More... | |
virtual | ~SamplePointContainer () |
Virtual destructor. 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 |
const Vector< std::pair< double, double > > & | min_and_max_coordinates () const |
bool | use_eulerian_coordinates_during_setup () const |
unsigned & | nsample_points_generated_per_element () |
"Measure of" number of sample points generated in each element More... | |
double & | max_search_radius () |
Static Public Attributes | |
static unsigned | Default_n_bin_1d = 5 |
Default number of bins (in each coordinate direction) More... | |
![]() | |
static std::ofstream | Visited_sample_points_file |
File to record sequence of visited sample points in. More... | |
static bool | Always_fail_elemental_locate_zeta = false |
Boolean flag to make to make locate zeta fail. More... | |
static bool | Use_equally_spaced_interior_sample_points = true |
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... | |
Private Member Functions | |
void | fill_bin_array () |
Fill the bin array with sample points from FiniteElements stored in mesh. More... | |
void | create_sample_points_from_element (FiniteElement *const element_pt, const unsigned &n_element) |
Private Attributes | |
Vector< RefineableBin * > | Bin_pt |
Vector of pointers to constituent RefineableBins. More... | |
bool | Bin_array_is_recursive |
unsigned | Depth |
unsigned | Max_depth |
Max depth of the hierarchical bin_array. More... | |
unsigned | Max_number_of_sample_point_per_bin |
RefineableBinArray * | Root_bin_array_pt |
Pointer to root bin array. More... | |
unsigned | First_sample_point_to_actually_lookup_during_locate_zeta |
unsigned | Last_sample_point_to_actually_lookup_during_locate_zeta |
unsigned | Multiplier_for_max_sample_point_to_actually_lookup_during_locate_zeta |
unsigned | Initial_last_sample_point_to_actually_lookup_during_locate_zeta |
Additional Inherited Members | |
![]() | |
void | setup_min_and_max_coordinates () |
Setup the min and max coordinates for the mesh, in each dimension. More... | |
![]() | |
Vector< unsigned > | Dimensions_of_bin_array |
Number of bins in each coordinate direction. More... | |
![]() | |
Mesh * | Mesh_pt |
Pointer to mesh from whose FiniteElements sample points are created. More... | |
Vector< std::pair< double, double > > | Min_and_max_coordinates |
bool | Use_eulerian_coordinates_during_setup |
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 |
double | Max_search_radius |
RefineableBinArray class.
///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
RefineableBinArray::RefineableBinArray | ( | SamplePointContainerParameters * | sample_point_container_parameters_pt | ) |
Constructor.
/////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// RefineableBin array class /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
References Bin_array_is_recursive, Bin_pt, Default_n_bin_1d, Depth, BinArray::Dimensions_of_bin_array, SamplePointContainer::Enable_timing_of_setup, fill_bin_array(), First_sample_point_to_actually_lookup_during_locate_zeta, i, Initial_last_sample_point_to_actually_lookup_during_locate_zeta, Last_sample_point_to_actually_lookup_during_locate_zeta, Max_depth, Max_number_of_sample_point_per_bin, SamplePointContainer::Mesh_pt, SamplePointContainer::Min_and_max_coordinates, Multiplier_for_max_sample_point_to_actually_lookup_during_locate_zeta, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::oomph_info, root_bin_array_pt(), Root_bin_array_pt, SamplePointContainer::setup_min_and_max_coordinates(), total_number_of_sample_points_computed_recursively(), and SamplePointContainer::Total_number_of_sample_points_visited_during_locate_zeta_from_top_level.
|
delete |
Broken copy constructor.
|
inline |
|
inline |
Add specified SamplePoint to RefineableBinArray.
References Bin_pt, BinArray::coords_to_bin_index(), and Eigen::zeta().
Referenced by fill_bin_array().
|
inline |
Is the BinArray recursive?
References Bin_array_is_recursive.
|
inline |
|
private |
Loop over all sample points in the element specified via the pointer and create a SamplePoint for each. Also specify the index of the element in its mesh.
|
inline |
|
private |
Fill the bin array with sample points from FiniteElements stored in mesh.
For all the sample points we have to create ...
References Bin_pt, BinArray::coords_to_bin_index(), e(), i, j, SamplePointContainer::Mesh_pt, SamplePointContainer::Min_and_max_coordinates, BinArray::ndim_zeta(), SamplePointContainer::Nsample_points_generated_per_element, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, s, SamplePointContainer::Use_equally_spaced_interior_sample_points, SamplePointContainer::Use_eulerian_coordinates_during_setup, and Eigen::zeta().
Referenced by RefineableBinArray().
|
inline |
Fill the bin array with specified SamplePoints.
References add_sample_point(), e(), i, j, SamplePointContainer::Mesh_pt, n, BinArray::ndim_zeta(), SamplePointContainer::Nsample_points_generated_per_element, s, SamplePointContainer::Use_equally_spaced_interior_sample_points, SamplePointContainer::Use_eulerian_coordinates_during_setup, and Eigen::zeta().
|
inline |
When searching through sample points recursively from the top level RefineableBinArray (in deterministic order!) only actually do the locate_zeta calls when when the counter exceeds this value.
References First_sample_point_to_actually_lookup_during_locate_zeta.
Referenced by oomph::Multi_domain_functions::aux_setup_multi_domain_interaction().
void RefineableBinArray::get_bin_boundaries | ( | const unsigned & | bin_index, |
Vector< std::pair< double, double >> & | min_and_max_coordinates_of_bin | ||
) |
Boundaries of specified bin in each coordinate direction. *.first = min; *.second = max.
References BinArray::dimension_of_bin_array(), BinArray::Dimensions_of_bin_array, SamplePointContainer::Min_and_max_coordinates, and BinArray::ndim_zeta().
Referenced by output_neighbouring_bins().
|
inline |
When searching through sample points recursively from the top level RefineableBinArray (in deterministic order!) only actually do the locate_zeta calls when when the counter exceeds this value. This is the initial value when starting the spiral based search.
References Initial_last_sample_point_to_actually_lookup_during_locate_zeta.
Referenced by oomph::Multi_domain_functions::aux_setup_multi_domain_interaction().
|
inline |
When searching through sample points recursively from the top level RefineableBinArray (in deterministic order!) only actually do the locate_zeta calls when when the counter is less than this value.
References Last_sample_point_to_actually_lookup_during_locate_zeta.
Referenced by oomph::Multi_domain_functions::aux_setup_multi_domain_interaction().
|
virtual |
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.
Implements SamplePointContainer.
References SamplePointContainer::Always_fail_elemental_locate_zeta, Bin_pt, BinArray::coords_to_bin_index(), BinArray::coords_to_vectorial_bin_index(), Depth, BinArray::Dimensions_of_bin_array, BinArray::get_neighbouring_bins_helper(), i, k, max, SamplePointContainer::max_search_radius(), SamplePointContainer::Min_and_max_coordinates, nbin(), BinArray::ndim_zeta(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, UniformPSDSelfTest::radius, s, total_number_of_sample_points_computed_recursively(), SamplePointContainer::Total_number_of_sample_points_visited_during_locate_zeta_from_top_level, and Eigen::zeta().
|
inline |
|
inline |
|
inline |
Maximum number of sample points in bin (before its subdivided recursively)
References Max_number_of_sample_point_per_bin.
|
inline |
Every time we've completed a "spiral", visiting a finite number of sample points in a deterministic order, use this multiplier to increase the max. number of sample points to be visited. Using a multiplier rather than a constant increment increases the amount of (more and more unlikely to yield anything!) work done locally before doing another costly mpi round trip when we're already far from the point we're trying to find.
References Multiplier_for_max_sample_point_to_actually_lookup_during_locate_zeta.
Referenced by oomph::Multi_domain_functions::aux_setup_multi_domain_interaction().
|
inlinevirtual |
Number of bins (not taking recursion into account)
Implements BinArray.
References Bin_pt.
Referenced by locate_zeta(), and total_number_of_sample_points_computed_recursively().
|
delete |
Broken assignment operator.
|
virtual |
Output bin vertices (allowing display of bins as zones).
Output neighbouring bins up to given "radius" of the specified bin.
Implements BinArray.
|
inlinevirtual |
void RefineableBinArray::output_neighbouring_bins | ( | const unsigned & | bin_index, |
const unsigned & | radius, | ||
std::ofstream & | outfile | ||
) |
Output neighbouring bins at given "radius" of the specified bin.
Output neighbouring bins up to given "radius" of the specified bin.
References get_bin_boundaries(), BinArray::get_neighbouring_bins_helper(), i, SamplePointContainer::min_and_max_coordinates(), SamplePointContainer::Min_and_max_coordinates, BinArray::ndim_zeta(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::oomph_info, and UniformPSDSelfTest::radius.
|
inline |
|
virtual |
Compute total number of sample points recursively.
Implements SamplePointContainer.
References Bin_pt, i, and nbin().
Referenced by oomph::Multi_domain_functions::aux_setup_multi_domain_interaction(), locate_zeta(), and RefineableBinArray().
|
inlinevirtual |
Counter to keep track of how many sample points we've visited during top level call to locate_zeta
Reimplemented from SamplePointContainer.
References Depth, Root_bin_array_pt, SamplePointContainer::Total_number_of_sample_points_visited_during_locate_zeta_from_top_level, and total_number_of_sample_points_visited_during_locate_zeta_from_top_level().
Referenced by total_number_of_sample_points_visited_during_locate_zeta_from_top_level().
|
private |
Variable which stores if the RefineableBinArray is recursive or not.
Referenced by bin_array_is_recursive(), and RefineableBinArray().
|
private |
Vector of pointers to constituent RefineableBins.
Referenced by add_sample_point(), bin_pt(), fill_bin_array(), locate_zeta(), nbin(), output_bin_vertices(), output_bins(), RefineableBinArray(), total_number_of_sample_points_computed_recursively(), and ~RefineableBinArray().
|
static |
Default number of bins (in each coordinate direction)
Default number of bins (in each coordinate direction) (Note: don't move this into a common base class because each derived class has its own value; we'll want far fewer in the refineable version!)
Referenced by RefineableBinArray().
|
private |
Variable which stores the Depth value of the bin_array. Useful for debugging and for preventing "infinite" recursion in case if there is a problem.
Referenced by depth(), locate_zeta(), RefineableBinArray(), and total_number_of_sample_points_visited_during_locate_zeta_from_top_level().
|
private |
When searching through sample points recursively from the top level RefineableBinArray (in deterministic order!) only actually do the locate_zeta calls when when the counter exceeds this value.
Referenced by first_sample_point_to_actually_lookup_during_locate_zeta(), and RefineableBinArray().
|
private |
When searching through sample points recursively from the top level RefineableBinArray (in deterministic order!) only actually do the locate_zeta calls when when the counter exceeds this value. This is the initial value when starting the spiral based search.
Referenced by initial_last_sample_point_to_actually_lookup_during_locate_zeta(), and RefineableBinArray().
|
private |
When searching through sample points recursively from the top level RefineableBinArray (in deterministic order!) only actually do the locate_zeta calls when when the counter is less than this value.
Referenced by last_sample_point_to_actually_lookup_during_locate_zeta(), and RefineableBinArray().
|
private |
Max depth of the hierarchical bin_array.
Referenced by max_depth(), and RefineableBinArray().
|
private |
Maximum number of sample points in bin (before it's subdivided recursively)
Referenced by max_number_of_sample_point_per_bin(), and RefineableBinArray().
|
private |
Every time we've completed a "spiral", visiting a finite number of sample points in a deterministic order, use this multiplier to increase the max. number of sample points to be visited. Using a multiplier rather than a constant increment increases the amount of (more and more unlikely to yield anything!) work done locally before doing another costly mpi round trip when we're already far from the point we're trying to find.
Referenced by multiplier_for_max_sample_point_to_actually_lookup_during_locate_zeta(), and RefineableBinArray().
|
private |
Pointer to root bin array.
Referenced by RefineableBinArray(), root_bin_array_pt(), and total_number_of_sample_points_visited_during_locate_zeta_from_top_level().