SheafSystem  0.0.0.0
geometry::d_bin_point_locator< DC, DB > Class Template 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 <d_bin_point_locator.h>

Inheritance diagram for geometry::d_bin_point_locator< DC, DB >:
geometry::point_locator geometry::d_array_point_locator< DC, DB > geometry::d_tree_point_locator< DC, DB >

D_BIN_POINT_LOCATOR FACET

typedef singly_linked_list< const d_bounding_box< DC, DB > * > box_list_type
 The type of box list. More...
 
block< size_type_bin_ub
 The upper bound for the bin index. 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< DC, DB > > _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 ~d_bin_point_locator ()
 Destructor. More...
 
virtual bool invariant () const
 Class invariant. 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< DC, DB > * 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< DC, DB > &xresult) const
 The position of xpt relative to the lower bound, in integer coordinates; pre-allocated version. More...
 
d_bounding_box< DC, DB > * assign_box (const scoped_index &xmbr_id, const scoped_index &xbranch_id, section_evaluator &xeval, const sec_vd_dof_type *xdofs, size_type xdofs_ct)
 Assigns a box to xmbr_id and initializes it, but does not insert it in the search structure. More...
 
size_type box_capacity ()
 The number of boxes that have been allocated. More...
 
d_bounding_box< DC, DB > * box (pod_index_type xi)
 The xi-th bounding box. More...
 
void update_box (pod_index_type xi, const sec_vd_dof_type *xdofs, size_type xdofs_ct)
 Updates the xi-th bounding box with dofs xdofs. More...
 
virtual void insert_box (d_bounding_box< DC, DB > *xbox)=0
 Insert xbox into the search structure. More...
 
