Bug with LAMMPS_POTENTIALS and tabulated potentials

The "table" pair style doesn't seem to respect the LAMMPS_POTENTIALS
directory. Line 346 and those that follow of pair_table.cpp are the
culprit. (As of 12 Feb 2014 version).

P.S. Thanks so much for creating this feature---I'm only embarrassed that
it took me six months to notice it. It will save me from setting a
variable to hold my potentials directory in every file and then updating
that line every time I transfer an input file between systems.

Karl D. Hammond
University of Tennessee, Knoxville

"You can never know everything, and part of what you know is always
   wrong. A portion of wisdom lies in knowing that. A portion of courage
   lies in going on anyway."
"Nothing ever goes as you expect. Expect nothing, and you will not be
   surprised."

The "table" pair style doesn't seem to respect the LAMMPS_POTENTIALS
directory. Line 346 and those that follow of pair_table.cpp are the
culprit. (As of 12 Feb 2014 version).

yes. the intent was to apply this to manybody potentials and anything
that might get installed system wide (e.g. on rpm package or windows
installations).
since tables are typically user generated, it may be preferable to use
a different environment variable, say LAMMPS_TABLES for this. so that
one can have both.

P.S. Thanks so much for creating this feature---I'm only embarrassed that
it took me six months to notice it. It will save me from setting a
variable to hold my potentials directory in every file and then updating
that line every time I transfer an input file between systems.

you're welcome.

axel.

FYI, the necessary change to hook up tables to LAMMPS_POTENTIALS is simple.

diff --git a/src/pair_table.cpp b/src/pair_table.cpp
index d6ea173..f12271a 100644
--- a/src/pair_table.cpp
+++ b/src/pair_table.cpp
@@ -343,7 +343,7 @@ void PairTable::read_table(Table *tb, char *file, char *keyw

   // open file

- FILE *fp = fopen(file,"r");
+ FILE *fp = open_potential(file);
   if (fp == NULL) {
     char str[128];
     sprintf(str,"Cannot open file %s",file);

made the change - will be in the next patch

Steve