[gmx-developers] remove periodicity

Anton Feenstra feenstra at few.vu.nl
Fri Jul 2 09:20:12 CEST 2010


On 01/07/10 22:22, Gaurav Goel wrote:
> If I know the coordinates at time 't-del_t' and 't', I can remove the
> periodicity as follows:
>    /* Remove periodicity */
> ...
> ...
>
>        while(xcur[ind][m]-xprev[ind][m]<= -hbox[m])
> 	rvec_inc(xcur[ind],box[m]);
>        while(xcur[ind][m]-xprev[ind][m]>   hbox[m])
> 	rvec_dec(xcur[ind],box[m]);
> ...
> ...

What do you mean with 'remove periodicity'? Make molecules whole? Put 
all atoms in the box? Put all molecules' center of mass in the box? Give 
all atoms (or molecules) a continuous trajectory (i.e., they will fly 
'out of the box')?

There are a number of PBC related options in trjconv that might include 
what you want. If you want to use that in a program of you own, I 
suggest copying over the routine(s) from trjconv.

> ->  If I only know the coordinates at 't', is it still possible to
> remove periodicity?
> In the update() subroutine, I want to be able to make a list of all
> atoms within a thin slab at a fixed distance from the edge of the box.
> E.g., all particles in a slab of width L/10, with the x-coordinate of
> the center of slab at a distance L/4 from the yz-face of box.

During md integration (i.e., in update() within mdrun), molecules are 
made whole to calculate bonded interactions, and atoms are put in the 
box for the non-bonded interactions. If you put your code in the proper 
place, you should catch the coordinates in the 'atoms in the box' state, 
and you don't have to worry about the PBC. You'll have to invest some 
time to get to understand the code, since it is quite involved.


-- 
Groetjes,

Anton
  _____________ _______________________________________________________
|             |                                                       |
|  _   _  ___,| K. Anton Feenstra                                     |
| / \ / \'| | | IBIVU/Bioinformatics - Free University  Amsterdam     |
|(   |   )| | | De Boelelaan 1083A - 1081 HV Amsterdam - Netherlands  |
| \_/ \_/ | | | Tel +31 20 59 87783 - Fax +31 20 59 87653 - Room P136 |
|             | Feenstra at few.vu.nl - www.few.vu.nl/~feenstra/         |
|             | "Just a Minute While I Reinvent Myself" (Red Hot      |
|             | Chili Peppers)                                        |
|_____________|_______________________________________________________|



More information about the gromacs.org_gmx-developers mailing list