SheafSystem  0.0.0.0
geometry::cylindrical_point_locator Class Referenceabstract

An abstract point location query in domains with global coordinate dimension dc and local coordinate dimension db using a search structure based on sorting bounding boxes into a set of bins. More...

#include <cylindrical_point_locator.h>

Inheritance diagram for geometry::cylindrical_point_locator:
geometry::point_locator geometry::array_cylindrical_point_locator

CYLINDRICAL_POINT_LOCATOR FACET

enum  space_dimensions { DC = 3, DB = 2 }
 Dimension of coordinate space. More...
 
typedef singly_linked_list< const d_bounding_box< 2, 2 > * > box_list_type
 The type of box list. More...
 
block< size_type_bin_ub
 The upper bound for the bin index. More...
 
sec_vd_value_type _bin_0_max
 A sec_vd_value_type that truncates to the maximum index for bin 0. More...
 
block< sec_vd_value_type_bin_size
 The dimensions of the smallest bins. More...
 
block< sec_vd_value_type_one_over_min_bin_size
 Reciprocal of the dimensions of the smallest bins. More...
 
size_type _box_ct
 The number of bounding boxes stored in the search structure. More...
 
block< d_bounding_box< 2, 2 > > _boxes
 Bounding boxes for the evaluation members. More...
 
block< sec_vd_dof_type_gathered_dofs
 The dofs of gathered by evaluation member. More...
 
eval_iterator _eval_itr
 The evaluator iterator used to populate the search structure; must have same life time as the search structure because it owns the eval_family which owns the section evaluators. More...
 
std::set< stl_scoped_index<> > _branches
 The branches for which a point has already been found for the current evaluation member. Used in all_points_at_value, allocated her to avoid reallocation for each query. More...
 
virtual ~cylindrical_point_locator ()
 Destructor. More...
 
const block< size_type > & bin_ub () const
 The upper bound for the bin index. More...
 
const block< sec_vd_value_type > & bin_size () const
 The dimensions of the smallest bins. More...
 
size_type box_ct () const
 The number of bounding boxes stored in the search structure. More...
 
bool is_empty () const
 True if this contains no bounding boxes. More...
 
d_bin_coordinates< 2, 2 > * relative_position (sec_vd_value_type *xpt, size_type xpt_ub) const
 The position of xpt relative to the lower bound, in integer coordinates; auto-allocated version. More...
 
void relative_position_pa (sec_vd_value_type *xpt, size_type xpt_ub, d_bin_coordinates< 2, 2 > &xresult) const
 The position of xpt relative to the lower bound, in integer coordinates; pre-allocated version. More...
 
virtual void insert_box (d_bounding_box< 2, 2 > *xbox)=0
 Insert xbox into the search structure. More...
 
virtual void remove_box (d_bounding_box< 2, 2 > *xbox)=0
 Remove xbox from the search structure. More...
 
virtual const box_list_typebox_list (sec_vd_value_type *xpt, size_type xpt_ub) const =0
 The list of bounding boxes which may contain xpt. More...
 
virtual bool contains_box (d_bounding_box< 2, 2 > *xbox) const =0
 True if xbox is in the box list of some bin. More...
 
virtual void clear ()=0
 Clear the search structure of all bounding boxes. More...
 
 cylindrical_point_locator (sec_ed &xcoords)
 Creates an instance for coordinate section xcoords. More...
 
 cylindrical_point_locator ()
 Default constructor; disabled. More...
 
 cylindrical_point_locator (const cylindrical_point_locator &xother)
 Copy constructor; disabled. More...
 
virtual cylindrical_point_locatoroperator= (const point_locator &xother)
 Assignment operator. More...
 
cylindrical_point_locatoroperator= (const cylindrical_point_locator &xother)
 Assignment operator; disabled. More...
 
virtual void update_bins ()=0
 Updates the bin parameters. More...
 
void insert_quad (block< sec_vd_dof_type > &xdofs, const scoped_index &xbranch_id, const scoped_index &xeval_id)
 Creates the bounding box or boxes for the quad defined by the dofs starting at xdofs and inserts them in the search structure. More...
 
void insert_triangle (block< sec_vd_dof_type > &xdofs, const scoped_index &xbranch_id, const scoped_index &xeval_id)
 Creates the bounding box or boxes for the triangle defined by the dofs starting at xdofs and inserts them in the search structure. More...
 
void xyz_to_lat_lon (const sec_vd_dof_type xcartesian[3], sec_vd_dof_type xresult[2])
 Converts cartesian coordinates xcartesian to (longitude, latitude) xresult. More...
 
