minor code modification request

Dear LAMMPS developers,

Long time ago we’ve successfully compiled lammps as a static library and used it from potfit force-matching code (http://potfit.sourceforge.net) to perform reaxff potential fitting.

More recently we’ve started discussion with potfit developers about including our modifications to potfit. It would be best if one could simply download latest version of lammps, compile it as a library, and compile potfit with it. The C interface that is needed for potfit is supposed to be provided with potfit through library.cpp and library.h files.

At the present moment, everything works fine with the latest lammps version (10Aug15) but after minor modifications in pair.h and pair_reax_c.h files. These modifications are needed to directly set reaxff potential parameters in lammps without writing&reading potential files. The way we set the parameters in library.cpp is similar to what is happening in coeff function in PairReaxC class (pair_reax_c.cpp). However, there are five following properties in this class that can not be accessed from library.cpp because they are declared as private/protected:

pair_reax_c.h:
int *map;
double *chi,*eta,*gamma;

pair.h:

int allocated;

The first four are directly related to reaxff and thus must be set. The latter one should be set to 1 not to get message: ERROR: All pair coeffs are not set (…/pair.cpp:218).

To make everything work I’ve moved these properties to public regions of their classes, which might not be a best practice. However, to allow users to simply replace library.h and library.cpp files without forcing them to do these manual modifications, I’d like to ask if it’s possible to provide (in future releases) set/get method(s) for the properties or any other way to safely (without breaking encapsulation) set/get them from outside their class.

yes, that should be possible - we’ll take a look and include
the mods in a patch soon.

If the potfit tool is something that can be used easily with
LAMMPS and is of general interest, we can advertise
it on the LAMMPS web pages as an auxiliary tool, like
here:

http://lammps.sandia.gov/offsite.html
http://lammps.sandia.gov/prepost.html

Just send us a paragraph or two of content and the
appropriate links, names?

Thanks,
Steve

Dear Steve,

Thank you very much for your reply. We will provide information about the potfit code once the new version combined with lammps is released.