From a812b4c783fac843e17068619a9016a03422f028 Mon Sep 17 00:00:00 2001 From: vbd Date: Wed, 7 May 2008 12:26:34 +0000 Subject: [PATCH] NPPAL 19079 : bug correction in PointLocator algos. --- src/INTERP_KERNEL/PointLocatorAlgos.txx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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; } -- 2.39.2