diff --git a/src/KOKKOS/fix_nh_kokkos.cpp b/src/KOKKOS/fix_nh_kokkos.cpp index 1b87b3c775..d9634b9d8b 100644 --- a/src/KOKKOS/fix_nh_kokkos.cpp +++ b/src/KOKKOS/fix_nh_kokkos.cpp @@ -50,6 +50,7 @@ template FixNHKokkos::FixNHKokkos(LAMMPS *lmp, int narg, char **arg) : FixNH(lmp, narg, arg) { kokkosable = 1; + atomKK = (AtomKokkos *)atom; domainKK = (DomainKokkos *) domain; execution_space = ExecutionSpaceFromDevice::space; @@ -289,7 +290,7 @@ void FixNHKokkos::remap() double oldlo,oldhi; double expfac; - int nlocal = atom->nlocal; + int nlocal = atomKK->nlocal; double *h = domain->h; // omega is not used, except for book-keeping @@ -298,13 +299,15 @@ void FixNHKokkos::remap() // convert pertinent atoms and rigid bodies to lamda coords - domainKK->x2lamda(nlocal); - //if (allremap) domainKK->x2lamda(nlocal); - //else { - // for (i = 0; i < nlocal; i++) - // if (mask[i] & dilate_group_bit) - // domain->x2lamda(x[i],x[i]); - //} + x = atomKK->k_x.template view(); + + if (allremap) domainKK->x2lamda(nlocal); + else { + for ( int i = 0; i < nlocal; i++) + if (mask[i] & dilate_group_bit) + domainKK->x2lamda(&x(i,0), &x(i,0)); + } + if (rfix.size() > 0) error->all(FLERR,"Cannot (yet) use rigid bodies with fix nh and Kokkos"); @@ -446,13 +449,19 @@ void FixNHKokkos::remap() // convert pertinent atoms and rigid bodies back to box coords - domainKK->lamda2x(nlocal); + //domainKK->lamda2x(nlocal); //if (allremap) domainKK->lamda2x(nlocal); //else { // for (i = 0; i < nlocal; i++) // if (mask[i] & dilate_group_bit) // domain->lamda2x(x[i],x[i]); //} + if (allremap) domainKK->lamda2x(nlocal); + else { + for ( int i = 0; i < nlocal; i++) + if (mask[i] & dilate_group_bit) + domainKK->lamda2x(&x(i,0), &x(i,0)); + } // for (auto &ifix : rfix) ifix->deform(1); }