Topic Options
#19646 - 12/19/08 04:21 PM computing diffusion using molecular center of mass and CORFUN DIFF
rmv Online   content

Forum Member

Registered: 09/17/03
Posts: 8373
Loc: 39 03 48 N, 77 06 54 W
The CHARMM and csh scripts that follow were used to compute the MSD curves for individual molecules from simulations of neat alkanes. The individual curves can be combined in groups to compute Dtrans, estimating the error using the group averages as independent data points. First, the csh script that manages the process in a PBS batch environment--

#!/bin/csh
#PBS -N UnfoR2com
#PBS -j oe
#PBS -l nodes=1:ecard1:ppn=2

cd $PBS_O_WORKDIR

uname -a
uptime

# job dependent /scratch subdir
set jn = `echo $PBS_JOBID | cut -d. -f1`
set s = /scratch/rv$jn
mkdir $s

# unfold to /scratch
~/bin/c34b2 S:$s N:17 < mrgunfo.inp >& mrgunfo.out

# box size
set a = `grep 'tal def' cryst.str | awk '{print $4}'`

# output data subdir
if ( ! -d tsmsd ) mkdir tsmsd

# r**2 c.o.m. time series
~/bin/c34b2 S:$s FTRJ:2 LTRJ:17 < r2com.inp >& r2com.out

# cleanup
rm -rf $s


The first task is to use MERGE COOR UNFOLD to remove the image centering jumps; the mrgunfo.inp script is--

* unfold @N files for r**2 time series for c.o.m.
*

stre ../../rtfprm.str
stre psfcrd.str
stre cryst.str

set k 1
set u 11
set o 51
label opnloop
open unit @U read file name dyn@K.trj
open unit @O write file name @S/dyn@K.trj
incr u by 1
incr o by 1
incr k by 1
if k le @N goto opnloop

merge coor unfold firstu 11 nunit @N outputu 51 nfile 1000

stop

Then, the unfolded trajectories on the local node /scratch volume are used to get center of mass (COM) coordinate time series, which are used as input to CORFUN DIFF to get the mean square displacement (MSD) vs. time for the molecular COM.

* c.o.m. r**2 time series using CORREL
* dir @S first @FTRJ last @LTRJ
*

stre ../../rtfprm.str
stre psfcrd.str
stre cryst.str

calc n = 1 + ( @LTRJ - @FTRJ )
set k @FTRJ
set u 11
label opnlp
open unit @U read file name @S/dyn@K.trj
incr u by 1
incr k by 1
if k le @LTRJ goto opnlp

correl maxt 16000 maxs 200 maxa ?NATOM noupdate
set r 1
label entloop
enter s@R atom xyz sele resid @R end mass
incr r by 1
if r le 64 goto entloop

traj first 11 nunit @N

set r 1
label wriloop
corfun s@R s@R diff total 2000
open unit 2 write card name tsmsd/r@R.dat
write corr dumb time unit 2
* dummy
*
incr r by 1
if r le 64 goto wriloop

end
stop

Top
#19647 - 01/20/09 09:31 AM Re: computing diffusion using molecular center of mass and CORFUN DIFF [Re: rmv]
beginner Offline
Forum Member

Registered: 07/19/04
Posts: 165
can you please provide some hints to get it on x-y and z plan ?

thank you

Top
#19648 - 01/20/09 12:35 PM Re: computing diffusion using molecular center of mass and CORFUN DIFF [Re: beginner]
rmv Online   content

Forum Member

Registered: 09/17/03
Posts: 8373
Loc: 39 03 48 N, 77 06 54 W
I guess you could set vector components you are not interested in to zero before CORFUN DIFF, i.e. if Z is zero then R^2 = X^2 + Y^2

Since I haven't done this myself, I cannot suggest the best CHARMM commands to use.

Top

Moderator:  chmgr, John Legato, petrella