SheafSystem  0.0.0.0
geometry::array_cylindrical_point_locator Class Reference

A point location query in domains with global coordinate dimension DC and local coordinate dimension DB implemented using a DC index array search structure. Efficient for for compact (axis-aligned, box-shaped) domains. More...

#include <array_cylindrical_point_locator.h>

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

ARRAY_CYLINDRICAL_POINT_LOCATOR FACET

block< box_list_type_bins
 The search structure; a d-dimensional array of bins. More...
 
 array_cylindrical_point_locator (sec_ed &xcoords, const block< size_type > &xbin_ub)
 Create an instance for coordinates xcoords with bin ub xbin_ub. More...
 
 array_cylindrical_point_locator (sec_ed &xcoords)
 Create an instance for coordinates xcoords with bin ub computed from the size of the mesh. More...
 
virtual ~array_cylindrical_point_locator ()
 Destructor. More...
 
size_type size () const
 The number of bins used by the search structure. More...
 
size_type capacity () const
 The number of bins allocated for use by the search structure. More...
 
bool is_dlinear_quads (const sec_ed &xcoords) const
 True if the base space of xcoords is a block of quads and the evaluator family id dlinear. More...
 
bool is_dlinear_triangles (const sec_ed &xcoords) const
 True if the base space of xcoords is a block of triangles and the evaluator family id dlinear. More...
 
 array_cylindrical_point_locator ()
 Default constructor; disabled. More...
 
 array_cylindrical_point_locator (const array_cylindrical_point_locator &xother)
 Copy constructor; disabled. More...
 
virtual array_cylindrical_point_locatoroperator= (const point_locator &xother)
 Assignment operator. More...
 
array_cylindrical_point_locatoroperator= (const array_cylindrical_point_locator &xother)
 Assignment operator; disabled. More...
 
void update_bins ()
 Resets this with bounds xlb, xub, and xbin_ub. If xbin_ub == 0; use default_bin_ub(). More...
 
size_type bin_id (const d_bin_coordinates< 2, 2 > &xcoord) const
 The single index (offset) associated with tree coordinates xcoord. More...
 
size_type bin_id (const block< size_type > &xid) const
 The single index (offset) associated with xid. More...
 
size_type bin_id (size_type xi, size_type xj) const
 The single index (offset) associated with xi, xj. More...
 

CYLINDRICAL_POINT_LOCATOR FACET

typedef singly_linked_list< const d_bounding_box< 2, 2 > * > box_list_type
 The type of box list. More...
 
virtual void insert_box (d_bounding_box< 2, 2 > *xbox)
 Insert xbox into this. More...
 
virtual void remove_box (d_bounding_box< 2, 2 > *xbox)
 Remove xbox from this. More...
 
virtual const box_list_typebox_list (sec_vd_value_type *xpt, size_type xpt_ub) const
 The list of bounding boxes which may contain xpt. More...
 
virtual bool contains_box (d_bounding_box< 2, 2 > *xbox) const
 True if xbox is in this. More...
 
virtual void clear ()
 Clear this of all bounding boxes. More...
 

POINT_LOCATOR FACET

virtual bool invariant () const
 Class invariant. More...
 

Additional Inherited Members

- Public Types inherited from geometry::cylindrical_point_locator
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...
 
- Public Member Functions inherited from geometry::cylindrical_point_locator
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 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...
 
- 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::cylindrical_point_locator
 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...
 
cylindrical_point_locatoroperator= (const cylindrical_point_locator &xother)
 Assignment operator; disabled. 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...
 
- 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::cylindrical_point_locator
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...
 
- 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

A point location query in domains with global coordinate dimension DC and local coordinate dimension DB implemented using a DC index array search structure. Efficient for for compact (axis-aligned, box-shaped) domains.

Definition at line 44 of file array_cylindrical_point_locator.h.

Member Typedef Documentation

◆ box_list_type

Constructor & Destructor Documentation

◆ array_cylindrical_point_locator() [1/4]

geometry::array_cylindrical_point_locator::array_cylindrical_point_locator ( sec_ed xcoords,
const block< size_type > &  xbin_ub 
)

Create an instance for coordinates xcoords with bin ub xbin_ub.

Precondition
  • xcoords.state_is_read_accessible()
  • xcoords.schema().df() == DC
  • xcoords.schema().db() == DB
  • is_dlinear_quads(xcoords) || is_dlinear_triangles(xcoords)
  • xbin_ub.ct() >= DB
  • for(int i = ( 0 ); i < ( DB ); ++ i ) xbin_ub[i] > 0

Definition at line 36 of file array_cylindrical_point_locator.cc.

References geometry::cylindrical_point_locator::_bin_0_max, geometry::cylindrical_point_locator::_bin_ub, array_cylindrical_point_locator(), sheaf::auto_block< T, S >::ct(), fiber_bundle::section_space_schema_member::db(), fiber_bundle::section_space_schema_member::df(), is_dlinear_quads(), is_dlinear_triangles(), fiber_bundle::sec_rep_space_member::schema(), sheaf::read_write_monitor_handle::state_is_read_accessible(), and geometry::cylindrical_point_locator::update().

◆ array_cylindrical_point_locator() [2/4]

geometry::array_cylindrical_point_locator::array_cylindrical_point_locator ( sec_ed xcoords)

◆ ~array_cylindrical_point_locator()

geometry::array_cylindrical_point_locator::~array_cylindrical_point_locator ( )
virtual

Destructor.

Definition at line 109 of file array_cylindrical_point_locator.cc.

References size().

