[lammps-users] new pair-style

Dear all

regarding lj/cut pair style in the source of Lammps, I tried to make new pair style for implementing hydrophobic interaction. When I added the Pair_lj_hyd.cpp and Pair_lj_hyd.h to the “src” directory and rebuild Lammps, I did not see any error. (for some reason I ignored the rRESPA sections).

But after running my script, I have gotten “ERROR: Unrecognized pair style ‘ljh’ (src/force.cpp:285)”.ljh is my pair style. Also, my new pair style is included in the “style_pair.h”.

I am confused about this error. I would be glad for any help.

Which LAMMPS version are you using? what platform are you compiling on? and how did you configure/compile LAMMPS?

Dear Dr. Axel Kohlmeyer
I am using Lammps-7Aug19 on the ubuntu 18.04.
Best regards

that still doesn’t tell me how you configured and compiled LAMMPS, which is crucial information.

Dear Dr. Axel Kohlmeyer
I just used the command “make no-all purge” and then by using “cmake …/cmake and cmake --build .” I tried to rebuild lammps.
Best regards
Masoud

Dear Dr. Axel Kohlmeyer
I just used the command “make no-all purge” and then by using “cmake …/cmake and cmake --build .” I tried to rebuild lammps.

if you did “cmake …/cmake” after you copied the files to the src folder, then there is something not quite correct with the files. Can you provide the equivalent of the following section

#ifdef PAIR_CLASS
// clang-format off
PairStyle(lj/cut,PairLJCut);
// clang-format on
#else
#ifndef LMP_PAIR_LJ_CUT_H
#define LMP_PAIR_LJ_CUT_H

#include “pair.h”

namespace LAMMPS_NS {

class PairLJCut : public Pair {
public:
PairLJCut(class LAMMPS *);

for your new file? and also the complete output of “cmake --build .” and “./lmp -h”?

If you ran “cmake …/cmake” before you copied the files to src, please run “cmake .” in your build folder and then “cmake --build .” again, and also provide the complete output of “cmake --build .” and “./lmp -h”?

When building with CMake you have to re-run cmake configuration whenever you add files to update the list of sources since the CMake scripts use globbing instead of explicit lists of sources in the generated makefiles. With GNU make that globbing is done inside the makefiles directly (but you need to make/update copies of files from packages instead).

Axel.