NAMD
ComputeLonepairsCUDA.h
Go to the documentation of this file.
1 #ifndef COMPUTELONEPAIRSCUDA_H
2 #define COMPUTELONEPAIRSCUDA_H
3 
4 #include "CudaUtils.h"
5 #include "CudaRecord.h"
6 #include <vector>
7 
8 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
9 
10 class AtomMap;
11 class HomePatch;
12 
14 public:
16  int i_soaid; // SOA ID of the lone pair "atom" i
17  int j_soaid; // SOA ID of the host atom j
18  int k_soaid; // SOA ID of the host atom k
19  double distance;
20  double scale_factor;
21  };
22 
24  int i_soaid; // SOA ID of the lone pair "atom" i
25  int j_soaid; // SOA ID of the host atom j
26  int k_soaid; // SOA ID of the host atom k
27  int l_soaid; // SOA ID of the host atom l
28  double dcosa;
29  double dsinacost;
30  double dsinasint;
31  };
32 
34  int i_soaid; // SOA ID of the lone pair "atom" i
35  int j_soaid; // SOA ID of the host atom j
36  int k_soaid; // SOA ID of the host atom k
37  int l_soaid; // SOA ID of the host atom l
38  double dcosa;
39  double dsinacost;
40  double dsinasint;
41  };
42 
45  // /*!
46  // * @brief Prepare the device lone pair lists from lphosts in the Molecule class
47  // */
48  // void initializeLonepairs(Lphost* lphost, size_t lphostsize);
52  void updateAtoms(
53  std::vector<HomePatch*> patchList,
54  std::vector<AtomMap*> &atomMapsList,
55  const std::vector<CudaLocalRecord> &localRecords,
56  const int* h_globalToLocalID, cudaStream_t stream);
60  void reposition(
61  double* d_pos_x,
62  double* d_pos_y,
63  double* d_pos_z,
64  cudaStream_t stream) const;
69  void redistributeForce(
70  double* d_f_normal_x,
71  double* d_f_normal_y,
72  double* d_f_normal_z,
73  double* d_f_nbond_x,
74  double* d_f_nbond_y,
75  double* d_f_nbond_z,
76  double* d_f_slow_x,
77  double* d_f_slow_y,
78  double* d_f_slow_z,
79  cudaTensor* d_virial_normal,
80  cudaTensor* d_virial_nbond,
81  cudaTensor* d_virial_slow,
82  const double* d_pos_x,
83  const double* d_pos_y,
84  const double* d_pos_z,
85  const int maxForceNumber,
86  const int doVirial,
87  cudaStream_t stream) const;
88 private:
89  LonepairColinear* d_lpcolinear_list;
90  size_t lpcolinear_list_size;
91  LonepairRelative* d_lprelative_list;
92  size_t lprelative_list_size;
93  LonepairBisector* d_lpbisector_list;
94  size_t lpbisector_list_size;
95 };
96 
97 #endif // NAMD_CUDA
98 #endif // COMPUTELONEPAIRSCUDA_H
void reposition(double *d_pos_x, double *d_pos_y, double *d_pos_z, cudaStream_t stream) const
Determine the positions of lone pairs. Should be called before force evaluations. ...
void updateAtoms(std::vector< HomePatch *> patchList, std::vector< AtomMap *> &atomMapsList, const std::vector< CudaLocalRecord > &localRecords, const int *h_globalToLocalID, cudaStream_t stream)
Prepare the device lone pair lists from lphosts in the Molecule class.
void redistributeForce(double *d_f_normal_x, double *d_f_normal_y, double *d_f_normal_z, double *d_f_nbond_x, double *d_f_nbond_y, double *d_f_nbond_z, double *d_f_slow_x, double *d_f_slow_y, double *d_f_slow_z, cudaTensor *d_virial_normal, cudaTensor *d_virial_nbond, cudaTensor *d_virial_slow, const double *d_pos_x, const double *d_pos_y, const double *d_pos_z, const int maxForceNumber, const int doVirial, cudaStream_t stream) const
Project the forces on lone pairs to host atoms. Should be called after force evaluations and before t...