File: top.py

package info (click to toggle)
gpaw 21.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 14,492 kB
  • sloc: python: 121,997; ansic: 14,138; sh: 1,125; csh: 139; makefile: 43
file content (25 lines) | stat: -rw-r--r-- 723 bytes parent folder | download | duplicates (5)
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
from ase.build import fcc111, add_adsorbate
from gpaw import GPAW, PW

#  Slab with CO:
slab = fcc111('Pt', size=(1, 1, 3))
add_adsorbate(slab, 'C', 2.0, 'ontop')
add_adsorbate(slab, 'O', 3.15, 'ontop')
slab.center(axis=2, vacuum=4.0)
slab.calc = GPAW(mode=PW(400),
                 xc='RPBE',
                 kpts=(12, 12, 1),
                 convergence={'bands': -10},
                 txt='top.txt')
slab.get_potential_energy()
slab.calc.write('top.gpw', mode='all')

#  Molecule
molecule = slab[-2:]
molecule.calc = GPAW(mode=PW(400),
                     xc='RPBE',
                     kpts=(12, 12, 1),
                     txt='CO.txt')

molecule.get_potential_energy()
molecule.calc.write('CO.gpw', mode='all')