Skip to content

Commit

Permalink
improve newcell for large size transformations: use Cartesian for com…
Browse files Browse the repository at this point in the history
…parison
  • Loading branch information
aoterodelaroza committed Feb 19, 2024
1 parent ca64051 commit 1d3ff35
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ module subroutine newcell(c,x00,t0,nnew,xnew,isnew,noenv,ti)
real*8, allocatable :: xlat(:,:)

real*8, parameter :: eps = 1d-2
real*8, parameter :: eps2 = eps * eps

if (c%ismolecule) &
call ferror('newcell','NEWCELL incompatible with molecules',faterr)
Expand Down Expand Up @@ -251,8 +252,8 @@ module subroutine newcell(c,x00,t0,nnew,xnew,isnew,noenv,ti)
ok = .true.
do m = 1, ncseed%nat
dx = x - ncseed%x(:,m)
dx = abs(dx - nint(dx))
if (all(dx < eps)) then
dx = matmul(ncseed%m_x2c,dx - nint(dx))
if (dot_product(dx,dx) < eps2) then
ok = .false.
exit
end if
Expand Down

0 comments on commit 1d3ff35

Please sign in to comment.