int Let3d::calgnext int  gNodeIdx  ) 
 

build U,V,W,X lists

Definition at line 234 of file let3d.cpp.

References adjacent(), depth(), findgnt(), nodeVec(), parent(), path2Node(), root(), and terminal().

00235 {
00236   vector<Node>&  nodeVec = this->nodeVec();
00237   
00238   set<int> Uset, Vset, Wset, Xset;
00239   int curGNodeIdx = gNodeIdx;
00240   if(root(curGNodeIdx)==false) {
00241          int parGNodeIdx = parent(curGNodeIdx);
00242          
00243          Index3 minIdx(0);
00244          Index3 maxIdx(pow2(depth(curGNodeIdx)));
00245 
00246          for(int i=-2; i<4; i++) {
00247                 for(int j=-2; j<4; j++) {
00248                   for(int k=-2; k<4; k++) {
00249                          Index3 tryPath( 2*path2Node(parGNodeIdx) + Index3(i,j,k) );
00250                          if(tryPath >= minIdx && tryPath <  maxIdx && tryPath != path2Node(curGNodeIdx)) {      
00251                                 int resGNodeIdx = findgnt(depth(curGNodeIdx), tryPath);
00252                                 bool adj = adjacent(resGNodeIdx, curGNodeIdx);
00253                                 if( depth(resGNodeIdx) < depth(curGNodeIdx) ) {
00254                                   if(adj){
00255                                          if(terminal(curGNodeIdx)){
00256                                                 Uset.insert(resGNodeIdx);
00257                                          }
00258                                          else { ; }
00259                                   }
00260                                   else {
00261                                          Xset.insert(resGNodeIdx);
00262                                   }
00263                                 }
00264                                 if( depth(resGNodeIdx)==depth(curGNodeIdx) ) {
00265                                   if(!adj) {
00266                                          Index3 bb(path2Node(resGNodeIdx)-path2Node(curGNodeIdx));
00267                                          assert( bb.linfty()<=3 );
00268                                          Vset.insert(resGNodeIdx);
00269                                   }
00270                                   else {
00271                                          if(terminal(curGNodeIdx)) {
00272                                                 queue<int> rest;
00273                                                 rest.push(resGNodeIdx);
00274                                                 while(rest.empty()==false) {
00275                                                   int fntGNodeIdx = rest.front(); rest.pop();                                    //int fntgNodeIdx = fntgnt.gNodeIdx();
00276                                                   if(adjacent(fntGNodeIdx, curGNodeIdx)==false) {
00277                                                          Wset.insert( fntGNodeIdx );
00278                                                   }
00279                                                   else {
00280                                                          if(terminal(fntGNodeIdx)) {
00281                                                                 Uset.insert(fntGNodeIdx);
00282                                                          }
00283                                                          else { 
00284                                                                 for(int a=0; a<2; a++) {
00285                                                                   for(int b=0; b<2; b++) {
00286                                                                          for(int c=0; c<2; c++) {
00287                                                                                 rest.push( child(fntGNodeIdx, Index3(a,b,c)) );
00288                                                                          }
00289                                                                   }
00290                                                                 }
00291                                                          }
00292                                                   }
00293                                                 }
00294                                          }
00295                                   }
00296                                 }
00297                          }
00298                   }
00299                 }
00300          }
00301   }
00302   if(terminal(curGNodeIdx))
00303          Uset.insert(curGNodeIdx);
00304   
00305   for(set<int>::iterator si=Uset.begin(); si!=Uset.end(); si++)
00306          if(nodeVec[*si].tag() & LET_SRCNODE)           nodeVec[gNodeIdx].Unodes().push_back(*si);
00307   for(set<int>::iterator si=Vset.begin(); si!=Vset.end(); si++)
00308          if(nodeVec[*si].tag() & LET_SRCNODE)           nodeVec[gNodeIdx].Vnodes().push_back(*si);
00309   for(set<int>::iterator si=Wset.begin(); si!=Wset.end(); si++)
00310          if(nodeVec[*si].tag() & LET_SRCNODE)           nodeVec[gNodeIdx].Wnodes().push_back(*si);
00311   for(set<int>::iterator si=Xset.begin(); si!=Xset.end(); si++)
00312          if(nodeVec[*si].tag() & LET_SRCNODE)           nodeVec[gNodeIdx].Xnodes().push_back(*si);
00313   
00314   return (0);
00315 }


Generated on Sun Dec 4 19:24:40 2005 for fmm3d by  doxygen 1.4.5