Molecular dynamics calculations: Difference between revisions

From VASP Wiki
 
(20 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Compilation ==
First of all to run molecular dynamics calculation VASP has to be compiled using the [[Precompiler_flags|-Dtbdyn]] precompiler flag in the makefile.include file. A sample input using this tag would look like this:
CPP    = $(CPP_) -DHOST=\"IFC9_fftw\" \
          -Dkind8 -DNGXhalf  -DCACHE_SIZE=12000 -DPGF90 -Davoidalloc  \
          -Dtbdyn
== Basic example ==
To run a basic molecular dynamics calculation perform the following steps:
To run a basic molecular dynamics calculation perform the following steps:
*Choose a {{TAG|POSCAR}} containing a large enough super cell.  
*Choose a {{TAG|POSCAR}} containing a large enough super cell.  
*If it a continuation run is performed copy {{TAG|CONTCAR}} to {{TAG|POSCAR}} or possibly deliver initial velocities in the {{TAG|POSCAR}} file. They are written after the Wycoff positions in an own paragraph. If no initial velocities are provided the random velocities are assumed at the beginning of the calculation. This is fully ok but the user should be aware that due to the initial random velocities the trajectory can change at the beginning of the molecular dynamics.
*If a continuation run is performed copy {{TAG|CONTCAR}} to {{TAG|POSCAR}} or possibly deliver initial velocities in the {{TAG|POSCAR}} file. They are written after the Wycoff positions in an own paragraph. If no initial velocities are provided random velocities are assumed at the beginning of the calculation. This is fully ok but the user should be aware that due to the initial random velocities the trajectories obtained from different calculations are difficult to compare.
*Set main {{TAG|INCAR}} tags:
*Set main {{TAG|INCAR}} tags:
**{{TAG|IBRION}}=0: Molecular dynamics calculations are enabled by setting the {{TAG|IBRION}} tag to 0.
**{{TAG|IBRION}}=0: Molecular dynamics calculations are enabled by setting the {{TAG|IBRION}} tag to 0.
Line 16: Line 8:
**{{TAG|TEBEG}}: If a thermostat is used define the desired temperature at which the molecular dynamics calculations should run.
**{{TAG|TEBEG}}: If a thermostat is used define the desired temperature at which the molecular dynamics calculations should run.
**{{TAG|ISIF}} (optional).
**{{TAG|ISIF}} (optional).
**{{TAG|MDALGO}}: This tag decides whether the molecular dynamics run is executed using without a thermostat ({{TAG|MDALGO}}=0 which is default) or with a thermostat ({{TAG|MDALGO}}>0).  For regular molecular dynamics calculations the thermostat is selected by a one digit number (e.g. 1 for Andersen, 2 for Nose-Hoover etc.). For biased molecular dynamics, metadynamics etc. the thermostat is selected by a two digit number where the first digit corresponds to the thermostat analogously to regular molecular dynamics and the second digit corresponds to the molecular dynamics type (e.g. 11 metadynamics with Andersen thermostat, 21 metadynamics with Nose-Hoover thermostat etc.). The NVE ensemble is a special case. It is available by selecting the Andersen thermostat and setting no collisions with the heat bath ({{TAG|ANDERSEN_PROB}}=0). Or by setting {{TAG|SMASS-3}} without setting the {{TAG|MDALGO}} tag (default of 0 is then used).
**{{TAG|MDALGO}}: This tag decides with which thermostat the molecular dynamics calculation is executed.  For regular molecular dynamics calculations the thermostat is selected by a one digit number (e.g. 1 for Andersen, 2 for Nose-Hoover etc.). For biased molecular dynamics, metadynamics etc. the thermostat is selected the same way from VASP 6 or higher. In VASP 5.x it is selected by a two digit number where the first digit corresponds to the thermostat analogously to regular molecular dynamics and the second digit corresponds to the molecular dynamics type (e.g. 11 metadynamics with Andersen thermostat, 21 metadynamics with Nose-Hoover thermostat etc.). The {{TAG|NVE ensemble}} is a special case. It is available by selecting the Andersen thermostat and setting no collisions with the heat bath ({{TAG|ANDERSEN_PROB}}=0).
**{{TAG|ISIF}}: In molecular dynamics calculations this tag is used to choose the {{TAG|NVT ensemble}} or {{TAG|NpT ensemble}} (the {{TAG|NVE}} ensemble is a special case!). For {{TAG|ISIF}}=2 the volume is kept constant and the {{TAG|NVT ensemble}} is used. Using this tag the stress tensor is calculated and hence the pressure can be monitored. For {{TAG|ISIF}}=3 the stress tensor (pressure) is kept constant and the {{TAG|NPT ensemble}} is used. Using this tag the volume is calculated and can be monitored.  
**{{TAG|ISIF}}: In molecular dynamics calculations this tag is used to choose the {{TAG|NVT ensemble}} or {{TAG|NpT ensemble}} (the {{TAG|NVE ensemble}} is a special case!). For {{TAG|ISIF}}=2 the volume is kept constant and the {{TAG|NVT ensemble}} is used. Using this tag the stress tensor is calculated and hence the pressure can be monitored. For {{TAG|ISIF}}=3 the stress tensor (pressure) is kept constant and the {{TAG|NpT ensemble}} is used. Using this tag the volume is calculated and can be monitored.  
*Decide which ensemble to use:
*Decide which [[:Category:Ensembles|ensemble]] to use:
**NVT: Set {{TAG|ISIF}}=2.  
**{{TAG|NVT ensemble}}: Set {{TAG|ISIF}}=2.  
**NpT: Set {{TAG|ISIF}}=3.
**{{TAG|NpT ensemble}}: Set {{TAG|ISIF}}=3.
**NVE: Set {{TAG|SMASS}}=-3 or {{TAG|ANDERSEN_PROB}}=0.0.
**{{TAG|NVE ensemble}}: Set {{TAG|MDALGO}}=1 and {{TAG|ANDERSEN_PROB}}=0.0.
*Decide which thermostat to use (the combination of thermostats and ensembles is given in table):
*Decide which thermostat to use (the combination of thermostats and ensembles is given in table):
**{{TAG|Andersen thermostat}}: Set {{TAG|MDALGO}}=1. Also set {{TAG|ANDERSEN_PROB}}>0.0 to control the stochastic update frequency of the thermostat.  
**{{TAG|Andersen thermostat}}: Set {{TAG|MDALGO}}=1. Also set {{TAG|ANDERSEN_PROB}}>0.0 to control the stochastic update frequency of the thermostat.  
**{{TAG|Nose-Hoover thermostat}}: Set {{TAG|MDALGO}}=2. Also set {{TAG|SMASS}}>0.0 to control the coupling to the heat bath.
**{{TAG|Nose-Hoover thermostat}}: Set {{TAG|MDALGO}}=2. Also set {{TAG|SMASS}}>0.0 to control the coupling to the heat bath.
**{{TAG|Langevin thermostat}}: Set {{TAG|MDALGO}}=3. Also set {{TAG|LANGEVIN_GAMMA}}>0.0 to control the friction parameter. If the {{TAG|NpT ensemble}} is used (by setting {{TAG|ISIF}}=3) additionally the friction coefficient of the lattice {{TAG|LANGEVIN_GAMMA_L}} has to be provided too.
**{{TAG|Langevin thermostat}}: Set {{TAG|MDALGO}}=3. Also set {{TAG|LANGEVIN_GAMMA}}>0.0 to control the friction parameter. If the {{TAG|NpT ensemble}} is used (by setting {{TAG|ISIF}}=3) additionally the friction coefficient of the lattice {{TAG|LANGEVIN_GAMMA_L}} has to be provided too.
**{{TAG|Nose-Hoover-chain thermostat}}: Set {{TAG|MDALGO}}=4. Also set the {{TAG|NHC_NCHAINS}}>0 to adjust the length of the Nose-Hoover chain.  With {{TAG|NHC_PERIOD}} the period (coupling strength to the heat bath) of the Nose-Hoover chains thermostat is set.
**{{TAG|CSVR thermostat}}: Set {{TAG|MDALGO}}=5 and additionally adjust {{TAG|CSVR_PERIOD}}>0.


== Combination of Ensembles and thermostats ==
The following combinations of thermostats and barostats is possible:
 
{{Template:MDCOMBINATIONS}}
{{Template:MDCOMBINATIONS|Table 1}}


== Compilation ==
To run molecular dynamics calculation VASP has to be compiled using the [[Precompiler_flags|-Dtbdyn]] precompiler flag in the makefile.include file. A sample input using this tag would look like this:
CPP    = $(CPP_) -DHOST=\"IFC9_fftw\" \
          -Dkind8 -DNGXhalf  -DCACHE_SIZE=12000 -DPGF90 -Davoidalloc  \
          -Dtbdyn


----
----


[[Category:Molecular Dynamics]][[Category:Howto]]
[[Category:Molecular dynamics]][[Category:Howto]]

Latest revision as of 15:52, 22 October 2024

To run a basic molecular dynamics calculation perform the following steps:

  • Choose a POSCAR containing a large enough super cell.
  • If a continuation run is performed copy CONTCAR to POSCAR or possibly deliver initial velocities in the POSCAR file. They are written after the Wycoff positions in an own paragraph. If no initial velocities are provided random velocities are assumed at the beginning of the calculation. This is fully ok but the user should be aware that due to the initial random velocities the trajectories obtained from different calculations are difficult to compare.
  • Set main INCAR tags:
    • IBRION=0: Molecular dynamics calculations are enabled by setting the IBRION tag to 0.
    • POTIM: This tag sets the time step in fs for the molecular dynamics run.
    • NSW: This tag sets the number of steps performed in the molecular dynamics run.
    • TEBEG: If a thermostat is used define the desired temperature at which the molecular dynamics calculations should run.
    • ISIF (optional).
    • MDALGO: This tag decides with which thermostat the molecular dynamics calculation is executed. For regular molecular dynamics calculations the thermostat is selected by a one digit number (e.g. 1 for Andersen, 2 for Nose-Hoover etc.). For biased molecular dynamics, metadynamics etc. the thermostat is selected the same way from VASP 6 or higher. In VASP 5.x it is selected by a two digit number where the first digit corresponds to the thermostat analogously to regular molecular dynamics and the second digit corresponds to the molecular dynamics type (e.g. 11 metadynamics with Andersen thermostat, 21 metadynamics with Nose-Hoover thermostat etc.). The NVE ensemble is a special case. It is available by selecting the Andersen thermostat and setting no collisions with the heat bath (ANDERSEN_PROB=0).
    • ISIF: In molecular dynamics calculations this tag is used to choose the NVT ensemble or NpT ensemble (the NVE ensemble is a special case!). For ISIF=2 the volume is kept constant and the NVT ensemble is used. Using this tag the stress tensor is calculated and hence the pressure can be monitored. For ISIF=3 the stress tensor (pressure) is kept constant and the NpT ensemble is used. Using this tag the volume is calculated and can be monitored.
  • Decide which ensemble to use:
  • Decide which thermostat to use (the combination of thermostats and ensembles is given in table):

The following combinations of thermostats and barostats is possible:

Thermostat
Ensemble Andersen Nose-Hoover Langevin NHC CSVR Multiple Andersen
Microcanonical (NVE) MDALGO=1, ANDERSEN_PROB=0.0
Canonical (NVT) MDALGO=1 MDALGO=2 MDALGO=3 MDALGO=4 MDALGO=5 MDALGO=13
ISIF=2 ISIF=2 ISIF=2 ISIF=2 ISIF=2 ISIF=2
Isobaric-isothermal (NpT) not available not available MDALGO=3 not available not available not available
ISIF=3
Isoenthalpic-isobaric (NpH) MDALGO=3, ISIF=3, LANGEVIN_GAMMA=LANGEVIN_GAMMA_L=0.0

Compilation

To run molecular dynamics calculation VASP has to be compiled using the -Dtbdyn precompiler flag in the makefile.include file. A sample input using this tag would look like this:

CPP     = $(CPP_) -DHOST=\"IFC9_fftw\" \
          -Dkind8 -DNGXhalf  -DCACHE_SIZE=12000 -DPGF90 -Davoidalloc  \
          -Dtbdyn