how to keep the atom's trajectory within the box

1,215 views
Skip to first unread message

王胜杰

unread,
Mar 18, 2016, 12:41:41 PM3/18/16
to cp2k
Dear all

When I was dealing with the trajectory of MD, I found the atoms always move beyond the boundary, making some atoms' coordinate larger than the box length,which reflect the true trajectories. 
But I don't want a true trajectory, I want a periodic boundary.When the atoms cross the boundary, the coordinate will minus the box length automatically, which each direction of  atoms' coordinate is less than the box length. By adding what command line can I fix that?

Thanks in advance.
Shengjie Wang 

huan...@mail.huji.ac.il

unread,
Mar 22, 2016, 4:45:33 PM3/22/16
to cp2k
Hi Shengjie,

Did you specify the keyword PERIODIC in the &SUBSYS &CELL section?
Please see the CP2K manual
Huan
.

王胜杰

unread,
Mar 23, 2016, 9:39:42 PM3/23/16
to cp2k
Hi Huan,

Thanks for your attention.
Yes, I did. I noticed and added the keyword the PERIODIC, and I tried the ensemble NPT_I and NVT, but cp2k still printed a real trajectory.

Regards,
Shengjie Wang

在 2016年3月23日星期三 UTC+8上午4:45:33,huan...@mail.huji.ac.il写道:

Huan Wang

unread,
Mar 24, 2016, 6:07:21 AM3/24/16
to cp2k
Hi Shengjie,

An additional question is how do you display the trajectory? 
If you use VMD, then you need to type some codes in Extensions --> Tk console to let the VMD know the size of your simulation box.

The codes are:

pbc set {xxx xxx xxx} -all 
# Here the "xxx" is the length of your (cubic) box. And "-all" means this operation controls all frames in the current trajectroy.
pbc box
pbc wrap -all 
# The wrap commend will show the atoms on the other side of the box when atoms move out of the box.

Good luck,
Huan
.

--
You received this message because you are subscribed to a topic in the Google Groups "cp2k" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cp2k/A083JgzAgLo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cp2k+uns...@googlegroups.com.
To post to this group, send email to cp...@googlegroups.com.
Visit this group at https://groups.google.com/group/cp2k.
For more options, visit https://groups.google.com/d/optout.

王胜杰

unread,
Mar 24, 2016, 11:37:58 AM3/24/16
to cp2k
Dear Huan,

I didn't display the trajectory, because the trajectory file is really big, thus it can't be dragged to VMD.  I wrote a little program to identify it. First I found the min and max coordinates in the initial configuration, in ensemble NVT, when the atom coordinates less than min or larger than max, identify it crossing the boundary. And print out which atom and during which step.
Sure I can split the trajectory into several parts, but splitting costs too much time, and VMD always crash.

Best wishing,
Shengjie Wang 
.
在 2016年3月24日星期四 UTC+8下午6:07:21,Huan Wang写道:

Huan Wang

unread,
Mar 24, 2016, 4:26:48 PM3/24/16
to cp2k
Hi Shengjie,

VMD is able to load short segment of the trajectory. You do not need to load the whole trajectory if the file is larger than the memory of your computer.

Since you have known the possible step point that the atom might move out of the box based on your own program (script), it is a good idea to check the trajectory around this point by using VMD. 
For example, if the step point is the 23456th frame, you can only load 100 points before and after this frame. e.g. from 23356 to 23556. Please see the picture below on which the red box and ellipse indicating the key points you need to pay attention. 

Inline image 1
 
After loading the segment of your trajectory, you need to set the pbc box length and wrap the atoms as I suggested in the last response.
Visualization the results will help you check both the trajectory and your program (script).

Good luck.

Huan
.


王胜杰

unread,
Mar 25, 2016, 3:42:02 AM3/25/16
to cp2k
Dear Huan,

Thanks for your instruction. I have tried your method about VMD, it works. Although  VMD can only handle a little piece of trajectory, it can prove my thought and my program is right at least.

In fact, I already have written a program to deal with the real trajectory, making it within the box. I just find my method is  troublesome. I think that dealing the problem during MD is much better than after treatment.


Best wishes,
Shengjie

在 2016年3月25日星期五 UTC+8上午4:26:48,Huan Wang写道:
Reply all
Reply to author
Forward
0 new messages