Topic Options
#19649 - 12/19/08 04:47 PM filling a box by placing molecules on a grid
rmv Online   content

Forum Member

Registered: 09/17/03
Posts: 8259
Loc: 39 03 48 N, 77 06 54 W
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

Top
#19650 - 12/24/08 01:22 AM Re: filling a box by placing molecules on a grid [Re: rmv]
jeffrey Offline
Forum Member

Registered: 03/18/07
Posts: 148
Dear RMV,

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

Thanks.

-------
Jeffrey

Top
#19651 - 12/24/08 12:30 PM Re: filling a box by placing molecules on a grid [Re: jeffrey]
rmv Online   content

Forum Member

Registered: 09/17/03
Posts: 8259
Loc: 39 03 48 N, 77 06 54 W
Yes.

Top
#35219 - 08/30/15 08:17 PM Re: filling a box by placing molecules on a grid [Re: rmv]
Sai Offline
Forum Member

Registered: 11/20/09
Posts: 46
Loc: FL
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


Edited by Sai (08/30/15 08:56 PM)

Top
#35222 - 08/31/15 11:23 AM Re: filling a box by placing molecules on a grid [Re: rmv]
rmv Online   content

Forum Member

Registered: 09/17/03
Posts: 8259
Loc: 39 03 48 N, 77 06 54 W
That will also work; either CRYSTAL BUILD or CRYSTAL READ is needed to make the list of image transformations.
_________________________
Rick Venable
computational chemist


Top
#35223 - 08/31/15 05:49 PM Re: filling a box by placing molecules on a grid [Re: rmv]
Sai Offline
Forum Member

Registered: 11/20/09
Posts: 46
Loc: FL
Thank you!

Top
#35264 - 09/21/15 05:14 PM Re: filling a box by placing molecules on a grid [Re: rmv]
fairoos Offline
Forum Member

Registered: 09/10/15
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 ..

Top
#35267 - 09/22/15 12:58 PM Re: filling a box by placing molecules on a grid [Re: rmv]
rmv Online   content

Forum Member

Registered: 09/17/03
Posts: 8259
Loc: 39 03 48 N, 77 06 54 W
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


Top
#35269 - 09/22/15 07:53 PM Re: filling a box by placing molecules on a grid [Re: rmv]
rmv Online   content

Forum Member

Registered: 09/17/03
Posts: 8259
Loc: 39 03 48 N, 77 06 54 W
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


Top
#35315 - 10/15/15 04:01 PM Re: filling a box by placing molecules on a grid [Re: rmv]
fairoos Offline
Forum Member

Registered: 09/10/15
Posts: 2
Thank you Rick,

Top

Moderator:  chmgr, John Legato, petrella