QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: mbjavan on November 10, 2013, 08:32

Title: how can I extract XYZ from each MD step?
Post by: mbjavan on November 10, 2013, 08:32
Dear ATK users,

is it possible to extract some date such as XYZ of the atomic structure from
each arbitrary step of MD calulation in ATK13.8?
it seems that the option of "export to clipboard" has been considered for this aim. But how does it work?
when i try to add MD configuration from clipboard in builder, there is nothing for showing?

Regards


Title: Re: how can I extract XYZ from each MD step?
Post by: Nordland on November 11, 2013, 07:36
The following script would give you the entire MD as a XYZ script:

md = nlread("your_file.nc", MDTrajectory)
md.writeToXYZ("export.xyz")
Title: Re: how can I extract XYZ from each MD step?
Post by: mbjavan on November 12, 2013, 08:16
Dear Prof. Nordland,

The following error is seen:

<module>
    md.writeToXYZ("export.xyz")
AttributeError: 'list' object has no attribute 'writeToXYZ'

Title: Re: how can I extract XYZ from each MD step?
Post by: Anders Blom on November 12, 2013, 10:23
It should have been

Code: python
md = nlread("your_file.nc", MDTrajectory)[0]
md.writeToXYZ("export.xyz")

Note that the produced XYZ file is not 100% standard - for instance it writes Carbon instead of C and also contains the velocities. Nothing a bit of search and replace can't fix though :)
Title: Re: how can I extract XYZ from each MD step?
Post by: Nordland on November 13, 2013, 08:31
This is not a RASMOL XYZ file. It is the XYZ fileformat for VMD (http://www.ks.uiuc.edu/Research/vmd/) - so you can use it directly to view MD simulations using this program.
Title: Re: how can I extract XYZ from each MD step?
Post by: Anders Blom on November 16, 2013, 22:44
At least VMD is tolerant to the extra columns. I'm not 100% sure it accepts "Carbon" instead of "C", however.