Better ways to get back my optimized cell and structure

Travis polla... at
Thu Jul 19 16:11:16 UTC 2018


import ase, sys
from ase import Atom, Atoms

# read xyz
slab =[1], format='xyz');

# Read this info from a log file or restart, or define it manually as I 
have below; you can do cell shape as well, but here it is alpha=beta=gamma= 
90 deg
#_cell_length_a                         11.47850
#_cell_length_b                         11.65350
#_cell_length_c                         24.67610
slab.set_cell([11.47850, 11.65350, 24.67610])

# output to the file type of choice; by default cif is in fractional 
coordinates, VASP/CONTCAR/POSCAR needs 'direct=True' to do the same
vasp =[2], slab, format='cif');

To compliment James' post on ASE. You just run something like this.

(in shell) python foo.cif

On Thursday, July 19, 2018 at 11:47:03 AM UTC-4, James Dean wrote:

> Hello Henrique,
> The way I've usually done this is by using OpenBabel to convert from XYZ 
> to a VASP file, and then filling in the cell parameters in the VASP file 
> via a script that reads the cp2k output to find the current cell 
> parameters. Just make sure you save it as a ".vasp" file or VESTA won't 
> know what to do with it.
> As an alternative, if you're comfortable using Python, the Atomic 
> Simulation Environment (ASE) is another way you'd be able to accomplish 
> this, as it has tools for file I/O with both xyz and VASP formats.
> Best,
> James Dean
> On Wednesday, July 18, 2018 at 7:21:11 AM UTC-4, Henrique Junior wrote:
>> This is probably a silly question. I’m running a CELL_OPT and at the end 
>> of my calculation I’m trying to open the resulting .xyz in VESTA and 
>> manually entering the cell parameters but doing this is generating a messy 
>> result.
>> What is the best way to get my optimized call and structure so I can work 
>> on them?
>> Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the CP2K-user mailing list