void make_quad_bounding_box (block< sec_vd_dof_type > &xlat_lon_dofs, const scoped_index &xbranch_id, const scoped_index &xeval_id)
 Makes a bounding box for a quad. More...
 
void make_triangle_bounding_box (block< sec_vd_dof_type > &xlat_lon_dofs, const scoped_index &xbranch_id, const scoped_index &xeval_id)
 Makes a bounding box for a triangle. More...
 

POINT_LOCATOR FACET

virtual bool invariant () const
 Class invariant. More...
 
virtual void update ()
 Updates the search structure to the current values of coordinates(). More...
 
virtual void point_at_value (const sec_vd_value_type *xvalue, size_type xvalue_ub, chart_point &xresult)
 Finds a chart point at which coordinates() has value xvalue. More...
 
virtual void all_points_at_value (const sec_vd_value_type *xvalue, size_type xvalue_ub, block< chart_point_3d > &xresult)
 Finds all chart points at which coordinates() has value xvalue and appends them to xresult. Note that charts overlap at their boundaries and hence if xvalue lies on a boundary it is contained in more than one chart. More...
 
virtual void branch_points_at_value (const sec_vd_value_type *xvalue, size_type xvalue_ub, block< branch_point_pair > &xresult)
 Finds one chart point in each branch at which coordinates() has value xvalue and appends them to xresult. More...
 

Additional Inherited Members

- Public Member Functions inherited from geometry::point_locator
sec_edcoordinates () const
 The coordinate section this inverts. More...
 
const block< sec_vd_value_type > & lb () const
 The lower bound of the domain defined by coordinates(). More...
 
const block< sec_vd_value_type > & ub () const
 The upper bound of the domain defined by coordinates(). More...
 
int dc () const
 The spatial dimension of the domain; the dimension of the global coordinates. More...
 
int db () const
 The intrinsic dimension of the domain; the dimension of the local coordinates. More...
 
bool domain_contains (sec_vd_value_type *xpt, size_type xpt_ub) const
 True if the domain contains xpt. More...
 
virtual ~point_locator ()
 Destructor. More...
 
- Protected Member Functions inherited from geometry::point_locator
 point_locator ()
 Default constructor. More...
 
 point_locator (sec_ed &xcoords)
 Create an instance for coordinate section xcoords. More...
 
void update_domain ()
 Initializes the domain bounds and dimension. More...
 
- Static Protected Member Functions inherited from geometry::point_locator
static sec_vd_value_type slightly_greater_than (sec_vd_value_type x)
 A value slightly greater then x. More...
 
static sec_vd_value_type slightly_less_than (sec_vd_value_type x)
 A value slightly less then x. More...
 
- Protected Attributes inherited from geometry::point_locator
block< sec_vd_value_type_lb
 The lower bound of the domain. More...
 
block< sec_vd_value_type_ub
 The upper bound of the domain. More...
 
int _dc
 The spatial dimension of the domain; the dimension of the global coordinates. More...
 
int _db
 The intrinsic dimension of the domain; the dimension of the local coordinates. More...
 

Detailed Description

An abstract point location query in domains with global coordinate dimension dc and local coordinate dimension db using a search structure based on sorting bounding boxes into a set of bins.

Definition at line 73 of file cylindrical_point_locator.h.

Member Typedef Documentation

◆ box_list_type

The type of box list.

Definition at line 101 of file cylindrical_point_locator.h.

Member Enumeration Documentation

◆ space_dimensions

Dimension of coordinate space.

Dimension of base space.

Definition at line 93 of file cylindrical_point_locator.h.

Constructor & Destructor Documentation

◆ ~cylindrical_point_locator()

geometry::cylindrical_point_locator::~cylindrical_point_locator ( )
virtual

Destructor.

Definition at line 95 of file cylindrical_point_locator.cc.

References bin_ub().

Referenced by cylindrical_point_locator().

◆ cylindrical_point_locator() [1/3]

geometry::cylindrical_point_locator::cylindrical_point_locator ( sec_ed xcoords)
protected

Creates an instance for coordinate section xcoords.

Precondition
  • precondition_of(point_locator(xcoords))
Hack:
a new eval_family is created every time put_schema_anchor(schema) is called in eval_itr, including initially from the eval_itr constructor. But we have to reanchor the eval_itr to each branch of a multisection in update(). We can do this only with put_schema_anchor(index), which does not recreate the eval family, if we initialize eval_itr here using its constructor, then force it to be done, ready for reanchoring.

Definition at line 53 of file cylindrical_point_locator.cc.

