1 // clang-format off
2 /* -*- c++ -*- ----------------------------------------------------------
3    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
4    https://www.lammps.org/, Sandia National Laboratories
5    Steve Plimpton, sjplimp@sandia.gov
6 
7    Copyright (2003) Sandia Corporation.  Under the terms of Contract
8    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
9    certain rights in this software.  This software is distributed under
10    the GNU General Public License.
11 
12    See the README file in the top-level LAMMPS directory.
13 ------------------------------------------------------------------------- */
14 
15 /* ----------------------------------------------------------------------
16    Contributing author: W. Michael Brown (Intel)
17 ------------------------------------------------------------------------- */
18 
19 #ifdef PAIR_CLASS
20 // clang-format off
21 PairStyle(gayberne/intel,PairGayBerneIntel);
22 // clang-format on
23 #else
24 
25 #ifndef LMP_PAIR_GAYBERNE_INTEL_H
26 #define LMP_PAIR_GAYBERNE_INTEL_H
27 
28 #include "fix_intel.h"
29 #include "pair_gayberne.h"
30 
31 namespace LAMMPS_NS {
32 
33 class PairGayBerneIntel : public PairGayBerne {
34 
35  public:
36   PairGayBerneIntel(class LAMMPS *);
37 
38   virtual void compute(int, int);
39   void init_style();
40 
41  private:
42   template <class flt_t> class ForceConst;
43 
44   template <class flt_t, class acc_t>
45   void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
46                const ForceConst<flt_t> &fc);
47   template <int EFLAG, int NEWTON_PAIR, class flt_t, class acc_t>
48   void eval(const int offload, const int vflag, IntelBuffers<flt_t, acc_t> *buffers,
49             const ForceConst<flt_t> &fc, const int astart, const int aend);
50 
51   template <class flt_t, class acc_t>
52   void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
53 
54   template <class flt_t> class ForceConst {
55    public:
56     typedef struct {
57       flt_t cutsq, lj1, lj2, offset, sigma, epsilon, lshape;
58       int form;
59     } fc_packed1;
60     typedef struct {
61       flt_t lj3, lj4;
62     } fc_packed2;
63     typedef struct {
64       flt_t shape2[4], well[4];
65     } fc_packed3;
66 
67     _alignvar(flt_t special_lj[4], 64);
68     _alignvar(flt_t gamma, 64);
69     _alignvar(flt_t upsilon, 64);
70     _alignvar(flt_t mu, 64);
71     fc_packed1 **ijc;
72     fc_packed2 **lj34;
73     fc_packed3 *ic;
74 
75     flt_t **rsq_form, **delx_form, **dely_form, **delz_form;
76     int **jtype_form, **jlist_form;
77 
ForceConst()78     ForceConst() : _ntypes(0) {}
~ForceConst()79     ~ForceConst() { set_ntypes(0, 0, 0, nullptr, _cop); }
80 
81     void set_ntypes(const int ntypes, const int one_length, const int nthreads, Memory *memory,
82                     const int cop);
83 
84    private:
85     int _ntypes, _cop;
86     Memory *_memory;
87   };
88 
89   ForceConst<float> force_const_single;
90   ForceConst<double> force_const_double;
91   int _max_nbors;
92 
93   double gayberne_lj(const int i, const int j, double a1[3][3], double b1[3][3], double g1[3][3],
94                      double *r12, const double rsq, double *fforce, double *ttor);
95 
96   FixIntel *fix;
97   int _cop;
98 };
99 
100 }    // namespace LAMMPS_NS
101 
102 #endif
103 #endif
104