From: JeJoon Yeon (sonicturbulent_at_gmail.com)
Date: Wed May 13 2015 - 16:11:48 CDT

Hello Maxim

This worked. but had same problem that I already mentioned.
It swaps the specific atoms for all frames, but the criteria is based on
only last frame's xyz position. Which means, only the last frame looks ok.
Other frame's swapping is wrong.

There are SiOH4 and H2O molecules inside the system, and they are all
flying inside the periodic box. "Animate write" swaps the atoms of all
frame, but it is based on last frame's position, not based on each frame's
position. This is same result I get with for-loop, which I couldn't escape.
What I want is, swap the atoms of all frame based on my criteria, for each
frame's position.

How can I escape from this situation?

2015-05-13 14:50 GMT-04:00 Maxim Belkin <mbelkin_at_ks.uiuc.edu>:

> "animate..." command line should replace the following portion of your
> code:
>
> set t [atomselect top all]
>
>> $t writexyz swapped.xyz
>
> I would also suggest consulting VMD User's Guide.
>
> Maxim
>
>
> On May 13, 2015, at 1:11 PM, JeJoon Yeon <sonicturbulent_at_gmail.com> wrote:
>
> Hello Maxim
>
> Is that 'animate' command line should be in the beginning of the code,
> right after reading? Or that should be placed in last lines? Also, is that
> require to use for loop?
>
> 2015-05-13 14:07 GMT-04:00 Maxim Belkin <mbelkin_at_ks.uiuc.edu>:
>
>> Hi,
>>
>> Have you tried the following?
>>
>> animate write xyz output.xyz beg 0 end -1 waitfor all
>>
>> Maxim
>>
>>
>> > On May 13, 2015, at 12:53 PM, JeJoon Yeon <sonicturbulent_at_gmail.com>
>> wrote:
>> >
>> > Hello all
>> >
>> > I can swap specific atoms for a single frame xyz only. Like
>> >
>> > mol new test.xyz type xyz waitfor all
>> > set a [atomselect top "index < 1338 and name Si and y>9 and within 5 of
>> atom O]
>> > $a set name C
>> > $a set type C
>> > $a set element C
>> > set t [atomselect top all]
>> > $t writexyz swapped.xyz
>> >
>> >
>> > But how can I do this with multiple frame? I tried to use for loop but
>> > 1) Sometimes it causes error
>> > 2) Sometimes it swaps the specific atoms for all frames, but the
>> criteria is based on only last frame's xyz position.
>> >
>> > So I don't know what to do anymore. Can anyone help or modify that
>> single frame code to work for multiple frames? Is this coming from read /
>> write problem?
>> >
>> > Thanks
>> >
>> > Best,
>>
>>
>
>