Attachment 'Relax.py'

Download

   1 from Dacapo import Dacapo
   2 from Build import FCC111
   3 from ASE.Dynamics.QuasiNewton import QuasiNewton
   4 from ASE import Atom
   5 from ASE.Filters.FixCoordinates import FixCoordinates
   6 from ASE.Trajectories import NetCDFTrajectory
   7 
   8 
   9 a = 4.05
  10 fcc = FCC111('Al', a, 2, 10.0)
  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               planewavecutoff=340,
  18               densitycutoff=400)
  19 fcc.SetCalculator(calc)
  20 
  21 # Make a trajectory file:
  22 traj = NetCDFTrajectory('ontop.nc', fcc)
  23 
  24 # Only the height (z-coordinate) of the H atom is relaxed:
  25 h = FixCoordinates(fcc, mask=[(1, 1, 1), (1, 1, 1), (1, 1, 0)])
  26 
  27 # The energy minimum is found using the "Molecular Dynamics
  28 # Minimization" algorithm.  The stopping criteria is: the force on the
  29 # H atom should be less than 0.05 eV/Ang
  30 dyn = QuasiNewton(h, fmax=0.05)
  31 
  32 dyn.Attach(traj)
  33 dyn.Converge()
  34 
  35 print 'ontop:', fcc.GetPotentialEnergy()
  36 print 'height:', fcc[-1].GetCartesianPosition()[2]

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.