From b16bca2f45d5b4de23957a30e36b8b66db7b7501 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 6 Aug 2021 12:09:06 -0400 Subject: [PATCH] simplify --- src/velocity.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/velocity.cpp b/src/velocity.cpp index acc374fa4a..9397e41861 100644 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -849,15 +849,11 @@ void Velocity::options(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"temp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command"); - int icompute; - for (icompute = 0; icompute < modify->ncompute; icompute++) - if (strcmp(arg[iarg+1],modify->compute[icompute]->id) == 0) break; - if (icompute == modify->ncompute) - error->all(FLERR,"Could not find velocity temperature ID"); + int icompute = modify->find_compute(arg[iarg+1]); + if (icompute < 0) error->all(FLERR,"Could not find velocity temperature ID"); temperature = modify->compute[icompute]; if (temperature->tempflag == 0) - error->all(FLERR, - "Velocity temperature ID does not compute temperature"); + error->all(FLERR,"Velocity temperature ID does not compute temperature"); iarg += 2; } else if (strcmp(arg[iarg],"bias") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command");