EFOR: Difference between revisions

From VASP Wiki
Line 8: Line 8:
{{NB| mind | The sum of all external forces set with {{TAG|EFOR}} must be 0 to avoid drift.}}
{{NB| mind | The sum of all external forces set with {{TAG|EFOR}} must be 0 to avoid drift.}}
==Setting external forces==
==Setting external forces==
{{TAG|EFOR}} can be a very long array, as 3 values need to be set for each ion in the system. The syntax is equivalent to setting the [[MAGMOM|magnetic moments]] in the noncollinear case, so it is possible to use an <code>N*F</code> syntax to indicate that the next '''N''' entries in the array should be of value '''F'''. E.g.:
{{TAG|EFOR}} can be a very long array, as 3 values need to be set for each ion in the system. The format is equivalent to setting the magnetic moments in the noncollinear case using [[MAGMOM]], so it is possible to use an <code>N*F</code> syntax to indicate that the next '''N''' entries in the array should be of value '''F'''. E.g.:
   EFOR = 2*0.0 1.0 188*0.0 -1.0
   EFOR = 2*0.0 1.0 188*0.0 -1.0
In this example, we have 64 ions, so we have to set 3*64=192 values in the array. Only the cartesian z components of the first and last ion are non-zero, enabling a compact [[INCAR]] line.
In this example, we have 64 ions, so we have to set 3*64=192 values in the array. Only the cartesian z components of the first and last ion should be non-zero, which enables a compact [[INCAR]] line.


If more force components are non-zero, it is better for readability to utilize the multi-line option in the [[INCAR]] file using backslashes ('''\''') to negate line breaks, e.g. for a 32 atom system with forces in the x- and y-directions on the first and last 8 atoms:
If more force components are non-zero, it is better for readability to utilize the multi-line option in the [[INCAR#Format|INCAR]] file using backslashes ('''\''') to negate line breaks or put the multi-line expression in quotes ('''"'''). E.g. for a 32 atom system with forces in the x- and y-directions on the first and last 8 atoms:
   EFOR = 2.0 0.0 1.0 \
   EFOR = "2.0 0.0 1.0
           2.0 0.0 1.0 \
           2.0 0.0 1.0
           2.0 0.0 1.0 \
           2.0 0.0 1.0
           2.0 0.0 1.0 \
           2.0 0.0 1.0
           0.0 0.0 1.0 \
           0.0 0.0 1.0
           0.0 0.0 1.0 \
           0.0 0.0 1.0
           0.0 0.0 1.0 \
           0.0 0.0 1.0
           0.0 0.0 1.0 \
           0.0 0.0 1.0
           48*0.0       \
           48*0.0    
        -1.0 0.0 -1.0 \
        -1.0 0.0 -1.0 \
        -1.0 0.0 -1.0 \
        -1.0 0.0 -1.0 \
        -1.0 0.0 -1.0 \
        -1.0 0.0 -1.0 \
        -1.0 0.0 -1.0 \
         -1.0 0.0 -1.0
         -1.0 0.0 -1.0
 
        -1.0 0.0 -1.0
        -1.0 0.0 -1.0
        -1.0 0.0 -1.0
        -1.0 0.0 -1.0
        -1.0 0.0 -1.0
        -1.0 0.0 -1.0
        -1.0 0.0 -1.0"


==Symmetry and periodic boundary conditions==
==Symmetry and periodic boundary conditions==

Revision as of 08:22, 12 June 2024

EFOR = [real array] 

Default: EFOR = 3 * NIONS * 0.0

Description: EFOR sets external forces in eV/ on each atom in the cartesian x-, y-, and z-directions. The order of the ions is equivalent to the order in the POSCAR file, and for each ion, x-, y-, and z-components have to be given.


The array of external forces will be added to the forces computed internally for each ionic step (ionic minimization or molecular dynamics). If an ionic minimization is performed with non-zero external forces, the converged structures will be only at a minimum accounting for the constraint of the external forces. Regardless if the convergence criterion is set to minimize total forces, or converge the total energy.

Mind: The sum of all external forces set with EFOR must be 0 to avoid drift.

Setting external forces

EFOR can be a very long array, as 3 values need to be set for each ion in the system. The format is equivalent to setting the magnetic moments in the noncollinear case using MAGMOM, so it is possible to use an N*F syntax to indicate that the next N entries in the array should be of value F. E.g.:

 EFOR = 2*0.0 1.0 188*0.0 -1.0

In this example, we have 64 ions, so we have to set 3*64=192 values in the array. Only the cartesian z components of the first and last ion should be non-zero, which enables a compact INCAR line.

If more force components are non-zero, it is better for readability to utilize the multi-line option in the INCAR file using backslashes (\) to negate line breaks or put the multi-line expression in quotes ("). E.g. for a 32 atom system with forces in the x- and y-directions on the first and last 8 atoms:

 EFOR = "2.0 0.0 1.0
         2.0 0.0 1.0
         2.0 0.0 1.0
         2.0 0.0 1.0
         0.0 0.0 1.0
         0.0 0.0 1.0
         0.0 0.0 1.0
         0.0 0.0 1.0
         48*0.0     
        -1.0 0.0 -1.0
        -1.0 0.0 -1.0
        -1.0 0.0 -1.0
        -1.0 0.0 -1.0
        -1.0 0.0 -1.0
        -1.0 0.0 -1.0
        -1.0 0.0 -1.0
        -1.0 0.0 -1.0"

Symmetry and periodic boundary conditions

Symmetry considerations

Setting external forces will, in most cases, break some symmetries of the system, resulting in more irreducible k points and thus increased computational effort.

The symmetry reduction for external forces is reported in the OUTCAR after all other symmetry operations. E.g.:

Analysis of structural, dynamic, and magnetic symmetry & ext. forces:
=====================================================================
 Subroutine PRICEL returns:
 Original cell was already a primitive cell.
  
  
 Routine SETGRP: Setting up the symmetry group for a 
 hexagonal supercell.
  
   
 Subroutine GETGRP returns: Found  6 space group operations
 (whereof  6 operations were pure point group operations)
 out of a pool of 24 trial point group operations.
  
   
 The overall configuration with ext. forces has the point symmetry S_6 .
 Periodic boundary conditions apply in all VASP calculations.

Periodic boundary conditions

All VASP calculations are performed under periodic boundary conditions. When external forces are applied on bulk systems, this can lead to unexpected results.


Tip: External forces in a system with periodic boundary conditions are typically only useful if there is a vacuum region in the simulation cell to break the symmetry.

External forces during on-the-fly learning

External forces can be used during on-the-fly training for machine-learned force fields. In that case, the external forces will be only used during the ionic updates but will be removed for the training. This ensures that only forces arising from interatomic interactions will contribute to the force field and the resulting force field can be used without, or with different external forces.

Output