From 8deeb57f636d8b051f5d6f14cee84f149be742a4 Mon Sep 17 00:00:00 2001 From: ageay Date: Tue, 30 Nov 2010 07:09:09 +0000 Subject: [PATCH] Acceleration of algorithm. --- src/MEDCoupling/MEDCouplingPointSet.txx | 45 ++++++++++++++----------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/src/MEDCoupling/MEDCouplingPointSet.txx b/src/MEDCoupling/MEDCouplingPointSet.txx index 658d6d9c5..9374a1cb6 100644 --- a/src/MEDCoupling/MEDCouplingPointSet.txx +++ b/src/MEDCoupling/MEDCouplingPointSet.txx @@ -36,30 +36,35 @@ namespace ParaMEDMEM BBTree myTree(&bbox[0],0,0,nbNodes,-prec); double bb[2*SPACEDIM]; double prec2=prec*prec; + std::vector isDone(nbNodes); for(int i=0;i intersectingElems; - myTree.getIntersectingElems(bb,intersectingElems); - if(intersectingElems.size()>1) - { - std::vector commonNodes; - for(std::vector::const_iterator it=intersectingElems.begin();it!=intersectingElems.end();it++) - if(*it!=i) - if(*it>=limitNodeId) - if(INTERP_KERNEL::distance2(coordsPtr+SPACEDIM*i,coordsPtr+SPACEDIM*(*it)) intersectingElems; + myTree.getIntersectingElems(bb,intersectingElems); + if(intersectingElems.size()>1) { - cI.push_back(cI.back()+commonNodes.size()+1); - c.push_back(i); - c.insert(c.end(),commonNodes.begin(),commonNodes.end()); + std::vector commonNodes; + for(std::vector::const_iterator it=intersectingElems.begin();it!=intersectingElems.end();it++) + if(*it!=i) + if(*it>=limitNodeId) + if(INTERP_KERNEL::distance2(coordsPtr+SPACEDIM*i,coordsPtr+SPACEDIM*(*it))