Commit 598586f9 authored by Ask Hjorth Larsen's avatar Ask Hjorth Larsen

handle units correctly for simulation_cell. Also, the UnitsInput parameter...

handle units correctly for simulation_cell.  Also, the UnitsInput parameter can override Units.  This is taken into account now
parent 0bc9ce7f
...@@ -250,6 +250,7 @@ def kwargs2atoms(kwargs, directory=None): ...@@ -250,6 +250,7 @@ def kwargs2atoms(kwargs, directory=None):
# XXX the other 'units' keywords: input, output. # XXX the other 'units' keywords: input, output.
units = kwargs.pop('units', 'atomic').lower() units = kwargs.pop('units', 'atomic').lower()
units = kwargs.pop('unitsinput', units).lower()
if units not in ['ev_angstrom', 'atomic']: if units not in ['ev_angstrom', 'atomic']:
raise OctopusKeywordError('Units not supported by ASE-Octopus ' raise OctopusKeywordError('Units not supported by ASE-Octopus '
'interface: %s' % units) 'interface: %s' % units)
......
...@@ -281,7 +281,10 @@ def parse(fname, fd): ...@@ -281,7 +281,10 @@ def parse(fname, fd):
# we re-extract the cell at a level where we can distinguish: # we re-extract the cell at a level where we can distinguish:
cell, _unused = kwargs2cell(kwargs) cell, _unused = kwargs2cell(kwargs)
if cell is not None: if cell is not None:
pew.addArrayValues('simulation_cell', cell) # ...and yet we add the ASE cell because that one is
# always measured in angstroms.
pew.addArrayValues('simulation_cell',
convert_unit(atoms.cell, 'angstrom'))
# XXX FIXME atoms can be labeled in ways not compatible with ASE. # XXX FIXME atoms can be labeled in ways not compatible with ASE.
pew.addArrayValues('atom_labels', pew.addArrayValues('atom_labels',
......
../../test/examples
\ No newline at end of file
parser/parser-octopus
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment