[ase-users] Unable to read the created .nc file
Marcin Dulak
Marcin.Dulak at fysik.dtu.dk
Fri Mar 25 10:56:32 CET 2011
Hi,
the jacapo handling of restart has been fixed in the development version
of ase: https://wiki.fysik.dtu.dk/ase/download.html#id8
Please use the ase trunk.
Best regards,
Marcin
c cook wrote:
> 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 python
> from ase import *
> from ase.calculators.jacapo import *
>
>
> a = 3.8 # approximate lattice constant
> b = 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 <http://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 <http://2.2.1-Al.nc> and the corresponding .txt file
> were created,
>
> but when I went further to:
>
> #!/usr/bin/env python
> from ase.calculators.jacapo import *
>
> bulk = Jacapo.read_atoms('2.2.1-Al.nc <http://2.2.1-Al.nc>')
>
> print 'energy: ' ,bulk.get_potential_energy()
>
>
> sxx, syy, szz, syz, sxz, sxy = bulk.get_stress()
>
> import numpy as np
> from ase.units import GPa
> print '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 <http://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
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
--
***********************************
Marcin Dulak
Technical University of Denmark
Department of Physics
Building 307, Room 229
DK-2800 Kongens Lyngby
Denmark
Tel.: (+45) 4525 3157
Fax.: (+45) 4593 2399
email: Marcin.Dulak at fysik.dtu.dk
***********************************
More information about the ase-users
mailing list