corret strmatch() semantics and restore strcmp() in extract function

This commit is contained in:
Axel Kohlmeyer
2020-09-28 13:49:38 -04:00
parent c217c8df24
commit 3b1d07225d

View File

@ -286,7 +286,7 @@ void PairCoulTT::init_style()
error->all(FLERR,"Pair style coul/tt requires atom attribute q");
int ifix;
for (ifix = 0; ifix < modify->nfix; ifix++)
if (utils::strmatch(modify->fix[ifix]->style,"drude") == 0) break;
if (utils::strmatch(modify->fix[ifix]->style,"^drude")) break;
if (ifix == modify->nfix) error->all(FLERR, "Pair coul/tt requires fix drude");
fix_drude = (FixDrude *) modify->fix[ifix];
@ -438,9 +438,9 @@ double PairCoulTT::single(int i, int j, int itype, int jtype,
void *PairCoulTT::extract(const char *str, int &dim)
{
dim = 2;
if (utils::strmatch(str,"scale") == 0) return (void *) scale;
if (utils::strmatch(str,"b") == 0) return (void *) b;
if (utils::strmatch(str,"c") == 0) return (void *) c;
if (utils::strmatch(str,"ntt") == 0) return (void *) ntt;
if (strcmp(str,"scale") == 0) return (void *) scale;
if (strcmp(str,"b") == 0) return (void *) b;
if (strcmp(str,"c") == 0) return (void *) c;
if (strcmp(str,"ntt") == 0) return (void *) ntt;
return nullptr;
}