Attachment 'densitydiff.py'

Download

   1 from Dacapo import Dacapo
   2 from ASE import Atom
   3 from ASE.IO.Cube import WriteCube
   4 inputfile='yourfile.nc'
   5 atoms0=Dacapo.ReadAtoms(inputfile)
   6 calc0=atoms0.GetCalculator()
   7 sys_density=calc0.GetDensityArray()
   8 
   9 atoms1=Dacapo.ReadAtoms(inputfile)
  10 #remove the slab
  11 del atoms1[0:2]
  12 calc1 = Dacapo(nbands=2 * 5,
  13               kpts=(4, 4, 1),
  14               planewavecutoff=340,
  15               densitycutoff=400)
  16 calc1.SetTxtFile('atom.txt')
  17 calc1.SetNetCDFFile('atom.nc')
  18 
  19 atoms1.SetCalculator(calc1)
  20 atoms1.GetPotentialEnergy()
  21 atom_density=calc1.GetDensityArray()
  22 
  23 atoms2=Dacapo.ReadAtoms(inputfile)
  24 #remove the ad atom
  25 del atoms2[2]
  26 calc2 = Dacapo(nbands=2 * 5,
  27               kpts=(4, 4, 1),
  28               planewavecutoff=340,
  29               densitycutoff=400)
  30 calc2.SetTxtFile('slab.txt')
  31 calc2.SetNetCDFFile('slab.nc')
  32 
  33 atoms2.SetCalculator(calc2)
  34 atoms2.GetPotentialEnergy()
  35 slab_density=calc2.GetDensityArray()
  36 
  37 density_diff=(sys_density-atom_density-slab_density)
  38 
  39 
  40 WriteCube(atoms0,density_diff,'densitydiff_array.cube')

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.
  • [get | view] (2006-02-02 11:56:04, 0.4 KB) [[attachment:Al111.py]]
  • [get | view] (2006-02-02 11:49:39, 1.2 KB) [[attachment:Build.py]]
  • [get | view] (2006-02-02 11:56:26, 1.0 KB) [[attachment:Relax.py]]
  • [get | view] (2006-02-13 15:20:54, 0.4 KB) [[attachment:atomplot.py]]
  • [get | view] (2006-02-13 15:23:50, 1.0 KB) [[attachment:densitydiff.py]]
  • [get | view] (2006-02-01 14:17:35, 5.5 KB) [[attachment:fcc.gif]]
  • [get | view] (2006-02-01 14:17:56, 5.7 KB) [[attachment:fcc111.gif]]
  • [get | view] (2006-02-21 14:56:31, 0.3 KB) [[attachment:vmd_input.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.