Stillinger-Weber (SW) potential with user defined functions

This example demonstrates the (ab)use of the modified embedded atom method (MEAM) potential routine together with user defined functions to create a Stillinger-Weber potential. The potential form and parameters have been taken from [StiWeb84]. The example also illustrates the use of XML Inclusions. Note that the potential is merely evaluated for a couple of simple lattice structures and none of the parameters are fitted.

Location

examples/potential_SW

Input files

  • main.xml: main input file

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    <?xml version='1.0' encoding='iso-8859-1'?>
    <job>
    
      <name>Stillinger and Weber,  Phys. Rev. B, v. 31, p. 5262, (1985)</name>
    
      <verbosity>medium</verbosity>
    
      <atom-types>
        <species>Si</species>
      </atom-types>
    
      <potentials>
        <xi:include href="potential.xml" xmlns:xi="http://www.w3.org/2003/XInclude" />
      </potentials>
    
      <structures>
        <xi:include href="structures.xml" xmlns:xi="http://www.w3.org/2003/XInclude" />
      </structures>
    
    </job>
    
  • potential.xml: potential parameter set (included in main input file via XML Inclusions)

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    <meam id='Si potential' species-a='*' species-b='*'>
    
      <mapping>
        <pair-interaction species-a='*' species-b='*' function='V' />
        <f-function species-a='*' species-b='*' function='f' />
        <g-function species-a='*' species-b='*' species-c='*' function='g' />
        <embedding-energy species='*' function='F' />
      </mapping>
    
      <functions>
    
          <user-function id="V">
            <cutoff>3.77118</cutoff>
            <input-var>r</input-var>
            <expression>
              A*epsilon*(B*(sigma/r)^(p) - (sigma/r)^(q)) * exp(sigma/(r-a*sigma))
            </expression>
            <derivative>
              A*exp(sigma/(r - a*sigma))*epsilon*
              (-((B*p*sigma*(sigma/r)^(-1 + p))/r^2) + (q*sigma*(sigma/r)^(-1 + q))/r^2)
              - (A*exp(sigma/(r - a*sigma))*epsilon*sigma*(B*(sigma/r)^p
              - (sigma/r)^q))/(r - a*sigma)^2
            </derivative>
            <param name="epsilon">2.1683</param>
            <param name="sigma">2.0951</param>
            <param name="a">1.80</param>
            <param name="p">4.0</param>
            <param name="q">0.0</param>
            <param name="A">7.049556277</param>
            <param name="B">0.6022245584</param>
          </user-function>
    
        <user-function id="F">
          <input-var>rho</input-var>
          <expression>
            rho
          </expression>
          <derivative>
            1
          </derivative>
        </user-function>
    
        <user-function id="f">
          <cutoff>3.771179</cutoff>
          <input-var>r</input-var>
          <expression>
            exp(gamma*sigma/(r-a*sigma))
          </expression>
          <derivative>
            -gamma * sigma * exp(gamma*sigma/(r-a*sigma)) / (r - a*sigma)^2
          </derivative>
          <param name="sigma">2.0951</param>
          <param name="gamma">1.20</param>
          <param name="a">1.80</param>
        </user-function>
    
        <user-function id="g">
          <input-var>costheta</input-var>
          <expression>
            lambda * epsilon * (costheta - costheta0)^2
          </expression>
          <derivative>
            lambda * epsilon * 2 * (costheta - costheta0)
          </derivative>
          <param name="epsilon">2.1683</param>
          <param name="lambda">21.0</param>
          <param name="costheta0">-0.333333333333</param>
        </user-function>
    
      </functions>
    
    </meam>
    
  • structures.xml: input structures (included in main input file via XML Inclusions)

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    <group>
    
      <fcc-lattice id='A1 (fcc)'>
        <atom-type>Si</atom-type>
        <lattice-parameter>4.14</lattice-parameter>
        <!-- <lattice-parameter>3.6</lattice-parameter> -->
        <relax-dof>
          <lattice-parameter/>
        </relax-dof>
        <properties>
          <atomic-energy/>
          <lattice-parameter/>
          <bulk-modulus/>
        </properties>
      </fcc-lattice>
    
      <bcc-lattice id='A2 (bcc)'>
        <atom-type>Si</atom-type>
        <lattice-parameter>3.24</lattice-parameter>
        <!-- <lattice-parameter>3.0</lattice-parameter> -->
        <relax-dof>
          <lattice-parameter/>
        </relax-dof>
        <properties>
          <atomic-energy/>
          <lattice-parameter/>
          <bulk-modulus/>
        </properties>
      </bcc-lattice>
    
      <diamond-lattice id='A4 (diamond)'>
        <atom-type>Si</atom-type>
        <lattice-parameter>5.43</lattice-parameter>
        <!-- <lattice-parameter>5.</lattice-parameter> -->
        <relax-dof>
          <atom-coordinates/>
          <lattice-parameter/>
        </relax-dof>
        <properties>
          <atomic-energy/>
          <lattice-parameter/>
          <bulk-modulus/>
        </properties>
      </diamond-lattice>
    
    </group>
    

Output (files)

  • The final properties (as well as parameters) are written to standard output.

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    This is program version 0.1.6
    Reading job file main.xml
    -------------------------------------------------------
    Parsing input file(s)
    -------------------------------------------------------
    -------------------------------------------------------
    Computing structure properties
    Structure 'A1 (fcc)':
       total-energy: -3.94031 eV
       atomic-energy: -3.94031 eV/atom
       total-volume: 17.8242 A^3
       atomic-volume: 17.8242 A^3/atom
    Structure 'A2 (bcc)':
       total-energy: -4.05556 eV
       atomic-energy: -4.05556 eV/atom
       total-volume: 17.0819 A^3
       atomic-volume: 17.0819 A^3/atom
    Structure 'A4 (diamond)':
       total-energy: -8.6732 eV
       atomic-energy: -4.3366 eV/atom
       total-volume: 40.0468 A^3
       atomic-volume: 20.0234 A^3/atom
    -------------------------------------------------------
    -------------------------------------------------------