NAMD
|
#include "msm_defn.h"
Go to the source code of this file.
Functions | |
NL_Msm * | NL_msm_create (void) |
void | NL_msm_destroy (NL_Msm *pm) |
int | NL_msm_configure (NL_Msm *pm, double gridspacing, int approx, int split, int nlevels) |
int | NL_msm_compute_force (NL_Msm *pm, double *felec, double *uelec, const double *atom, int natoms) |
int | NL_msm_compute_force_sprec (NL_Msm *pm, float *felec_f, float *uelec_f, const float *atom_f, int natoms) |
int | NL_msm_approx (const char *name) |
const char * | NL_msm_approx_name (int approx) |
int | NL_msm_split (const char *name) |
const char * | NL_msm_split_name (int split) |
Variables | |
static const char * | ApproxName [] |
static const char * | SplitName [] |
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.
pm | 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.
pm | the MSM solver object |
felec_f | electrostatic forces x/y/z for each atom |
uelec_f | electrostatic potential energy |
atom_f | 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.
pm | 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_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().
|
static |
Order must be the same as APPROX enum in msm.h
Definition at line 149 of file msm.c.
Referenced by NL_msm_approx(), and NL_msm_approx_name().
|
static |
Order must be the same as SPLIT enum in msm.h
Definition at line 179 of file msm.c.
Referenced by NL_msm_split(), and NL_msm_split_name().