|
phdMesh Version of the Day
|
00001 /*------------------------------------------------------------------------*/ 00002 /* phdMesh : Parallel Heterogneous Dynamic unstructured Mesh */ 00003 /* Copyright (2007) Sandia Corporation */ 00004 /* */ 00005 /* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */ 00006 /* license for use of this work by or on behalf of the U.S. Government. */ 00007 /* */ 00008 /* This library is free software; you can redistribute it and/or modify */ 00009 /* it under the terms of the GNU Lesser General Public License as */ 00010 /* published by the Free Software Foundation; either version 2.1 of the */ 00011 /* License, or (at your option) any later version. */ 00012 /* */ 00013 /* This library is distributed in the hope that it will be useful, */ 00014 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 00015 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ 00016 /* Lesser General Public License for more details. */ 00017 /* */ 00018 /* You should have received a copy of the GNU Lesser General Public */ 00019 /* License along with this library; if not, write to the Free Software */ 00020 /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 */ 00021 /* USA */ 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
1.7.4