Made changes to propel/self. Kept all features of previous version (and tested they stayed the same), but additionally added dipole option for direction of self-propulsion. Also updated examples.

This commit is contained in:
Sam Cameron
2020-12-20 16:39:04 +00:00
parent 4c1f449350
commit 05ecf86134
20 changed files with 919 additions and 469 deletions

View File

@ -0,0 +1,70 @@
# 2D overdamped active brownian particle dynamics (ABP)
# with WCA potential
variable gamma_t equal 1.0
variable gamma_r equal 1.0
variable D_t equal 1.0
variable D_r equal 3.0
variable seed equal 1974019
variable fp equal 4.0
variable params string ${gamma_t}_${gamma_r}_${D_t}_${D_r}_${fp}
log log_WCA_${params}_2d.lammps.log
units lj
atom_style hybrid dipole sphere
dimension 2
newton off
lattice sq 0.4
region box block -16 16 -16 16 -0.2 0.2
create_box 1 box
create_atoms 1 box
mass * 1.0
set type * dipole/random ${seed} 1.0
velocity all create 1.0 1 loop geom
# more careful with neighbors since higher diffusion in abps
neighbor 1.0 bin
neigh_modify every 1 delay 1 check yes
# WCA potential (purely repulsive)
pair_style lj/cut 2.5
pair_coeff * * 1.0 1.0 1.1224
pair_modify shift yes
# overdamped brownian dynamics time-step
fix step all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} dipole
# self-propulsion force along the dipole direction
fix activity all propel/self ${fp} dipole
fix 2 all enforce2d
compute press all pressure NULL virial
thermo_style custom step temp epair c_press
#equilibration
timestep 0.0000000001
thermo 50001
run 50000
reset_timestep 0
# MSD
compute msd all msd
thermo_style custom step temp epair c_msd[*] c_press
timestep 0.00001
thermo 10000
# main run
run 200000

View File

@ -0,0 +1,74 @@
# 3D overdamped active brownian dynamics with no interactions
variable gamma_t equal 1.0
variable gamma_r equal 1.0
variable D_t equal 1.0
variable D_r equal 3.0
variable seed equal 1974019
variable fp equal 4.0
variable params string ${gamma_t}_${gamma_r}_${D_t}_${D_r}_${fp}
log log_ideal_${params}_3d.lammps.log
units lj
atom_style hybrid dipole sphere
dimension 3
newton off
lattice sc 0.4
region box block -8 8 -8 8 -8 8
create_box 1 box
create_atoms 1 box
mass * 1.0
set type * dipole/random ${seed} 1.0
velocity all create 1.0 1 loop geom
pair_style none
# overdamped brownian dynamics time-step
fix step all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} dipole
# self-propulsion force along the dipole direction
fix activity all propel/self ${fp} dipole
compute press all pressure NULL virial
thermo_style custom step temp epair c_press
#equilibration
timestep 0.0000000001
thermo 50001
run 50000
reset_timestep 0
# MSD to demonstrate expected diffusive behaviour for ideal active
# brownian motion, which is
#
# MSD = (2*d*D_t + 2*fp**2/(gamma_t**2*(d-1)*D_r))*t
#
# with d being simulation dimension
compute msd all msd
thermo_style custom step temp epair c_msd[*] c_press
timestep 0.00001
thermo 10000
# main run
run 120000
# if you want to check that rotational diffusion is behaving as expected,
# uncomment next three lines for dump output and then plot <e(t).e(0)>,
# which should decay exponentially with timescale (d-1)*D_r (with d
# being simulation dimension)
#dump 1 all custom 2000 dump_ideal_${params}_3d.lammpstrj id type &
# x y xu yu mux muy muz fx fy fz
#dump_modify 1 first yes sort id
#run 120000

View File

