replace strstr with utils::strmatch

This commit is contained in:
abhishandy 2020-08-10 16:28:42 -04:00
parent a83147ce20
commit a7fee0a96f
6 changed files with 15 additions and 15 deletions

View File

@ -689,7 +689,7 @@ void PairLJCharmmCoulLong::init_style()
int irequest;
int respa = 0;
if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) {
if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
}
@ -718,7 +718,7 @@ void PairLJCharmmCoulLong::init_style()
// set & error check interior rRESPA cutoffs
if (strstr(update->integrate_style,"respa") &&
if (utils::strmatch(update->integrate_style,"^respa") &&
((Respa *) update->integrate)->level_inner >= 0) {
cut_respa = ((Respa *) update->integrate)->cutoff;
cut_in_off = cut_respa[0];

View File

@ -659,7 +659,7 @@ void PairLJCutCoulLong::init_style()
int irequest;
int respa = 0;
if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) {
if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
}
@ -676,7 +676,7 @@ void PairLJCutCoulLong::init_style()
// set rRESPA cutoffs
if (strstr(update->integrate_style,"respa") &&
if (utils::strmatch(update->integrate_style,"^respa") &&
((Respa *) update->integrate)->level_inner >= 0)
cut_respa = ((Respa *) update->integrate)->cutoff;
else cut_respa = NULL;

View File

@ -688,12 +688,12 @@ void PairLJCharmmCoulLongSoft::init_style()
error->all(FLERR,
"Pair style lj/charmm/coul/long/soft requires atom attribute q");
// request regular or rRESPA neighbor list
// request regular or rRESPA neighbor lists
int irequest;
int respa = 0;
if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) {
if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
}
@ -721,7 +721,7 @@ void PairLJCharmmCoulLongSoft::init_style()
// set & error check interior rRESPA cutoffs
if (strstr(update->integrate_style,"respa") &&
if (utils::strmatch(update->integrate_style,"^respa") &&
((Respa *) update->integrate)->level_inner >= 0) {
cut_respa = ((Respa *) update->integrate)->cutoff;
if (MIN(cut_lj,cut_coul) < cut_respa[3])

View File

@ -631,12 +631,12 @@ void PairLJCutCoulLongSoft::init_style()
if (!atom->q_flag)
error->all(FLERR,"Pair style lj/cut/coul/long/soft requires atom attribute q");
// request regular or rRESPA neighbor list
// request regular or rRESPA neighbor lists
int irequest;
int respa = 0;
if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) {
if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
}
@ -653,7 +653,7 @@ void PairLJCutCoulLongSoft::init_style()
// set rRESPA cutoffs
if (strstr(update->integrate_style,"respa") &&
if (utils::strmatch(update->integrate_style,"^respa") &&
((Respa *) update->integrate)->level_inner >= 0)
cut_respa = ((Respa *) update->integrate)->cutoff;
else cut_respa = NULL;

View File

@ -509,12 +509,12 @@ void PairLJCutSoft::coeff(int narg, char **arg)
void PairLJCutSoft::init_style()
{
// request regular or rRESPA neighbor list
// request regular or rRESPA neighbor lists
int irequest;
int respa = 0;
if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) {
if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
}
@ -529,7 +529,7 @@ void PairLJCutSoft::init_style()
// set rRESPA cutoffs
if (strstr(update->integrate_style,"respa") &&
if (utils::strmatch(update->integrate_style,"^respa") &&
((Respa *) update->integrate)->level_inner >= 0)
cut_respa = ((Respa *) update->integrate)->cutoff;
else cut_respa = NULL;

View File

@ -484,7 +484,7 @@ void PairLJCut::init_style()
int irequest;
int respa = 0;
if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) {
if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
}
@ -499,7 +499,7 @@ void PairLJCut::init_style()
// set rRESPA cutoffs
if (strstr(update->integrate_style,"respa") &&
if (utils::strmatch(update->integrate_style,"^respa") &&
((Respa *) update->integrate)->level_inner >= 0)
cut_respa = ((Respa *) update->integrate)->cutoff;
else cut_respa = NULL;