References _bin_size, _bin_ub, _box_ct, _eval_itr, _one_over_min_bin_size, fiber_bundle::eval_iterator::force_is_done(), geometry::point_locator::point_locator(), sheaf::auto_block< T, S >::reserve(), sheaf::auto_block< T, S >::set_ct(), and ~cylindrical_point_locator().

◆ cylindrical_point_locator() [2/3]

geometry::cylindrical_point_locator::cylindrical_point_locator ( )
inlineprotected

Default constructor; disabled.

Definition at line 177 of file cylindrical_point_locator.h.

◆ cylindrical_point_locator() [3/3]

geometry::cylindrical_point_locator::cylindrical_point_locator ( const cylindrical_point_locator xother)
inlineprotected

Copy constructor; disabled.

Definition at line 182 of file cylindrical_point_locator.h.

Member Function Documentation

◆ all_points_at_value()

◆ bin_size()

const sheaf::block< fiber_bundle::sec_vd_value_type > & geometry::cylindrical_point_locator::bin_size ( ) const

The dimensions of the smallest bins.

Definition at line 132 of file cylindrical_point_locator.cc.

References _bin_size, and box_ct().

Referenced by bin_ub().

◆ bin_ub()

const sheaf::block< sheaf::size_type > & geometry::cylindrical_point_locator::bin_ub ( ) const

The upper bound for the bin index.

Postcondition
  • for(int i = ( 0 ); i < ( db() ); ++ i ) result[i] > 0

Definition at line 112 of file cylindrical_point_locator.cc.

References _bin_ub, bin_size(), and geometry::point_locator::db().

Referenced by ~cylindrical_point_locator().

◆ box_ct()

sheaf::size_type geometry::cylindrical_point_locator::box_ct ( ) const

The number of bounding boxes stored in the search structure.

Definition at line 152 of file cylindrical_point_locator.cc.

References _box_ct, and is_empty().

Referenced by bin_size(), insert_box(), geometry::array_cylindrical_point_locator::insert_box(), is_empty(), remove_box(), and geometry::array_cylindrical_point_locator::remove_box().

◆ box_list()

const geometry::cylindrical_point_locator::box_list_type & geometry::cylindrical_point_locator::box_list ( sec_vd_value_type xpt,
size_type  xpt_ub 
) const
pure virtual

The list of bounding boxes which may contain xpt.

Precondition
  • xpt != 0
Is Abstract.

Implemented in geometry::array_cylindrical_point_locator.

Definition at line 317 of file cylindrical_point_locator.cc.

References contains_box(), and geometry::point_locator::db().

Referenced by all_points_at_value(), branch_points_at_value(), point_at_value(), and remove_box().

◆ branch_points_at_value()

void geometry::cylindrical_point_locator::branch_points_at_value ( const sec_vd_value_type xvalue,
size_type  xvalue_ub,
block< branch_point_pair > &  xresult 
)
virtual

Finds one chart point in each branch at which coordinates() has value xvalue and appends them to xresult.

Precondition
  • xvalue != 0
Postcondition
  • xresult.ct() >= old_xresult_ct
  • for(int i = ( old_xresult_ct ); i < ( xresult.ct() ); ++ i ) coordinates().host()->contains_member(xresult[i].first, false)
  • for(int i = ( old_xresult_ct ); i < ( xresult.ct() ); ++ i ) xresult[i].second.is_valid()

Implements geometry::point_locator.

Definition at line 1101 of file cylindrical_point_locator.cc.

References _branches, _gathered_dofs, sheaf::auto_block< T, S >::base(), sheaf::singly_linked_list< T, A >::begin(), box_list(), geometry::d_bounding_box< DC, DB >::branch_id(), sheaf::poset_state_handle::contains_member(), geometry::d_bounding_box< DC, DB >::contains_point(), fiber_bundle::section_evaluator::coord_at_value(), geometry::point_locator::coordinates(), sheaf::auto_block< T, S >::ct(), fiber_bundle::chart_point_3d::db(), geometry::point_locator::dc(), geometry::d_bounding_box< DC, DB >::dof_ct(), geometry::d_bounding_box< DC, DB >::dofs_index(), sheaf::singly_linked_list< T, A >::end(), geometry::d_bounding_box< DC, DB >::evaluator(), fiber_bundle::sec_at1::host(), fiber_bundle::section_evaluator::in_standard_domain(), fiber_bundle::chart_point_3d::local_coords(), geometry::d_bounding_box< DC, DB >::member_id(), sheaf::auto_block< T, S >::push_back(), fiber_bundle::chart_point::put_chart_id(), relative_position_pa(), and xyz_to_lat_lon().

Referenced by all_points_at_value().

