Attachment 'Potential.py'
Download 1 import Gnuplot as gp
2 import Numeric as num
3 from Dacapo import Dacapo
4 from BuildFCC import FCC111
5 from ASE import Atom
6
7
8 a = 4.05
9 h = 12.0
10 fcc = FCC111('Al', a, 2, h)
11
12 # Add the adsorbate:
13 fcc.append(Atom('H', (0, 0, 1.55)))
14
15 calc = Dacapo(nbands=2 * 5,
16 kpts=(4, 4, 1),
17 dipole=True,
18 planewavecutoff=340,
19 densitycutoff=400)
20 fcc.SetCalculator(calc)
21
22 v = calc.GetElectrostaticPotential()
23 nx, ny, nz = v.shape
24 vz = num.sum(num.sum(v)) / (nx * ny)
25 z = num.arange(nz) * h / nz
26 plot = gp.Gnuplot(persist=True)
27 plot.plot(gp.Data(z, vz, with='lines lw 3'),
28 gp.Func(str(calc.GetFermilevel()), with='lines lw 3'))
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.