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

« back to all changes in this revision

Viewing changes to lib/cuda/pair_cg_cmm_cuda_kernel_nc.cu

  • 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
 
   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
3
 
 
4
 
   Original Version:
5
 
   http://lammps.sandia.gov, Sandia National Laboratories
6
 
   Steve Plimpton, sjplimp@sandia.gov
7
 
 
8
 
   See the README file in the top-level LAMMPS directory.
9
 
 
10
 
   -----------------------------------------------------------------------
11
 
 
12
 
   USER-CUDA Package and associated modifications:
13
 
   https://sourceforge.net/projects/lammpscuda/
14
 
 
15
 
   Christian Trott, christian.trott@tu-ilmenau.de
16
 
   Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
17
 
   Theoretical Physics II, University of Technology Ilmenau, Germany
18
 
 
19
 
   See the README file in the USER-CUDA directory.
20
 
 
21
 
   This software is distributed under the GNU General Public License.
22
 
------------------------------------------------------------------------- */
23
 
 
24
 
__device__ inline F_FLOAT PairCGCMMCuda_Eval(const F_FLOAT &rsq, const int ij_type, F_FLOAT &factor_lj, int &eflag, ENERGY_FLOAT &evdwl) //0.11 of 0.4
25
 
{
26
 
  const F_FLOAT r2inv = F_F(1.0) / rsq;
27
 
  const int cg_type = _cg_type[ij_type];
28
 
  const F_FLOAT r4inv = r2inv * r2inv;
29
 
  const F_FLOAT rNinv_first = cg_type != CG_LJ9_6 ? r4inv : _RSQRT_(rsq);
30
 
  const F_FLOAT rNinv_second = cg_type != CG_LJ12_4 ? -r2inv : -F_F(1.0);
31
 
  const F_FLOAT forcelj = r4inv * (_lj1[ij_type] * r4inv * rNinv_first + _lj2[ij_type] * rNinv_second);
32
 
 
33
 
  if(eflag) evdwl += factor_lj * (r4inv * (_lj3[ij_type] * r4inv * rNinv_first + _lj4[ij_type] * rNinv_second) - _offset[ij_type]);
34
 
 
35
 
  return factor_lj * forcelj * r2inv;
36
 
}
37
 
 
38
 
/*__device__ inline F_FLOAT PairCGCMMCuda_Eval(const F_FLOAT& rsq,const int ij_type,F_FLOAT& factor_lj,int& eflag, ENERGY_FLOAT& evdwl)
39
 
{
40
 
        const int cg_type = tex1Dfetch(_coeff5_gm_tex,ij_type);
41
 
        const F_FLOAT r2inv = F_F(1.0)/rsq;
42
 
        const F_FLOAT r4inv = r2inv*r2inv;
43
 
        const F_FLOAT rNinv_first = cg_type!=CG_LJ9_6?r4inv:_RSQRT_(rsq);
44
 
        const F_FLOAT rNinv_second = cg_type!=CG_LJ12_4?r2inv:F_F(1.0);
45
 
        const F_FLOAT forcelj = r4inv * (tex1Dfetch(_coeff1_gm_tex,ij_type)*r4inv*rNinv_first - tex1Dfetch(_coeff2_gm_tex,ij_type)*rNinv_second);
46
 
 
47
 
    if(eflag) evdwl += factor_lj*(r4inv*(tex1Dfetch(_coeff3_gm_tex,ij_type)*r4inv*rNinv_first-tex1Dfetch(_coeff4_gm_tex,ij_type)*rNinv_second));
48
 
        return factor_lj*forcelj*r2inv;
49
 
}*/