File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -496,12 +496,13 @@ void periodic_boundary_adjustment(Atom* atoms,
496496 atom->taud [ia][ik] -= 1.0 ;
497497 }
498498 }
499- if (atom->taud [ia].x < 0
500- || atom->taud [ia].y < 0
501- || atom->taud [ia].z < 0
502- || atom->taud [ia].x >= 1.0
503- || atom->taud [ia].y >= 1.0
504- || atom->taud [ia].z >= 1.0 )
499+ const double eps = 1e-12 ;
500+ if (atom->taud [ia].x < -eps
501+ || atom->taud [ia].y < -eps
502+ || atom->taud [ia].z < -eps
503+ || atom->taud [ia].x >= 1.0 +eps
504+ || atom->taud [ia].y >= 1.0 +eps
505+ || atom->taud [ia].z >= 1.0 +eps)
505506 {
506507 GlobalV::ofs_warning << " atom type=" << it + 1 << " atom index=" << ia + 1 << std::endl;
507508 GlobalV::ofs_warning << " direct coordinate=" << atom->taud [ia].x << " "
You can’t perform that action at this time.
0 commit comments