[CP2K:9329] Outputting cell information and fractional coordinates

Steve Schmerler elco... at gmail.com
Sat Aug 26 21:31:54 UTC 2017

On Aug 26 12:27 -0700, Efrem Braun wrote:
> Thanks Steve. It's very peculiar to me that CP2K would write out the PDB 
> files without aligning the axes as per the normal convention; I think 
> there's probably a lot of people that are doing what I did, i.e., assuming 
> that the convention is being followed and that the output can be converted 
> to other file formats using tools such as openbabel and pwtools. I'm sure 
> the CP2K developers have a good reason for having chosen to do this, such 
> as FX's point that it makes for better visualization. In that case, it 
> might be a good idea to include a sentence in the documentation that the 
> printed trajectory is for visualization purposes only. Otherwise, one needs 
> to hope that the user will have read this thread to know how to use the 
> output properly (I only knew about this because a CP2K user in my group 
> expressly warned me against using the printed trajectory and pointed me to 
> this thread).

I did a lot of NPT MD and had to take care of cell information. As I
mentioned, what I did was to have CP2K write the cell *vectors*

        run_type md
        print_level low
    &end global

        &end md
            &end cell
        &end print
    &end motion

which produces a file PROJECT-1.cell. Then I used pwtools to parse the
trajectory [1].

   >>> tr = io.read_cp2k_md('cp2k.out')

The parser reads the cell file and calculates fractional coordinates,
among other things. That Trajectory object can be sliced like Python
lists, such that

    >>> st = tr[-1]

is your last structure (a Structure object) which you can visualize
[2] or transform to other formats. Works also for relaxations runs.


[1] http://elcorto.github.io/pwtools/written/tutorial.html#parse-md-output-plot-stuff
[2] http://elcorto.github.io/pwtools/written/tutorial.html#view-a-structure-or-trajectory

More information about the CP2K-user mailing list