more accurate matching of styles using utils::strmatch()

This commit is contained in:
Axel Kohlmeyer
2019-04-04 17:10:27 -04:00
parent df94e80bb1
commit dbbf198edb
3 changed files with 9 additions and 6 deletions

View File

@ -38,6 +38,7 @@
#include "timer.h"
#include "memory.h"
#include "error.h"
#include "utils.h"
#include "pair_hybrid.h"
using namespace LAMMPS_NS;
@ -120,7 +121,7 @@ Respa::Respa(LAMMPS *lmp, int narg, char **arg) :
iarg += 2;
} else if (strcmp(arg[iarg],"hybrid") == 0) {
// the hybrid keyword requires a hybrid pair style
if (!strstr(force->pair_style,"hybrid"))
if (!utils::strmatch(force->pair_style,"^hybrid"))
error->all(FLERR,"Illegal run_style respa command");
PairHybrid *hybrid = (PairHybrid *) force->pair;
nhybrid_styles = hybrid->nstyles;