simplify checking for per chunk compute

This commit is contained in:
Axel Kohlmeyer
2019-07-29 20:35:24 -04:00
parent 180c90acfb
commit 5cb02781c2

View File

@ -23,6 +23,7 @@
#include "input.h"
#include "memory.h"
#include "error.h"
#include "utils.h"
using namespace LAMMPS_NS;
@ -116,9 +117,7 @@ ComputeChunkSpreadAtom(LAMMPS *lmp, int narg, char **arg) :
error->all(FLERR,"Compute ID for compute chunk/spread/atom "
"does not exist");
char *ptr = strstr(modify->compute[icompute]->style,"/chunk");
if (!ptr || (ptr != modify->compute[icompute]->style +
strlen(modify->compute[icompute]->style) - strlen("/chunk")))
if (!utils::strmatch(modify->compute[icompute]->style,"/chunk$")
error->all(FLERR,"Compute for compute chunk/spread/atom "
"does not calculate per-chunk values");