Referenced by array_cylindrical_point_locator().

◆ array_cylindrical_point_locator() [3/4]

geometry::array_cylindrical_point_locator::array_cylindrical_point_locator ( )
inlineprotected

Default constructor; disabled.

Definition at line 97 of file array_cylindrical_point_locator.h.

Referenced by array_cylindrical_point_locator().

◆ array_cylindrical_point_locator() [4/4]

geometry::array_cylindrical_point_locator::array_cylindrical_point_locator ( const array_cylindrical_point_locator xother)
inlineprotected

Copy constructor; disabled.

Definition at line 104 of file array_cylindrical_point_locator.h.

Member Function Documentation

◆ bin_id() [1/3]

sheaf::size_type geometry::array_cylindrical_point_locator::bin_id ( const d_bin_coordinates< 2, 2 > &  xcoord) const
protected

The single index (offset) associated with tree coordinates xcoord.

Definition at line 301 of file array_cylindrical_point_locator.cc.

References geometry::cylindrical_point_locator::_bin_ub.

Referenced by bin_id(), box_list(), contains_box(), insert_box(), remove_box(), and update_bins().

◆ bin_id() [2/3]

sheaf::size_type geometry::array_cylindrical_point_locator::bin_id ( const block< size_type > &  xid) const
protected

The single index (offset) associated with xid.

Definition at line 308 of file array_cylindrical_point_locator.cc.

References geometry::cylindrical_point_locator::_bin_ub, and bin_id().

◆ bin_id() [3/3]

sheaf::size_type geometry::array_cylindrical_point_locator::bin_id ( size_type  xi,
size_type  xj 
) const
protected

The single index (offset) associated with xi, xj.

Definition at line 315 of file array_cylindrical_point_locator.cc.

References geometry::cylindrical_point_locator::_bin_ub, and insert_box().

◆ box_list()

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

The list of bounding boxes which may contain xpt.

Precondition
  • xpt != 0

Implements geometry::cylindrical_point_locator.

Definition at line 405 of file array_cylindrical_point_locator.cc.

References _bins, bin_id(), contains_box(), geometry::point_locator::db(), and geometry::cylindrical_point_locator::relative_position_pa().

Referenced by remove_box().

◆ capacity()

sheaf::size_type geometry::array_cylindrical_point_locator::capacity ( ) const

The number of bins allocated for use by the search structure.

Postcondition
  • result > 0

Definition at line 148 of file array_cylindrical_point_locator.cc.

References _bins, and is_dlinear_quads().

Referenced by invariant(), and size().

◆ clear()

void geometry::array_cylindrical_point_locator::clear ( )
virtual

◆ contains_box()

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

◆ insert_box()

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

◆ invariant()

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

Class invariant.

Invariant

Reimplemented from geometry::cylindrical_point_locator.

Definition at line 534 of file array_cylindrical_point_locator.cc.

References capacity(), and size().

Referenced by operator=().

◆ is_dlinear_quads()

◆ is_dlinear_triangles()

◆ operator=() [1/2]

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

Assignment operator.

Not Implemented.

Postcondition

Reimplemented from geometry::cylindrical_point_locator.

Definition at line 493 of file array_cylindrical_point_locator.cc.

References invariant().

Referenced by clear().

◆ operator=() [2/2]

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

Assignment operator; disabled.

Not Implemented.

Postcondition

Definition at line 514 of file array_cylindrical_point_locator.cc.

References invariant().

◆ remove_box()

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

Remove xbox from this.

Precondition
  • xbox != 0
  • contains_box(xbox)
Postcondition
  • !contains_box(xbox)

Implements geometry::cylindrical_point_locator.

Definition at line 367 of file array_cylindrical_point_locator.cc.

References _bins, geometry::cylindrical_point_locator::_box_ct, bin_id(), geometry::cylindrical_point_locator::box_ct(), box_list(), contains_box(), geometry::d_bounding_box< DC, DB >::lb(), and geometry::d_bounding_box< DC, DB >::ub().

Referenced by insert_box().

◆ size()

sheaf::size_type geometry::array_cylindrical_point_locator::size ( ) const

The number of bins used by the search structure.

Postcondition
  • result > 0

Definition at line 126 of file array_cylindrical_point_locator.cc.

References _bins, and capacity().

Referenced by invariant(), and ~array_cylindrical_point_locator().

◆ update_bins()

void geometry::array_cylindrical_point_locator::update_bins ( )
protectedvirtual

Resets this with bounds xlb, xub, and xbin_ub. If xbin_ub == 0; use default_bin_ub().

Precondition
Issue:
block.reserve doesn't reallocate if capacity is already large enough; so storage will never shrink.
Todo:
provide mechanism in block for reclaiming storage.

Implements geometry::cylindrical_point_locator.

Definition at line 253 of file array_cylindrical_point_locator.cc.

References geometry::cylindrical_point_locator::_bin_size, geometry::cylindrical_point_locator::_bin_ub, _bins, geometry::cylindrical_point_locator::_one_over_min_bin_size, bin_id(), geometry::cylindrical_point_locator::is_empty(), and geometry::d_bin_coordinates< DC, DB >::ub().

Referenced by is_dlinear_triangles().

Member Data Documentation

◆ _bins

block<box_list_type> geometry::array_cylindrical_point_locator::_bins
protected

The search structure; a d-dimensional array of bins.

Definition at line 127 of file array_cylindrical_point_locator.h.

Referenced by box_list(), capacity(), clear(), contains_box(), insert_box(), remove_box(), size(), and update_bins().


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