?==?utf-8?q? ?==?utf-8?q? Install/add rebomos pair style to LAMMPS

I'm not sure that I have well undertood your question, but I try to answer it:

My input file is in another folder than the lammps folder.
In that folder : "MoSrebomos", I just have the input file and the file MoS.REBO.set5b.

In the lammps/src folder I have added the file rebomos.cpp and rebomos.h which seems to have been compiled.

In the ./bashrc file I have exported the PATH of LAMMPS folder:
export PATH=/home/timothee/lammps/src:{PATH}:
export PATH=/home/timothee/lammps/:{PATH}:

As I understand the executable is rebomos.cpp => I didn't copied it in to MoSrebomos folder.

In copied-executable.png attached, I do it but it still doesn't work.
Thus, I'm not convinced that l'm calling a previously installed executable/rebomos.cpp.

Tim

copied-executable.png

compilation.png

compiled-executable.png

I’m not sure that I have well undertood your question, but I try to answer it:

My input file is in another folder than the lammps folder.
In that folder : “MoSrebomos”, I just have the input file and the file MoS.REBO.set5b.

In the lammps/src folder I have added the file rebomos.cpp and rebomos.h which seems to have been compiled.

In the ./bashrc file I have exported the PATH of LAMMPS folder:
export PATH=/home/timothee/lammps/src:{PATH}:
export PATH=/home/timothee/lammps/:{PATH}:

these two statements are incorrect. the way you compiled LAMMPS (using the traditional make procedure) you only need to add ${HOME}/lammps/src to PATH. but /home… is going to be an invalid path, so it is being ignored.

you can always check which lammps executable is going to be picked up by typing:
which lmp_serial
or:
type lmp_serial

you can always determine if the executable has the desired (optional) feature by running:
lmp_serial -h

this should show you

As I understand the executable is rebomos.cpp => I didn’t copied it in to MoSrebomos folder.

no, that is not the executable and copying that would also not have an impact. what matters is the location of lmp_serial and whether it is in a folder listed in ${PATH} or not.

BTW: using the compilation folder in you PATH is not such a great idea. what happens, if you suddenly make more changes and compile again (and break something in the process). suddenly you will use the broken version in your simulation. thus either copy the executable (lmp_serial) and run it like this:
./lmp_serial -in in.put.file -log log.file
or copy the (tried and tested) compiled executable to a local location, e.g. to ${HOME}/.local/bin and then add this folder to the path (if you compile using cmake, and do “make install” this will be the default setting. the conventional build has no “install” target.) via:

PATH={HOME}/.local/bin:{PATH}
export PATH

(note, the proper variable expansion and no trailing colon).

axel.

Effectively, by running the newly compiled executable it worked out, the previous executable was not the good one.
By running ./lmp-serial -h in src folder, the rebomos files indeed appears.

Then I moved my input folder in the SRC folder and did :
./lmp_serial -in Dynamique_Moleculaire/MoS_REBO_fordistribution/test.in
in the src folder, and it works.

Many thanks for your precise advices Axel & Steve.

However I'm facing another error message for the next line:
./lmp_serial -in Dynamique_Moleculaire/MoS_REBO_fordistribution/test.in
LAMMPS (7 Aug 2019)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:93)
  using 1 OpenMP thread(s) per MPI task
Created orthogonal box = (0 0 0) to (100 100 100)
  1 by 1 by 1 MPI processor grid
Lattice spacing in x,y,z = 3.17 12.288 5.4906
Created 58016 atoms
  create_atoms CPU = 0.0148368 secs
ERROR: Incorrect args for pair coefficients (../pair_rebomos.cpp:159)
Last command: pair_coeff * * MoS.REBO.set5b M S

I have just copied the two lines as mentioned here after defining the simulation box and the lattice : https://research.matse.psu.edu/sinnott/software
but it doesn't work.
Do you have an idea to explain why it's not working for the pair_coefficients command ?
Is it a missing package or a missing prerequisite command or anything else ?

Tim

installed package.png

Screenshot from 2019-11-13 04-23-16.png

Screenshot from 2019-11-13 04-30-08.png

test.in (1.38 KB)

Screenshot from 2019-11-13 04-13-51.png

[…]

However I’m facing another error message for the next line:
./lmp_serial -in Dynamique_Moleculaire/MoS_REBO_fordistribution/test.in
LAMMPS (7 Aug 2019)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (…/comm.cpp:93)
using 1 OpenMP thread(s) per MPI task
Created orthogonal box = (0 0 0) to (100 100 100)
1 by 1 by 1 MPI processor grid
Lattice spacing in x,y,z = 3.17 12.288 5.4906
Created 58016 atoms
create_atoms CPU = 0.0148368 secs
ERROR: Incorrect args for pair coefficients (…/pair_rebomos.cpp:159)
Last command: pair_coeff * * MoS.REBO.set5b M S

I have just copied the two lines as mentioned here after defining the simulation box and the lattice : https://research.matse.psu.edu/sinnott/software
but it doesn’t work.

Do you have an idea to explain why it’s not working for the pair_coefficients command ?
Is it a missing package or a missing prerequisite command or anything else ?

please note, that you are asking a question about a pair style that is not part of LAMMPS. If it were part of LAMMPS, there would be documentation explaining the details how to use it correctly. From the file name it looks like it is based on the AIREBO pair style, so you may try to guess what is wrong from there, but ultimately you have to ask the authors of this add-on software for documentation and help, as it is their code and none of us knows any specifics.

axel.

Perhaps it’s because your “data” file does not contain two atom types? The error message comes from this piece of code:

158 if (narg != 3 + atom->ntypes)
159 error->all(FLERR,“Incorrect args for pair coefficients”);

Bruce

"""
Perhaps it's because your "data" file does not contain two atom types? The
error message comes from this piece of code:

158 if (narg != 3 + atom->ntypes)
159 error->all(FLERR,"Incorrect args for pair coefficients");

Bruce
"""

Effectively as Bruce explained me, by defining the two types of atoms : Mo and S in a data file , it works.
It was my fault, the Rebomos package works correctly, no problem on that side.
Many many thanks for your advice Bruce.

Here is the data file :
LAMMPS 1_3 monolayer

       6 atoms

         2 atom types

#Cell: Hexagonal
         0.0000 3.16000 xlo xhi
         0.0000 5.47300 ylo yhi
         0.0000 32.0000 zlo zhi

Masses

      1 95.940 # Mo
      2 32.065 # Se1

Atoms

1 1 1.580 4.56107 16.760
2 1 0.000 1.82443 16.760
3 2 1.580 0.91221 18.300
4 2 0.000 3.64885 18.300
5 2 1.580 0.91221 15.220
6 2 0.000 3.64885 15.220

Tim