Skip to content

Reproduce: make

Tongqi Wen edited this page Jun 19, 2020 · 9 revisions

First, the package would check if the vasp_lmp_path exists or not. If not, an error "please do VASP or LAMMPS calcualtions first" would be printed out. Then, the VASP and LAMMPS task numbers which are to be reproduced are counted and if the task numbers are 0, an error "Please do VASP or LAMMPS calculations first" would occur. According to whether OUTCAR or log.lammps exists in the original task directory, we can divide the process of generating input configuration into two types: 1. VASP to LAMMPS, 2. LAMMPS to VASP. We take the input example in the previous section to explain these two processes.

VASP to LAMMPS

Step 1. Here we start from the vasp/confs/mp-*/eos_00/task.000000 directory, all the energy values in the OUTCAR file are appended in an energies list. Then deepmd/confs/mp-*/eos_reprod/XDATCAR would link to vasp/confs/mp-*/eos_00/task.000000/XDATCAR.

Step 2. If the total frame number in XDATCAR is larger than the length of energies list, the last frames in XDATCAR whose number is equal to the length of energies list would be used. So let's suppose now we have n frames with configuration and the corresponding energy.

Step 3. For n frames, the task directory in deepmd/confs/mp-*/eos_reprod would be built based on the task id up to now. If there are already old input files including INCAR, POTCAR, POSCAR.orig, POSCAR, conf.lmp, and in.lammps in the task directory, they will be deleted to avoid redundancy. The corresponding frame would also be written to the new POSCAR file.

Step 4. When vasp/confs/mp-*/eos_00/task.000000 is finished, we will then repeat the above steps to vasp/confs/mp-*/eos_00/task.000001,...,vasp/confs/mp-*/eos_00/task.[0-9]*[0-9] in sequence.

Step 5. The following is an example of in.lammps for LAMMPS reproduce:

clear
units 	metal
dimension	3
boundary	p	p    p
atom_style	atomic
box         tilt large
read_data   conf.lmp
mass            1 1
neigh_modify    every 1 delay 0 check no
pair_style deepmd graph.002.pb graph.000.pb graph.003.pb graph.001.pb  out_freq 10 out_file model_devi.out
pair_coeff
compute         mype all pe
thermo          100
thermo_style    custom step pe pxx pyy pzz pxy pxz pyz lx ly lz vol c_mype
dump            1 all custom 100 dump.relax id type xs ys zs fx fy fz
run    0
variable        N equal count(all)
variable        V equal vol
variable        E equal "c_mype"
variable        tmplx equal lx
variable        tmply equal ly
variable        Pxx equal pxx
variable        Pyy equal pyy
variable        Pzz equal pzz
variable        Pxy equal pxy
variable        Pxz equal pxz
variable        Pyz equal pyz
variable        Epa equal ${E}/${N}
variable        Vpa equal ${V}/${N}
variable        AA equal (${tmplx}*${tmply})
print "All done"
print "Total number of atoms = ${N}"
print "Final energy per atoms = ${Epa}"
print "Final volume per atoms = ${Vpa}"
print "Final Base area = ${AA}"
print "Final Stress (xx yy zz xy xz yz) = ${Pxx} ${Pyy} ${Pzz} ${Pxy} ${Pxz} ${Pyz}"

LAMMPS to VASP

Step 1. Check if dump.relax file exists, if not, an error would occur "the LAMMPS calculations should output the snapshots as dump.relax". Then for dump.relax file, we can get the energy for every configuration and put them sequentially in an energies list.

Step 2. The rest is similar to that in VASP to LAMMPS. We build the task directory based on the current task id, remove old input files, and then transfer the configuration in dump file to POSCAR one by one by dpdata. In VASP reproduce, NSW is shifted to 0.

Clone this wiki locally