* Initializes the search with a given box and reference positions.
*
* \param[in] mode Search mode to use.
- * \param[in] bUseBoundingBox Whether to use bounding box for
- * non-periodic grids.
* \param[in] bXY Whether to use 2D searching.
* \param[in] excls Exclusions.
* \param[in] pbc PBC information.
* \param[in] positions Set of reference positions.
*/
void init(AnalysisNeighborhood::SearchMode mode,
- bool bUseBoundingBox,
bool bXY,
const t_blocka *excls,
const t_pbc *pbc,
* \param[in] pbc Information about the box.
* \param[in] posCount Number of positions in \p x.
* \param[in] x Reference positions that will be put on the grid.
- * \param[in] bUseBoundingBox If `true`, non-periodic grid dimensions
- * will use the bounding box of \p x instead of the box.
* \param[in] bForce If `true`, grid searching will be used if at all
* possible, even if a simple search might give better performance.
* \returns `false` if grid search is not suitable.
*/
- bool initGrid(const t_pbc &pbc, int posCount, const rvec x[],
- bool bUseBoundingBox, bool bForce);
+ bool initGrid(const t_pbc &pbc, int posCount, const rvec x[], bool bForce);
/*! \brief
* Maps a point into a grid cell.
*
}
bool AnalysisNeighborhoodSearchImpl::initGrid(
- const t_pbc &pbc, int posCount, const rvec x[], bool bUseBoundingBox,
- bool bForce)
+ const t_pbc &pbc, int posCount, const rvec x[], bool bForce)
{
if (posCount == 0)
{
clear_rvec(gridOrigin_);
for (int dd = 0; dd < DIM; ++dd)
{
- if (bUseBoundingBox && !bGridPBC_[dd] && !bSingleCell[dd])
+ if (!bGridPBC_[dd] && !bSingleCell[dd])
{
gridOrigin_[dd] = origin[dd];
clear_rvec(box[dd]);
void AnalysisNeighborhoodSearchImpl::init(
AnalysisNeighborhood::SearchMode mode,
- bool bUseBoundingBox,
bool bXY,
const t_blocka *excls,
const t_pbc *pbc,
}
else if (bTryGrid_)
{
- bGrid_ = initGrid(pbc_, positions.count_, positions.x_, bUseBoundingBox,
+ bGrid_ = initGrid(pbc_, positions.count_, positions.x_,
mode == AnalysisNeighborhood::eSearchMode_Grid);
}
refIndices_ = positions.indices_;
typedef std::vector<SearchImplPointer> SearchList;
Impl()
- : cutoff_(0), excls_(NULL), mode_(eSearchMode_Automatic),
- bUseBoundingBox_(true), bXY_(false)
+ : cutoff_(0), excls_(NULL), mode_(eSearchMode_Automatic), bXY_(false)
{
}
~Impl()
real cutoff_;
const t_blocka *excls_;
SearchMode mode_;
- bool bUseBoundingBox_;
bool bXY_;
};
impl_->cutoff_ = cutoff;
}
-void AnalysisNeighborhood::setUseBoundingBox(bool bUseBoundingBox)
-{
- impl_->bUseBoundingBox_ = bUseBoundingBox;
-}
-
void AnalysisNeighborhood::setXYMode(bool bXY)
{
impl_->bXY_ = bXY;
const AnalysisNeighborhoodPositions &positions)
{
Impl::SearchImplPointer search(impl_->getSearch());
- search->init(mode(), impl_->bUseBoundingBox_, impl_->bXY_, impl_->excls_,
+ search->init(mode(), impl_->bXY_, impl_->excls_,
pbc, positions);
return AnalysisNeighborhoodSearch(search);
}
* Does not throw.
*/
void setCutoff(real cutoff);
- /*! \brief
- * Sets the search to prefer a grid that covers the bounding box of
- * reference positions.
- *
- * By default, non-periodic dimensions will ignore the size of the box
- * passed to initSearch() and construct a grid based on the bounding
- * box of the reference positions.
- *
- * If you call this method with `false`, the size of the box will be
- * used instead to set the grid. If one of the box vectors is zero,
- * then grid searching will not be used for that dimension. This
- * allows you to control the size of the used grid in case the default
- * is not suitable. However, in this case the grid will currently
- * always start at the origin.
- *
- * Currently, this only influences cases where the grid is not
- * periodic in some dimensions, i.e., `pbc` passed to initSearch() is
- * NULL, `epbcNONE`, or `epbcXY`.
- *
- * Does not throw.
- */
- void setUseBoundingBox(bool bUseBoundingBox);
/*! \brief
* Sets the search to only happen in the XY plane.
*