~ubuntu-branches/debian/sid/lammps/sid

« back to all changes in this revision

Viewing changes to src/USER-INTEL/pair_lj_charmm_coul_long_intel.h

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2015-04-29 23:44:49 UTC
  • mfrom: (5.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20150429234449-mbhy9utku6hp6oq8
Tags: 0~20150313.gitfa668e1-1
Upload into unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- c++ -*- ----------------------------------------------------------
 
2
   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
3
   http://lammps.sandia.gov, 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
/* ----------------------------------------------------------------------
 
15
   Contributing author: W. Michael Brown (Intel)
 
16
------------------------------------------------------------------------- */
 
17
 
 
18
#ifdef PAIR_CLASS
 
19
 
 
20
PairStyle(lj/charmm/coul/long/intel,PairLJCharmmCoulLongIntel)
 
21
 
 
22
#else
 
23
 
 
24
#ifndef LMP_PAIR_LJ_CHARMM_COUL_LONG_INTEL_H
 
25
#define LMP_PAIR_LJ_CHARMM_COUL_LONG_INTEL_H
 
26
 
 
27
#include "pair_lj_charmm_coul_long.h"
 
28
#include "fix_intel.h"
 
29
 
 
30
namespace LAMMPS_NS {
 
31
 
 
32
class PairLJCharmmCoulLongIntel : public PairLJCharmmCoulLong {
 
33
 
 
34
 public:
 
35
  PairLJCharmmCoulLongIntel(class LAMMPS *);
 
36
  virtual ~PairLJCharmmCoulLongIntel();
 
37
 
 
38
  virtual void compute(int, int);
 
39
  void init_style();
 
40
 
 
41
  typedef struct { float x,y,z; int w; } sng4_t;
 
42
 
 
43
 private:
 
44
  FixIntel *fix;
 
45
  int _cop;
 
46
 
 
47
  template <class flt_t> class ForceConst;
 
48
  template <class flt_t, class acc_t>
 
49
  void compute(int eflag, int vflag, IntelBuffers<flt_t,acc_t> *buffers,
 
50
               const ForceConst<flt_t> &fc);
 
51
  template <int EVFLAG, int EFLAG, int NEWTON_PAIR, class flt_t, class acc_t>
 
52
  void eval(const int offload, const int vflag,
 
53
            IntelBuffers<flt_t,acc_t> * buffers,
 
54
            const ForceConst<flt_t> &fc, const int astart, const int aend);
 
55
 
 
56
  template <class flt_t, class acc_t>
 
57
  void pack_force_const(ForceConst<flt_t> &fc,
 
58
                        IntelBuffers<flt_t, acc_t> *buffers);
 
59
 
 
60
  // ----------------------------------------------------------------------
 
61
  template <class flt_t>
 
62
  class ForceConst {
 
63
   public:
 
64
    typedef struct { flt_t r, dr, f, df; } table_t;
 
65
    _alignvar(flt_t special_coul[4],64);
 
66
    _alignvar(flt_t special_lj[4],64);
 
67
    flt_t **cutsq, g_ewald, tabinnersq;
 
68
    flt_t cut_coulsq, cut_ljsq;
 
69
    flt_t cut_lj_innersq;
 
70
    table_t *table;
 
71
    flt_t *etable, *detable, *ctable, *dctable;
 
72
    typename IntelBuffers<flt_t,flt_t>::vec4_t **lj;
 
73
 
 
74
    ForceConst() : _ntypes(0), _ntable(0) {}
 
75
    ~ForceConst() { set_ntypes(0,0,NULL,_cop); }
 
76
 
 
77
    void set_ntypes(const int ntypes, const int ntable, Memory *memory,
 
78
                    const int cop);
 
79
 
 
80
   private:
 
81
    int _ntypes, _ntable, _cop;
 
82
    Memory *_memory;
 
83
  };
 
84
  ForceConst<float> force_const_single;
 
85
  ForceConst<double> force_const_double;
 
86
};
 
87
 
 
88
}
 
89
 
 
90
#endif
 
91
#endif
 
92
 
 
93
/* ERROR/WARNING messages:
 
94
 
 
95
E: The 'package intel' command is required for /intel styles
 
96
 
 
97
Self-explanatory.
 
98
 
 
99
E: Intel varient of lj/charmm/coul/long expects lj cutoff<=coulombic
 
100
 
 
101
The intel accelerated version of the CHARMM style requires that the
 
102
Lennard-Jones cutoff is not greater than the coulombic cutoff.
 
103
 
 
104
*/