///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// More...
#include <sample_point_container.h>
Public Member Functions | |
CGALSamplePointContainer (SamplePointContainerParameters *sample_point_container_parameters_pt) | |
Constructor. More... | |
CGALSamplePointContainer (const CGALSamplePointContainer &data)=delete | |
Broken copy constructor. More... | |
void | operator= (const CGALSamplePointContainer &)=delete |
Broken assignment operator. More... | |
virtual | ~CGALSamplePointContainer () |
Virtual destructor. More... | |
unsigned & | first_sample_point_to_actually_lookup_during_locate_zeta () |
When searching through sample points only actually do the locate_zeta calls when when the counter exceeds this value. More... | |
unsigned & | last_sample_point_to_actually_lookup_during_locate_zeta () |
When searching through sample points only actually do the locate_zeta calls when when the counter is less than this value. More... | |
unsigned & | multiplier_for_max_sample_point_to_actually_lookup_during_locate_zeta () |
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. More... | |
unsigned & | initial_last_sample_point_to_actually_lookup_during_locate_zeta () |
When searching through sample points 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. More... | |
void | locate_zeta (const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s) |
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... | |
void | limited_locate_zeta (const Vector< double > &zeta, const unsigned &max_sample_points_for_newton_based_search, GeomObject *&sub_geom_object_pt, Vector< double > &s) |
Find the sub geometric object and local coordinate therein that corresponds to the intrinsic coordinate zeta, using up to the specified number of sample points as initial guess for the Newton-based search. If this fails, return the nearest sample point. More... | |
unsigned | ndim_zeta () const |
Dimension of the zeta ( = dim of local coordinate of elements) More... | |
unsigned | total_number_of_sample_points_computed_recursively () const |
Compute total number of sample points in sample point container. 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 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... | |
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... | |
Private Types | |
typedef CGAL::Cartesian_d< double > | Kernel_d |
typedefs for cgal stuff More... | |
typedef Kernel_d::Point_d | Point_d |
typedef boost::tuple< Point_d, SamplePoint * > | Point_d_and_pointer |
typedef CGAL::Search_traits_d< Kernel_d > | Traits_base_d |
typedef CGAL::Search_traits_adapter< Point_d_and_pointer, CGAL::Nth_of_tuple_property_map< 0, Point_d_and_pointer >, Traits_base_d > | Traits_d |
typedef CGAL::Orthogonal_k_neighbor_search< Traits_d > | K_neighbor_search_d |
Private Member Functions | |
double | get_sample_points () |
Get the sample points; return time for setup of CGAL tree. More... | |
Private Attributes | |
unsigned | Ndim_zeta |
Dimension of the zeta ( = dim of local coordinate of elements) More... | |
Vector< Point_d > | CGAL_sample_point_zeta_d |
Vector containing sample point coordinates. More... | |
K_neighbor_search_d::Tree * | CGAL_tree_d_pt |
Pointer to tree-based representation of sample points. More... | |
Vector< SamplePoint * > | Sample_point_pt |
Vector storing pointers to sample point objects (which represent sample point in terms of number of element in its mesh and number of sample point) More... | |
unsigned | First_sample_point_to_actually_lookup_during_locate_zeta |
When searching through sample points only actually do the locate_zeta calls when when the counter exceeds this value. More... | |
unsigned | Last_sample_point_to_actually_lookup_during_locate_zeta |
When searching through sample points only actually do the locate_zeta calls when when the counter is less than this value. More... | |
unsigned | Multiplier_for_max_sample_point_to_actually_lookup_during_locate_zeta |
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. More... | |
unsigned | Initial_last_sample_point_to_actually_lookup_during_locate_zeta |
When searching through sample points 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. 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... | |
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... | |
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
CGAL-based SamplePointContainer
Definition at line 1039 of file sample_point_container.h.
|
private |
Definition at line 1146 of file sample_point_container.h.
|
private |
typedefs for cgal stuff
Definition at line 1137 of file sample_point_container.h.
|
private |
Definition at line 1138 of file sample_point_container.h.
|
private |
Definition at line 1139 of file sample_point_container.h.
|
private |
Definition at line 1140 of file sample_point_container.h.
|
private |
Definition at line 1145 of file sample_point_container.h.
CGALSamplePointContainer::CGALSamplePointContainer | ( | SamplePointContainerParameters * | sample_point_container_parameters_pt | ) |
Constructor.
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
Constructor
Definition at line 3390 of file sample_point_container.cc.
References SamplePointContainer::Enable_timing_of_setup, First_sample_point_to_actually_lookup_during_locate_zeta, get_sample_points(), Initial_last_sample_point_to_actually_lookup_during_locate_zeta, Last_sample_point_to_actually_lookup_during_locate_zeta, SamplePointContainer::Mesh_pt, SamplePointContainer::Min_and_max_coordinates, Multiplier_for_max_sample_point_to_actually_lookup_during_locate_zeta, Ndim_zeta, oomph::oomph_info, SamplePointContainer::setup_min_and_max_coordinates(), oomph::TimingHelpers::timer(), 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.
|
inlinevirtual |
Virtual destructor.
Definition at line 1053 of file sample_point_container.h.
References CGAL_tree_d_pt, i, and Sample_point_pt.
|
inline |
When searching through sample points only actually do the locate_zeta calls when when the counter exceeds this value.
Definition at line 1067 of file sample_point_container.h.
References First_sample_point_to_actually_lookup_during_locate_zeta.
Referenced by oomph::Multi_domain_functions::aux_setup_multi_domain_interaction(), and locate_zeta().
|
private |
Get the sample points; return time for setup of CGAL tree.
Get the sample points; returns time taken for setup of CGAL tree.
For all the sample points we have to create ...
Definition at line 3480 of file sample_point_container.cc.
References CGAL_sample_point_zeta_d, CGAL_tree_d_pt, e, SamplePointContainer::Enable_timing_of_setup, i, SamplePointContainer::Mesh_pt, SamplePointContainer::Min_and_max_coordinates, ndim_zeta(), SamplePointContainer::Nsample_points_generated_per_element, s, Sample_point_pt, oomph::TimingHelpers::timer(), SamplePointContainer::Use_equally_spaced_interior_sample_points, and SamplePointContainer::Use_eulerian_coordinates_during_setup.
Referenced by CGALSamplePointContainer().
|
inline |
When searching through sample points 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.
Definition at line 1095 of file sample_point_container.h.
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 only actually do the locate_zeta calls when when the counter is less than this value.
Definition at line 1074 of file sample_point_container.h.
References Last_sample_point_to_actually_lookup_during_locate_zeta.
Referenced by oomph::Multi_domain_functions::aux_setup_multi_domain_interaction(), and locate_zeta().
void CGALSamplePointContainer::limited_locate_zeta | ( | const Vector< double > & | zeta, |
const unsigned & | max_sample_points_for_newton_based_search, | ||
GeomObject *& | sub_geom_object_pt, | ||
Vector< double > & | s | ||
) |
Find the sub geometric object and local coordinate therein that corresponds to the intrinsic coordinate zeta, using up to the specified number of sample points as initial guess for the Newton-based search. If this fails, return the nearest sample point.
Definition at line 3821 of file sample_point_container.cc.
References SamplePointContainer::Always_fail_elemental_locate_zeta, CGAL_tree_d_pt, SamplePoint::element_index_in_mesh(), i, SamplePointContainer::ignore_halo_elements_during_locate_zeta_search(), SamplePointContainer::Max_search_radius, SamplePointContainer::Mesh_pt, ndim_zeta(), SamplePointContainer::nsample_points_generated_per_element(), s, SamplePoint::sample_point_index_in_element(), Sample_point_pt, 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_equally_spaced_interior_sample_points, SamplePointContainer::use_eulerian_coordinates_during_setup(), and SamplePointContainer::Visited_sample_points_file.
|
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.
Definition at line 3606 of file sample_point_container.cc.
References SamplePointContainer::Always_fail_elemental_locate_zeta, CGAL_tree_d_pt, SamplePoint::element_index_in_mesh(), first_sample_point_to_actually_lookup_during_locate_zeta(), i, SamplePointContainer::ignore_halo_elements_during_locate_zeta_search(), last_sample_point_to_actually_lookup_during_locate_zeta(), SamplePointContainer::Max_search_radius, SamplePointContainer::Mesh_pt, SamplePointContainer::Min_and_max_coordinates, ndim_zeta(), SamplePointContainer::nsample_points_generated_per_element(), s, SamplePoint::sample_point_index_in_element(), Sample_point_pt, 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_equally_spaced_interior_sample_points, SamplePointContainer::use_eulerian_coordinates_during_setup(), and SamplePointContainer::Visited_sample_points_file.
|
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.
Definition at line 1087 of file sample_point_container.h.
References Multiplier_for_max_sample_point_to_actually_lookup_during_locate_zeta.
Referenced by oomph::Multi_domain_functions::aux_setup_multi_domain_interaction().
|
inlinevirtual |
Dimension of the zeta ( = dim of local coordinate of elements)
Implements SamplePointContainer.
Definition at line 1121 of file sample_point_container.h.
References Ndim_zeta.
Referenced by get_sample_points(), limited_locate_zeta(), and locate_zeta().
|
delete |
Broken assignment operator.
|
virtual |
Compute total number of sample points in sample point container.
Implements SamplePointContainer.
Definition at line 3593 of file sample_point_container.cc.
References Sample_point_pt.
Referenced by oomph::Multi_domain_functions::aux_setup_multi_domain_interaction(), and CGALSamplePointContainer().
|
private |
Vector containing sample point coordinates.
Definition at line 1149 of file sample_point_container.h.
Referenced by get_sample_points().
|
private |
Pointer to tree-based representation of sample points.
Definition at line 1152 of file sample_point_container.h.
Referenced by get_sample_points(), limited_locate_zeta(), locate_zeta(), and ~CGALSamplePointContainer().
|
private |
When searching through sample points only actually do the locate_zeta calls when when the counter exceeds this value.
Definition at line 1161 of file sample_point_container.h.
Referenced by CGALSamplePointContainer(), and first_sample_point_to_actually_lookup_during_locate_zeta().
|
private |
When searching through sample points 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.
Definition at line 1180 of file sample_point_container.h.
Referenced by CGALSamplePointContainer(), and initial_last_sample_point_to_actually_lookup_during_locate_zeta().
|
private |
When searching through sample points only actually do the locate_zeta calls when when the counter is less than this value.
Definition at line 1165 of file sample_point_container.h.
Referenced by CGALSamplePointContainer(), and last_sample_point_to_actually_lookup_during_locate_zeta().
|
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.
Definition at line 1175 of file sample_point_container.h.
Referenced by CGALSamplePointContainer(), and multiplier_for_max_sample_point_to_actually_lookup_during_locate_zeta().
|
private |
Dimension of the zeta ( = dim of local coordinate of elements)
Definition at line 1134 of file sample_point_container.h.
Referenced by CGALSamplePointContainer(), and ndim_zeta().
|
private |
Vector storing pointers to sample point objects (which represent sample point in terms of number of element in its mesh and number of sample point)
Definition at line 1157 of file sample_point_container.h.
Referenced by get_sample_points(), limited_locate_zeta(), locate_zeta(), total_number_of_sample_points_computed_recursively(), and ~CGALSamplePointContainer().