lammps/examples/COUPLE/lammps_quest58443251c31fmaster
lammps_quest
README
This directory has an application that runs classical MD via LAMMPS, but uses quantum forces calculated by the Quest DFT (density functional) code in place of the usual classical MD forces calculated by a pair style in LAMMPS.
lmpqst.cpp main program
it links LAMMPS as a library it invokes Quest as an executable
in.lammps LAMMPS input script, without the run command si_111.in Quest input script for an 8-atom Si unit cell lmppath.h contains path to LAMMPS home directory qstexe.h contains full pathname to Quest executable
After editing the Makefile, lmppath.h, and qstexe.h to make them suitable for your box, type:
g++ -f Makefile.g++
and you should get the lmpqst executable.
You can run lmpqst in serial or parallel as:
% lmpqst Niter in.lammps in.quest % mpirun -np 4 lmpqst Niter in.lammps in.quest
where
Niter = # of MD iterations in.lammps = LAMMPS input script in.quest = Quest input script
The log files are for this run:
% lmpqst 10 in.lammps si_111.in
This application is an example of a coupling where the driver code (lmpqst) runs one code (LAMMPS) as an outer code and facilitates it calling the other code (Quest) as an inner code. Specifically, the driver (lmpqst) invokes one code (LAMMPS) to perform its timestep loop, and grabs information from the other code (Quest) during its timestep. This is done in LAMMPS using the fix external command, which makes a "callback" to the driver application (lmpqst), which in turn invokes Quest with new atom coordinates, lets Quest compute forces, and returns those forces to the LAMMPS fix external.
The driver code launches LAMMPS in parallel. But Quest is only run on a single processor. It would be possible to change this by using a parallel build of Quest.
Since Quest does not currently have a library interface, the driver code interfaces with Quest via input and output files.
Note that essentially 100% of the run time for this coupled application is spent in Quest, as the quantum calculation of forces dominates the calculation.
You can look at the log files in the directory to see sample LAMMPS output for this simulation. Dump files produced by LAMMPS are stored as dump.md.