NAMD
|
Go to the source code of this file.
Typedefs | |
typedef struct NL_Msm_t | NL_Msm |
Functions | |
NL_Msm * | NL_msm_create (void) |
void | NL_msm_destroy (NL_Msm *) |
int | NL_msm_setup (NL_Msm *msm, double cutoff, double cellvec1[3], double cellvec2[3], double cellvec3[3], double cellcenter[3], int msmflags) |
int | NL_msm_configure (NL_Msm *msm, double gridspacing, int approx, int split, int nlevels) |
int | NL_msm_compute_force (NL_Msm *msm, double *felec, double *uelec, const double *atom, int natoms) |
int | NL_msm_compute_force_sprec (NL_Msm *msm, float *felec, float *uelec, const float *atom, int natoms) |
int | NL_msm_approx (const char *name) |
int | NL_msm_split (const char *name) |
const char * | NL_msm_approx_name (int approx) |
const char * | NL_msm_split_name (int split) |
anonymous enum |
Use in setup for msmflags, bitwise OR the options.
Definition at line 43 of file msm.h.
anonymous enum |
Return codes.
anonymous enum |
MSM approximation/interpolation methods. (Default is CUBIC.)
anonymous enum |
MSM splitting functions to smooth the 1/r potential. (Default is TAYLOR2.)
The Taylor splittings are the family of C^k Taylor polynomials of s^(-1/2) about s=1. Discussed in section 5.1 of the thesis. TAYLOR1 is listed last so that reasonable default parameters (CUBIC approximation with TAYLOR2 splitting) are automatically selected from zeroing the values.
The sigma(k,d) splittings generalize the Taylor splittings above for C^k continuity at r=1 and degree d polynomial in r. (The Taylor splittings are sigma(d/2,d).) The ones here are uniquely determined. Discussed in section 5.2 of the thesis.
The special sigma(2,6) splitting is from section 5.3 of the thesis. This is a proof-of-concept where the polynomial in even powers of r has an extra degree of freedom chosen to minimize the error bound.
Elimiate the self-force artifact through the use of a switching function between 1/r and a polynomial reproduced exactly by CUBIC interpolation. Discussed in section 5.4 of thesis.
Definition at line 187 of file msm.h.
int NL_msm_approx | ( | const char * | name | ) |
Helper function to determine APPROX enum constant from string name.
Definition at line 160 of file msm.c.
References ApproxName, and NELEMS.
const char* NL_msm_approx_name | ( | int | approx | ) |
Helper function returning string name for APPROX enum constant.
Definition at line 170 of file msm.c.
References ApproxName, and NELEMS.
Referenced by print_status().
int NL_msm_compute_force | ( | NL_Msm * | msm, |
double * | felec, | ||
double * | uelec, | ||
const double * | atom, | ||
int | natoms | ||
) |
Compute the electrostatic forces and potential energy for the array of atoms. The felec array and the location pointed to by uelec is expected to be initialized before the call. As stated, the atoms must be within the defined cell.
msm | the MSM solver object |
felec | electrostatic forces x/y/z for each atom |
uelec | electrostatic potential energy |
atom | positions and charge x/y/z/q for each atom |
natoms | number of atoms |
Definition at line 56 of file msm.c.
References NL_Msm_t::atom, NL_Msm_t::felec, NL_Msm_t::msmflags, NL_MSM_COMPUTE_LONG_RANGE, NL_msm_compute_long_range(), NL_MSM_COMPUTE_SHORT_RANGE, NL_msm_compute_short_range(), NL_MSM_COMPUTE_SPREC, NL_MSM_ERROR_PARAM, NL_Msm_t::numatoms, NL_Msm_t::report_timings, NL_Msm_t::timer, NL_Msm_t::uelec, wkf_timer_start(), wkf_timer_stop(), and wkf_timer_time().
Referenced by ComputeMsmSerialMgr::recvCoord().
int NL_msm_compute_force_sprec | ( | NL_Msm * | msm, |
float * | felec, | ||
float * | uelec, | ||
const float * | atom, | ||
int | natoms | ||
) |
Same as NL_msm_compute_force() except for single precision calculation. Call this only if NL_MSM_COMPUTE_SPREC flag was selected.
msm | the MSM solver object |
felec | electrostatic forces x/y/z for each atom |
uelec | electrostatic potential energy |
atom | positions and charge x/y/z/q for each atom |
natoms | number of atoms |
Definition at line 102 of file msm.c.
References NL_Msm_t::atom_f, NL_Msm_t::felec_f, NL_Msm_t::msmflags, NL_MSM_COMPUTE_LONG_RANGE, NL_msm_compute_long_range_sprec(), NL_MSM_COMPUTE_SHORT_RANGE, NL_msm_compute_short_range_sprec(), NL_MSM_COMPUTE_SPREC, NL_MSM_ERROR_PARAM, NL_Msm_t::numatoms, NL_Msm_t::report_timings, NL_Msm_t::timer, NL_Msm_t::uelec, wkf_timer_start(), wkf_timer_stop(), and wkf_timer_time().
int NL_msm_configure | ( | NL_Msm * | msm, |
double | gridspacing, | ||
int | approx, | ||
int | split, | ||
int | nlevels | ||
) |
Advanced configuration of MSM. The ratio of cutoff / gridspacing is generally kept between about 2.5 and 6. For atomic lengths in Angstroms, good results are demonstrated for a cutoff distance between 8 and 12 A and the default grid spacing of 2.5 A.
The optimal pairings of approx and split have been demonstrated to be:
Use QUINTIC2, SEPTIC3, NONIC4 paired with the same splitting functions above if greater continuity is desired.
Set "nlevels" to 0 (the default) to fully adapt the number of grid levels to the system cell size.
msm | the MSM solver object |
gridspacing | grid spacing for first grid level |
approx | which approximation method |
split | which splitting |
nlevels | number of grid levels to use |
Definition at line 36 of file msm.c.
References NL_Msm_t::approx, NL_Msm_t::gridspacing, NL_MSM_APPROX_END, NL_MSM_ERROR_PARAM, NL_MSM_SPLIT_END, NL_MSM_SUCCESS, NL_Msm_t::nlevels, split(), and NL_Msm_t::split.
Referenced by ComputeMsmSerialMgr::recvCoord().
Allocate MSM solver.
Definition at line 6 of file msm.c.
References NL_Msm_t::approx, NL_Msm_t::binfill, DEFAULT_APPROX, DEFAULT_BINFILL, DEFAULT_DENSITY, DEFAULT_GRIDSPACING, DEFAULT_NBINSLOTS, DEFAULT_NLEVELS, DEFAULT_SPLIT, NL_Msm_t::density, NL_Msm_t::gridspacing, NL_Msm_t::nbinslots, NL_Msm_t::nlevels, NL_Msm_t::split, NL_Msm_t::timer, NL_Msm_t::timer_longrng, and wkf_timer_create().
Referenced by ComputeMsmSerialMgr::recvCoord().
Free MSM solver.
Definition at line 28 of file msm.c.
References NL_msm_cleanup(), NL_Msm_t::timer, NL_Msm_t::timer_longrng, and wkf_timer_destroy().
Referenced by ComputeMsmSerialMgr::~ComputeMsmSerialMgr().
int NL_msm_setup | ( | NL_Msm * | msm, |
double | cutoff, | ||
double | cellvec1[3], | ||
double | cellvec2[3], | ||
double | cellvec3[3], | ||
double | cellcenter[3], | ||
int | msmflags | ||
) |
Setup the MSM solver for the molecular system. These parameters come directly from the simulation. Here the cutoff provides some control over the accuracy. The region of space containing the atoms is defined as a parallelepiped, and the "isperiodic" flag determines whether or not each individual cell dimension has periodic boundary conditions. The defined cell is expected to contain the atoms regardless of the choice of boundary conditions. The cell volume must contain the cutoff-sphere.
XXX For now, the MSM solver permits only cell vectors that align with the x-, y-, and z-axis, respectively.
msm | the MSM solver object |
cutoff | cutoff distance for short-range part |
cellvec1 | cell basis vector 1 |
cellvec2 | cell basis vector 2 |
cellvec3 | cell basis vector 3 |
cellcenter | center of cell |
msmflags | flags for periodicity and calculation |
Definition at line 62 of file msm_setup.c.
References NL_Msm_t::a, NL_Msm_t::a_f, NL_Msm_t::cellcenter, NL_Msm_t::cellcenter_f, NL_Msm_t::cellvec1, NL_Msm_t::cellvec1_f, NL_Msm_t::cellvec2, NL_Msm_t::cellvec2_f, NL_Msm_t::cellvec3, NL_Msm_t::cellvec3_f, NL_Msm_t::gx, NL_Msm_t::gx_f, NL_Msm_t::gy, NL_Msm_t::gy_f, NL_Msm_t::gz, NL_Msm_t::gz_f, NL_Msm_t::hx, NL_Msm_t::hx_f, NL_Msm_t::hy, NL_Msm_t::hy_f, NL_Msm_t::hz, NL_Msm_t::hz_f, NL_Msm_t::msmflags, NL_MSM_ALL_FLAGS, NL_MSM_COMPUTE_1AWAY, NL_MSM_COMPUTE_ALL, NL_MSM_COMPUTE_CUDA_FALL_BACK, NL_MSM_COMPUTE_CUDA_GRID_CUTOFF, NL_MSM_COMPUTE_LONG_RANGE, NL_MSM_COMPUTE_SHORT_RANGE, NL_MSM_COMPUTE_SPREC, NL_MSM_ERROR_PARAM, NL_MSM_ERROR_SUPPORT, NL_MSM_PERIODIC_VEC1, NL_MSM_PERIODIC_VEC2, NL_MSM_PERIODIC_VEC3, NL_MSM_REPORT_TIMINGS, NL_MSM_SUCCESS, print_status(), NL_Msm_t::recipvec1, NL_Msm_t::recipvec1_f, NL_Msm_t::recipvec2, NL_Msm_t::recipvec2_f, NL_Msm_t::recipvec3, NL_Msm_t::recipvec3_f, NL_Msm_t::report_timings, setup_bins_1away(), setup_bins_k_away(), setup_cell_vectors(), and setup_grids().
Referenced by ComputeMsmSerialMgr::recvCoord().
int NL_msm_split | ( | const char * | name | ) |
const char* NL_msm_split_name | ( | int | split | ) |
Helper function returning string name for SPLIT enum constant.
Definition at line 220 of file msm.c.
References NELEMS, split(), and SplitName.
Referenced by print_status().