When I want to modify the SW potential into SW/ZBL potential, just like the Tersoff potential vesus Tersoff/ZBL, I realize how to conduct the SW/ZBL potential in the in.file. Since there is no pair_style command like SW/ZBL in Lammps, so how can I invoke this modified and named SW/ZBL potential? Or maybe generally, how does the Lammps code find the potential code in src folder?
Thanks a lot!
Please see: 3.1. Overview — LAMMPS documentation
The technical details of how this actually is implemented in practice are a bit complex to explain and they also differ between the CMake and traditional make build process. It doesn’t really matter. You just need to put your modified source in the right place and recompile. For CMake you currently need to re-run CMake once (without any arguments outside the build folder) and then it will update the build system (this will be automated very soon, too). LAMMPS will automatically create maps between the pair style name and the C++ class.
You can see from running LAMMPS with the -h flag whether the new pair style is present.