Skip to content

Commit

Permalink
Fixed a bug of reading VIB_EIGS_FILE_NAME and add test for MD initial…
Browse files Browse the repository at this point in the history
…ization
  • Loading branch information
zjing7 committed Feb 21, 2020
1 parent 26675c8 commit 76d510d
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/motion/md_util.F
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ SUBROUTINE read_vib_eigs_unformatted(md_section, &
CALL section_vals_val_get(md_section, "INITIAL_VIBRATION%VIB_EIGS_FILE_NAME", &
n_rep_val=n_rep_val)
IF (n_rep_val > 0) THEN
CALL section_vals_val_get(md_section, "VIB_EIGS_FILE_NAME", c_val=filename)
CALL section_vals_val_get(md_section, "INITIAL_VIBRATION%VIB_EIGS_FILE_NAME", c_val=filename)
ELSE
print_key => section_vals_get_subs_vals(vib_section, "PRINT%CARTESIAN_EIGS")
filename = cp_print_key_generate_filename(logger, print_key, extension="eig", &
Expand Down
10 changes: 10 additions & 0 deletions tests/QS/regtest-md-init/TEST_FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# runs are executed in the same order as in this file
# the second field tells which test should be run in order to compare with the last available output
# e.g. 0 means do not compare anything, running is enough
# 1 compares the last total energy in the file
# 8 compares the first frequency in the last vibration line in the file
# for details see cp2k/tools/do_regtest
# MD inititalization with velocities from vibrational analysis
mdinit-1-2.inp 8 1e-14 6355.339830
mdinit-1-3.inp 70 1e-01 7444.751
#EOF
56 changes: 56 additions & 0 deletions tests/QS/regtest-md-init/mdinit-1-2.inp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
&GLOBAL
PROJECT mdinit-1-2
RUN_TYPE VIBRATIONAL_ANALYSIS
PRINT_LEVEL MEDIUM
trace f
&END GLOBAL
&MOTION
&MD
ENSEMBLE NVE
STEPS 2
TIMESTEP 1.0
TEMPERATURE 300.0
&END MD
&END MOTION
&FORCE_EVAL
METHOD QS
&DFT
BASIS_SET_FILE_NAME GTH_BASIS_SETS
POTENTIAL_FILE_NAME POTENTIAL
&MGRID
CUTOFF 120
&END MGRID
&QS
METHOD GPW
EPS_DEFAULT 1.0E-9
&END QS
&SCF
SCF_GUESS ATOMIC
&END SCF
&XC
&XC_FUNCTIONAL Pade
&END XC_FUNCTIONAL
&END XC
&END DFT
&SUBSYS
&CELL
ABC 15 4 4
&END CELL
&COORD
O 0.000000 0.000000 -0.065587
H 0.000000 -0.757136 0.520545
H 0.000000 0.757136 0.520545
O 1.000000 0.000000 -0.065587
H 1.000000 -0.757136 0.520545
H 1.000000 0.757136 0.520545
&END COORD
&KIND H
BASIS_SET dZVp-GTH
POTENTIAL GTH-PADE-q1
&END KIND
&KIND O
BASIS_SET dZVp-GTH
POTENTIAL GTH-PADE-q6
&END KIND
&END SUBSYS
&END FORCE_EVAL
61 changes: 61 additions & 0 deletions tests/QS/regtest-md-init/mdinit-1-3.inp
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
&GLOBAL
PROJECT mdinit-1-3
RUN_TYPE MD
PRINT_LEVEL MEDIUM
trace f
&END GLOBAL
&MOTION
&MD
ENSEMBLE NVE
STEPS 2
TIMESTEP 0.5
TEMPERATURE 100
INITIALIZATION_METHOD VIBRATIONAL
&INITIAL_VIBRATION
VIB_EIGS_FILE_NAME mdinit-1-2-VIBRATIONS-1.eig
PHASE 0.1
&END INITIAL_VIBRATION
&END MD
&END MOTION
&FORCE_EVAL
METHOD QS
&DFT
BASIS_SET_FILE_NAME GTH_BASIS_SETS
POTENTIAL_FILE_NAME POTENTIAL
&MGRID
CUTOFF 120
&END MGRID
&QS
METHOD GPW
EPS_DEFAULT 1.0E-5
&END QS
&SCF
SCF_GUESS ATOMIC
&END SCF
&XC
&XC_FUNCTIONAL Pade
&END XC_FUNCTIONAL
&END XC
&END DFT
&SUBSYS
&CELL
ABC 15 4 4
&END CELL
&COORD
O 0.000000 0.000000 -0.065587
H 0.000000 -0.757136 0.520545
H 0.000000 0.757136 0.520545
O 1.000000 0.000000 -0.065587
H 1.000000 -0.757136 0.520545
H 1.000000 0.757136 0.520545
&END COORD
&KIND H
BASIS_SET dZVp-GTH
POTENTIAL GTH-PADE-q1
&END KIND
&KIND O
BASIS_SET dZVp-GTH
POTENTIAL GTH-PADE-q6
&END KIND
&END SUBSYS
&END FORCE_EVAL
1 change: 1 addition & 0 deletions tests/TEST_DIRS
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Directories have been reordered according the execution time needed for a gfortran pdbg run using 2 MPI tasks
# in case a new directory is added just add it at the top of the list..
# the order will be regularly checked and modified...
QS/regtest-md-init
QS/regtest-corr_dipm
QS/regtest-admm-gapw libint
QS/regtest-rs-dhft libint
Expand Down

0 comments on commit 76d510d

Please sign in to comment.