◆ clear()

void geometry::cylindrical_point_locator::clear ( )
pure virtual

Clear the search structure of all bounding boxes.

Is Abstract.

Postcondition

Implemented in geometry::array_cylindrical_point_locator.

Definition at line 363 of file cylindrical_point_locator.cc.

References is_empty(), and update_bins().

Referenced by contains_box().

◆ contains_box()

bool geometry::cylindrical_point_locator::contains_box ( d_bounding_box< 2, 2 > *  xbox) const
pure virtual

True if xbox is in the box list of some bin.

Precondition
  • xbox != 0
Is Abstract.

Implemented in geometry::array_cylindrical_point_locator.

Definition at line 341 of file cylindrical_point_locator.cc.

References clear().

Referenced by box_list(), insert_box(), and remove_box().

◆ insert_box()

void geometry::cylindrical_point_locator::insert_box ( d_bounding_box< 2, 2 > *  xbox)
pure virtual

Insert xbox into the search structure.

Precondition
  • xbox != 0
Is Abstract.
Postcondition
  • contains_box(xbox)

Implemented in geometry::array_cylindrical_point_locator.

Definition at line 268 of file cylindrical_point_locator.cc.

References _box_ct, box_ct(), contains_box(), and remove_box().

Referenced by make_quad_bounding_box(), make_triangle_bounding_box(), and relative_position_pa().

◆ insert_quad()

void geometry::cylindrical_point_locator::insert_quad ( block< sec_vd_dof_type > &  xdofs,
const scoped_index xbranch_id,
const scoped_index xeval_id 
)
protected

Creates the bounding box or boxes for the quad defined by the dofs starting at xdofs and inserts them in the search structure.

Definition at line 404 of file cylindrical_point_locator.cc.

References insert_triangle(), make_quad_bounding_box(), sheaf::auto_block< T, S >::set_ct(), and xyz_to_lat_lon().

Referenced by update(), and update_bins().

◆ insert_triangle()

void geometry::cylindrical_point_locator::insert_triangle ( block< sec_vd_dof_type > &  xdofs,
const scoped_index xbranch_id,
const scoped_index xeval_id 
)
protected

Creates the bounding box or boxes for the triangle defined by the dofs starting at xdofs and inserts them in the search structure.

Definition at line 487 of file cylindrical_point_locator.cc.

References make_triangle_bounding_box(), sheaf::auto_block< T, S >::set_ct(), and xyz_to_lat_lon().

Referenced by insert_quad(), and update().

◆ invariant()

bool geometry::cylindrical_point_locator::invariant ( ) const
virtual

Class invariant.

Invariant

Reimplemented from geometry::point_locator.

Reimplemented in geometry::array_cylindrical_point_locator.

Definition at line 809 of file cylindrical_point_locator.cc.

References geometry::point_locator::coordinates(), and update().

Referenced by operator=().

◆ is_empty()

bool geometry::cylindrical_point_locator::is_empty ( ) const

True if this contains no bounding boxes.

Postcondition

Definition at line 173 of file cylindrical_point_locator.cc.

References box_ct(), and relative_position().

Referenced by box_ct(), clear(), geometry::array_cylindrical_point_locator::clear(), geometry::array_cylindrical_point_locator::update_bins(), and update_bins().

◆ make_quad_bounding_box()

◆ make_triangle_bounding_box()

◆ operator=() [1/2]

geometry::cylindrical_point_locator & geometry::cylindrical_point_locator::operator= ( const point_locator xother)
protectedvirtual

Assignment operator.

Not Implemented.

Postcondition

Reimplemented from geometry::point_locator.

Reimplemented in geometry::array_cylindrical_point_locator.

Definition at line 768 of file cylindrical_point_locator.cc.

References invariant().

Referenced by make_triangle_bounding_box().

◆ operator=() [2/2]

geometry::cylindrical_point_locator & geometry::cylindrical_point_locator::operator= ( const cylindrical_point_locator xother)
protected

Assignment operator; disabled.

Not Implemented.

Postcondition

Definition at line 789 of file cylindrical_point_locator.cc.

References invariant().

◆ point_at_value()

◆ relative_position()

geometry::d_bin_coordinates< 2, 2 > * geometry::cylindrical_point_locator::relative_position ( sec_vd_value_type xpt,
size_type  xpt_ub 
) const

The position of xpt relative to the lower bound, in integer coordinates; auto-allocated version.

Precondition
  • xpt != 0
Postcondition
  • result != 0
  • postcondition_of(relative_position_pa(xpt, xpt_ub, result))

Definition at line 195 of file cylindrical_point_locator.cc.

