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

« back to all changes in this revision

Viewing changes to lib/gpu/lal_coul_debye.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
/***************************************************************************
 
2
                                 coul_debye.h
 
3
                             -------------------
 
4
                               Trung Dac Nguyen
 
5
 
 
6
  Class for acceleration of the coul/debye pair style.
 
7
 
 
8
 __________________________________________________________________________
 
9
    This file is part of the LAMMPS Accelerator Library (LAMMPS_AL)
 
10
 __________________________________________________________________________
 
11
 
 
12
    begin                : 
 
13
    email                : ndtrung@umich.edu
 
14
 ***************************************************************************/
 
15
 
 
16
#ifndef LAL_COUL_DEBYE_H
 
17
#define LAL_COUL_DEBYE_H
 
18
 
 
19
#include "lal_base_charge.h"
 
20
 
 
21
namespace LAMMPS_AL {
 
22
 
 
23
template <class numtyp, class acctyp>
 
24
class CoulDebye : public BaseCharge<numtyp, acctyp> {
 
25
 public:
 
26
  CoulDebye();
 
27
  ~CoulDebye();
 
28
 
 
29
  /// Clear any previous data and set up for a new LAMMPS run
 
30
  /** \param max_nbors initial number of rows in the neighbor matrix
 
31
    * \param cell_size cutoff + skin
 
32
    * \param gpu_split fraction of particles handled by device
 
33
    * 
 
34
    * Returns:
 
35
    * -  0 if successfull
 
36
    * - -1 if fix gpu not found
 
37
    * - -3 if there is an out of memory error
 
38
    * - -4 if the GPU library was not compiled for GPU
 
39
    * - -5 Double precision is not supported on card **/
 
40
  int init(const int ntypes, double **host_scale,
 
41
           double **host_cutsq, double *host_special_coul,
 
42
           const int nlocal, const int nall, const int max_nbors, 
 
43
           const int maxspecial, const double cell_size,
 
44
           const double gpu_split, FILE *screen,
 
45
           const double qqrd2e, const double kappa);
 
46
  
 
47
  /// Send updated coeffs from host to device (to be compatible with fix adapt)
 
48
  void reinit(const int ntypes, double **host_scale);
 
49
  
 
50
  /// Clear all host and device data
 
51
  /** \note This is called at the beginning of the init() routine **/
 
52
  void clear();
 
53
 
 
54
  /// Returns memory usage on device per atom
 
55
  int bytes_per_atom(const int max_nbors) const;
 
56
 
 
57
  /// Total host memory used by library for pair style
 
58
  double host_memory_usage() const;
 
59
 
 
60
  // --------------------------- TYPE DATA --------------------------
 
61
 
 
62
  /// scale
 
63
  UCL_D_Vec<numtyp> scale;
 
64
  /// cutsq
 
65
  UCL_D_Vec<numtyp> cutsq;
 
66
  /// Special Coul values [0-3]
 
67
  UCL_D_Vec<numtyp> sp_cl;
 
68
 
 
69
  /// If atom type constants fit in shared memory, use fast kernels
 
70
  bool shared_types;
 
71
 
 
72
  /// Number of atom types 
 
73
  int _lj_types;
 
74
 
 
75
  numtyp _qqrd2e,_kappa;
 
76
 
 
77
 private:
 
78
  bool _allocated;
 
79
  void loop(const bool _eflag, const bool _vflag);
 
80
};
 
81
 
 
82
}
 
83
 
 
84
#endif