00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00028 #ifndef pddgeom_OctTreeOps_hpp
00029 #define pddgeom_OctTreeOps_hpp
00030
00031 #include <utility>
00032 #include <vector>
00033 #include <util/Parallel.hpp>
00034 #include <util/OctTree.hpp>
00035
00036 namespace phdmesh {
00037
00038
00046 struct IdentProcBox : public IdentProc {
00047 unsigned part ;
00048 float box[6] ;
00049
00050 IdentProcBox() {}
00051
00052 IdentProcBox( const IdentProcBox & rhs )
00053 : IdentProc( rhs ), part( rhs.part ) { Copy<6>( box , rhs.box ); }
00054
00055 IdentProcBox & operator = ( const IdentProcBox & rhs )
00056 {
00057 IdentProc::operator =( rhs );
00058 part = rhs.part ;
00059 Copy<6>( box , rhs.box );
00060 return *this ;
00061 }
00062 };
00063
00064
00070 void box_global_bounds(
00071 ParallelMachine arg_comm ,
00072 const unsigned arg_domain_boxes_number ,
00073 const IdentProcBox * const arg_domain_boxes ,
00074 const unsigned arg_range_boxes_number ,
00075 const IdentProcBox * const arg_range_boxes ,
00076 float * const arg_global_box );
00077
00078
00101 bool oct_tree_proximity_search(
00102 ParallelMachine arg_comm ,
00103 const float * const arg_global_box ,
00104 const unsigned arg_domain_boxes_number ,
00105 const IdentProcBox * const arg_domain_boxes ,
00106 const unsigned arg_range_boxes_number ,
00107 const IdentProcBox * const arg_range_boxes ,
00108 const OctTreeKey * const arg_cuts ,
00109 std::vector< std::pair<IdentProc,IdentProc> > & arg_relation ,
00110 unsigned * const arg_search_tree_stats = NULL );
00111
00112
00120 bool hsfc_box_covering( const float * const global_box ,
00121 const float * const small_box ,
00122 OctTreeKey * const covering ,
00123 unsigned & number );
00124
00125
00130 void oct_tree_partition_course(
00131 ParallelMachine comm ,
00132 const unsigned length ,
00133 const OctTreeKey * const keys ,
00134 const float * const weights ,
00135 OctTreeKey * const cut_keys ,
00136 const unsigned override_ncuts = 0 );
00137
00138
00145 void oct_tree_partition_fine(
00146 ParallelMachine comm ,
00147 const unsigned length ,
00148 const OctTreeKey * const keys ,
00149 const float * const weights ,
00150 OctTreeKey * const cut_keys );
00151
00152
00157 void oct_tree_partition_private(
00158 const unsigned p_first ,
00159 const unsigned p_end ,
00160 const unsigned depth ,
00161 const double tolerance ,
00162 float * const weights ,
00163 const unsigned cuts_length ,
00164 OctTreeKey * const cuts );
00165
00166
00167
00168 }
00169
00170 #endif
00171