[ase-users] Unable to read the created .nc file
c cook
csecook at gmail.com
Thu Mar 24 21:34:33 CET 2011
Hello again,
I started to do some simple testing:
http://beowulf.cheme.cmu.edu/jacapo/2-bulk/2.2-unitcell-optimization/2.2.0-unit-cell-optimization.html#simple-total-energy-calculation
the first step to calculate the energy seen below worked
#!/usr/bin/env pythonfrom ase import *from ase.calculators.jacapo import *
a = 3.8 # approximate lattice constantb = a / 2.bulk =
Atoms([Atom('Al',(0.0,0.0,0.0))],
cell=[(0,b,b),
(b,0,b),
(b,b,0)])
calc = Jacapo('2.2.1-Al.nc',
pw=350,
kpts=(4,4,4),
calculate_stress=True,
atoms=bulk)
print bulk.get_stress()
the 2.2.1-Al.nc and the corresponding .txt file were created,
but when I went further to:
#!/usr/bin/env pythonfrom ase.calculators.jacapo import *
bulk = Jacapo.read_atoms('2.2.1-Al.nc')
print 'energy: ' ,bulk.get_potential_energy()
sxx, syy, szz, syz, sxz, sxy = bulk.get_stress()
import numpy as npfrom ase.units import GPaprint 'Stress (GPa) =
'print np.array([[sxx, sxy, sxz],
[sxy, syy, syz],
[sxz, syz, szz]])/GPa
I' ve got the following error:
File "./bulkAl2.sh", line 4, in <module>
bulk = Jacapo.read_atoms('2.2.1-Al.nc')
File "/home/csaba/ase/ase/calculators/jacapo/jacapo.py", line 3059, in
read_atoms
calc = Jacapo(filename)
File "/home/csaba/ase/ase/calculators/jacapo/jacapo.py", line 231, in
__init__
self.set_nc(nc)
File "/home/csaba/ase/ase/calculators/jacapo/jacapo.py", line 1135, in
set_nc
self.update_input_parameters()
File "/home/csaba/ase/ase/calculators/jacapo/jacapo.py", line 383, in
update_input_parameters
self.pars[key] = eval(getf)
File "<string>", line 1, in <module>
File "/home/csaba/ase/ase/calculators/jacapo/jacapo.py", line 2257, in
get_psp
raise Exception, 'You can only specify Z or sym!'
Exception: You can only specify Z or sym!
I've checked in the jacapo.py and the only reference to the error is this:
*def set_psp(self,*
* sym=None,*
* z=None,*
* psp=None):*
* '''*
* set the pseudopotential file for a species or an atomic number.*
*
*
* :Parameters:*
*
*
* sym : string*
* chemical symbol of the species*
*
*
* z : integer*
* the atomic number of the species*
*
*
* psp : string*
* filename of the pseudopotential*
*
*
* *
* you can only set sym or z.*
*
*
* examples::*
* *
* set_psp('N',psp='pspfile')*
* set_psp(z=6,psp='pspfile')*
* '''*
* log.debug(str([sym, z, psp]))*
* if (sym, z, psp) == (None, None, None):*
* return*
* *
* if (sym is None and z is not None):*
* from ase.data import chemical_symbols*
* sym = chemical_symbols[z]*
* elif (sym is not None and z is None):*
* pass*
* else:*
* raise Exception, 'You can only specify Z or sym!'*
But, I am stuck here. The DACAPOPATH is correctly pointing to the psp
directory, and anyways, why it didn't complain when he did the energy
calculation?
And this is happening every time there is a need to read an already created
.nc file (I 've tried couple of more examples and I got the same error)
What am I doing wrong?
Thanks,
Csaba
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20110324/f6f92f01/attachment.html>
More information about the ase-users
mailing list