![]() |
|
NonRefineableBinArray class. More...
#include <sample_point_container.h>
Public Member Functions | |
NonRefineableBinArray (SamplePointContainerParameters *bin_array_parameters_pt) | |
Constructor. More... | |
~NonRefineableBinArray () | |
Destructor: More... | |
NonRefineableBinArray (const NonRefineableBinArray &data)=delete | |
Broken copy constructor. More... | |
void | operator= (const NonRefineableBinArray &)=delete |
Broken assignment operator. More... | |
void | locate_zeta (const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s) |
unsigned | nbin () const |
Total number of bins (empty or not) More... | |
unsigned | total_number_of_sample_points_computed_recursively () const |
Compute total number of sample points recursively. More... | |
unsigned | n_spiral_chunk () const |
Number of spirals to be searched in one go const version. More... | |
unsigned & | n_spiral_chunk () |
Number of spirals to be searched in one go. More... | |
unsigned & | max_spiral_level () |
unsigned & | current_min_spiral_level () |
Access function to current min. spiral level. More... | |
unsigned & | current_max_spiral_level () |
Access function to current max. spiral level. More... | |
void | get_fill_stats (unsigned &n_bin, unsigned &max_n_entry, unsigned &min_n_entry, unsigned &tot_n_entry, unsigned &n_empty) const |
Provide some stats on the fill level of the associated bin. More... | |
double | min_distance (const unsigned &i_bin, const Vector< double > &zeta) |
void | output_bin_vertices (std::ofstream &outfile) |
Output bin vertices (allowing display of bins as zones). More... | |
void | get_bin_vertices (const unsigned &i_bin, Vector< Vector< double >> &bin_vertex) |
void | get_bin (const Vector< double > &zeta, int &bin_number) |
void | get_bin (const Vector< double > &zeta, int &bin_number, Vector< std::pair< FiniteElement *, Vector< double >>> &sample_point_pairs) |
Vector< Vector< std::pair< FiniteElement *, Vector< double > > > > | bin_content () const |
Get the contents of all bins in vector. More... | |
const std::map< unsigned, Vector< std::pair< FiniteElement *, Vector< double > > > > * | get_all_bins_content () const |
Get the contents of all bins in vector. More... | |
void | fill_bin_by_diffusion (const unsigned &bin_diffusion_radius=1) |
void | output_bins (std::ofstream &outfile) |
Output bins. More... | |
void | output_bins (std::string &filename) |
Output bins. More... | |
![]() | |
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... | |
virtual unsigned & | total_number_of_sample_points_visited_during_locate_zeta_from_top_level () |
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 = 100 |
Default number of bins (in each coordinate direction) More... | |
static unsigned long | Total_nbin_cells_counter = 0 |
static unsigned long | Threshold_for_total_bin_cell_number_warning |
static bool | Suppress_warning_about_large_total_number_of_bins |
Boolean to supppress warnings about large number of bins. More... | |
static bool | Already_warned_about_large_number_of_bin_cells |
static unsigned | Threshold_for_elements_per_bin_warning = 100 |
static bool | Suppress_warning_about_small_number_of_bins |
Boolean to supppress warnings about small number of bins. More... | |
static bool | Already_warned_about_small_number_of_bin_cells |
![]() | |
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_bins_of_objects () |
void | flush_bins_of_objects () |
Private Attributes | |
SparseVector< Vector< std::pair< FiniteElement *, Vector< double > > > > | Bin_object_coord_pairs |
Storage for paired objects and coords in each bin. More... | |
unsigned | Max_spiral_level |
unsigned | Current_min_spiral_level |
Current min. spiralling level. More... | |
unsigned | Current_max_spiral_level |
Current max. spiralling level. More... | |
unsigned | Nspiral_chunk |
Number of spirals to be searched in one go. More... | |
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 |
NonRefineableBinArray class.
///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
NonRefineableBinArray::NonRefineableBinArray | ( | SamplePointContainerParameters * | sample_point_container_parameters_pt | ) |
Constructor.
///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
References Current_max_spiral_level, Current_min_spiral_level, Default_n_bin_1d, BinArray::Dimensions_of_bin_array, SamplePointContainer::Enable_timing_of_setup, fill_bin_array(), BinArray::max_bin_dimension(), Max_spiral_level, SamplePointContainer::Mesh_pt, SamplePointContainer::Min_and_max_coordinates, Nspiral_chunk, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::oomph_info, SamplePointContainer::setup_min_and_max_coordinates(), and total_number_of_sample_points_computed_recursively().
|
inline |
Destructor:
References flush_bins_of_objects().
|
delete |
Broken copy constructor.
|
inline |
Get the contents of all bins in vector.
References Bin_object_coord_pairs.
|
private |
Initialise and populate the "bin" structure for locating coordinates and increment counter for total number of bins in active use by any MeshAsGeomObject)
|
inline |
Access function to current max. spiral level.
References Current_max_spiral_level.
Referenced by oomph::Multi_domain_functions::aux_setup_multi_domain_interaction(), check_locate_zeta(), and locate_zeta().
|
inline |
Access function to current min. spiral level.
References Current_min_spiral_level.
Referenced by oomph::Multi_domain_functions::aux_setup_multi_domain_interaction(), check_locate_zeta(), and locate_zeta().
|
private |
Fill the bin array with sample points from FiniteElements stored in mesh.
Loop over subobjects (elements) to decide which bin they belong in...
References Already_warned_about_large_number_of_bin_cells, Already_warned_about_small_number_of_bin_cells, Bin_object_coord_pairs, BinArray::Dimensions_of_bin_array, e(), flush_bins_of_objects(), i, int(), SamplePointContainer::Mesh_pt, SamplePointContainer::Min_and_max_coordinates, Global_Physical_Variables::multiplier(), nbin(), BinArray::ndim_zeta(), SamplePointContainer::Nsample_points_generated_per_element, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, SamplePointContainer::Percentage_offset, Suppress_warning_about_large_total_number_of_bins, Suppress_warning_about_small_number_of_bins, Threshold_for_elements_per_bin_warning, Threshold_for_total_bin_cell_number_warning, Total_nbin_cells_counter, SamplePointContainer::Use_equally_spaced_interior_sample_points, and SamplePointContainer::Use_eulerian_coordinates_during_setup.
Referenced by NonRefineableBinArray().
void NonRefineableBinArray::fill_bin_by_diffusion | ( | const unsigned & | bin_diffusion_radius = 1 | ) |
Fill bin by diffusion, populating each empty bin with the same content as the first non-empty bin found during a spiral-based search up to the specified "radius" (default 1)
References Bin_object_coord_pairs, BinArray::get_neighbouring_bins_helper(), i, j, min_distance(), n, nbin(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, s, size, and plotDoE::x.
|
inlineprivate |
Flush the storage for the binning method (and decrement counter for total number of bins in active use by any MeshAsGeomObject)
References Bin_object_coord_pairs, and Total_nbin_cells_counter.
Referenced by fill_bin_array(), and ~NonRefineableBinArray().
|
inline |
Get the contents of all bins in vector.
References Bin_object_coord_pairs.
Get the number of the bin containing the specified coordinate. Bin number is negative if the coordinate is outside the bin structure.
References BinArray::Dimensions_of_bin_array, get_bin_vertices(), i, int(), j, SamplePointContainer::Min_and_max_coordinates, Global_Physical_Variables::multiplier(), BinArray::ndim_zeta(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, Eigen::bfloat16_impl::pow(), and Eigen::zeta().
void NonRefineableBinArray::get_bin | ( | const Vector< double > & | zeta, |
int & | bin_number, | ||
Vector< std::pair< FiniteElement *, Vector< double >>> & | sample_point_pairs | ||
) |
Get the number of the bin containing the specified coordinate; also return the contents of that bin. Bin number is negative if the coordinate is outside the bin structure.
void NonRefineableBinArray::get_bin_vertices | ( | const unsigned & | i_bin, |
Vector< Vector< double >> & | bin_vertex | ||
) |
Get vector of vectors containing the coordinates of the vertices of the i_bin-th bin: bin_vertex[j][i] contains the i-th coordinate of the j-th vertex.
References BinArray::Dimensions_of_bin_array, i, SamplePointContainer::Min_and_max_coordinates, BinArray::ndim_zeta(), OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.
Referenced by get_bin(), min_distance(), and output_bin_vertices().
void NonRefineableBinArray::get_fill_stats | ( | unsigned & | n_bin, |
unsigned & | max_n_entry, | ||
unsigned & | min_n_entry, | ||
unsigned & | tot_n_entry, | ||
unsigned & | n_empty | ||
) | const |
Provide some stats on the fill level of the associated bin.
References Bin_object_coord_pairs, and nbin().
|
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.
Find the sub geometric object and local coordinate therein that corresponds to the intrinsic coordinate zeta. If sub_geom_object_pt=0 on return from this function, none of the constituent sub-objects contain the required coordinate.
Implements SamplePointContainer.
References SamplePointContainer::Always_fail_elemental_locate_zeta, Bin_object_coord_pairs, current_max_spiral_level(), current_min_spiral_level(), BinArray::Dimensions_of_bin_array, BinArray::get_neighbouring_bins_helper(), i, int(), SamplePointContainer::Max_search_radius, SamplePointContainer::Min_and_max_coordinates, min_distance(), Global_Physical_Variables::multiplier(), BinArray::ndim_zeta(), s, sqrt(), SamplePointContainer::total_number_of_sample_points_visited_during_locate_zeta_from_top_level(), SamplePointContainer::Total_number_of_sample_points_visited_during_locate_zeta_from_top_level, SamplePointContainer::use_eulerian_coordinates_during_setup(), SamplePointContainer::Visited_sample_points_file, and Eigen::zeta().
|
inline |
Access function to max. spiral level during straight locate_zeta search (for efficiency; similar to max_search_radius())
References Max_spiral_level.
double NonRefineableBinArray::min_distance | ( | const unsigned & | i_bin, |
const Vector< double > & | zeta | ||
) |
Compute the minimum distance of any vertex in the specified bin from the specified Lagrangian coordinate zeta
Compute the minimum distance of any vertex in the specified bin from the specified Lagrangian coordinate zeta.
References get_bin_vertices(), i, BinArray::ndim_zeta(), Eigen::bfloat16_impl::pow(), sqrt(), v, and Eigen::zeta().
Referenced by fill_bin_by_diffusion(), and locate_zeta().
|
inline |
Number of spirals to be searched in one go.
References Nspiral_chunk.
|
inline |
Number of spirals to be searched in one go const version.
References Nspiral_chunk.
Referenced by oomph::Multi_domain_functions::aux_setup_multi_domain_interaction(), and check_locate_zeta().
|
inlinevirtual |
Total number of bins (empty or not)
Implements BinArray.
References BinArray::Dimensions_of_bin_array, i, and BinArray::ndim_zeta().
Referenced by fill_bin_array(), fill_bin_by_diffusion(), get_fill_stats(), and output_bin_vertices().
|
delete |
Broken assignment operator.
|
virtual |
Output bin vertices (allowing display of bins as zones).
Implements BinArray.
References BinArray::Dimensions_of_bin_array, get_bin_vertices(), i, j, nbin(), and BinArray::ndim_zeta().
|
virtual |
Output bins.
Implements BinArray.
References b, Bin_object_coord_pairs, BinArray::Dimensions_of_bin_array, e(), i, BinArray::ndim_zeta(), s, SamplePointContainer::Use_eulerian_coordinates_during_setup, and Eigen::zeta().
Referenced by output_bins().
|
inline |
Output bins.
References MergeRestartFiles::filename, and output_bins().
|
virtual |
Compute total number of sample points recursively.
Implements SamplePointContainer.
References Bin_object_coord_pairs.
Referenced by NonRefineableBinArray().
|
static |
Boolean flag to make sure that warning about large number of bin cells only gets triggered once.
Referenced by fill_bin_array().
|
static |
Boolean flag to make sure that warning about small number of bin cells only gets triggered once.
Referenced by fill_bin_array().
|
private |
Storage for paired objects and coords in each bin.
Referenced by bin_content(), fill_bin_array(), fill_bin_by_diffusion(), flush_bins_of_objects(), get_all_bins_content(), get_fill_stats(), locate_zeta(), output_bins(), and total_number_of_sample_points_computed_recursively().
|
private |
Current max. spiralling level.
Referenced by current_max_spiral_level(), and NonRefineableBinArray().
|
private |
Current min. spiralling level.
Referenced by current_min_spiral_level(), and NonRefineableBinArray().
|
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; nonrefineable bin wants a much larger value than the refineable one!)
Referenced by NonRefineableBinArray(), and UnstructuredFSIProblem< FLUID_ELEMENT, SOLID_ELEMENT >::UnstructuredFSIProblem().
|
private |
Max. spiralling level (for efficiency; effect similar to max_search_radius)
Referenced by max_spiral_level(), and NonRefineableBinArray().
|
private |
Number of spirals to be searched in one go.
Referenced by n_spiral_chunk(), and NonRefineableBinArray().
|
static |
Boolean to supppress warnings about large number of bins.
Referenced by fill_bin_array().
|
static |
Boolean to supppress warnings about small number of bins.
Referenced by fill_bin_array().
|
static |
Fraction of elements/bin that triggers warning. Too many elements per bin can lead to very slow computations
Referenced by fill_bin_array().
|
static |
Total number of bins above which warning is issued. (Default assignment of 100^DIM bins per MeshAsGeomObject can be a killer if there are huge numbers of sub-meshes (e.g. in unstructured FSI).
Referenced by fill_bin_array().
|
static |
Counter for overall number of bins allocated – used to issue warning if this exceeds a threshhold. (Default assignment of 100^DIM bins per MeshAsGeomObject can be a killer if there are huge numbers of sub-meshes (e.g. in unstructured FSI).
Referenced by fill_bin_array(), and flush_bins_of_objects().