A Simple Example of Lammps

Embed Size (px)

Citation preview

a simple example of lammps: UO2 lattice at 1000Ka simple example is shown using computation of UO2 system at 1000K.Computation of behavior of UO2 system under conditions:Number of atoms,Pressure,Temperature are constant: NPT fixedperiodic boundary condition is employed: necessary for Ewald method.a lammps script file:in.1000#Initialization:atom_style chargeunits metalboundary p p pdimension 3newton on#default is on#Atom definition:read_data data.fcc111 # set position of atomsmass 1 238group 1 type 1mass 2 16group 2 type 2#Force fields:pair_style hybrid/overlay born/coul/long 10.0 morse 10.0pair_coeff 1 1 born/coul/long 0.013806784 0.32702 3.26 0.0 0.0 10.0pair_coeff 1 2 born/coul/long 0.013806827 0.327021 3.54 0.0 0.0 10.0pair_coeff 1 2 morse 0.57745 1.65 2.369 10.0pair_coeff 2 2 born/coul/long 0.013806869 0.327022 3.82 3.950633264 0.0 10.0# refered to http://lammps.sandia.gov/threads/msg13365.htmlkspace_style pppm 1.0e-4log log.UO2_fcc111-1000K # set log file namevelocity all create 1000.0 78621 dist gaussian # initial distribution of velocity of atomsfix NPT all npt temp 1000.0 1000.0 0.005 iso 0.0 0.0 10.0 drag 0.2thermo 10 # thermo step 10dump 1 all atom 10 dump.UO2_fcc111-1000K.gz # zipped dump file with step 10run 2000Execution of lammps$ ./fcc111.py > data.fcc111 # generate a lammps data; U=1000, O=2000$ ./dat2cfg < data.fcc111 > fcc111.cfg # atomeye data$ atomeye fcc111.cfg &$ mpirun -np 2 lmp_openmpi < in.1000 # run lammps as two mpi-process

viewing the lattice of UO2 with atomeye

via/ [pixiv]in japanese"a big tree of black honey and a sprig of hot water" / illustration by poko [pixiv]download:in.1000download:fcc111.pydownload:dat2cfg.pyAnalyzing log with Octave:octave-3.6.1:1> a=readlog("log.UO2_fcc111-1000K");octave-3.6.1:9> aWARNING: terminal is not fully functionala =(press RETURN)

scalar structure containing the fields:

Chead = { [1,1] = Step [1,2] = Temp [1,3] = E_pair [1,4] = E_mol [1,5] = TotEng [1,6] = Press [1,7] = Volume [1,8] = } data = { [1,1] =

0.0000e+00 1.0000e+03 -3.0472e+04 0.0000e+00 -3.0085e+04 4.6630e+05 4.3399e+04 1.0000e+01 3.6121e+03 -3.7732e+04 0.0000e+00 -3.6332e+04 1.0384e+05 4.3401e+04 2.0000e+01 8.8344e+02 -3.7458e+04 0.0000e+00 -3.7116e+04 9.5518e+04 4.3405e+04 3.0000e+01 2.0197e+03 -3.8183e+04 0.0000e+00 -3.7400e+04 5.8506e+04 4.3411e+04 4.0000e+01 1.5293e+03 -3.8463e+04 0.0000e+00 -3.7871e+04 5.4620e+04 4.3417e+04 5.0000e+01 1.8013e+03 -3.8959e+04 0.0000e+00 -3.8261e+04 4.6632e+04 4.3424e+04 6.0000e+01 1.6175e+03 -3.9292e+04 0.0000e+00 -3.8665e+04 4.1967e+04 4.3432e+04 7.0000e+01 1.7681e+03 -3.9738e+04 0.0000e+00 -3.9052e+04 4.9086e+04 4.3440e+04 8.0000e+01 1.6729e+03 -4.0127e+04 0.0000e+00 -3.9478e+04 6.2420e+04 4.3450e+04 9.0000e+01 1.5952e+03 -4.0459e+04 0.0000e+00 -3.9841e+04 6.8996e+04 4.3459e+04warning: broken pipe -- some output may be lost

octave-3.6.1:2> b=a.data(1){};octave-3.6.1:3> plot(b(:,1),b(:,2))

download:readlog.m(a modified version)

via/ [pixiv]in japanese"a big tree of black honey and a sprig of hot water" / illustration by poko [pixiv]generating anime files with atomeye as follows:(on making animations for lammps, see "animations with atomeyein this site" for details.)$ gzcat dump.UO2_fcc111-1000K.gz > dump.UO2_fcc111-1000K$ lmp2cfg < input.txt------input.txt---------200002'dump.UO2_fcc111-1000K'1100001234.0000'U'216.0000'O'------input.txt---------$ atomeye 00001.cfg &$ cd Jpg/$ ffmpeg -r 20 -i "%05d.jpg" -vcodec mjpeg -sameq uo2_at_1000K.avi$ mv uo2_at_1000K.avi ../$ cd ..$ rm -rf Jpg/ *.cfgdownload:input.txtdownload:lmp2cfg.f(a modified version)

a movie generation by ffmpegvia/ [pixiv]in japanese"a big tree of black honey and a sprig of hot water" / illustration by poko [pixiv]a movie: UO2 at 1000K of a fcc 111 latice cut with a slant plane