Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Restrictions

VASP is restricted to 6 Stanford users and 6 SLAC licensed users. It may not be used in contractual research in cooperation with industry or military.

Authorized users have read-access to the source code, executables and pseudo-potentials, but you must not copy these anywhere where they could be publicly visible.

Contact cpo to be put on the permissions list.

Warning

As best I can tell, VASP has no self-tests. There may be problems. Talk to cpo if you see something strange.

VASP Dangers

Courtesy of Jun Yan:

  • If you have a typo (e.g. instead of "LDAUTYPE" you use "LADUTYPE") in the INCAR then VASP will ignore the parameter. This is true for many parameters.
  • If you have a unit-cell with a very small angle (e.g. Mn3O4 experimental structure) then you have to specify a large ENCUT (~700eV)
  • For spin-polarized calculations it's not enough to set spinpol=True, but also must specify relatively large initial magnetic moments (otherwise the magnetic moments remain near 0 for the calculation)
  • VASP has a default number of electronic steps of 50. If this is exceeded, then a structural relaxation continues, but the final structure sometimes appears wrong, even if the last SCF step had <50 iterations. (not clear why this happens)

Submitting Batch Jobs

Code Block

vasp-ver-bsub <version> myscript.py
vasp-ver-bsub-native <version> -q suncat-test -n 2 -o junk.log

...

Thanks to Joel Varley for providing this BEEF example.

Code Block

#!/usr/bin/env python

#LSF -q suncat-test
#LSF -n 2
#LSF -o std.out
#LSF -e std.err

from ase import *
from ase import io
from ase.lattice.spacegroup import crystal
from ase.io.trajectory import PickleTrajectory
from ase.optimize import BFGS, QuasiNewton
from ase.units import kJ, Hartree
from ase.utils.eos import EquationOfState
from ase.calculators.vasp import Vasp
from ase.data.molecules import molecule as molecule
from ase.vibrations import Vibrations
import os, sys

#############################################################################
#############################################################################

name  = 'H'
a = 5.0
atoms = Atoms([Atom('H',(a/2, a/2, a/2))],
              cell=(a, a, a))

# note that BEEF is only available in suncat vasp version 2 (v2) or later.
xcf = 'BEEF'
encut = 400
nkp   = 1
sigma = 0.05
ibrion= -1 # no atomic displacement done by VASP (only ASE)
ispin = 1 # NOT spin-polarized (ispin=2 for SP)

# some types of GGA
vaspgga = {'RPBE' : 'RP',
           'PBE'  : 'PE',
           'AM05' : 'AM',
           'PBEsol' : 'PS',
           'PW86' : 'PW',
           'PW91' : '91',
           'BEEF' : 'BF',
           'GGA'  : '--',
          }

if xcf=='BEEF':
    luse_vdw=True
    if not (os.path.exists('vdw_kernel.bindat')):
        os.symlink('/nfs/slac/g/suncatfs/sw/vasp/vdw_kernel.bindat','vdw_kernel.bindat')
else:
    luse_vdw=False

# VASP uses LDA or PBE PAW pseudopotentials as a start (gga flag modifies the GGA paramaterization
if xcf in vaspgga.keys():
    xc = 'PBE'
else:
    xc = 'LDA'
    vaspgga['LDA'] = '--'

#############################################################################
#############################################################################
calc = Vasp(encut=encut,
            xc=xc,
            gga=vaspgga[xcf],
            kpts  = (nkp,nkp,nkp),
            gamma = False, # Gamma-centered (defaults to Monkhorst-Pack)
            ismear=0,
            sigma=sigma,
            ibrion=ibrion,
            nsw=0, # don't use the VASP internal relaxation, only use ASE
            #potim=potim, # use to take smaller ionic steps (or for vibration/normal mode calculations)
            lvtot=False,
            npar=1, # use this if you run on one node (most calculations).  see suncat confluence page for optimal setting
            lwave=False,
            luse_vdw=luse_vdw,
            ispin=ispin,
            zab_vdw=-1.8867,  # this selects vdw-DF2
            #lreal=True,  # can speed up if supercells are large
           )

atoms.set_calculator(calc)

dyn = QuasiNewton(atoms, logfile=name+'.log', trajectory=name+'.traj')
dyn.run(fmax=0.05)

electronicenergy = atoms.get_potential_energy()
f = open('out.energy','w')
f.write(str(electronicenergy))
f.close()

# clean up big leftover files (WAVECAR or CHGCAR could be of use for some calculations)
os.system('rm CHG vasprun.xml PCDAT WAVECAR CHGCAR')
#############################################################################

...