Skip to content

Commit 6def33f

Browse files
author
Gareth Aneurin Tribello
committed
Hopefully fixes issue with link cells when pbc are not set.
1 parent 6336911 commit 6def33f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/tools/LinkCells.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ void LinkCells::buildCellLists( const std::vector<Vector>& pos, const std::vecto
4949
// Must be able to check that pbcs are not nonsensical in some way?? -- GAT
5050
auto box = pbc.getBox();
5151
if(box(0,0)==0.0 && box(0,1)==0.0 && box(0,2)==0.0 && box(1,0)==0.0 && box(1,1)==0.0 && box(1,2)==0.0 && box(2,0)==0.0 && box(2,1)==0 && box(2,2)==0) {
52-
box(0,0) = box(1,1) = box(2,2) = link_cutoff;
52+
// If the box is not set then we can't use link cells. We thus set the link cell cutoff and box vectors equal to 23 (because it is the best number).
53+
// Setting everything this way ensures that the link cells are a 1x1x1 box. Notice that if it is a one by one by one box then we are hard coded to return
54+
// 0 in findCell
55+
box(0,0) = box(1,1) = box(2,2) = link_cutoff = 23;
5356
} else {
5457
auto determinant = box.determinant();
5558
plumed_assert(determinant > epsilon) <<"Cell lists cannot be built when passing a box with null volume. Volume is "<<determinant;

0 commit comments

Comments
 (0)