Commit 95ee6440 authored by Richard Berger's avatar Richard Berger
Browse files

Use pair_map to list pair styles

parent 00b08bb5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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<std::string,PairCreator>();
  pair_map = new PairCreatorMap();

#define PAIR_CLASS
#define PairStyle(key,Class) \
+2 −1
Original line number Diff line number Diff line
@@ -49,7 +49,8 @@ class Force : protected Pointers {
  char *pair_style;

  typedef Pair *(*PairCreator)(LAMMPS *);
  std::map<std::string,PairCreator> *pair_map;
  typedef std::map<std::string,PairCreator> PairCreatorMap;
  PairCreatorMap *pair_map;

  class Bond *bond;
  char *bond_style;
+5 −4
Original line number Diff line number Diff line
@@ -607,10 +607,11 @@ void Info::pair_styles(FILE * out)
  fprintf(out, "\nPair styles:\n");

  vector<string> 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");
}