@ -0,0 +1,163 @@
units lj
atom_style hybrid dipole sphere
WARNING: Atom_style hybrid defines both pertype and peratom masses - both must be set, only peratom masses will be used (src/atom_vec_hybrid.cpp:157)
dimension 2
newton off
lattice sq 0.4
Lattice spacing in x,y,z = 1.5811388 1.5811388 1.5811388
region box block -16 16 -16 16 -0.2 0.2
create_box 1 box
Created orthogonal box = (-25.298221 -25.298221 -0.31622777) to (25.298221 25.298221 0.31622777)
2 by 2 by 1 MPI processor grid
create_atoms 1 box
Created 1024 atoms
create_atoms CPU = 0.001 seconds
mass * 1.0
set type * dipole/random ${seed} 1.0
set type * dipole/random 1974019 1.0
Setting atom values ...
1024 settings made for dipole/random
velocity all create 1.0 1 loop geom
# more careful with neighbors since higher diffusion in abps
neighbor 1.0 bin
neigh_modify every 1 delay 1 check yes
# WCA potential (purely repulsive)
pair_style lj/cut 2.5
pair_coeff * * 1.0 1.0 1.1224
pair_modify shift yes
# overdamped brownian dynamics time-step
fix step all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} dipole
fix step all brownian/sphere 1 ${gamma_r} ${D_t} ${D_r} ${seed} dipole
fix step all brownian/sphere 1 1 ${D_t} ${D_r} ${seed} dipole
fix step all brownian/sphere 1 1 1 ${D_r} ${seed} dipole
fix step all brownian/sphere 1 1 1 3 ${seed} dipole
fix step all brownian/sphere 1 1 1 3 1974019 dipole
# self-propulsion force along the dipole direction
fix activity all propel/self ${fp} dipole
fix activity all propel/self 4 dipole
fix 2 all enforce2d
compute press all pressure NULL virial
thermo_style custom step temp epair c_press
#equilibration
timestep 0.0000000001
thermo 50001
run 50000
Neighbor list info ...
update every 1 steps, delay 1 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 2.1224
ghost atom cutoff = 2.1224
binsize = 1.0612, bins = 48 48 1
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair lj/cut, perpetual
attributes: half, newton off
pair build: half/bin/newtoff
stencil: half/bin/2d/newtoff
bin: standard
Per MPI rank memory allocation (min/avg/max) = 5.052 | 5.052 | 5.052 Mbytes
Step Temp E_pair c_press
0 1 0 -0.53979198
50000 1.0371295e+10 0 -0.542818
Loop time of 2.25396 on 4 procs for 50000 steps with 1024 atoms
Performance: 0.192 tau/day, 22183.200 timesteps/s
99.8% CPU use with 4 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0.1034 | 0.10382 | 0.10438 | 0.1 | 4.61
Neigh | 0 | 0 | 0 | 0.0 | 0.00
Comm | 0.26698 | 0.26833 | 0.26924 | 0.2 | 11.90
Output | 2.2284e-05 | 2.4926e-05 | 3.2332e-05 | 0.0 | 0.00
Modify | 1.7222 | 1.7237 | 1.727 | 0.1 | 76.48
Other | | 0.1581 | | | 7.01
Nlocal: 256.000 ave 256 max 256 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Nghost: 105.000 ave 105 max 105 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Neighs: 544.000 ave 544 max 544 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Total # of neighbors = 2176
Ave neighs/atom = 2.1250000
Neighbor list builds = 0
Dangerous builds = 0
reset_timestep 0
# MSD
compute msd all msd
thermo_style custom step temp epair c_msd[*] c_press
timestep 0.00001
thermo 10000
# main run
run 200000
Per MPI rank memory allocation (min/avg/max) = 5.427 | 5.427 | 5.427 Mbytes
Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press
0 1.0371295e+10 0 0 0 0 0 -0.542818
10000 107356.09 0.079828495 0.19584264 0.19679822 0 0.39264086 0.00078740793
20000 101692.44 0.11317533 0.40847364 0.42097802 0 0.82945167 0.74111888
30000 105763.55 0.10261852 0.68303669 0.66125751 0 1.3442942 0.71112533
40000 105127.29 0.12371743 0.97990144 0.94005552 0 1.919957 1.0574552
50000 101579.58 0.12771813 1.3059069 1.2364468 0 2.5423537 1.059263
60000 104914.36 0.12055843 1.6215593 1.525488 0 3.1470473 0.79873537
70000 106629.18 0.1278745 1.9639958 1.8682794 0 3.8322752 0.91950208
80000 103286.54 0.13927689 2.3201565 2.2373383 0 4.5574948 1.1875034
90000 106451.61 0.093479681 2.6287902 2.5753347 0 5.2041249 1.0861163
100000 102199.72 0.13269425 2.9127976 2.9369237 0 5.8497214 1.4841998
110000 105229.73 0.10594209 3.1798718 3.3495317 0 6.5294035 1.5444784
120000 106262.36 0.11902575 3.6267452 3.7188125 0 7.3455578 1.3366518
130000 109388.12 0.10562576 3.929973 4.0226942 0 7.9526672 1.324534
140000 107697.35 0.13028752 4.231893 4.3780995 0 8.6099925 1.7406167
150000 103928.72 0.12278994 4.5826286 4.7578662 0 9.3404948 1.3024003
160000 103370.23 0.11391216 4.8767011 5.1181189 0 9.99482 1.4325241
170000 103821.53 0.11163256 5.153318 5.3785963 0 10.531914 1.4569115
180000 106824.99 0.13225083 5.4080929 5.7399804 0 11.148073 1.334984
190000 101794.6 0.10632938 5.7384925 6.080955 0 11.819448 0.81285422
200000 102128.67 0.13703498 6.0414673 6.4511058 0 12.492573 0.42904128
Loop time of 9.60419 on 4 procs for 200000 steps with 1024 atoms
Performance: 17992.140 tau/day, 20824.236 timesteps/s
100.0% CPU use with 4 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0.71756 | 0.75121 | 0.79008 | 3.0 | 7.82
Neigh | 0.018158 | 0.018773 | 0.019357 | 0.3 | 0.20
Comm | 1.0469 | 1.0597 | 1.0738 | 1.2 | 11.03
Output | 0.00051435 | 0.00057078 | 0.00070838 | 0.0 | 0.01
Modify | 6.8012 | 6.9883 | 7.1513 | 4.9 | 72.76
Other | | 0.7857 | | | 8.18
Nlocal: 256.000 ave 265 max 240 min
Histogram: 1 0 0 0 0 0 1 0 0 2
Nghost: 88.5000 ave 91 max 87 min
Histogram: 1 0 2 0 0 0 0 0 0 1
Neighs: 678.500 ave 713 max 597 min
Histogram: 1 0 0 0 0 0 0 0 1 2
Total # of neighbors = 2714
Ave neighs/atom = 2.6503906
Neighbor list builds = 241
Dangerous builds = 0
Total wall time: 0:00:11

