Install LAMMPS on my Mac.
Installing with Homebrew
It’s super easy with Homebrew.
Just run:
brew install lammpsThat’s it.
Running LAMMPS
Example files are located at /opt/homebrew/share/lammps/examples, so pick one and try running it.
ex. melt
コマンドファイルは以下。
# 3d Lennard-Jones melt
units ljatom_style atomic
lattice fcc 0.8442region box block 0 10 0 10 0 10create_box 1 boxcreate_atoms 1 boxmass 1 1.0
velocity all create 3.0 87287 loop geom
pair_style lj/cut 2.5pair_coeff 1 1 1.0 1.0 2.5
neighbor 0.3 binneigh_modify every 20 delay 0 check no
#change_box all x scale 2.0 y scale 2.0 z scale 2.0 remap
fix 1 all nve
dump 1 all atom 25 *.dumpdump_modify 1 pad 4
dump 2 all image 25 *.jpg type type & axes yes 0.8 0.02 view 60 -30dump_modify 2 pad 4
#dump 3 all movie 25 movie.mpg type type &# axes yes 0.8 0.02 view 60 -30#dump_modify 3 pad 3
thermo 50run 1000Note: The dump movie command doesn’t work with the Homebrew-installed version.
If you want to use it, you’ll need to build from source.
Alternatively, you can quickly create a movie with ffmpeg.
lmp_serial -in in.meltls *.jpg | sort | awk '{print "file \x27" $0 "\x27"}' > filelist.txtffmpeg -f concat -safe 0 -i filelist.txt -vsync vfr -pix_fmt yuv420p output.mp4That said, using Ovito to load dump files and create animations gives you more flexibility and better results.