Skip to content

Commit

Permalink
Pint: Fixed position init for centroid constraints + adjusted regtest…
Browse files Browse the repository at this point in the history
… values
  • Loading branch information
cschran authored and hforbert committed Aug 23, 2019
1 parent 5ffd82a commit 7153351
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/motion/pint_methods.F
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@ SUBROUTINE pint_init_v(pint_env)
factor = SQRT(REAL(pint_env%p, dp))
ELSE
! lowest NM is centroid
factor = 1
factor = 1.0_dp
END IF
IF (pint_env%logger%para_env%ionode) THEN
Expand Down Expand Up @@ -2002,7 +2002,7 @@ SUBROUTINE pint_step(pint_env, helium_env)
! Multiply with 1/SQRT(n_beads) due to normal mode transformation in RPMD
factor = SQRT(REAL(pint_env%p, dp))
ELSE
factor = 1
factor = 1.0_dp
END IF

CALL getold(gci, local_molecules, molecule_set, &
Expand Down Expand Up @@ -2224,9 +2224,11 @@ SUBROUTINE pint_step(pint_env, helium_env)
! Apply centroid constraints (RATTLE)
IF (pint_env%simpar%constraint) THEN
IF (pint_env%logger%para_env%ionode) THEN
! Reset particle r, due to force calc:
DO i = 1, nparticle
DO j = 1, 3
vel(j, i) = pint_env%uv(1, j+(i-1)*3)
particle_set(i)%r(j) = pint_env%ux(1, j+(i-1)*3)
END DO
END DO

Expand Down Expand Up @@ -2429,12 +2431,13 @@ SUBROUTINE pint_step(pint_env, helium_env)
IF (pint_env%simpar%constraint) THEN
IF (pint_env%logger%para_env%ionode) THEN
! Transform positions and velocities to Cartesian coordinates:
! Reset particle r, due to force calc:
DO i = 1, nparticle
DO j = 1, 3
vel(j, i) = pint_env%uv(1, j+(i-1)*3)/factor
particle_set(i)%r(j) = pint_env%ux(1, j+(i-1)*3)/factor
END DO
END DO

CALL rattle_control(gci, local_molecules, &
molecule_set, molecule_kind_set, &
particle_set, vel, dti, &
Expand Down
4 changes: 2 additions & 2 deletions tests/Pimd/regtest-1/TEST_FILES
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ h2o_pint_qs_nose.inp 9 1.0E-14 -
h2o_pint_qs_nose_restart.inp 9 2e-09 -17.1295368929579
h2o_pint_exact_harm.inp 9 3e-14 2.8542777100474888E-003
h2o_pint_rpmd.inp 9 2e-14 1.1503487725277912E-002
h2o_pint_constraints_nose.inp 9 2e-14 9.7527459873828996E-003
h2o_pint_constraints_exact.inp 9 2e-14 2.8127782657626638E-003
h2o_pint_constraints_nose.inp 9 2e-14 9.7527488124538198E-003
h2o_pint_constraints_exact.inp 9 2e-14 2.8127812079331727E-003
he32_only.inp 40 2e-14 -6.8432379611995943E-005
he32_only_restart.inp 40 2e-14 -6.9355037438372283E-005
water-in-helium.inp 9 7e-14 1.0717546824070511E-003
Expand Down

0 comments on commit 7153351

Please sign in to comment.