virtual void remove_box (d_bounding_box< DC, DB > *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< DC, DB > *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...
 
const block< sec_vd_dof_type > & gathered_dofs () const
 The dofs of gathered by evaluation member. More...
 
 d_bin_point_locator (sec_ed &xcoords)
 Creates an instance for coordinate section xcoords. More...
 
 d_bin_point_locator ()
 Default constructor; disabled. More...
 
 d_bin_point_locator (const d_bin_point_locator< DC, DB > &xother)
 Copy constructor; disabled. More...
 
virtual d_bin_point_locatoroperator= (const point_locator &xother)
 Assignment operator; disabled. More...
 
d_bin_point_locatoroperator= (const d_bin_point_locator< DC, DB > &xother)
 Assignment operator; disabled. More...
 
virtual void update_bins ()=0
 Updates the bin parameters. More...
 

POINT_LOCATOR FACET

virtual void update ()
 Updates the search structure to the current values of coordinates(); synonym for update(true);. More...
 
virtual void update (bool xpopulate, size_type xeval_capacity)
 Updates the search structure to the current values of coordinates(); if xpopulate, populates the search structure with the eval members coordinates(). Ensures capacity for at least xeval_capacity eval members. 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

template<int DC, int DB>
class geometry::d_bin_point_locator< DC, DB >

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 68 of file d_bin_point_locator.h.

Member Typedef Documentation

◆ box_list_type

template<int DC, int DB>
typedef singly_linked_list<const d_bounding_box<DC, DB>*> geometry::d_bin_point_locator< DC, DB >::box_list_type

The type of box list.

Definition at line 81 of file d_bin_point_locator.h.

Constructor & Destructor Documentation

◆ ~d_bin_point_locator()

◆ d_bin_point_locator() [1/3]

template<int DC, int DB>
geometry::d_bin_point_locator< DC, DB >::d_bin_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 79 of file d_bin_point_locator.impl.h.

References geometry::d_bin_point_locator< DC, DB >::_bin_size, geometry::d_bin_point_locator< DC, DB >::_bin_ub, geometry::d_bin_point_locator< DC, DB >::_box_ct, geometry::d_bin_point_locator< DC, DB >::_eval_itr, geometry::d_bin_point_locator< DC, DB >::_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 geometry::d_bin_point_locator< DC, DB >::~d_bin_point_locator().

◆ d_bin_point_locator() [2/3]

template<int DC, int DB>
geometry::d_bin_point_locator< DC, DB >::d_bin_point_locator ( )
inlineprotected

Default constructor; disabled.

Definition at line 195 of file d_bin_point_locator.h.

◆ d_bin_point_locator() [3/3]

template<int DC, int DB>
geometry::d_bin_point_locator< DC, DB >::d_bin_point_locator ( const d_bin_point_locator< DC, DB > &  xother)
inlineprotected

Copy constructor; disabled.

Definition at line 200 of file d_bin_point_locator.h.

Member Function Documentation

◆ all_points_at_value()

template<int DC, int DB>
void geometry::d_bin_point_locator< DC, DB >::all_points_at_value ( const sec_vd_value_type xvalue,
size_type  xvalue_ub,
block< chart_point_3d > &  xresult 
)
virtual

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.

Precondition
  • xvalue != 0
  • xvalue_ub >= this->dc()
Todo:
propagate constness everywhere.
Postcondition
  • for(int i = ( 0 ); i < ( xresult.ct() ); ++ i ) xresult[i].is_valid()

Implements geometry::point_locator.

Definition at line 994 of file d_bin_point_locator.impl.h.

References geometry::d_bin_point_locator< DC, DB >::_gathered_dofs, sheaf::auto_block< T, S >::base(), sheaf::singly_linked_list< T, A >::begin(), geometry::d_bin_point_locator< DC, DB >::box_list(), geometry::d_bin_point_locator< DC, DB >::branch_points_at_value(), geometry::d_bounding_box< DC, DB >::contains_point(), fiber_bundle::section_evaluator::coord_at_value(), sheaf::auto_block< T, un_block_initialization_policy< T > >::ct(), geometry::point_locator::db(), geometry::point_locator::dc(), geometry::d_bounding_box< DC, DB >::dof_ct(), geometry::d_bounding_box< DC, DB >::dofs_index(), geometry::point_locator::domain_contains(), sheaf::singly_linked_list< T, A >::end(), geometry::d_bounding_box< DC, DB >::evaluator(), fiber_bundle::section_evaluator::in_standard_domain(), sheaf::invalid_pod_index(), geometry::d_bounding_box< DC, DB >::member_id(), sheaf::auto_block< T, un_block_initialization_policy< T > >::push_back(), and geometry::d_bin_point_locator< DC, DB >::relative_position_pa().

Referenced by geometry::d_bin_point_locator< DC, DB >::point_at_value().

◆ assign_box()

template<int DC, int DB>
d_bounding_box< DC, DB > * geometry::d_bin_point_locator< DC, DB >::assign_box ( const scoped_index xmbr_id,
const scoped_index xbranch_id,
section_evaluator xeval,
const sec_vd_dof_type xdofs,
size_type  xdofs_ct 
)

◆ bin_size()

template<int DC, int DB>
const block< sec_vd_value_type > & geometry::d_bin_point_locator< DC, DB >::bin_size ( ) const

◆ bin_ub()

template<int DC, int DB>
const block< size_type > & geometry::d_bin_point_locator< DC, DB >::bin_ub ( ) const

The upper bound for the bin index.

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

Definition at line 155 of file d_bin_point_locator.impl.h.

References geometry::d_bin_point_locator< DC, DB >::_bin_ub, geometry::d_bin_point_locator< DC, DB >::bin_size(), and geometry::point_locator::dc().

Referenced by geometry::d_bin_point_locator< DC, DB >::invariant().

◆ box()

◆ box_capacity()

◆ box_ct()

◆ box_list()

◆ branch_points_at_value()

template<int DC, int DB>
void geometry::d_bin_point_locator< DC, DB >::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
  • xvalue_ub >= this->dc()
Todo:
propagate constness everywhere.
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 1097 of file d_bin_point_locator.impl.h.

References geometry::d_bin_point_locator< DC, DB >::_branches, geometry::d_bin_point_locator< DC, DB >::_gathered_dofs, sheaf::auto_block< T, S >::base(), sheaf::singly_linked_list< T, A >::begin(), geometry::d_bin_point_locator< DC, DB >::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(), geometry::point_locator::domain_contains(), 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(), and geometry::d_bin_point_locator< DC, DB >::relative_position_pa().

Referenced by geometry::d_bin_point_locator< DC, DB >::all_points_at_value().

◆ clear()

template<int DC, int DB>
void geometry::d_bin_point_locator< DC, DB >::clear ( )
pure virtual

◆ contains_box()

◆ gathered_dofs()

template<int DC, int DB>
const block< sec_vd_dof_type > & geometry::d_bin_point_locator< DC, DB >::gathered_dofs ( ) const

◆ insert_box()

◆ invariant()

template<int DC, int DB>
bool geometry::d_bin_point_locator< DC, DB >::invariant ( ) const
virtual

◆ is_empty()

◆ operator=() [1/2]

template<int DC, int DB>
virtual d_bin_point_locator& geometry::d_bin_point_locator< DC, DB >::operator= ( const point_locator xother)
inlineprotectedvirtual

Assignment operator; disabled.

Reimplemented from geometry::point_locator.

Reimplemented in geometry::d_array_point_locator< DC, DB >, and geometry::d_tree_point_locator< DC, DB >.

Definition at line 205 of file d_bin_point_locator.h.

◆ operator=() [2/2]

template<int DC, int DB>
d_bin_point_locator& geometry::d_bin_point_locator< DC, DB >::operator= ( const d_bin_point_locator< DC, DB > &  xother)
inlineprotected

Assignment operator; disabled.

Definition at line 210 of file d_bin_point_locator.h.

◆ point_at_value()

template<int DC, int DB>
void geometry::d_bin_point_locator< DC, DB >::point_at_value ( const sec_vd_value_type xvalue,
size_type  xvalue_ub,
chart_point xresult 
)
virtual

Finds a chart point at which coordinates() has value xvalue.

Precondition
  • xvalue != 0
  • xvalue_ub >= this->dc()
  • xresult.db() >= this->db()
Todo:
propagate constness everywhere.
Postcondition
  • -unexecutable( xresult.is_valid() ? xresult.chart() contains xvalue at xresult.local_coord() : no chart contains xvalue )

Implements geometry::point_locator.

Definition at line 900 of file d_bin_point_locator.impl.h.

References geometry::d_bin_point_locator< DC, DB >::_gathered_dofs, geometry::d_bin_point_locator< DC, DB >::all_points_at_value(), sheaf::auto_block< T, S >::base(), sheaf::singly_linked_list< T, A >::begin(), geometry::d_bin_point_locator< DC, DB >::box_list(), geometry::d_bounding_box< DC, DB >::contains_point(), fiber_bundle::section_evaluator::coord_at_value(), fiber_bundle::chart_point::db(), geometry::point_locator::db(), geometry::point_locator::dc(), geometry::d_bounding_box< DC, DB >::dof_ct(), geometry::d_bounding_box< DC, DB >::dofs_index(), geometry::point_locator::domain_contains(), sheaf::singly_linked_list< T, A >::end(), geometry::d_bounding_box< DC, DB >::evaluator(), fiber_bundle::section_evaluator::in_standard_domain(), fiber_bundle::chart_point::invalidate(), fiber_bundle::chart_point::is_valid(), fiber_bundle::chart_point::local_coord(), fiber_bundle::chart_point::local_coords(), geometry::d_bounding_box< DC, DB >::member_id(), fiber_bundle::chart_point::put_chart_id(), and geometry::d_bin_point_locator< DC, DB >::relative_position_pa().

Referenced by geometry::d_bin_point_locator< DC, DB >::update_box().

◆ relative_position()

template<int DC, int DB>
d_bin_coordinates< DC, DB > * geometry::d_bin_point_locator< DC, DB >::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 244 of file d_bin_point_locator.impl.h.

References geometry::point_locator::dc(), and geometry::d_bin_point_locator< DC, DB >::relative_position_pa().

Referenced by geometry::d_bin_point_locator< DC, DB >::is_empty().

◆ relative_position_pa()

◆ remove_box()

template<int DC, int DB>
void geometry::d_bin_point_locator< DC, DB >::remove_box ( d_bounding_box< DC, DB > *  xbox)
pure virtual

◆ update() [1/2]

template<int DC, int DB>
void geometry::d_bin_point_locator< DC, DB >::update ( )
virtual

Updates the search structure to the current values of coordinates(); synonym for update(true);.

Precondition
Postcondition
  • !is_empty()

Implements geometry::point_locator.

Definition at line 470 of file d_bin_point_locator.impl.h.

References geometry::point_locator::coordinates(), and geometry::d_bin_point_locator< DC, DB >::is_empty().

Referenced by geometry::d_array_point_locator< DC, DB >::d_array_point_locator(), geometry::d_tree_point_locator< DC, DB >::d_tree_point_locator(), and geometry::d_bin_point_locator< DC, DB >::update_bins().

◆ update() [2/2]

template<int DC, int DB>
void geometry::d_bin_point_locator< DC, DB >::update ( bool  xpopulate,
size_type  xeval_capacity 
)
virtual

Updates the search structure to the current values of coordinates(); if xpopulate, populates the search structure with the eval members coordinates(). Ensures capacity for at least xeval_capacity eval members.

Precondition
Hack:
the multisection hack.
Postcondition

Definition at line 500 of file d_bin_point_locator.impl.h.

References geometry::d_bin_point_locator< DC, DB >::_boxes, geometry::d_bin_point_locator< DC, DB >::_eval_itr, geometry::d_bin_point_locator< DC, DB >::_gathered_dofs, geometry::d_bin_point_locator< DC, DB >::assign_box(), sheaf::abstract_poset_member::attach_to_state(), sheaf::auto_block< T, S >::base(), geometry::point_locator::coordinates(), sheaf::auto_block< T, S >::ct(), fiber_bundle::sec_tuple::detach_from_state(), fiber_bundle::eval_iterator::discretization_members(), sheaf::DOWN, fiber_bundle::section_space_schema_member::evaluation_ct(), fiber_bundle::eval_iterator::evaluator(), fiber_bundle::eval_iterator::gather_dofs(), sheaf::poset_component::index(), sheaf::depth_first_iterator::index(), geometry::d_bin_point_locator< DC, DB >::insert_box(), sheaf::depth_first_iterator::is_done(), geometry::d_bin_point_locator< DC, DB >::is_empty(), fiber_bundle::section_evaluator::max(), fiber_bundle::section_evaluator::min(), fiber_bundle::eval_iterator::next(), sheaf::NOT_STRICT, geometry::d_bounding_box< DC, DB >::put_branch_id(), geometry::d_bounding_box< DC, DB >::put_dof_ct(), geometry::d_bounding_box< DC, DB >::put_dofs_index(), geometry::d_bounding_box< DC, DB >::put_evaluator(), geometry::d_bounding_box< DC, DB >::put_lb(), geometry::d_bounding_box< DC, DB >::put_member_id(), fiber_bundle::eval_iterator::put_schema_anchor(), geometry::d_bounding_box< DC, DB >::put_ub(), geometry::d_bin_point_locator< DC, DB >::relative_position_pa(), sheaf::auto_block< T, S >::reserve(), sheaf::depth_first_iterator::reset(), fiber_bundle::sec_rep_space_member::schema(), sheaf::auto_block< T, S >::set_ct(), sheaf::depth_first_iterator::truncate(), geometry::d_bin_point_locator< DC, DB >::update_bins(), and geometry::point_locator::update_domain().

◆ update_bins()

◆ update_box()

Member Data Documentation

◆ _bin_size

◆ _bin_ub

◆ _box_ct

◆ _boxes

◆ _branches

template<int DC, int DB>
std::set< stl_scoped_index<> > geometry::d_bin_point_locator< DC, DB >::_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 259 of file d_bin_point_locator.h.

Referenced by geometry::d_bin_point_locator< DC, DB >::branch_points_at_value().

◆ _eval_itr

template<int DC, int DB>
eval_iterator geometry::d_bin_point_locator< DC, DB >::_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 252 of file d_bin_point_locator.h.

Referenced by geometry::d_bin_point_locator< DC, DB >::d_bin_point_locator(), and geometry::d_bin_point_locator< DC, DB >::update().

◆ _gathered_dofs

◆ _one_over_min_bin_size


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