LAMMPS (7 Jan 2022) # Numerical difference calculation # of error in forces and virial stress # adjustable parameters variable nsteps index 500 # length of run variable nthermo index 10 # thermo output interval variable ndump index 500 # dump output interval variable nlat index 3 # size of box variable fdelta index 1.0e-4 # displacement size variable vdelta index 1.0e-6 # strain size variable temp index 10.0 # temperature units metal atom_style atomic atom_modify map yes lattice fcc 5.358000 Lattice spacing in x,y,z = 5.358 5.358 5.358 region box block 0 ${nlat} 0 ${nlat} 0 ${nlat} region box block 0 3 0 ${nlat} 0 ${nlat} region box block 0 3 0 3 0 ${nlat} region box block 0 3 0 3 0 3 create_box 1 box Created orthogonal box = (0 0 0) to (16.074 16.074 16.074) 1 by 1 by 1 MPI processor grid create_atoms 1 box Created 108 atoms using lattice units in orthogonal box = (0 0 0) to (16.074 16.074 16.074) create_atoms CPU = 0.000 seconds mass 1 39.903 velocity all create ${temp} 2357 mom yes dist gaussian velocity all create 10.0 2357 mom yes dist gaussian pair_style lj/cubic pair_coeff * * 0.0102701 3.42 neighbor 0.0 bin neigh_modify every 1 delay 0 check no timestep 0.001 fix nve all nve # define numerical force calculation fix numforce all numdiff ${nthermo} ${fdelta} fix numforce all numdiff 10 ${fdelta} fix numforce all numdiff 10 1.0e-4 variable ferrx atom f_numforce[1]-fx variable ferry atom f_numforce[2]-fy variable ferrz atom f_numforce[3]-fz variable ferrsq atom v_ferrx^2+v_ferry^2+v_ferrz^2 compute faverrsq all reduce ave v_ferrsq variable fsq atom fx^2+fy^2+fz^2 compute favsq all reduce ave v_fsq variable frelerr equal sqrt(c_faverrsq/c_favsq) dump errors all custom ${ndump} force_error.dump v_ferrx v_ferry v_ferrz dump errors all custom 500 force_error.dump v_ferrx v_ferry v_ferrz # define numerical virial stress tensor calculation compute myvirial all pressure NULL virial fix numvirial all numdiff/virial ${nthermo} ${vdelta} fix numvirial all numdiff/virial 10 ${vdelta} fix numvirial all numdiff/virial 10 1.0e-6 variable errxx equal f_numvirial[1]-c_myvirial[1] variable erryy equal f_numvirial[2]-c_myvirial[2] variable errzz equal f_numvirial[3]-c_myvirial[3] variable erryz equal f_numvirial[4]-c_myvirial[6] variable errxz equal f_numvirial[5]-c_myvirial[5] variable errxy equal f_numvirial[6]-c_myvirial[4] variable verrsq equal "v_errxx^2 + v_erryy^2 + v_errzz^2 + v_erryz^2 + v_errxz^2 + v_errxy^2" variable vsq equal "c_myvirial[1]^2 + c_myvirial[3]^2 + c_myvirial[3]^2 + c_myvirial[4]^2 + c_myvirial[5]^2 + c_myvirial[6]^2" variable vrelerr equal sqrt(v_verrsq/v_vsq) thermo_style custom step temp pe etotal press v_frelerr v_vrelerr thermo ${nthermo} thermo 10 run ${nsteps} run 500 generated 0 of 0 mixed pair_coeff terms from geometric mixing rule Neighbor list info ... update every 1 steps, delay 0 steps, check no max neighbors/atom: 2000, page size: 100000 master list distance cutoff = 5.9407173 ghost atom cutoff = 5.9407173 binsize = 2.9703587, bins = 6 6 6 1 neighbor lists, perpetual/occasional/extra = 1 0 0 (1) pair lj/cubic, perpetual attributes: half, newton on pair build: half/bin/atomonly/newton stencil: half/bin/3d bin: standard Per MPI rank memory allocation (min/avg/max) = 6.083 | 6.083 | 6.083 Mbytes Step Temp PotEng TotEng Press v_frelerr v_vrelerr 0 10 -7.0259569 -6.8876486 28.564278 19203.344 1.5660292e-06 10 9.9376583 -7.0250947 -6.8876486 30.254762 1.5040965e-08 2.1991382e-07 20 9.7520139 -7.022527 -6.8876485 35.28505 1.4756358e-08 2.6265315e-06 30 9.4477557 -7.0183188 -6.8876485 43.519863 1.4688198e-08 2.6356166e-07 40 9.0330215 -7.0125826 -6.8876484 54.727797 1.4637921e-08 5.2292327e-08 50 8.5192918 -7.0054772 -6.8876483 68.585553 1.4587854e-08 7.1324716e-08 60 7.9212026 -6.997205 -6.8876481 84.684636 1.4525561e-08 3.1108149e-08 70 7.2562592 -6.9880081 -6.8876479 102.54088 1.450885e-08 3.2311094e-08 80 6.5444294 -6.9781627 -6.8876478 121.60715 1.4444738e-08 2.1776998e-08 90 5.8075961 -6.9679715 -6.8876476 141.2895 1.4493562e-08 2.0400898e-08 100 5.0688629 -6.957754 -6.8876474 160.9668 1.445455e-08 1.2636688e-08 110 4.3517145 -6.947835 -6.8876472 180.0135 1.4460371e-08 1.2528038e-08 120 3.6790589 -6.9385314 -6.887647 197.82486 1.4371757e-08 1.4489522e-08 130 3.0721984 -6.9301379 -6.8876468 213.84331 1.4364708e-08 1.2461922e-08 140 2.5497991 -6.9229125 -6.8876467 227.58429 1.4330926e-08 9.3913926e-09 150 2.1269443 -6.917064 -6.8876466 238.6596 1.4287002e-08 4.1510266e-09 160 1.8143642 -6.9127407 -6.8876465 246.79599 1.4282669e-08 7.7048281e-09 170 1.6179191 -6.9100237 -6.8876465 251.84748 1.42726e-08 1.2719973e-08 180 1.5383946 -6.9089239 -6.8876466 253.79991 1.4236534e-08 8.1200831e-09 190 1.5716287 -6.9093836 -6.8876467 252.76745 1.41706e-08 6.5670612e-09 200 1.7089493 -6.911283 -6.8876468 248.98142 1.4096463e-08 1.1685863e-08 210 1.9378716 -6.9144493 -6.8876469 242.77289 1.4008978e-08 1.1226902e-08 220 2.2429731 -6.9186692 -6.887647 234.55055 1.3886901e-08 9.9914102e-09 230 2.606862 -6.9237023 -6.8876472 224.77626 1.3864576e-08 1.1540228e-08 240 3.0111524 -6.9292941 -6.8876474 213.93996 1.3696314e-08 1.1697747e-08 250 3.4373794 -6.9351893 -6.8876475 202.53583 1.3626701e-08 1.0398197e-08 260 3.8678047 -6.9411426 -6.8876476 191.04084 1.3489489e-08 6.6603364e-09 270 4.2860853 -6.9469279 -6.8876478 179.89646 1.3312014e-08 1.1687917e-08 280 4.6777954 -6.9523457 -6.8876479 169.49404 1.3081144e-08 1.1336675e-08 290 5.030805 -6.9572282 -6.887648 160.16371 1.2947385e-08 1.7342825e-08 300 5.3355278 -6.9614428 -6.887648 152.16682 1.2893673e-08 1.7510534e-08 310 5.5850532 -6.964894 -6.887648 145.69148 1.2842022e-08 1.2782546e-08 320 5.7751794 -6.9675236 -6.8876481 140.85102 1.2903488e-08 1.5319437e-08 330 5.9043601 -6.9693103 -6.887648 137.68497 1.3076809e-08 1.1208999e-08 340 5.9735784 -6.9702676 -6.887648 136.16232 1.3296904e-08 1.891087e-08 350 5.9861549 -6.9704415 -6.887648 136.18679 1.3504051e-08 2.5783601e-08 360 5.947496 -6.9699067 -6.8876479 137.60397 1.3731112e-08 2.0556839e-08 370 5.8647874 -6.9687627 -6.8876478 140.2101 1.4009878e-08 2.1771736e-08 380 5.7466376 -6.9671285 -6.8876477 143.76234 1.4092054e-08 1.1085162e-08 390 5.6026773 -6.9651374 -6.8876477 147.99019 1.4282872e-08 2.0221602e-08 400 5.4431231 -6.9629305 -6.8876476 152.60787 1.4317739e-08 1.7076065e-08 410 5.2783192 -6.960651 -6.8876475 157.32722 1.4415075e-08 2.5031776e-08 420 5.1182723 -6.9584374 -6.8876474 161.87063 1.4441435e-08 2.2519289e-08 430 4.9722 -6.956417 -6.8876473 165.98344 1.4550624e-08 2.4512613e-08 440 4.8481153 -6.9547008 -6.8876473 169.44527 1.4544672e-08 1.4758301e-08 450 4.7524707 -6.9533779 -6.8876472 172.07964 1.4546492e-08 1.324687e-08 460 4.6898817 -6.9525122 -6.8876472 173.76132 1.4537475e-08 1.351367e-08 470 4.6629495 -6.9521397 -6.8876472 174.42109 1.4530458e-08 1.521106e-08 480 4.6721922 -6.9522675 -6.8876472 174.04742 1.4543785e-08 1.0905422e-08 490 4.7160887 -6.9528747 -6.8876473 172.68525 1.4545591e-08 2.0128525e-08 500 4.7912313 -6.953914 -6.8876473 170.43183 1.4438981e-08 1.6062775e-08 Loop time of 0.837333 on 1 procs for 500 steps with 108 atoms Performance: 51.592 ns/day, 0.465 hours/ns, 597.134 timesteps/s 99.8% CPU use with 1 MPI tasks x no OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 0.0097726 | 0.0097726 | 0.0097726 | 0.0 | 1.17 Neigh | 0.03095 | 0.03095 | 0.03095 | 0.0 | 3.70 Comm | 0.005564 | 0.005564 | 0.005564 | 0.0 | 0.66 Output | 0.0042451 | 0.0042451 | 0.0042451 | 0.0 | 0.51 Modify | 0.78618 | 0.78618 | 0.78618 | 0.0 | 93.89 Other | | 0.0006258 | | | 0.07 Nlocal: 108 ave 108 max 108 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 558 ave 558 max 558 min Histogram: 1 0 0 0 0 0 0 0 0 0 Neighs: 972 ave 972 max 972 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 972 Ave neighs/atom = 9 Neighbor list builds = 500 Dangerous builds not checked Total wall time: 0:00:00