CGAL-based SamplePointContainer. More...
#include <sample_point_container.h>
Public Member Functions | |
CGALSamplePointContainer (SamplePointContainerParameters *sample_point_container_parameters_pt) | |
Constructor. More... | |
CGALSamplePointContainer (const CGALSamplePointContainer &data) | |
Broken copy constructor. More... | |
void | operator= (const CGALSamplePointContainer &) |
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. 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. 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... | |
![]() | |
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) | |
Broken copy constructor. More... | |
void | operator= (const SamplePointContainer &) |
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. 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 |
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 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. 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... | |
![]() | |
void | setup_min_and_max_coordinates () |
Helper function to compute the min and max coordinates for the mesh, in each dimension. 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 |
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 1079 of file sample_point_container.h.
|
private |
Definition at line 1193 of file sample_point_container.h.
|
private |
typedefs for cgal stuff
Definition at line 1186 of file sample_point_container.h.
|
private |
Definition at line 1187 of file sample_point_container.h.
|
private |
Definition at line 1188 of file sample_point_container.h.
|
private |
Definition at line 1189 of file sample_point_container.h.
|
private |
Definition at line 1192 of file sample_point_container.h.
CGALSamplePointContainer::CGALSamplePointContainer | ( | SamplePointContainerParameters * | sample_point_container_parameters_pt | ) |
Constructor.
Definition at line 3388 of file sample_point_container.cc.
References 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.
|
inline |
Broken copy constructor.
Definition at line 1089 of file sample_point_container.h.
References oomph::BrokenCopy::broken_copy().
|
inlinevirtual |
|
inline |
When searching through sample points only actually do the locate_zeta calls when when the counter exceeds this value.
Definition at line 1115 of file sample_point_container.h.
Referenced by 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 3473 of file sample_point_container.cc.
References CGAL_sample_point_zeta_d, CGAL_tree_d_pt, e, 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 1143 of file sample_point_container.h.
References s.
|
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 1122 of file sample_point_container.h.
Referenced by 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 3814 of file sample_point_container.cc.
References 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(), 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, and SamplePointContainer::use_eulerian_coordinates_during_setup().
|
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 3601 of file sample_point_container.cc.
References 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(), 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, and SamplePointContainer::use_eulerian_coordinates_during_setup().
|
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 1135 of file sample_point_container.h.
|
inlinevirtual |
Dimension of the zeta ( = dim of local coordinate of elements)
Implements SamplePointContainer.
Definition at line 1169 of file sample_point_container.h.
Referenced by get_sample_points(), limited_locate_zeta(), and locate_zeta().
|
inline |
Broken assignment operator.
Definition at line 1095 of file sample_point_container.h.
References oomph::BrokenCopy::broken_assign().
|
virtual |
Compute total number of sample points in sample point container.
Implements SamplePointContainer.
Definition at line 3588 of file sample_point_container.cc.
References Sample_point_pt.
Referenced by CGALSamplePointContainer().
|
private |
Vector containing sample point coordinates.
Definition at line 1196 of file sample_point_container.h.
Referenced by get_sample_points().
|
private |
Pointer to tree-based representation of sample points.
Definition at line 1199 of file sample_point_container.h.
Referenced by get_sample_points(), limited_locate_zeta(), and locate_zeta().
|
private |
When searching through sample points only actually do the locate_zeta calls when when the counter exceeds this value.
Definition at line 1208 of file sample_point_container.h.
Referenced by CGALSamplePointContainer().
|
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 1226 of file sample_point_container.h.
Referenced by CGALSamplePointContainer().
|
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 1212 of file sample_point_container.h.
Referenced by CGALSamplePointContainer().
|
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 1221 of file sample_point_container.h.
Referenced by CGALSamplePointContainer().
|
private |
Dimension of the zeta ( = dim of local coordinate of elements)
Definition at line 1183 of file sample_point_container.h.
Referenced by CGALSamplePointContainer().
|
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 1204 of file sample_point_container.h.
Referenced by get_sample_points(), limited_locate_zeta(), locate_zeta(), and total_number_of_sample_points_computed_recursively().