Skip to content

Commit ed3adc9

Browse files
Merge pull request #23 from lammpstutorials/continue-improving-tutorial-3
continue improving tutorial 3
2 parents 7f31b87 + 0d08d30 commit ed3adc9

6 files changed

Lines changed: 263 additions & 107 deletions

File tree

File renamed without changes.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
units real
3+
atom_style full
4+
bond_style harmonic
5+
angle_style harmonic
6+
dihedral_style harmonic
7+
pair_style lj/cut/coul/long 10
8+
kspace_style pppm 1e-5
9+
special_bonds lj 0.0 0.0 0.5 coul 0.0 0.0 1.0 &
10+
angle yes dihedral yes
11+
12+
read_data ../pureH2O/H2O.data &
13+
extra/bond/per/atom 3 &
14+
extra/angle/per/atom 6 &
15+
extra/dihedral/per/atom 10 &
16+
extra/special/per/atom 14
17+
include ../PARM.lmp
18+
19+
molecule pegmol PEG-GROMOS.mol
20+
create_atoms 0 single 0 0 0 mol pegmol 454756
21+
22+
group H2O type OW HW
23+
group PEG type C CPos H HC OAlc OE
24+
25+
delete_atoms overlap 2.0 H2O PEG mol yes
26+
27+
fix mynpt all npt temp 300 300 100 x 1 1 1000
28+
timestep 1.0
29+
30+
dump mydmp all image 1000 dump.*.ppn type &
31+
type shiny 0.1 box no 0.01 &
32+
view 0 90 zoom 1.8 fsaa yes bond atom 0.8
33+
dump_modify mydmp backcolor white &
34+
acolor OW red acolor HW white &
35+
acolor OE red acolor OAlc red &
36+
acolor C gray acolor CPos gray &
37+
acolor H white acolor HC white &
38+
adiam OW 0.2 adiam HW 0.2 &
39+
adiam C 3 adiam CPos 3 adiam OAlc 2.8 &
40+
adiam H 1 adiam HC 1 adiam OE 2.8
41+
42+
thermo 1000
43+
44+
run 30000
45+
write_data mix.data
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
variable f0 equal 5
2+
3+
units real
4+
atom_style full
5+
bond_style harmonic
6+
angle_style harmonic
7+
dihedral_style harmonic
8+
pair_style lj/cut/coul/long 10
9+
kspace_style pppm 1e-5
10+
special_bonds lj 0.0 0.0 0.5 &
11+
coul 0.0 0.0 1.0 &
12+
angle yes dihedral yes
13+
14+
read_data ../mergePEGH2O/mix.data
15+
include ../PARM.lmp
16+
17+
group H2O type OW HW
18+
group PEG type C CPos H HC OAlc OE
19+
group ends type OAlc
20+
variable xcm equal xcm(ends,x)
21+
variable oxies atom type==label2type(atom,OAlc)
22+
variable end1 atom v_oxies*(x>v_xcm)
23+
variable end2 atom v_oxies*(x<v_xcm)
24+
25+
group topull1 variable end1
26+
group topull2 variable end2
27+
28+
dump mydmp all image 1000 dump.*.ppn type &
29+
type shiny 0.1 box no 0.01 &
30+
view 0 90 zoom 1.8 fsaa yes bond atom 0.8
31+
dump_modify mydmp backcolor white &
32+
acolor OW red acolor HW white &
33+
acolor OE red acolor OAlc red &
34+
acolor C gray acolor CPos gray &
35+
acolor H white acolor HC white &
36+
adiam OW 0.2 adiam HW 0.2 &
37+
adiam C 3 adiam CPos 3 adiam OAlc 2.8 &
38+
adiam H 1 adiam HC 1 adiam OE 2.8
39+
40+
variable x1 equal xcm(topull1,x)
41+
variable x2 equal xcm(topull2,x)
42+
variable y1 equal xcm(topull1,y)
43+
variable y2 equal xcm(topull2,y)
44+
variable z1 equal xcm(topull1,z)
45+
variable z2 equal xcm(topull2,z)
46+
variable delta_r equal sqrt((v_x1-v_x2)^2+(v_y1-v_y2)^2+(v_z1-v_z2)^2)
47+
compute rgyr PEG gyration
48+
thermo_style custom step temp etotal v_delta_r c_rgyr
49+
thermo 1000
50+
51+
timestep 1.0
52+
fix mynvt all nvt temp 300 300 100
53+
54+
run 30000
55+
56+
fix myaf1 topull1 addforce ${f0} 0 0
57+
fix myaf2 topull2 addforce -${f0} 0 0
58+
59+
run 30000

files/tutorial3/pureH2O/input.lmp

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
units real
3+
atom_style full
4+
bond_style harmonic
5+
angle_style harmonic
6+
dihedral_style harmonic
7+
pair_style lj/cut/coul/long 10
8+
kspace_style pppm 1e-5
9+
special_bonds lj 0.0 0.0 0.5 &
10+
coul 0.0 0.0 1.0 angle yes
11+
12+
region box block -45 45 -15 15 -15 15
13+
create_box 8 box &
14+
bond/types 7 &
15+
angle/types 8 &
16+
dihedral/types 4 &
17+
extra/bond/per/atom 3 &
18+
extra/angle/per/atom 6 &
19+
extra/dihedral/per/atom 10 &
20+
extra/special/per/atom 14
21+
22+
include ../PARM.lmp
23+
24+
molecule h2omol H2O-SPCFw.mol
25+
create_atoms 0 random 1050 87910 NULL mol &
26+
h2omol 454756 overlap 1.0 maxtry 50
27+
28+
group H2O type OW HW
29+
minimize 1.0e-4 1.0e-6 100 1000
30+
reset_timestep 0
31+
32+
fix mynpt all npt temp 300 300 100 &
33+
iso 1 1 1000
34+
35+
dump mydmp all image 500 dump.*.jpg type type &
36+
shiny 0.1 box no 0.01 view 0 90 zoom 1.8
37+
dump_modify mydmp backcolor white &
38+
acolor OW red acolor HW white &
39+
adiam OW 3 adiam HW 1.5
40+
41+
variable myvol equal vol
42+
variable myoxy equal count(H2O)/3
43+
variable rho equal ${myoxy}/v_myvol
44+
thermo 1000
45+
thermo_style custom step temp etotal v_myvol v_rho
46+
47+
timestep 1.0
48+
run 20000
49+
write_data H2O.data

0 commit comments

Comments
 (0)