nb_kerneltype.h
来自「最著名最快的分子模拟软件」· C头文件 代码 · 共 355 行 · 第 1/2 页
H
355 行
* positions <tt>pos[3*n]</tt>, <tt>pos[3*n+1]</tt>, and * <tt>pos[3*n+2]</tt>. This is binary compatible with, * and can be typecast from, an array of gmx_rvec_t. * For kernels that do not calculate forces this can be NULL. * \param charge Array with the charge of atom n in position n. * If you are calling a kernel without coulomb interaction * this parameter can safely be set to NULL. * \param facel Factor to multiply all electrostatic interactions with; * this is essentially 1/(4*pi*epsilon). For kernels without * coulomb interaction the value will not be used. In the * fortran version (pass-by-reference) it can be NULL in * that case. * \param krf The 'k' constant for reaction-field electrostatic * interactions. Can be zero/NULL for non-RF interactions. * \param crf The 'c' constant for reaction-field electrostatic * interactions. Can be zero/NULL for non-RF interactions. * \param vc List of Coulomb energies, the length is equal to the * number of energy group combinations. As described for * gid above, the coulomb energy of each outer/i-particle * list will be added to vc[gid[i]]. Can be NULL for * kernels without electrostatic interaction. * \param type Array with the index of the Van der Waals type for each * atom, starting on 0 . This is used to look up the VdW * parameters. When no VdW interactions are calculated * (i.e. only Coulomb), this can be set to NULL. * \param ntype Number of VdW types, used to look up the VdW parameters. * This parameter can be zero (NULL for pass-by-reference) * if the kernel does not include VdW interactions. * \param vdwparam Array with Van der Waals parameters. The contents and * size depends on the number of parameters required for * the selected VdW interaction (3 for B-ham, 2 for LJ, etc). * There are a total of ntype*ntype pair combinations, and * the size of this array is the number of such pairs times * the number of parameters. * With 'nparam' parameters, and 'ntype' types in total, * the first parameter for interactions between atoms of VdW * type 'ti' and VdW type 'tj' is located in * <tt>vdwparam[nparam*(ntype*ti+tj)]</tt>, and the * additional parameters follow directly in the next * position(s). Note that the array corresponds to a * symmetric matrix - you should get the same parameters if * you swap ti and tj. This parameter can be NULL * if the kernel does not include VdW interactions. * \param vvdw List of Van der Waals energies, the length is equal to * the number of energy group combinations. As described * for gid above, the coulomb energy of each outer list * will be added to vc[gid[i]]. Can be NULL for * kernels without electrostatic interaction. * \param tabscale Distance between table points in the vftab table. * This is always the same for Coulomb and VdW when both * are tabulated. If the kernel does not include any * tabulated interactions it can be zero, or NULL when * passed-by-reference. * \param vftab Table data for Coulomb and/or VdW interactions. * Each 'point' in the table consists of the four * floating-point numbers Y,F,G,H as described in the * Gromacs manual. If the kernel only tabulates the * Coulomb interaction this is followed by the next * point. If both Coulomb and Van der Waals interactions * are tabulated it is instead followed by another * four numbers for the dispersion table at the same * point, and then finally the repulsion table, i.e. * a total of 12 numbers per table point. If only * Van der Waals interactions are tabulated the * Dispersion and Repulsion table (in that order) use * a total of 8 floating-point numbers per point. * This array only needs to be provided for kernels with * tabulated interactions - otherwise it can be NULL. * \param invsqrta Array with the inverse square root of the born radius * of each atom. This can safely be NULL when the kernel * does not calculate Generalized Born interactions. * \param dvda Array where the derivative of the potential with respect * to the born radius for each atom will be written. This * is necessary to calculate the effect of born radius * derivatives on forces. However, just as for the force * arrays it must be provided even when not calculating * forces, since an implementation might not provide a * non-force version of the routine. When the kernel does * not calculate Generalized Born interactions it can * safely be set to NULL, though. * \param gbtabscale Distance between (scaled) table points for tabulated * Generalized Born interactions. If the kernel does not * calculate Generalized Born interactions it can be zero, * or NULL when passed-by-reference. Note that this is * usually different from the standard (non-GB) table scale. * \param gbtab Table data for Generalized Born Coulomb interactions. * Since these interactions contain parameters that * enter in a non-trivial way I have introduced a trick * where the tabulated interaction is a function of * the distance scaled with the square roots of the two * born radii. Apart from this it contains similar * data (Y,F,G,H) as the normal Coulomb/VdW tables. * See comments in the table code for details. This * can safely be set to NULL if you are not using * Generalized Born interactions. * \param nthreads Number of threads calling the kernel concurrently. * This value is only used to optimize the chunk size * of the neighborlists processed by each thread, so * it won't cause incorrect results if you get it wrong. * \param count Pointer to a common counter to synchronize * multithreaded execution. This is normally the counter * in the neighborlist. It must be set to zero before * calling the kernel to get correct results. Note that * this is necessary even for a single thread if Gromacs * is compiled with thread support (meaning it is * a mandatory parameter). * \param mtx Pointer to a mutex protecting the counter, masked as * a pointer-to-void since thread support is optional. * However, if Gromacs is compiled with threads you \a must * provide a mutex - it would hurt performance to check * it for each iteration in the nonbonded kernel. The * mutex is normally created automatically by the * neighborlist initialization routine gmx_nlist_init(). * (Yet another reason not to call kernels directly). * \param outeriter The number of iterations performed in the outer loop * of the kernel will be written to this integer. If * multiple threads are calling the loop this will be * the part of nri handled by this thread. * This value is only used to get accurate flop accounting. * Since we cannot check for NULL pointers in Fortran it must * always be provided, but you can discard * the result if you don't need it. * \param inneriter The number of iterations performed in the inner loop * of the kernel will be written to this integer; compare * with nouter. Since we cannot check for NULL pointers in * Fortran it must always be provided, but you can discard * the result if you don't need it. * \param work Double precision work array - to be used for optimization. * * \warning There is \a very little error control inside * the nonbonded kernels in order to maximize performance. * It cannot be overemphasized that you should never call * them directly, but rely on the higher-level routines. */typedef voidnb_kernel_t(int * nri, int * iinr, int * jindex, int * jjnr, int * shift, real * shiftvec, real * fshift, int * gid, real * pos, real * faction, real * charge, real * facel, real * krf, real * crf, real * vc, int * type, int * ntype, real * vdwparam, real * vvdw, real * tabscale, real * vftab, real * invsqrta, real * dvda, real * gbtabscale, real * gbtab, int * nthreads, int * count, void * mtx, int * outeriter, int * inneriter, real * work);#ifdef __cplusplus}#endif#endif /* _NB_KERNEL_H_ */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?