From d714abf484b1ea6218af7c3a87527a93c48abdab Mon Sep 17 00:00:00 2001 From: ageay Date: Fri, 5 Mar 2010 15:41:33 +0000 Subject: [PATCH] Precsion information is accessible from the outside now. --- src/INTERP_KERNEL/PointLocatorAlgos.txx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/INTERP_KERNEL/PointLocatorAlgos.txx b/src/INTERP_KERNEL/PointLocatorAlgos.txx index 5379ce1ca..9fe6b6daa 100644 --- a/src/INTERP_KERNEL/PointLocatorAlgos.txx +++ b/src/INTERP_KERNEL/PointLocatorAlgos.txx @@ -32,7 +32,7 @@ namespace INTERP_KERNEL { public: virtual ~GenericPointLocatorAlgos() { } - virtual std::list locates(const double* x) = 0; + virtual std::list locates(const double* x, double eps) = 0; }; template @@ -84,7 +84,7 @@ namespace INTERP_KERNEL //returns the list of elements that contains //the point pointed to by x - std::list locates(const double* x) + std::list locates(const double* x, double eps) { typedef typename MyMeshType::MyConnType ConnType; const NumberingPolicy numPol=MyMeshType::My_numPol; @@ -94,7 +94,7 @@ namespace INTERP_KERNEL for(int i=0; i< candidates.size(); i++) { int ielem=candidates[i]; - if (elementContainsPoint(ielem,x)) + if (elementContainsPoint(ielem,x,eps)) retlist.push_back(OTT::indFC(ielem)); } return retlist; @@ -161,7 +161,7 @@ namespace INTERP_KERNEL return ret; } - static bool isElementContainsPoint(const double *ptToTest, NormalizedCellType type, const double *coords, const typename MyMeshType::MyConnType *conn_elem, int conn_elem_sz) + static bool isElementContainsPoint(const double *ptToTest, NormalizedCellType type, const double *coords, const typename MyMeshType::MyConnType *conn_elem, int conn_elem_sz, double eps) { const int SPACEDIM=MyMeshType::MY_SPACEDIM; typedef typename MyMeshType::MyConnType ConnType; @@ -178,18 +178,18 @@ namespace INTERP_KERNEL const double* a=coords+SPACEDIM*(OTT::ind2C(conn_elem[iedge])); std::copy(a,a+SPACEDIM,pts+iedge*SPACEDIM); } - bool ret=isElementContainsPointAlg2D(ptToTest,pts,nbEdges,1e-12); + bool ret=isElementContainsPointAlg2D(ptToTest,pts,nbEdges,eps); delete [] pts; return ret; } if (SPACEDIM==3) { - return isElementContainsPointAlg3D(ptToTest,conn_elem,conn_elem_sz,coords,cmType,1e-12); + return isElementContainsPointAlg3D(ptToTest,conn_elem,conn_elem_sz,coords,cmType,eps); } } - bool elementContainsPoint(typename MyMeshType::MyConnType i, const double* x) + bool elementContainsPoint(typename MyMeshType::MyConnType i, const double* x, double eps) { //as i is extracted from the BBTRee, it is already in C numbering //it is not necessary to convert it from F to C @@ -202,7 +202,7 @@ namespace INTERP_KERNEL const ConnType* conn_elem=conn+OTT::ind2C(conn_index[i]); int conn_elem_sz=conn_index[i+1]-conn_index[i]; NormalizedCellType type=_mesh.getTypeOfElement(OTT::indFC(i)); - return isElementContainsPoint(x,type,coords,conn_elem,conn_elem_sz); + return isElementContainsPoint(x,type,coords,conn_elem,conn_elem_sz,eps); } static bool decideFromSign(const int* sign, int nbelem) -- 2.39.2