Previous Thread
Next Thread
Print Thread
filling a box by placing molecules on a grid
#19649 12/19/08 09:47 PM
Joined: Sep 2003
Posts: 8,450
rmv Online Content OP
Forum Member
OP Online Content
Forum Member
Joined: Sep 2003
Posts: 8,450
The following script places octane molecules on a grid in order to create a box of neat alkane. Extensive use is made of ?RAND to perturb the grid placement, via small displacements and molecular rotations. It is also used to choose conformations, from a Langevin dynamics simulation of a single octane with 1000 stored frames in the trajectory; the C4 atom of octane was fixed at the origin for the LD. I run scripts like this several times, with a different ID (1,2,3,...) and a different random seed.

* place 148 octanes in a 6x5x5 grid, random displacement from grid coords
* random configs from LD, random orientation; id @ID ; seed @SEED
*

open unit 1 read card name lipid27.rtf
read rtf card unit 1
close unit 1

open unit 1 read card name lipid27.prm
read param card unit 1
close unit 1

read sequ octa 148
gener O

open unit 2 write card name oct148.psf
write psf unit 2 card
* psf for 148 octanes, randomized setup for liquid phase
*

random uniform iseed @SEED

set xt -17.
set yt -17.
set zt -17.
set k 1

label kloop
calc ndx 1 + int( 1000. * ?RAND )
define kres sele resid @K end
open unit 22 read file name ldynf.trj
read coor file unit 22 ifile @NDX sele kres end
close unit 22
calc xd -1. + 2. * ?RAND
calc yd -1. + 2. * ?RAND
calc zd -1. + 2. * ?RAND
calc phi 360. * ?RAND
coor rota xdir @XD ydir @YD zdir @ZD phi @PHI sele kres end
coor tran xdir @XD ydir @YD zdir @ZD sele kres end
coor tran xdir @XT ydir @YT zdir @ZT sele kres end
incr k by 1
if k .gt. 148 goto kdone
incr xt by 7.
if xt .lt. 17. goto kloop
set xt -17.
incr yt by 7.
if yt .lt. 17. goto kloop
set yt -17.
incr zt by 7.
goto kloop

label kdone

crystal define cubic 36. 36. 36. 90. 90. 90.
open unit 21 read card name box.cry
crystal read unit 21 card
close unit 21
pressure init
image byres

mini sd nstep 50 nprint 5 cutnb 14. ctofnb 12.0 ctonnb 8.0 -
vfswitch cdie eps 1.0 atom vatom cutim 14. -
ewald pme fftx 32 ffty 32 fftz 32 order 6 spline kappa 0.32

pressure inst temp 293. volume ?VOLU

mini abnr nstep 50 nprint 5 lattice nocoor
mini abnr nstep 500 nprint 10 tolgrd 1.e-4
pressure inst temp 293. volume ?VOLU
mini abnr nstep 50 nprint 5 lattice nocoor
mini abnr nstep 500 nprint 10 tolgrd 1.e-4
pressure inst temp 293. volume ?VOLU

scalar mass stat
calc rho 1.66506 * ?STOT / ?VOLU

open unit 2 write card name oct148@ID.crd
write coor card unit 2
* neat octane model @ID, 148 molecules, construction seed @SEED
* edge ?XTLA ; rho @RHO ; ener ?ENER ; pressure ?PRSI
*

stop

Re: filling a box by placing molecules on a grid
rmv #19650 12/24/08 06:22 AM
Joined: Mar 2007
Posts: 148
J
Forum Member
Offline
Forum Member
J
Joined: Mar 2007
Posts: 148
Dear RMV,

Is the input trajectory "ldynf.trj" produced by Langevin dynamics?

Thanks.

-------
Jeffrey

Re: filling a box by placing molecules on a grid
jeffrey #19651 12/24/08 05:30 PM
Joined: Sep 2003
Posts: 8,450
rmv Online Content OP
Forum Member
OP Online Content
Forum Member
Joined: Sep 2003
Posts: 8,450
Yes.

Re: filling a box by placing molecules on a grid
rmv #35219 08/31/15 12:17 AM
Joined: Nov 2009
Posts: 46
S
Sai Offline
Forum Member
Offline
Forum Member
S
Joined: Nov 2009
Posts: 46
Hello Dr. Venable, This script is really efficient and useful than the one I made Random molecule replacement.

As you have seen my previous post I started using your script to make a methanol box, which is very neat and convenient. I am curious about the parameters present under the box.cry file. I basically used the following I obtained from my solvation script instead of reading the contents of box.cry. And I have a working script, but not sure If I am missing something.

