1 /* -*- c++ -*- ---------------------------------------------------------- 2 LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 3 https://www.lammps.org/, Sandia National Laboratories 4 Steve Plimpton, sjplimp@sandia.gov 5 6 Copyright (2003) Sandia Corporation. Under the terms of Contract 7 DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains 8 certain rights in this software. This software is distributed under 9 the GNU General Public License. 10 11 See the README file in the top-level LAMMPS directory. 12 ------------------------------------------------------------------------- */ 13 14 #ifdef PAIR_CLASS 15 // clang-format off 16 PairStyle(coul/wolf/kk,PairCoulWolfKokkos<LMPDeviceType>); 17 PairStyle(coul/wolf/kk/device,PairCoulWolfKokkos<LMPDeviceType>); 18 PairStyle(coul/wolf/kk/host,PairCoulWolfKokkos<LMPHostType>); 19 // clang-format on 20 #else 21 22 // clang-format off 23 #ifndef LMP_PAIR_COUL_WOLF_KOKKOS_H 24 #define LMP_PAIR_COUL_WOLF_KOKKOS_H 25 26 #include "pair_kokkos.h" 27 #include "pair_coul_wolf.h" 28 #include "neigh_list_kokkos.h" 29 30 namespace LAMMPS_NS { 31 32 template<int NEIGHFLAG, int NEWTON_PAIR, int EVFLAG> 33 struct TagPairCoulWolfKernelA{}; 34 35 template<class DeviceType> 36 class PairCoulWolfKokkos : public PairCoulWolf { 37 public: 38 enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF}; 39 enum {COUL_FLAG=1}; 40 typedef DeviceType device_type; 41 typedef ArrayTypes<DeviceType> AT; 42 typedef EV_FLOAT value_type; 43 PairCoulWolfKokkos(class LAMMPS *); 44 ~PairCoulWolfKokkos(); 45 46 void compute(int, int); 47 void init_style(); 48 49 template<int NEIGHFLAG, int NEWTON_PAIR, int EVFLAG> 50 KOKKOS_INLINE_FUNCTION 51 void operator()(TagPairCoulWolfKernelA<NEIGHFLAG,NEWTON_PAIR,EVFLAG>, const int&, EV_FLOAT&) const; 52 53 template<int NEIGHFLAG, int NEWTON_PAIR, int EVFLAG> 54 KOKKOS_INLINE_FUNCTION 55 void operator()(TagPairCoulWolfKernelA<NEIGHFLAG,NEWTON_PAIR,EVFLAG>, const int&) const; 56 57 template<int NEIGHFLAG, int NEWTON_PAIR> 58 KOKKOS_INLINE_FUNCTION 59 void ev_tally(EV_FLOAT &ev, const int &i, const int &j, 60 const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, 61 const F_FLOAT &dely, const F_FLOAT &delz) const; 62 63 KOKKOS_INLINE_FUNCTION 64 int sbmask(const int& j) const; 65 66 protected: 67 68 typename AT::t_x_array_randomread x; 69 typename AT::t_f_array f; 70 typename AT::t_float_1d_randomread q; 71 72 DAT::tdual_efloat_1d k_eatom; 73 DAT::tdual_virial_array k_vatom; 74 typename ArrayTypes<DeviceType>::t_efloat_1d d_eatom; 75 typename ArrayTypes<DeviceType>::t_virial_array d_vatom; 76 77 78 int neighflag,newton_pair; 79 int nlocal,nall,eflag,vflag; 80 81 double e_shift,f_shift; 82 83 double special_coul[4]; 84 double qqrd2e; 85 86 typename AT::t_neighbors_2d d_neighbors; 87 typename AT::t_int_1d_randomread d_ilist; 88 typename AT::t_int_1d_randomread d_numneigh; 89 //NeighListKokkos<DeviceType> k_list; 90 91 friend void pair_virial_fdotr_compute<PairCoulWolfKokkos>(PairCoulWolfKokkos*); 92 93 }; 94 95 } 96 97 #endif 98 #endif 99 100 /* ERROR/WARNING messages: 101 102 E: Cannot use chosen neighbor list style with coul/wolf/kk 103 104 That style is not supported by Kokkos. 105 106 */ 107