diff --git a/src/KOKKOS/fix_viscous_kokkos.cpp b/src/KOKKOS/fix_viscous_kokkos.cpp index 6fb2bd9d6a..80ddff2fce 100644 --- a/src/KOKKOS/fix_viscous_kokkos.cpp +++ b/src/KOKKOS/fix_viscous_kokkos.cpp @@ -17,16 +17,12 @@ #include "atom_kokkos.h" #include "update.h" #include "modify.h" -#include "domain.h" #include "input.h" -#include "variable.h" #include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" #include "kokkos_base.h" -#include - using namespace LAMMPS_NS; using namespace FixConst; @@ -49,7 +45,6 @@ template FixViscousKokkos::~FixViscousKokkos() { if (copymode) return; - } /* ---------------------------------------------------------------------- */ @@ -61,10 +56,9 @@ void FixViscousKokkos::init() k_gamma = Kokkos::DualView("FixViscousKokkos:gamma",atom->ntypes+1); - gamma2 = k_gamma.template view(); - - for (int i = 1; i <= atom->ntypes; i++) k_gamma.h_view(i) = gamma[i]; + for (int i = 1; i <= atom->ntypes; i++) k_gamma.h_view(i) = gamma[i]; + k_gamma.template modify(); k_gamma.template sync(); if (utils::strmatch(update->integrate_style,"^respa")) @@ -76,7 +70,7 @@ void FixViscousKokkos::init() template void FixViscousKokkos::post_force(int /*vflag*/) { - atomKK->sync(execution_space, V_MASK | F_MASK | MASK_MASK); + atomKK->sync(execution_space, V_MASK | F_MASK | MASK_MASK | TYPE_MASK); v = atomKK->k_v.view(); f = atomKK->k_f.view(); @@ -90,14 +84,13 @@ void FixViscousKokkos::post_force(int /*vflag*/) copymode = 0; atomKK->modified(execution_space, F_MASK); - } template KOKKOS_INLINE_FUNCTION void FixViscousKokkos::operator()(TagFixViscous, const int &i) const { if (mask[i] & groupbit) { - double drag = gamma2(type[i]); + double drag = k_gamma.d_view(type[i]); f(i,0) -= drag*v(i,0); f(i,1) -= drag*v(i,1); f(i,2) -= drag*v(i,2); diff --git a/src/KOKKOS/fix_viscous_kokkos.h b/src/KOKKOS/fix_viscous_kokkos.h index 0498b3ab77..2594c0cf85 100644 --- a/src/KOKKOS/fix_viscous_kokkos.h +++ b/src/KOKKOS/fix_viscous_kokkos.h @@ -30,13 +30,10 @@ namespace LAMMPS_NS { struct TagFixViscous{}; -struct TagFixViscousNonConstant{}; - template class FixViscousKokkos : public FixViscous { public: typedef DeviceType device_type; -// typedef double_3 value_type; typedef ArrayTypes AT; FixViscousKokkos(class LAMMPS *, int, char **); @@ -54,7 +51,6 @@ class FixViscousKokkos : public FixViscous { typename AT::t_int_1d_randomread type; Kokkos::DualView k_gamma; - typename Kokkos::DualView::t_dev_const_um gamma2; }; }