address logic error with check for KOKKOS version of hybrid styles

This commit is contained in:
Axel Kohlmeyer
2020-07-03 09:01:59 -04:00
parent 2c64809cd8
commit 735f9ad592
2 changed files with 4 additions and 6 deletions

View File

@ -28,6 +28,7 @@
#include "respa.h"
#include "utils.h"
#include "suffix.h"
#include "fmt/format.h"
using namespace LAMMPS_NS;
@ -265,6 +266,9 @@ void PairHybrid::allocate()
void PairHybrid::settings(int narg, char **arg)
{
if (narg < 1) error->all(FLERR,"Illegal pair_style command");
if (lmp->kokkos && !utils::strmatch(force->pair_style,"^hybrid.*/kk$"))
error->all(FLERR,fmt::format("Must use pair_style {}/kk with Kokkos",
force->pair_style));
// delete old lists, since cannot just change settings
@ -433,9 +437,6 @@ void PairHybrid::coeff(int narg, char **arg)
if (narg < 3) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
if (lmp->kokkos)
error->all(FLERR,"Must use pair_style hybrid/kk with Kokkos");
int ilo,ihi,jlo,jhi;
force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi);
force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi);