int Let3d::trgData  ) 
 

Definition at line 154 of file let3d.cpp.

References _trgPos, center(), dim(), nodeVec(), and radius().

00155 {
00156   //-----------------------------------------
00157   //edata
00158   DblNumMat& pos = *(_trgPos);  iA( pos.m()==dim() );
00159   
00160   vector<Node>& nodeVec = this->nodeVec();
00161   vector< vector<int> > vecIdxs; vecIdxs.resize(nodeVec.size() );
00162   vector<int> lclSrcNumVec;           lclSrcNumVec.resize(nodeVec.size(), 0);
00163   
00164   vector<int>& curVecIdxs = vecIdxs[0];
00165   Point3 bbmin(center()-Point3(radius()));
00166   Point3 bbmax(center()+Point3(radius()));  //cerr<<" bbx "<<bbmin<<" "<<bbmax<<endl;
00167   for(int k=0; k < pos.n(); k++) {
00168          Point3 tmp(pos.clmdata(k));
00169          iA(tmp>=bbmin && tmp<=bbmax);   //LEXING: IMPORTANT
00170          curVecIdxs.push_back(k);
00171   }
00172   lclSrcNumVec[0] = curVecIdxs.size();
00173   
00174   vector<int> orderBoxesVec     ;  iC( dwnOrderCollect(orderBoxesVec    ) );
00175   for(int i=0; i < orderBoxesVec        .size(); i++) {
00176          int gNodeIdx = orderBoxesVec[i];
00177          Node& curNode = nodeVec[gNodeIdx];
00178          vector<int>& curVecIdxs = vecIdxs[gNodeIdx];    
00179          if(curNode.child()!=-1) { //not terminal
00180                 //children's vecIdxs
00181                 Point3 curCenter( center(gNodeIdx) );
00182                 for(vector<int>::iterator curVecIdxsIt=curVecIdxs.begin();curVecIdxsIt !=curVecIdxs.end(); curVecIdxsIt++) {
00183                   Point3 tmp(pos.clmdata(*curVecIdxsIt));
00184                   Index3 idx;
00185                   for(int j=0; j<dim(); j++)
00186                          idx(j) = (tmp(j)>=curCenter(j));
00187                   int chdGNodeIdx = child(gNodeIdx, idx);
00188                   vector<int>& chdVecIdxs = vecIdxs[chdGNodeIdx];
00189                   chdVecIdxs.push_back(*curVecIdxsIt);
00190                 }
00191                 curVecIdxs.clear(); //VERY IMPORTANT
00192                 //children's lsm                //              for(int ord=0; ord<8; ord++) {
00193                 for(int a=0; a<2; a++) {
00194                   for(int b=0; b<2; b++) {
00195                          for(int c=0; c<2; c++) {
00196                                 int chdGNodeIdx = child(gNodeIdx, Index3(a,b,c));
00197                                 lclSrcNumVec[chdGNodeIdx] = vecIdxs[chdGNodeIdx].size();
00198                          }
00199                   }
00200                 }
00201          }
00202   }
00203   //set EVTR
00204   int cnt = 0;
00205   int sum = 0;
00206   for(int i=0; i<orderBoxesVec  .size(); i++) {
00207          int gNodeIdx = orderBoxesVec   [i];
00208          if(lclSrcNumVec[gNodeIdx]>0) { //evtr node
00209                 nodeVec[gNodeIdx].tag() = nodeVec[gNodeIdx].tag() | LET_TRGNODE;
00210                 nodeVec[gNodeIdx].trgNodeIdx() = cnt;
00211                 cnt ++;
00212                 if(nodeVec[gNodeIdx].child()==-1) { //terminal
00213                   nodeVec[gNodeIdx].trgExaBeg() = sum;
00214                   nodeVec[gNodeIdx].trgExaNum() = lclSrcNumVec[gNodeIdx];
00215                   sum += lclSrcNumVec[gNodeIdx];
00216                   nodeVec[gNodeIdx].trgOwnVecIdxs() = vecIdxs[gNodeIdx];
00217                 }
00218          }
00219   }
00220   _trgNodeCnt = cnt;  _trgExaCnt = sum;
00221   
00222   //set USER
00223   for(int i=0; i < orderBoxesVec        .size(); i++) {
00224          int gNodeIdx = orderBoxesVec   [i];
00225          if(nodeVec[gNodeIdx].tag() & LET_TRGNODE) { //a evtr           
00226                 iC( calgnext(gNodeIdx) );
00227          }
00228   }
00229   //cerr<<usndecnt<<" "<<usextcnt<<endl;
00230   return 0;
00231 }


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