View File

@ -0,0 +1,150 @@
units lj
atom_style hybrid dipole sphere
WARNING: Atom_style hybrid defines both pertype and peratom masses - both must be set, only peratom masses will be used (src/atom_vec_hybrid.cpp:157)
dimension 3
newton off
lattice sc 0.4
Lattice spacing in x,y,z = 1.3572088 1.3572088 1.3572088
region box block -8 8 -8 8 -8 8
create_box 1 box
Created orthogonal box = (-10.857670 -10.857670 -10.857670) to (10.857670 10.857670 10.857670)
2 by 1 by 2 MPI processor grid
create_atoms 1 box
Created 4096 atoms
create_atoms CPU = 0.002 seconds
mass * 1.0
set type * dipole/random ${seed} 1.0
set type * dipole/random 1974019 1.0
Setting atom values ...
4096 settings made for dipole/random
velocity all create 1.0 1 loop geom
pair_style none
# overdamped brownian dynamics time-step
fix step all brownian/sphere ${gamma_t} ${gamma_r} ${D_t} ${D_r} ${seed} dipole
fix step all brownian/sphere 1 ${gamma_r} ${D_t} ${D_r} ${seed} dipole
fix step all brownian/sphere 1 1 ${D_t} ${D_r} ${seed} dipole
fix step all brownian/sphere 1 1 1 ${D_r} ${seed} dipole
fix step all brownian/sphere 1 1 1 3 ${seed} dipole
fix step all brownian/sphere 1 1 1 3 1974019 dipole
# self-propulsion force along the dipole direction
fix activity all propel/self ${fp} dipole
fix activity all propel/self 4 dipole
compute press all pressure NULL virial
thermo_style custom step temp epair c_press
#equilibration
timestep 0.0000000001
thermo 50001
run 50000
WARNING: No pairwise cutoff or binsize set. Atom sorting therefore disabled. (src/atom.cpp:2118)
WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167)
Per MPI rank memory allocation (min/avg/max) = 4.319 | 4.319 | 4.319 Mbytes
Step Temp E_pair c_press
0 1 0 0.068021726
50000 1.046425e+10 0 0.067505633
Loop time of 7.83903 on 4 procs for 50000 steps with 4096 atoms
Performance: 0.055 tau/day, 6378.340 timesteps/s
97.9% CPU use with 4 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0 | 0 | 0 | 0.0 | 0.00
Neigh | 0 | 0 | 0 | 0.0 | 0.00
Comm | 0.50238 | 0.51891 | 0.53617 | 1.7 | 6.62
Output | 2.6343e-05 | 3.6075e-05 | 4.6997e-05 | 0.0 | 0.00
Modify | 6.9536 | 6.9732 | 7.0105 | 0.8 | 88.95
Other | | 0.3469 | | | 4.43
Nlocal: 1024.00 ave 1024 max 1024 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Nghost: 353.000 ave 353 max 353 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Neighs: 0.00000 ave 0 max 0 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Total # of neighbors = 0
Ave neighs/atom = 0.0000000
Neighbor list builds = 0
Dangerous builds = 0
reset_timestep 0
# MSD to demonstrate expected diffusive behaviour for ideal active
# brownian motion, which is
#
# MSD = (2*d*D_t + 2*fp**2/(gamma_t**2*(d-1)*D_r))*t
#
# with d being simulation dimension
compute msd all msd
thermo_style custom step temp epair c_msd[*] c_press
timestep 0.00001
thermo 10000
# main run
run 120000
WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:167)
Per MPI rank memory allocation (min/avg/max) = 4.694 | 4.694 | 4.694 Mbytes
Step Temp E_pair c_msd[1] c_msd[2] c_msd[3] c_msd[4] c_press
0 1.046425e+10 0 0 0 0 0 0.067505633
10000 106340.56 0 0.2469318 0.23662295 0.2441413 0.72769605 0.19939966
20000 104620.27 0 0.55429324 0.5231436 0.54976641 1.6272032 0.26601423
30000 106130.45 0 0.87562668 0.84813496 0.89321299 2.6169746 0.30836996
40000 105773.31 0 1.2262635 1.1899278 1.2626926 3.6788838 0.35392219
50000 103804.88 0 1.5851624 1.5645815 1.6434185 4.7931624 0.33326997
60000 105746.45 0 1.9928016 1.9347072 1.9837329 5.9112417 0.2550878
70000 104500.3 0 2.3269429 2.2774077 2.3368821 6.9412326 0.25218225
80000 105381.46 0 2.7114959 2.6937299 2.7171132 8.122339 0.36940892
90000 104542.79 0 3.0828648 3.084417 3.0783207 9.2456025 0.36106481
100000 104246.75 0 3.4635513 3.5105066 3.4545226 10.42858 0.3712313
110000 103099.55 0 3.8471061 3.9389997 3.8220676 11.608173 0.38466185
120000 103098.45 0 4.2014598 4.3456831 4.1888659 12.736009 0.36710217
Loop time of 22.8893 on 4 procs for 120000 steps with 4096 atoms
Performance: 4529.619 tau/day, 5242.615 timesteps/s
100.0% CPU use with 4 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0 | 0 | 0 | 0.0 | 0.00
Neigh | 0.0049489 | 0.0050479 | 0.0050978 | 0.1 | 0.02
Comm | 0.082752 | 0.084491 | 0.085332 | 0.4 | 0.37
Output | 0.00054352 | 0.0006034 | 0.00064793 | 0.0 | 0.00
Modify | 21.069 | 21.521 | 21.964 | 7.0 | 94.02
Other | | 1.278 | | | 5.58
Nlocal: 1024.00 ave 1050 max 1010 min
Histogram: 2 0 0 1 0 0 0 0 0 1
Nghost: 0.00000 ave 0 max 0 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Neighs: 0.00000 ave 0 max 0 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Total # of neighbors = 0
Ave neighs/atom = 0.0000000
Neighbor list builds = 2169
Dangerous builds = 0
# if you want to check that rotational diffusion is behaving as expected,
# uncomment next three lines for dump output and then plot <e(t).e(0)>,
# which should decay exponentially with timescale (d-1)*D_r (with d
# being simulation dimension)
#dump 1 all custom 2000 dump_ideal_${params}_3d.lammpstrj id type # x y xu yu mux muy muz fx fy fz
#dump_modify 1 first yes sort id
#run 120000
Total wall time: 0:00:30

