Previous Thread
Next Thread
Print Thread
computing diffusion using molecular center of mass and CORFUN DIFF
#19646 12/19/08 09:21 PM
Joined: Sep 2003
Posts: 8,425
rmv Offline OP
Forum Member
OP Offline
Forum Member
Joined: Sep 2003
Posts: 8,425
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

Re: computing diffusion using molecular center of mass and CORFUN DIFF
rmv #19647 01/20/09 02:31 PM
Joined: Jul 2004
Posts: 165
B
Forum Member
Offline
Forum Member
B
Joined: Jul 2004
Posts: 165
can you please provide some hints to get it on x-y and z plan ?

thank you

Re: computing diffusion using molecular center of mass and CORFUN DIFF
beginner #19648 01/20/09 05:35 PM
Joined: Sep 2003
Posts: 8,425
rmv Offline OP
Forum Member
OP Offline
Forum Member
Joined: Sep 2003
Posts: 8,425
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.


Moderated by  chmgr, John Legato, petrella 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 5.6.33-0+deb8u1 Page Time: 0.006s Queries: 20 (0.002s) Memory: 0.9034 MB (Peak: 0.9768 MB) Data Comp: Off Server Time: 2020-04-10 08:57:38 UTC
Valid HTML 5 and Valid CSS