This directory contains utility scripts for using VMD to visualize and analyze LAMMPS trajectories (hopefully in the future this will turn into a plugin or proper library). Below are short descriptions and examples on how to use them. Additional information on VMD as well as additional scripts can be found at: http://www.ks.uiuc.edu/Research/vmd/ and: http://www.theochem.rub.de/go/cpmd-vmd.html codes:http://code.google.com/p/lammps-hppi/source/browse/branches /lammps-10Mar10/tools/lmp2vmd/?r=21 The scripts are maintained by Axel Kohlmeyer akohlmey@cmm.chem.upenn.edu; please contact him through the LAMMPS mailing list in case of problems. ------------------------- 0. Installation. The scripts below define new tcl procedures for use with the tcl script interpreter embedded into VMD. To activate them, you can load them by using the "source" command. However it is more convenient to have VMD load them automatically on demand. To do this, you need to modify your .vmdrc (or vmd.rc) file (see the VMD User's Guide for details) and add the and adapted version of the following code. # add local (auto-loaded) scripts to the interpreter search path set auto_path With this change the "source" command lines below are no longer needed. If you add new files or procedures to this directory, you have to run the mkindex script to update the tclIndex file. ------------------------- 1. lmpbonds2vmd.tcl - translate bonding information from a LAMMPS data file into VMD. 1a. Background. With VMD one typically reads bonding information from a topology file and then reads a trajectory with the coordinate information on top of that. The most common use is the combination of a (CHARMM or X-PLOR style) PSF file and a DCD file (the latter can be produced by LAMMPS directly). If the bonding information is not available, VMD uses a heuristic guess which works reasonably well with biological systems, but can be particularly cumbersome in coarse grained MD or similar model systems. The lmpbonds2vmd.tcl script provides an option to transfer bonding information from a LAMMPS data file into VMD. 1b. Usage. The script defines a new procedure "lmpbondsfromdata". To activate it type at the VMD command prompt: source lmpbonds2vmd.tcl To then build a PSF file for use in subsequent visualizations you can load one just frame of a native LAMMPS trajectory (not binary, not custom!), for example perusing the output from the micelle example. mol new dump.micelle type lammpstrj waitfor all lmpbondsfromdata data.micelle Now you should only see the bonds that actually have bonded interactions. To avoid having to run the script all the time you can save the bonding information in an (incomplete) PSF file. animate write psf micelle.psf In the future you can now load this PSF file first and then the LAMMPS dump file(s) (or a more compact and faster loading DCD or XTC file) with: vmd micelle.psf -lammpstrj dump.micelle 1c. Problems. The LAMMPS data file format is quite flexible and thus not always easy to parse independently from context. As a consequence, the lmpbondsfromdata parser may be confused by your specific setup. 1d. History. First version. 2007, Axel Kohlmeyer akohlmey@cmm.chem.upenn.edu Added a sanity check 03/2008, Axel Kohlmeyer akohlmey@cmm.chem.upenn.edu ------------------------- 2. lmpresid2vmd.tcl - translate residue information from a LAMMPS data file into VMD. 2a. Background. LAMMPS dump files contain information about the (numerical) atom type, but not a molecule or residue id as it is typically used in PSF or PDB files to define subunits of a system. Adding this information can be very helpful for analysis and post-processing of LAMMPS data in VMD. 2b. Usage. The script defines a new procedure "lmpresidfromdata". To activate it type at the VMD command prompt: source lmpresid2vmd.tcl To then add the residue information to a PSF file, see the steps for from item 1 from above and then type into the VMD console. lmpresidfromdata data.micelle To avoid having to run the script all the time you can save the residue information in an (incomplete) PSF file. animate write psf micelle2.psf In the future you can now load this PSF file first and then the LAMMPS dump file(s) (or a more compact and faster loading DCD or XTC file) with: vmd micelle2.psf -lammpstrj dump.micelle You can use the residue information to join bonds split across the periodic boundaries with: pbc join residue -all and then enjoy a nice visualization of the micelle example with VMD. :) 2c. Problems. The LAMMPS data file format is quite flexible and thus not always easy to parse independent from context. As a consequence, the lmpresidfromdata parser may be confused by your specific setup. 2d. History. First version. 2008, Axel Kohlmeyer akohlmey@cmm.chem.upenn.edu ------------------------- 3. lmpname2vmd.tcl - set atom names based on LAMMPS type in VMD. 3a. Background. LAMMPS dump files contain information about the (numerical) atom type, but not atom names like in PSF or PDB files. The names are used in VMD to guess element, radius and (default) coloring. Adding this information can be very helpful to set convenient defaults for visualization of LAMMPS data in VMD. 3b. Usage. The script defines a new procedure "lmptypetoname". To activate it type at the VMD command prompt: source lmpname2vmd.tcl To then add atom name information, e.g., to a PSF file, see the steps for item 1 from above and then type into the VMD console. lmptypetoname "SOL HDR TL1 TL2" To avoid having to run the script all the time you can save the bonding information in an (incomplete) PSF file. animate write psf micelle3.psf In the future you can now load this PSF file first and then the LAMMPS dump file(s) (or a more compact and faster loading DCD or XTC file) with: vmd micelle3.psf -lammpstrj dump.micelle And you'll see that VMD will assign different colors to the atom types. You cat get the previous coloring back by using the "Type" coloring scheme. 3c. Problems. This script assumes the data originates from a LAMMPS dump file and thus the atoms types are numerical starting from 1. If those have been modified by some means, no name will be assigned. 3d. History. First version. 2008, Axel Kohlmeyer akohlmey@cmm.chem.upenn.edu ------------------------- 4. lmpradius2vmd.tcl - set VdW radius based on LAMMPS type in VMD. 4a. Background. The radii used for VDW and derived representations in VMD are guessed from the atom names. This script offers a convenient way to reset them (e.g. by using the sigma parameters from matching LJ interactions). 4b. Usage. The script defines a new procedure "lmptypetoradius". To activate it type at the VMD command prompt: source lmpradius2vmd.tcl To then add atom radius information, see the steps for item 1 from above and then type into the VMD console. lmptypetoradius "1.00 1.00 0.75 0.50" 4c. Problems. This script assumes the data originates from a LAMMPS dump file and thus the atoms types are numerical starting from 1. If those have been modified by some means, no name will be assigned. There is currently no file format that exports the radius information, so this script/command has to be added, e.g., to "saved states" and other visualization scripts. 4d. History. First version. 2008, Axel Kohlmeyer akohlmey@cmm.chem.upenn.edu
label forloop variable i loop 50 variable F1 equal $i*0.05 variable F2 equal $i*0.05*(-1) fix 1 lo setforce ${F1} 0.0 0.0 fix 2 hi setforce ${F2} 0.0 0.0 dump 3 hi custom 10 dump.myforce id fx run 1000 next i
Instruction how to compile LAMMPS in the amber1 Dear Haining; This instruction is based on the 15Jan2012 version of LAMMPS and our amber1 machine. 1. Download the latest LAMMPS 2. Unzip the file you downloaded. 【自:解压命令 tar -xvf 文件; 而 不是-zxvf。 改于20170507 】 3. go to the library directory, (dir)/lib/ compile the libraries that you want to include in LAMMPS. 3-1. for example, if you want to include ReaxFF into LAMMPS, you should compile it. Go to the reax directory, then type the following: make -f Makefile.ifort 3-2. If the libreax.a file is created, the compile has been done well. 3-3. Open and edit Makefile.lammps. You can refer the following: # Settings that the LAMMPS build will import when this package library is used reax_SYSINC = reax_SYSLIB = -lifcore -lsvml -lompstub -limf reax_SYSPATH = -L/opt/intel/opt/intel/Compiler/11.1/046/lib/intel64 3-4. If you include other packages such as meam, atc, etc. go back to 3-1. 4. go to the main source directory. (dir)/src/ 4-1. Type 'make package-status', then you can see which package will be installed or not. 4-2. Type 'make yes-reax' in order to include the package that you already compiled in the section 3. 4-3. Type 'make package-status' again to check if it does well. 4.4. If you type just 'make' you will see the information. 5. go to the Make directory. (dir)/src/MAKE/ 5-1. rename Makefile.linux into Makefile.(version), for example, Makefile.15Jan12 5-2. open and edit Makefile.15Jan12 as follows CC = mpicxx CCFLAGS = -O DEPFLAGS = -M LINK = mpicxx LINKFLAGS = -O -i-static LIB = -lstdc++ ARCHIVE = ar ARFLAGS = -rc SIZE = size LMP_INC = -DLAMMPS_GZIP MPI_INC = -I/usr/local/mpich-mx-1.2.7..7_i11/include -DMPICH_IGNORE_CXX_SEEK MPI_PATH = -L/usr/local/mpich-mx-1.2.7..7_i11/lib MPI_LIB = -lmpich -lpthread FFT_INC = -I/usr/local/fftw-2.1.5_i10_mx/include -DFFT_FFTW FFT_PATH = -L/usr/local/fftw-2.1.5_i10_mx/lib FFT_LIB = -lfftw 5-3. Do not change any words after this sentences in Makefile. # --------------------------------------------------------------------- # build rules and dependencies # no need to edit this section 6. Now you are ready to install the LAMMPS 6-1. go to (dir)/src 6-2. Type 'make (version name, suffix that you rename in section 5-1.)' make 15Jan12 6-3. If lmp_(version name) is created, you done! Don't forget the details must be changed according to which machine we are going to use. Hope this helps. BK. ------------------------------------------------------- Byung-Hyun Kim Ph. D Candidate Computational Science Center Korea Institute of Science and Technology 39-1 Hawolgok-dong, Seongbuk-gu, Seoul, 136-791, KOREA TEL : +82-2-958-5498 FAX : +82-2-958-5509 Mobile : +82-10-7558-0791 E-mail : bhkim00@kist.re.kr