more accurate checking for styles using utils::strmatch() instead of strcmp() or strncmp()
This commit is contained in:
@ -31,6 +31,7 @@
|
||||
#include "math_const.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
#include "utils.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
using namespace FixConst;
|
||||
@ -375,8 +376,7 @@ void FixAdapt::init()
|
||||
|
||||
// if pair hybrid, test that ilo,ihi,jlo,jhi are valid for sub-style
|
||||
|
||||
if (strcmp(force->pair_style,"hybrid") == 0 ||
|
||||
strcmp(force->pair_style,"hybrid/overlay") == 0) {
|
||||
if (utils::strmatch(force->pair_style,"^hybrid")) {
|
||||
PairHybrid *pair = (PairHybrid *) force->pair;
|
||||
for (i = ad->ilo; i <= ad->ihi; i++)
|
||||
for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
|
||||
@ -416,8 +416,7 @@ void FixAdapt::init()
|
||||
|
||||
if (ad->bdim == 1) ad->vector = (double *) ptr;
|
||||
|
||||
if (strcmp(force->bond_style,"hybrid") == 0 ||
|
||||
strcmp(force->bond_style,"hybrid_overlay") == 0)
|
||||
if (utils::strmatch(force->bond_style,"^hybrid"))
|
||||
error->all(FLERR,"Fix adapt does not support bond_style hybrid");
|
||||
|
||||
delete [] bstyle;
|
||||
|
||||
Reference in New Issue
Block a user