新建
Day4作业

Zitong Xu

推荐镜像 :LAMMPS:23Jun2022-dp2.1.5-latest
推荐机型 :c2_m4_cpu
赞
双击即可修改
代码
文本
[1]
%%writefile in.diffusion
#---------------Initialize Simulation -------------------------
units lj # 使用LJ单位制
dimension 2 # 使用二维空间
boundary p p p # 使用周期性边界条件
atom_style atomic # 使用普通原子
variable t equal 0.5 # 定义系统温度
#-------------- Create Atoms Intial Conditions----------------
lattice sq 1.0 # 使用简单正方晶格,晶格常数为1.0
region box block 0 100 0 100 -0.5 0.5 # 定义盒子的范围
create_box 2 box # 在盒子中创建两种类型的原子
create_atoms 1 random 2500 12345 box # 随机创建2500个类型为1的原子
create_atoms 2 random 2500 54321 box # 随机创建2500个类型为2的原子
mass 1 1.0 # 设置原子1质量
mass 2 3.0 # 设置原子2质量,并按照作业要求设定为不同粒子
#---------------- Define Simulation Parameters----------------
pair_style hybrid lj/cut 2.5 soft 5.0 # 使用hybrid混合两种势
pair_coeff 1 1 lj/cut 1.0 1.0 2.5 # 类型为1的原子之间为LJ势
pair_coeff 2 2 lj/cut 1.0 1.0 2.5 # 类型为2的原子之间为LJ势
pair_coeff 1 2 soft 5.0 # 类型为1和2的原子之间为soft势
#--------------- Run MD Simulation ----------------------------
compute eng all pe/atom # 计算每个原子的势能
compute eatoms all reduce sum c_eng # 计算所有原子的总势能
thermo_style custom step temp epair etotal press c_eatoms # 定义输出的热力学量
thermo 1000 # 每1000步输出一次热力学量
dump id all atom 100 dump.lammpstrj # 每100步将所有原子的状态输出到dump.lammpstrj文件中
minimize 1e-4 1e-6 1000 10000 # 防止随机生成的原子重叠能量过大
velocity all create $t 87287 # 赋予所有原子初始速度
fix nvt all nvt temp $t $t 0.01 # 使用NVT系综,温度为t,时间常数为0.01
run 50000 # 运行50000步
Writing in.diffusion
代码
文本
[2]
!lmp -i in.diffusion
Warning: This LAMMPS executable is in a conda environment, but the environment has not been activated. Libraries may fail to load. To activate this environment please see https://conda.io/activation. LAMMPS (23 Jun 2022 - Update 1) OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) using 1 OpenMP thread(s) per MPI task Loaded 1 plugins from /opt/deepmd-kit-2.1.5/lib/deepmd_lmp Lattice spacing in x,y,z = 1 1 1 Created orthogonal box = (0 0 -0.5) to (100 100 0.5) 1 by 1 by 1 MPI processor grid Created 2500 atoms using lattice units in orthogonal box = (0 0 -0.5) to (100 100 0.5) create_atoms CPU = 0.002 seconds Created 2500 atoms using lattice units in orthogonal box = (0 0 -0.5) to (100 100 0.5) create_atoms CPU = 0.000 seconds WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (src/min.cpp:187) Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 master list distance cutoff = 5.3 ghost atom cutoff = 5.3 binsize = 2.65, bins = 38 38 1 3 neighbor lists, perpetual/occasional/extra = 3 0 0 (1) pair lj/cut, perpetual, skip from (3) attributes: half, newton on pair build: skip stencil: none bin: none (2) pair soft, perpetual, skip from (3) attributes: half, newton on pair build: skip stencil: none bin: none (3) neighbor class addition, perpetual attributes: half, newton on pair build: half/bin/atomonly/newton stencil: half/bin/2d bin: standard Setting up cg style minimization ... Unit style : lj Current step : 0 Per MPI rank memory allocation (min/avg/max) = 7.075 | 7.075 | 7.075 Mbytes Step Temp E_pair TotEng Press c_eatoms 0 0 5.0637488e+15 5.0637488e+15 1.5191246e+16 5.0637488e+15 1000 0 -2.2238562 -2.2238562 2.4537066 -2.2238562 Loop time of 5.22828 on 1 procs for 1000 steps with 5000 atoms 100.0% CPU use with 1 MPI tasks x 1 OpenMP threads Minimization stats: Stopping criterion = max iterations Energy initial, next-to-last, final = 5.06374880431566e+15 -2.22328314271219 -2.22385624354953 Force two-norm initial, final = 1.5674736e+22 38.101405 Force max component initial, final = 1.0813852e+22 8.3143077 Final line search alpha, max atom move = 0.005428131 0.045131151 Iterations, force evaluations = 1000 1586 MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 3.8049 | 3.8049 | 3.8049 | 0.0 | 72.78 Neigh | 1.131 | 1.131 | 1.131 | 0.0 | 21.63 Comm | 0.032366 | 0.032366 | 0.032366 | 0.0 | 0.62 Output | 0.051384 | 0.051384 | 0.051384 | 0.0 | 0.98 Modify | 0 | 0 | 0 | 0.0 | 0.00 Other | | 0.2087 | | | 3.99 Nlocal: 5000 ave 5000 max 5000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 1045 ave 1045 max 1045 min Histogram: 1 0 0 0 0 0 0 0 0 0 Neighs: 0 ave 0 max 0 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 0 Ave neighs/atom = 0 Neighbor list builds = 387 Dangerous builds = 0 Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule Setting up Verlet run ... Unit style : lj Current step : 1000 Time step : 0.005 Per MPI rank memory allocation (min/avg/max) = 6.075 | 6.075 | 6.075 Mbytes Step Temp E_pair TotEng Press c_eatoms 1000 0.5 -2.2238562 -1.7239562 2.7036566 -2.2238562 2000 0.4949906 -2.0884178 -1.5935262 1.8208201 -2.0884178 3000 0.49742189 -2.1764669 -1.6791445 1.0956713 -2.1764669 4000 0.49767735 -2.1690414 -1.6714636 0.86460694 -2.1690414 5000 0.50159325 -2.1670865 -1.6655936 0.68350406 -2.1670865 6000 0.50213256 -2.1394782 -1.637446 0.53366013 -2.1394782 7000 0.51577911 -2.1306671 -1.6149911 0.50028334 -2.1306671 8000 0.50077102 -2.1061593 -1.6054884 0.42328939 -2.1061593 9000 0.49530855 -2.0985198 -1.6033103 0.32179694 -2.0985198 10000 0.49619446 -2.072605 -1.5765098 0.32620387 -2.072605 11000 0.48840769 -2.058302 -1.569992 0.2292908 -2.058302 12000 0.49943046 -2.0418714 -1.5425409 0.22001855 -2.0418714 13000 0.50017682 -2.0114187 -1.5113419 0.2442835 -2.0114187 14000 0.49424865 -2.0088018 -1.514652 0.17439343 -2.0088018 15000 0.50714146 -1.9721381 -1.4650981 0.18736809 -1.9721381 16000 0.50343834 -1.9698293 -1.4664917 0.15999903 -1.9698293 17000 0.50068879 -1.9453976 -1.4448089 0.16554229 -1.9453976 18000 0.51411346 -1.950727 -1.4367164 0.15088806 -1.950727 19000 0.50688169 -1.9443484 -1.4375681 0.18801815 -1.9443484 20000 0.50041875 -1.9265457 -1.426227 0.14969453 -1.9265457 21000 0.5145349 -1.9274468 -1.4130148 0.13929095 -1.9274468 22000 0.49953013 -1.9317925 -1.4323623 0.1648356 -1.9317925 23000 0.50656224 -1.9305855 -1.4241246 0.15276985 -1.9305855 24000 0.49243139 -1.9164986 -1.4241657 0.15298029 -1.9164986 25000 0.5033437 -1.9202001 -1.4169571 0.13307823 -1.9202001 26000 0.49878801 -1.9172587 -1.4185704 0.13139242 -1.9172587 27000 0.49377212 -1.9197226 -1.4260492 0.16187951 -1.9197226 28000 0.49606137 -1.9280161 -1.4320539 0.12520829 -1.9280161 29000 0.49867061 -1.9026841 -1.4041133 0.18282532 -1.9026841 30000 0.49605919 -1.9076036 -1.4116436 0.19854189 -1.9076036 31000 0.48730354 -1.9081954 -1.4209894 0.16014957 -1.9081954 32000 0.4961979 -1.8997865 -1.4036878 0.14549662 -1.8997865 33000 0.49926113 -1.8891543 -1.389993 0.13228389 -1.8891543 34000 0.49053736 -1.9008015 -1.4103622 0.13725469 -1.9008015 35000 0.50081009 -1.8936883 -1.3929784 0.16566779 -1.8936883 36000 0.50127899 -1.8850226 -1.3838439 0.15614537 -1.8850226 37000 0.48588156 -1.8921728 -1.4063884 0.15600445 -1.8921728 38000 0.50381926 -1.8839801 -1.3802616 0.12077484 -1.8839801 39000 0.49882167 -1.9057592 -1.4070373 0.15219859 -1.9057592 40000 0.49836124 -1.9051593 -1.4068977 0.10461306 -1.9051593 41000 0.48770979 -1.8904725 -1.4028602 0.13075343 -1.8904725 42000 0.49377673 -1.8873972 -1.3937193 0.12483865 -1.8873972 43000 0.49910008 -1.8931826 -1.3941823 0.11410788 -1.8931826 44000 0.49671487 -1.8899772 -1.3933617 0.1210732 -1.8899772 45000 0.50455286 -1.8991947 -1.3947428 0.14018836 -1.8991947 46000 0.50126495 -1.8772986 -1.3761339 0.084781182 -1.8772986 47000 0.50066613 -1.8975293 -1.3969633 0.12742051 -1.8975293 48000 0.51034155 -1.8870678 -1.3768284 0.14531825 -1.8870678 49000 0.49790812 -1.884302 -1.3864935 0.14077895 -1.884302 50000 0.50261033 -1.8829514 -1.3804416 0.13353632 -1.8829514 51000 0.49860333 -1.8747559 -1.3762523 0.065797304 -1.8747559 Loop time of 48.9533 on 1 procs for 50000 steps with 5000 atoms Performance: 441236.546 tau/day, 1021.381 timesteps/s 99.7% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 30.091 | 30.091 | 30.091 | 0.0 | 61.47 Neigh | 11.147 | 11.147 | 11.147 | 0.0 | 22.77 Comm | 0.53752 | 0.53752 | 0.53752 | 0.0 | 1.10 Output | 2.5576 | 2.5576 | 2.5576 | 0.0 | 5.22 Modify | 4.1913 | 4.1913 | 4.1913 | 0.0 | 8.56 Other | | 0.429 | | | 0.88 Nlocal: 5000 ave 5000 max 5000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 1077 ave 1077 max 1077 min Histogram: 1 0 0 0 0 0 0 0 0 0 Neighs: 0 ave 0 max 0 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 0 Ave neighs/atom = 0 Neighbor list builds = 4723 Dangerous builds = 2279 Total wall time: 0:00:55
代码
文本
点个赞吧
推荐阅读
公开
许成科-第4天-2403-计算材料学实战
xck

发布于 2024-03-12
公开
李洲-第4天-2403-计算材料学实践
bohr5582d3

发布于 2024-03-12
1 赞