CP2K Snippets

From Deskins Group Resources

Various input file snippets for CP2K.

Job Monitoring/Processing

Check Forces/Convergence

This is useful for checking whether the geometry is converging or not. It should be getting smaller, and eventually under the MAX_FORCE criteria.

grep "Max. gradient" outputfile.out

Get Energies

This gets the energies from the output file.

grep "ENERGY|" outputfile.out

or to get final energy

grep "ENERGY|" outputfile.out | tail -n 1


van der Waals corrections

Put text under XC section.

Grimme D2 method:

&vdW_POTENTIAL
  DISPERSION_FUNCTIONAL PAIR_POTENTIAL
  &PAIR_POTENTIAL
    TYPE DFTD2
     REFERENCE_FUNCTIONAL PBE
  &END PAIR_POTENTIAL
 &END vdW_POTENTIAL

Grimme D3 method:

&vdW_POTENTIAL
 &PAIR_POTENTIAL
   TYPE DFTD3
   PARAMETER_FILE_NAME ../../../data/dftd3.dat
   REFERENCE_FUNCTIONAL PBE
   # CALCULATE_C9_TERM .TRUE.
   &PRINT_DFTD
   &END
 &END PAIR_POTENTIAL
&END vdW_POTENTIAL

Semi-empirical Calculations

You can run PM6 calculations with CP2K. This may be useful for optimizing a structure before running at DFT level if the structure is far from optimized. The semi-empirical routines do not seem as developed as the DFT routines (e.g. more buggy), so be careful.

&GLOBAL
 PROJECT cisplatin
 RUN_TYPE GEO_OPT
 PRINT_LEVEL LOW
&END GLOBAL

&MOTION
 &GEO_OPT
  OPTIMIZER BFGS
 &END GEO_OPT
&END MOTION

&FORCE_EVAL
 METHOD Quickstep
 &DFT
  LSD
  &QS
   METHOD PM6
   &SE
    &MEMORY
     MAX_MEMORY 100
    &END
   &END
  &END QS
  &SCF
   MAX_SCF 20
   SCF_GUESS atomic
   &OT
    MINIMIZER DIIS
    N_DIIS 7
    PRECONDITIONER NONE
   &END
   &OUTER_SCF
    MAX_SCF 5
   &END
  &END SCF
 &END DFT
 &SUBSYS
  &CELL
    ABC 30.0 30.0 30.0
    PERIODIC NONE
  &END CELL
  &COORD
   COORDS HERE
  &END COORD
  &PRINT
   &KINDS
    BASIS_SET
    POTENTIAL
   &END KINDS
  &END PRINT
 &END SUBSYS
&END FORCE_EVAL

DFT+U Ramping

This is a neat method that incrementally increases the U value to the target U value. Useful for convergence using DFT+U.

&DFT_PLUS_U
  L 2
  U_MINUS_J 0.220496
  # U = 6 eV
  U_RAMPING 0.0220496
  #INIT_U_RAMPING_EACH_SCF .TRUE.
  #EPS_U_RAMPING 1.E-6
 &END