LAMMPS logo 介绍
前面介绍了下LAMMPS里内置的建模命令(region, create_atoms, lattice, create_box等等),今天就介绍个相关的经典例子——LAMMPS经典logo的制作,不知道各位在看LAMMPS官网时有没有注意过这个logo(这个logo由一个个原子所组成),这个logo其实是由LAMMPS内置的命令建模所得到,并完成了一个简单的动态模拟,有兴趣的同学可以学习一下,顺便也可熟悉下我们之前提到的命令(主要是用到region命令):
# simulation of LAMMPS logo
units lj
atom_style atomic
dimension 2
# create 2d lattice, low density so diffuses
lattice sq2 0.5 origin 0.25 0.25 0.0
region box block 0 31 0 7 -0.5 0.5
create_box 2 box
create_atoms 1 box
# LAMMPS letters via regions, convert to type 2 atoms
region L1 block 2 3 1 6 -0.5 0.5
region L2 block 2 5 1 2 -0.5 0.5
region L union 2 L1 L2
region A1 block 6 7 1 6 -0.5 0.5
region A2 block 8 9 1 6 -0.5 0.5
region A3 block 6 9 3 4 -0.5 0.5
region A4 block 6 9 5 6 -0.5 0.5
region A union 4 A1 A2 A3 A4
region 1M1 block 10 11 1 6 -0.5 0.5
region 1M2 block 14 15 1 6 -0.5 0.5
region 1M3 block 10 15 5 6 -0.5 0.5
region 1M4 block 12 13 3 6 -0.5 0.5
region 1M union 4 1M1 1M2 1M3 1M4
region 2M1 block 16 17 1 6 -0.5 0.5
region 2M2 block 20 21 1 6 -0.5 0.5
region 2M3 block 16 21 5 6 -0.5 0.5
region 2M4 block 18 19 3 6 -0.5 0.5
region 2M union 4 2M1 2M2 2M3 2M4
region P1 block 22 23 1 6 -0.5 0.5
region P2 block 24 25 3 6 -0.5 0.5
region P3 block 22 25 3 4 -0.5 0.5
region P4 block 22 25 5 6 -0.5 0.5
region P union 4 P1 P2 P3 P4
region S1 block 26 29 5 6 -0.5 0.5
region S2 block 26 27 3 6 -0.5 0.5
region S3 block 26 29 3 4 -0.5 0.5
region S4 block 28 29 1 4 -0.5 0.5
region S5 block 26 29 1 2 -0.5 0.5
region S union 5 S1 S2 S3 S4 S5
region LAMMPS union 6 L A 1M 2M P S
set region LAMMPS type 2
# LJ and other system parameters
mass * 1.0
pair_style lj/cut 2.5
pair_coeff * * 1.0 1.0 2.5
timestep 0.005
neighbor 0.3 bin
neigh_modify delay 0 every 1 check yes
velocity all create 2.0 87287 loop geom
thermo 100
dump 1 all atom 20 tmp.dump
# run without integrator to "pause" the visualization
run 100
# dissolve the lattice
fix 1 all nve
fix 2 all enforce2d
run 1000
# run without integrator to "pause" the visualization
unfix 1
unfix 2
run 200
# reverse the velocities and continue run
# logo and lattice should reassemble within round-off errors
variable vxflip atom -vx
variable vyflip atom -vy
velocity all set v_vxflip v_vyflip NULL
fix 1 all nve
fix 2 all enforce2d
run 1000
# run without integrator to "pause" the visualization
unfix 1
unfix 2
run 100
最后可以得到这个经典logo:
在LAMMPS官网界面鼠标放在这个logo上即可看到这个in文件内容所展示的动力学过程
根据这个例子我们DIY了用MDer的方式给党庆生”的内容,有兴趣的同学可以去看看
转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 weig16@whu.edu.cn