diff --git a/src/force.cpp b/src/force.cpp index 37ac4f4ee6..9d751d0b31 100644 --- a/src/force.cpp +++ b/src/force.cpp @@ -78,7 +78,7 @@ Force::Force(LAMMPS *lmp) : Pointers(lmp) // fill pair map with pair styles listed in style_pair.h - pair_map = new std::map(); + pair_map = new PairCreatorMap(); #define PAIR_CLASS #define PairStyle(key,Class) \ diff --git a/src/force.h b/src/force.h index 1873173a74..4c1f81c21f 100644 --- a/src/force.h +++ b/src/force.h @@ -49,7 +49,8 @@ class Force : protected Pointers { char *pair_style; typedef Pair *(*PairCreator)(LAMMPS *); - std::map *pair_map; + typedef std::map PairCreatorMap; + PairCreatorMap *pair_map; class Bond *bond; char *bond_style; diff --git a/src/info.cpp b/src/info.cpp index 4166238e66..52f1f56cf7 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -607,10 +607,11 @@ void Info::pair_styles(FILE * out) fprintf(out, "\nPair styles:\n"); vector styles; -#define PAIR_CLASS -#define PairStyle(key,Class) styles.push_back(#key); -#include "style_pair.h" -#undef PAIR_CLASS + + for(Force::PairCreatorMap::iterator it = force->pair_map->begin(); it != force->pair_map->end(); ++it) { + styles.push_back(it->first); + } + print_columns(out, styles); fprintf(out, "\n\n\n"); }