Attachment '2H2O.py'

Download

   1 from math import cos, sin, pi
   2 
   3 from ASE import ListOfAtoms, Atom
   4 from ASE.Visualization.RasMol import RasMol
   5 from ASE.Dynamics.ConjugateGradient import ConjugateGradient
   6 from ASE.Trajectories import NetCDFTrajectory
   7 from Dacapo import Dacapo
   8 
   9 
  10 d = 2.0
  11 r = 0.9575
  12 t = pi / 180 * 104.51
  13 dimer = ListOfAtoms([Atom('O', (0, 0, 0)),
  14                      Atom('H', (-r * cos(t / 2), r * sin(t / 2), 0)),
  15                      Atom('H', (-r * cos(t / 2), -r * sin(t / 2), 0)),
  16                      Atom('O', (d + r, 0, 0)),
  17                      Atom('H', (d, 0, 0)),
  18                      Atom('H', (d + r - r * cos(t), 0, r * sin(t)))],
  19                     cell=(9, 6, 7))
  20 dimer.SetCartesianPositions(dimer.GetCartesianPositions() + (4, 3, 3.5))
  21 plot = RasMol(dimer, (2, 2, 2))
  22 calc = Dacapo(nbands=12,
  23               planewavecutoff=340,
  24               densitycutoff=500,
  25               out='2H2O.nc')
  26 calc.StayAliveOff()
  27 dimer.SetCalculator(calc)
  28 traj = NetCDFTrajectory('2H2O.traj', dimer)
  29 cg = ConjugateGradient(dimer, fmax=0.05)
  30 
  31 cg.Attach(traj)
  32 cg.Attach(plot)
  33 cg.Converge()

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-07 13:04:54, 1.0 KB) [[attachment:2H2O.py]]
  • [get | view] (2006-02-07 13:03:11, 1.2 KB) [[attachment:H2O_density_plot.py]]
  • [get | view] (2006-02-07 13:03:40, 23.6 KB) [[attachment:H2O_densplot.jpg]]
  • [get | view] (2006-02-07 13:02:12, 0.5 KB) [[attachment:H2O_freeze1.py]]
  • [get | view] (2006-02-07 13:02:29, 0.5 KB) [[attachment:H2O_freeze2.py]]
  • [get | view] (2006-02-03 14:11:18, 76.6 KB) [[attachment:NMA_densplot.jpg]]
  • [get | view] (2006-02-03 14:10:55, 1.3 KB) [[attachment:diff_density_plot.py]]
  • [get | view] (2006-02-03 14:10:22, 27.3 KB) [[attachment:nma_model.jpg]]
  • [get | view] (2006-02-03 14:09:54, 44.1 KB) [[attachment:peptidechain.jpg]]
  • [get | view] (2006-02-07 12:59:18, 88.2 KB) [[attachment:scheme_anti.jpg]]
  • [get | view] (2006-02-07 12:59:38, 86.6 KB) [[attachment:scheme_par.jpg]]
  • [get | view] (2006-02-07 13:00:02, 28.6 KB) [[attachment:termination.jpg]]
 All files | Selected Files: delete move to page copy to page

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