phdMesh  Version of the Day
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
OctTreeOps.hpp
1 /*------------------------------------------------------------------------*/
2 /* phdMesh : Parallel Heterogneous Dynamic unstructured Mesh */
3 /* Copyright (2007) Sandia Corporation */
4 /* */
5 /* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */
6 /* license for use of this work by or on behalf of the U.S. Government. */
7 /* */
8 /* This library is free software; you can redistribute it and/or modify */
9 /* it under the terms of the GNU Lesser General Public License as */
10 /* published by the Free Software Foundation; either version 2.1 of the */
11 /* License, or (at your option) any later version. */
12 /* */
13 /* This library is distributed in the hope that it will be useful, */
14 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
15 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
16 /* Lesser General Public License for more details. */
17 /* */
18 /* You should have received a copy of the GNU Lesser General Public */
19 /* License along with this library; if not, write to the Free Software */
20 /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 */
21 /* USA */
22 /*------------------------------------------------------------------------*/
28 #ifndef pddgeom_OctTreeOps_hpp
29 #define pddgeom_OctTreeOps_hpp
30 
31 #include <utility>
32 #include <vector>
33 #include <util/Parallel.hpp>
34 #include <util/OctTree.hpp>
35 
36 namespace phdmesh {
37 
38 //----------------------------------------------------------------------
46 struct IdentProcBox : public IdentProc {
47  unsigned part ;
48  float box[6] ;
49 
50  IdentProcBox() {}
51 
52  IdentProcBox( const IdentProcBox & rhs )
53  : IdentProc( rhs ), part( rhs.part ) { Copy<6>( box , rhs.box ); }
54 
55  IdentProcBox & operator = ( const IdentProcBox & rhs )
56  {
57  IdentProc::operator =( rhs );
58  part = rhs.part ;
59  Copy<6>( box , rhs.box );
60  return *this ;
61  }
62 };
63 
64 //----------------------------------------------------------------------
71  ParallelMachine arg_comm ,
72  const unsigned arg_domain_boxes_number ,
73  const IdentProcBox * const arg_domain_boxes ,
74  const unsigned arg_range_boxes_number ,
75  const IdentProcBox * const arg_range_boxes ,
76  float * const arg_global_box );
77 
78 //----------------------------------------------------------------------
102  ParallelMachine arg_comm ,
103  const float * const arg_global_box ,
104  const unsigned arg_domain_boxes_number ,
105  const IdentProcBox * const arg_domain_boxes ,
106  const unsigned arg_range_boxes_number ,
107  const IdentProcBox * const arg_range_boxes ,
108  const OctTreeKey * const arg_cuts ,
109  std::vector< std::pair<IdentProc,IdentProc> > & arg_relation ,
110  unsigned * const arg_search_tree_stats = NULL );
111 
112 //----------------------------------------------------------------------
120 bool hsfc_box_covering( const float * const global_box ,
121  const float * const small_box ,
122  OctTreeKey * const covering ,
123  unsigned & number );
124 
125 //----------------------------------------------------------------------
131  ParallelMachine comm ,
132  const unsigned length ,
133  const OctTreeKey * const keys ,
134  const float * const weights ,
135  OctTreeKey * const cut_keys ,
136  const unsigned override_ncuts = 0 );
137 
138 //----------------------------------------------------------------------
146  ParallelMachine comm ,
147  const unsigned length ,
148  const OctTreeKey * const keys ,
149  const float * const weights ,
150  OctTreeKey * const cut_keys );
151 
152 //----------------------------------------------------------------------
158  const unsigned p_first ,
159  const unsigned p_end ,
160  const unsigned depth ,
161  const double tolerance ,
162  float * const weights ,
163  const unsigned cuts_length ,
164  OctTreeKey * const cuts );
165 
166 //----------------------------------------------------------------------
167 
168 }
169 
170 #endif
171 
bool oct_tree_proximity_search(ParallelMachine arg_comm, const float *const arg_global_box, const unsigned arg_domain_boxes_number, const IdentProcBox *const arg_domain_boxes, const unsigned arg_range_boxes_number, const IdentProcBox *const arg_range_boxes, const OctTreeKey *const arg_cuts, std::vector< std::pair< IdentProc, IdentProc > > &arg_relation, unsigned *const arg_search_tree_stats=NULL)
void box_global_bounds(ParallelMachine arg_comm, const unsigned arg_domain_boxes_number, const IdentProcBox *const arg_domain_boxes, const unsigned arg_range_boxes_number, const IdentProcBox *const arg_range_boxes, float *const arg_global_box)
bool hsfc_box_covering(const float *const global_box, const float *const small_box, OctTreeKey *const covering, unsigned &number)
void oct_tree_partition_course(ParallelMachine comm, const unsigned length, const OctTreeKey *const keys, const float *const weights, OctTreeKey *const cut_keys, const unsigned override_ncuts=0)
void oct_tree_partition_fine(ParallelMachine comm, const unsigned length, const OctTreeKey *const keys, const float *const weights, OctTreeKey *const cut_keys)
void oct_tree_partition_private(const unsigned p_first, const unsigned p_end, const unsigned depth, const double tolerance, float *const weights, const unsigned cuts_length, OctTreeKey *const cuts)