CRYSTAL DEFINE CUBIC 90 90 90 90.00 90.00 90.00
CRYSTAL BUILD NOPER 0
SET BOXLEN = 90
SET EWALDVAL = 90

Thanks in advance.

Best,
Sai

Last edited by Sai; 08/31/15 12:56 AM.
Re: filling a box by placing molecules on a grid
rmv #35222 08/31/15 03:23 PM
Joined: Sep 2003
Posts: 8,450
rmv Online Content OP
Forum Member
OP Online Content
Forum Member
Joined: Sep 2003
Posts: 8,450
That will also work; either CRYSTAL BUILD or CRYSTAL READ is needed to make the list of image transformations.


Rick Venable
computational chemist

Re: filling a box by placing molecules on a grid
rmv #35223 08/31/15 09:49 PM
Joined: Nov 2009
Posts: 46
S
Sai Offline
Forum Member
Offline
Forum Member
S
Joined: Nov 2009
Posts: 46
Thank you!

Re: filling a box by placing molecules on a grid
rmv #35264 09/21/15 09:14 PM
Joined: Sep 2015
Posts: 2
F
Forum Member
Offline
Forum Member
F
Joined: Sep 2015
Posts: 2
Hello..
Where do i get the input files (ldynf.trj , and box.cry) used above.I hop i can reproduce the same if i have all input files.Is that right.?,i mean without changing anything ..

Re: filling a box by placing molecules on a grid
rmv #35267 09/22/15 04:58 PM
Joined: Sep 2003
Posts: 8,450
rmv Online Content OP
Forum Member
OP Online Content
Forum Member
Joined: Sep 2003
Posts: 8,450
As noted a couple posts above, the sequence

open unit 21 read card name box.cry
crystal read unit 21 card
close unit 21


can be replaced by

crystal build noper 0


The script used to generate 1000 octane configurations for packing follows:

* octane Langevin config generator; C4,C5 fixed to remove tran, rot
*

open unit 1 read card name lipid27.rtf
read rtf card unit 1
close unit 1

open unit 1 read card name lipid27.prm
read param card unit 1
close unit 1

! build PSF via GENER, use IC BUILD for initial coords

read sequ octa 1
gener O setup warn
ic param
ic purge
ic seed 1 c4 1 c5 1 c6
ic build

! align and fix two bonded atoms, C4 and C5

coor orient sele atom O 1 C4 .or. atom O 1 C5 end
cons fix sele atom O 1 C4 .or. atom O 1 C5 end

! low friction for more dihedral transitions
scalar fbeta set 2.0

! large CUTNB includes all atoms in initial nonbond list
! since all atoms are in the list, for efficiency DYNA can has INBFRQ 0

update cutnb 30. ctofnb 12.0 ctonnb 8.0 fshift vshift cdie eps 2.0 -
atom vatom

! save 1000 configs
open unit 50 write file name ldynf.trj

! run at elevated T to increase sampling

DYNA LEAP LANGEVIN STRT NSTEP 10000000 TIMESTEP 0.001 -
IPRFRQ 100000 IHTFRQ 0 IEQFRQ 0 NTRFRQ 0 -
IUNREA -1 IUNWRI -1 IUNCRD 50 IUNVEL -1 KUNIT -1 -
NPRINT 1000 NSAVC 10000 NSAVV 0 IHBFRQ 0 INBFRQ 0 -
ILBFRQ 100000 RBUFFER 0.0 TBATH 400.0 -
FIRSTT 400.0 FINALT 400.0 -
IASORS 1 IASVEL 1 ISCVEL 0 ICHECW 0

stop


Rick Venable
computational chemist

Re: filling a box by placing molecules on a grid
rmv #35269 09/22/15 11:53 PM
Joined: Sep 2003
Posts: 8,450
rmv Online Content OP
Forum Member
OP Online Content
Forum Member
Joined: Sep 2003
Posts: 8,450
I should add that the distributed topology files may not contain octane, but it can easily be added based on heptane from the lipid model compound file found in toppar/stream

Use the new C36 parameters, not the older C27 parameters.


Rick Venable
computational chemist

Re: filling a box by placing molecules on a grid
rmv #35315 10/15/15 08:01 PM
Joined: Sep 2015
Posts: 2
F
Forum Member
Offline
Forum Member
F
Joined: Sep 2015
Posts: 2
Thank you Rick,


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.007s Queries: 34 (0.001s) Memory: 0.9725 MB (Peak: 1.1025 MB) Data Comp: Off Server Time: 2020-06-07 09:01:49 UTC
Valid HTML 5 and Valid CSS