References geometry::point_locator::db(), and relative_position_pa().

Referenced by is_empty().

◆ relative_position_pa()

void geometry::cylindrical_point_locator::relative_position_pa ( sec_vd_value_type xpt,
size_type  xpt_ub,
d_bin_coordinates< 2, 2 > &  xresult 
) const

The position of xpt relative to the lower bound, in integer coordinates; pre-allocated version.

Precondition
  • xpt != 0
  • (-90.0 < xpt[1]) && (xpt[1] < 90.0)

Definition at line 221 of file cylindrical_point_locator.cc.

References _bin_0_max, _bin_ub, _one_over_min_bin_size, geometry::point_locator::db(), and insert_box().

Referenced by all_points_at_value(), geometry::array_cylindrical_point_locator::box_list(), branch_points_at_value(), make_quad_bounding_box(), make_triangle_bounding_box(), point_at_value(), and relative_position().

◆ remove_box()

void geometry::cylindrical_point_locator::remove_box ( d_bounding_box< 2, 2 > *  xbox)
pure virtual

Remove xbox from the search structure.

Precondition
  • xbox != 0
  • contains_box(xbox)
Is Abstract.
Postcondition
  • !contains_box(xbox)

Implemented in geometry::array_cylindrical_point_locator.

Definition at line 292 of file cylindrical_point_locator.cc.

References _box_ct, box_ct(), box_list(), and contains_box().

Referenced by insert_box().

◆ update()

◆ update_bins()

void geometry::cylindrical_point_locator::update_bins ( )
protectedpure virtual

Updates the bin parameters.

Precondition
Is Abstract.

Implemented in geometry::array_cylindrical_point_locator.

Definition at line 385 of file cylindrical_point_locator.cc.

References insert_quad(), and is_empty().

Referenced by clear(), and update().

◆ xyz_to_lat_lon()

void geometry::cylindrical_point_locator::xyz_to_lat_lon ( const sec_vd_dof_type  xcartesian[3],
sec_vd_dof_type  xresult[2] 
)
protected

Member Data Documentation

◆ _bin_0_max

sec_vd_value_type geometry::cylindrical_point_locator::_bin_0_max
protected

A sec_vd_value_type that truncates to the maximum index for bin 0.

Definition at line 202 of file cylindrical_point_locator.h.

Referenced by geometry::array_cylindrical_point_locator::array_cylindrical_point_locator(), and relative_position_pa().

◆ _bin_size

block<sec_vd_value_type> geometry::cylindrical_point_locator::_bin_size
protected

The dimensions of the smallest bins.

Definition at line 207 of file cylindrical_point_locator.h.

Referenced by bin_size(), cylindrical_point_locator(), and geometry::array_cylindrical_point_locator::update_bins().

◆ _bin_ub

◆ _box_ct

size_type geometry::cylindrical_point_locator::_box_ct
protected

◆ _boxes

block< d_bounding_box<2, 2> > geometry::cylindrical_point_locator::_boxes
protected

Bounding boxes for the evaluation members.

Definition at line 227 of file cylindrical_point_locator.h.

Referenced by make_quad_bounding_box(), make_triangle_bounding_box(), and update().

◆ _branches

std::set< stl_scoped_index<> > geometry::cylindrical_point_locator::_branches
protected

The branches for which a point has already been found for the current evaluation member. Used in all_points_at_value, allocated her to avoid reallocation for each query.

Definition at line 246 of file cylindrical_point_locator.h.

Referenced by branch_points_at_value().

◆ _eval_itr

eval_iterator geometry::cylindrical_point_locator::_eval_itr
protected

The evaluator iterator used to populate the search structure; must have same life time as the search structure because it owns the eval_family which owns the section evaluators.

Definition at line 239 of file cylindrical_point_locator.h.

Referenced by cylindrical_point_locator(), and update().

◆ _gathered_dofs

block<sec_vd_dof_type> geometry::cylindrical_point_locator::_gathered_dofs
protected

The dofs of gathered by evaluation member.

Definition at line 232 of file cylindrical_point_locator.h.

Referenced by all_points_at_value(), branch_points_at_value(), make_quad_bounding_box(), make_triangle_bounding_box(), point_at_value(), and update().

◆ _one_over_min_bin_size

block<sec_vd_value_type> geometry::cylindrical_point_locator::_one_over_min_bin_size
protected

Reciprocal of the dimensions of the smallest bins.

Definition at line 212 of file cylindrical_point_locator.h.

Referenced by cylindrical_point_locator(), relative_position_pa(), and geometry::array_cylindrical_point_locator::update_bins().


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