-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
}
/*! returns in \a elems the list of elements potentially containing the point pointed to by \a xx
- \param xx pointer to query point coords
- \param elems list of elements (given in 0-indexing) intersecting the bounding box
- \sa BBTreePts::getElementsAroundPoint2
- */
+ * ** Infinite norm is used here not norm 2 ! ***
+ *
+ * \param xx pointer to query point coords
+ * \param elems list of elements (given in 0-indexing) intersecting the bounding box
+ * \sa BBTreePts::getElementsAroundPoint2
+ */
void getElementsAroundPoint(const double* xx, std::vector<ConnType>& elems) const
{
// terminal node : return list of elements intersecting bb
const double* const bb_ptr=_pts+_elems[i]*dim;
bool intersects = true;
for(int idim=0;idim<dim;idim++)
- if(std::abs(bb_ptr[idim]-xx[idim])>_epsilon)
- intersects=false;
+ intersects=intersects && (std::abs(bb_ptr[idim]-xx[idim])<=_epsilon);
if(intersects)
elems.push_back(_elems[i]);
}