View File

@ -1,54 +0,0 @@
dimension 2
boundary p p p
variable L equal 20
region total block -$L $L -$L $L -0.5 0.5
lattice hex 0.3
create_box 2 total
create_atoms 1 box
# Set random fraction to passive:
set type 1 type/fraction 2 0.5 1337
# Purely repulsive particles:
variable rc equal "2^(1.0/6.0)"
pair_style lj/cut ${rc}
pair_coeff * * 1.0 1.0
pair_modify shift yes
mass * 1.0
fix step all nve
fix temp all langevin 1.0 1.0 1.0 13
fix twod all enforce2d
neighbor 0.6 bin
dump traj all custom 250 2d_active.dump.bin id type x y z
thermo_style custom time step pe ke etotal temp
thermo 1000
run 5000
group one type 1
group two type 2
compute ke1 one ke
compute ke2 two ke
thermo_style custom step pe ke etotal temp c_ke1 c_ke2
fix active all propel/self velocity 1.0
# With active force there is more motion so increase bin size:
neighbor 1.0 bin
run 10000
# Only make type 1 active:
fix active all propel/self velocity 1.0 types 1
# With active force there is more motion so increase bin size:
neighbor 1.0 bin
run 10000

View File

@ -1,37 +0,0 @@
dimension 2
boundary p p p
variable L equal 20
region total block -$L $L -$L $L -0.5 0.5
lattice hex 0.3
create_box 2 total
create_atoms 1 box
# Set random fraction to passive:
set type 1 type/fraction 2 0.5 1337
# Purely repulsive particles:
variable rc equal "2^(1.0/6.0)"
pair_style lj/cut ${rc}
pair_coeff * * 1.0 1.0
pair_modify shift yes
mass * 1.0
fix step all nve
fix twod all enforce2d
neighbor 0.6 bin
dump traj all custom 250 2d_active.dump.bin id type x y z
thermo_style custom step pe ke etotal temp
thermo 1000
run 10000
fix active all propel/self velocity 1.0
fix fric all viscous 1.0
# With active force there is more motion so increase bin size:
neighbor 1.0 bin
run 10000

View File

@ -1,40 +0,0 @@
dimension 3
boundary p p p
atom_style ellipsoid
variable L equal 20
region total block -$L $L -$L $L -$L $L
lattice sc 0.1
create_box 2 total
create_atoms 1 box
# Set random fraction to passive:
set type 1 type/fraction 2 0.5 1337
# Purely repulsive particles:
variable rc equal "2^(1.0/6.0)"
pair_style lj/cut ${rc}
pair_coeff * * 1.0 1.0
pair_modify shift yes
# mass * 1.0
set type * shape 1.0 1.0 1.0
set type * density 1.9098593171027443
set type * quat 0 0 1 0
fix step all nve/asphere
fix temp all langevin 1.0 1.0 1.0 13 angmom 3.333333333
neighbor 0.6 bin
dump traj all custom 100 3d_active.dump.bin id type x y z fx fy fz
thermo_style custom step pe ke etotal temp
thermo 100
run 500
fix active all propel/self quat 1.0
# With active force there is more motion so increase bin size:
neighbor 1.0 bin
run 500