MOAB: Mesh Oriented datABase
(version 5.4.1)
|
Classes | |
class | Box |
struct | _Element_data |
Functions | |
template<typename T , typename Stream > | |
void | print_vector (const T &v, Stream &out) |
template<typename T > | |
void | print_vector (const T &begin, const T &end) |
template<typename _Box , typename _Point > | |
bool | box_contains_point (const _Box &box, const _Point &p, const double tol) |
template<typename _Box > | |
bool | box_contains_box (const _Box &a, const _Box &b, const double tol) |
template<typename Vector > | |
void | compute_box_center (Vector &max, Vector &min, Vector ¢er) |
template<typename Box > | |
Box::value_type | compute_box_center (const Box &box, const int dim) |
template<typename T > | |
std::ostream & | operator<< (std::ostream &out, const Box< T > &box) |
template<typename Entities , typename Iterator > | |
void | assign_entities (Entities &entities, const Iterator &begin, const Iterator &end) |
template<typename Coordinate , typename Coordinate_iterator > | |
void | update_bounding_max (Coordinate &max, Coordinate_iterator j) |
template<typename Coordinate , typename Coordinate_iterator > | |
void | update_bounding_min (Coordinate &min, Coordinate_iterator j) |
template<typename Box > | |
void | update_bounding_box (Box &a, const Box &b) |
template<typename Entity_map , typename Ordering > | |
void | construct_ordering (Entity_map &entity_map, Ordering &entity_ordering) |
template<typename Entity_handles , typename Element_map , typename Bounding_box , typename Moab > | |
void | construct_element_map (const Entity_handles &elements, Element_map &map, Bounding_box &bounding_box, Moab &moab) |
void moab::common_tree::assign_entities | ( | Entities & | entities, |
const Iterator & | begin, | ||
const Iterator & | end | ||
) |
Definition at line 171 of file common_tree.hpp.
Referenced by moab::Element_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::build_tree(), and moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::build_tree().
bool moab::common_tree::box_contains_box | ( | const _Box & | a, |
const _Box & | b, | ||
const double | tol | ||
) |
Definition at line 74 of file common_tree.hpp.
Referenced by moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::build_tree(), moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::Bvh_tree(), moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::establish_buckets(), moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::find_split(), moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::initialize_splits(), moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::median_order(), and update_bounding_box().
{ for( std::size_t i = 0; i < a.min.size(); ++i ) { if( b.min[i] < ( a.min[i] - tol ) ) { return false; } if( b.max[i] > ( a.max[i] + tol ) ) { return false; } } return true; }
bool moab::common_tree::box_contains_point | ( | const _Box & | box, |
const _Point & | p, | ||
const double | tol | ||
) |
Definition at line 61 of file common_tree.hpp.
Referenced by moab::Element_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::_find_point(), moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::_find_point(), and moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::bruteforce_find().
void moab::common_tree::compute_box_center | ( | Vector & | max, |
Vector & | min, | ||
Vector & | center | ||
) | [inline] |
Definition at line 108 of file common_tree.hpp.
Referenced by moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::median_order().
Box::value_type moab::common_tree::compute_box_center | ( | const Box & | box, |
const int | dim | ||
) | [inline] |
Definition at line 116 of file common_tree.hpp.
References moab::common_tree::Box< T >::max, and moab::common_tree::Box< T >::min.
void moab::common_tree::construct_element_map | ( | const Entity_handles & | elements, |
Element_map & | map, | ||
Bounding_box & | bounding_box, | ||
Moab & | moab | ||
) |
Definition at line 229 of file common_tree.hpp.
References box(), update_bounding_box(), update_bounding_max(), and update_bounding_min().
Referenced by moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::Bvh_tree(), and moab::Element_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::Element_tree().
{ typedef typename Element_map::mapped_type Box_data; typedef typename Entity_handles::value_type Entity_handle; typedef typename Entity_handles::iterator Entity_handles_iterator; typedef typename Box_data::first_type::value_type Unit; typedef typename std::vector< Unit > Coordinates; typedef typename Coordinates::iterator Coordinate_iterator; for( Entity_handles_iterator i = elements.begin(); i != elements.end(); ++i ) { // TODO: not generic enough. Why dim != 3 const int DIM = 3; int num_vertices = 0; // Commence un-necessary deep copying. const Entity_handle* vertex_handle; moab.get_connectivity( *i, vertex_handle, num_vertices ); Coordinates coordinate( DIM * num_vertices, 0.0 ); moab.get_coords( vertex_handle, num_vertices, &coordinate[0] ); Bounding_box box( coordinate.begin(), coordinate.begin() + 3 ); if( i == elements.begin() ) { bounding_box = box; } for( Coordinate_iterator j = coordinate.begin() + DIM; j != coordinate.end(); j += DIM ) { update_bounding_max( box.max, j ); update_bounding_min( box.min, j ); } update_bounding_box( bounding_box, box ); map.insert( std::make_pair( *i, Box_data( box ) ) ); } }
void moab::common_tree::construct_ordering | ( | Entity_map & | entity_map, |
Ordering & | entity_ordering | ||
) |
Definition at line 214 of file common_tree.hpp.
Referenced by moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::Bvh_tree().
{ entity_ordering.reserve( entity_map.size() ); typedef typename Entity_map::iterator Map_iterator; for( Map_iterator i = entity_map.begin(); i != entity_map.end(); ++i ) { entity_ordering.push_back( i ); } }
std::ostream& moab::common_tree::operator<< | ( | std::ostream & | out, |
const Box< T > & | box | ||
) |
Definition at line 144 of file common_tree.hpp.
References box(), and print_vector().
{ out << "Max: "; print_vector( box.max, out ); out << "Min: "; print_vector( box.min, out ); return out; }
void moab::common_tree::print_vector | ( | const T & | v, |
Stream & | out | ||
) |
Definition at line 28 of file common_tree.hpp.
Referenced by moab::Element_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::compute_split(), moab::Element_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::determine_split(), and operator<<().
{ typedef typename T::const_iterator Iterator; out << "[ "; for( Iterator i = v.begin(); i != v.end(); ++i ) { out << *i; if( i + 1 != v.end() ) { out << ", "; } } out << " ]" << std::endl; }
void moab::common_tree::print_vector | ( | const T & | begin, |
const T & | end | ||
) |
Definition at line 45 of file common_tree.hpp.
References T.
{ std::cout << "[ "; for( T i = begin; i != end; ++i ) { std::cout << ( *i )->second.second.to_ulong(); if( i + 1 != end ) { std::cout << ", "; } } std::cout << " ]" << std::endl; }
void moab::common_tree::update_bounding_box | ( | Box & | a, |
const Box & | b | ||
) |
Definition at line 201 of file common_tree.hpp.
References box_contains_box(), moab::common_tree::Box< T >::max, moab::common_tree::Box< T >::min, update_bounding_max(), and update_bounding_min().
Referenced by construct_element_map(), moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::establish_buckets(), moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::find_split(), moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::initialize_splits(), moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::median_order(), and moab::Bvh_tree< _Entity_handles, _Box, _Moab, _Parametrizer >::set_interval().
{ update_bounding_max( a.max, b.max.begin() ); update_bounding_min( a.min, b.min.begin() ); #ifdef COMMON_TREE_DEBUG if( !box_contains_box( a, b ) ) { std::cout << a << b << std::endl; } #endif }
void moab::common_tree::update_bounding_max | ( | Coordinate & | max, |
Coordinate_iterator | j | ||
) |
Definition at line 181 of file common_tree.hpp.
Referenced by construct_element_map(), and update_bounding_box().
{ typedef typename Coordinate::iterator Iterator; for( Iterator i = max.begin(); i != max.end(); ++i, ++j ) { *i = std::max( *i, *j ); } }
void moab::common_tree::update_bounding_min | ( | Coordinate & | min, |
Coordinate_iterator | j | ||
) |
Definition at line 191 of file common_tree.hpp.
Referenced by construct_element_map(), and update_bounding_box().
{ typedef typename Coordinate::iterator Iterator; for( Iterator i = min.begin(); i != min.end(); ++i, ++j ) { *i = std::min( *i, *j ); } }