From: vbd Date: Wed, 7 May 2008 12:26:34 +0000 (+0000) Subject: NPPAL 19079 : X-Git-Tag: BR_Ensight_Indus_Patched1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a812b4c783fac843e17068619a9016a03422f028;p=tools%2Fmedcoupling.git NPPAL 19079 : bug correction in PointLocator algos. --- diff --git a/src/INTERP_KERNEL/PointLocatorAlgos.txx b/src/INTERP_KERNEL/PointLocatorAlgos.txx index 412f004e9..7f18751c3 100644 --- a/src/INTERP_KERNEL/PointLocatorAlgos.txx +++ b/src/INTERP_KERNEL/PointLocatorAlgos.txx @@ -41,7 +41,10 @@ namespace INTERP_KERNEL{ } for (int index= conn_index[i]; index < conn_index[i+1];index++) { - const double* coordelem = coords+OTT::ind2C(conn[OTT::ind2C(index)]); + //coordelem points to the coordinates of the current node of the i-th element + const double* coordelem = coords+OTT::ind2C(conn[OTT::ind2C(index)])*SPACEDIM; + + //the bounding box is updated by checking wheher the node is at the min/max in exach dimension for (int idim=0; idim locates(const double* x) { vector candidates; @@ -65,8 +70,9 @@ namespace INTERP_KERNEL{ list retlist; for (int i=0; i< candidates.size(); i++) { - if (elementContainsPoint(i,x)) - retlist.push_back(OTT::indFC(i)); + int ielem=candidates[i]; + if (elementContainsPoint(ielem,x)) + retlist.push_back(OTT::indFC(ielem)); } return retlist; }