EFOR: Difference between revisions

From VASP Wiki
Line 10: Line 10:
{{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.:
{{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 should be non-zero, which enables 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 {{FILE|INCAR}} line.


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:
If more force components are non-zero, readability is increased by utilizing the [[INCAR#Format|multi-line option]] in the {{FILE|INCAR}} file. This is achieved by 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

Revision as of 10:39, 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, readability is increased by utilizing the multi-line option in the INCAR file. This is achieved by 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.

If any non-zero external forces are set, the symmetry reduction 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 to bulk systems, this can lead to unexpected results. E.g. pushing an atom towards another atom in the same unit cell might pull it further away from the same atom in a neighboring unit cell. Thus external forces cannot be used to uniformly compress or strain a bulk system along a specific axis. This can however be achieved by lengthening or shortening the relevant lattice vector.

On the other hand, external forces are used if strain needs to be applied to a slab, a molecule, or any other system in which a vacuum region is used. When e.g. a surface slab needs to be compressed in the direction normal to the surface plane, the lattice vector cannot be shortened because this would collapse the vacuum. External forces on the atoms at the surfaces can achieve the desired effect.

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