diff --git a/src/KOKKOS/atom_kokkos.cpp b/src/KOKKOS/atom_kokkos.cpp index bd96f2ff9f..938d9709e9 100644 --- a/src/KOKKOS/atom_kokkos.cpp +++ b/src/KOKKOS/atom_kokkos.cpp @@ -379,10 +379,14 @@ void AtomKokkos::sync_modify(ExecutionSpace execution_space, unsigned int datama AtomVec *AtomKokkos::new_avec(const std::string &style, int trysuffix, int &sflag) { + // check if avec already exists, if so this is a hybrid substyle + + int hybrid_substyle_flag = (avec != nullptr); + AtomVec *avec = Atom::new_avec(style, trysuffix, sflag); if (!avec->kokkosable) error->all(FLERR, "KOKKOS package requires a kokkos enabled atom_style"); - if (!avecKK) // for hybrid + if (!hybrid_substyle_flag) avecKK = dynamic_cast(avec); return avec;