Customized pair potentials not running - invalid pair style

Hi lammps users,

we made a new pair_style called with files:

pair_prog.cpp
pair_prog.h
user_style.h

In user_style.h we have added then following:

#ifdef PairInclude
#include “pair_prog.h”
#endif

Everything compiles but when i try to run lammps and type in: pair_style prog we get:

ERROR: invalid pair style

Nithin

Hi lammps users,

we made a new pair_style called with files:

pair_prog.cpp
pair_prog.h
user_style.h

In user_style.h we have added then following:

#ifdef PairInclude
      #include "pair_prog.h"
#endif

Everything compiles but when i try to run lammps and type in: pair_style
prog we get:

ERROR: invalid pair style

​there is a lot of information missing here, e.g.:​

- ​which version of LAMMPS is for?
- what platform are you on?
- where did you get the instructions to edit a "user_style.h" file?​
- did you recompile after adding the files?
- what does your PairStyle() macro look like and what is your pair_style
command?

axel.

  • Since I am taking over a project of a previous student, I am using an older version of lammps: lammps-20feb10.
  • I am using MAC OS Sierra v 10.12.3.
  • I did not get these instructions from the website, I was told to do so by my collegeaue who made the original code.
  • Yes I did recompile them successfully.
  • What do you mean with PairStyle() macro, where can I find it?

thnx,

Nithin

- Since I am taking over a project of a previous student, I am using an
older version of lammps: lammps-20feb10.

​consider upgrading. many, many, many bugs have been fixed and many, many
improvements added over the last 7 years.
depending on how complex the pair style is, there changes are likely to be
fairly small.
this is too old a version for any developers to seriously care about
addressing any problems with it.
in almost all cases, it is highly advisable to upgrade, especially when you
are new to a project.

- I am using MAC OS Sierra v 10.12.3.
- I did not get these instructions from the website, I was told to do so
by my collegeaue who made the original code.

​in current LAMMPS versions, no manual changes are needed. you type "make
mpi" and any *_style.h file will be automatically updated, if there are new
source files added.​ for your old version, you have to refer to the manual
for this specific version.

- Yes I did recompile them successfully.
- What do you mean with PairStyle() macro, where can I find it?

​it should be in ​pair_<yourstyle>.h​ this macro matches pair_style
commands with individual pair style classes.

axel.

I’ve spotted the mistake. The following was missing in the header file:

#ifdef PAIR_CLASS

PairStyle(prog,PairProg)