NAMD
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <strings.h>
#include "msm.h"
#include "wkfutils.h"
Go to the source code of this file.
Classes | |
struct | NL_Msm_t |
Macros | |
#define | X 0 |
#define | Y 1 |
#define | Z 2 |
#define | Q 3 |
#define | NELEMS(arr) (sizeof(arr)/sizeof(arr[0])) |
#define | GRID_TEMPLATE(TYPE) |
#define | GRID_INIT(_p) |
#define | GRID_DONE(_p) free((_p)->buffer) |
#define | GRID_INDEX(_p, _i, _j, _k) (((_k)*((_p)->nj) + (_j))*((_p)->ni) + (_i)) |
#define | GRID_POINTER(_p, _i, _j, _k) ((_p)->data + GRID_INDEX(_p, _i, _j, _k)) |
#define | GRID_RESIZE(_p, TYPE, __i0, __ni, __j0, __nj, __k0, __nk) |
#define | GRID_ZERO(_p) memset((_p)->buffer, 0, (_p)->numbytes) /* ; */ |
#define | ASSERT(expr) |
#define | GRID_INDEX_CHECK(a, _i, _j, _k) |
#define | DEFAULT_GRIDSPACING 2.5 |
#define | DEFAULT_APPROX NL_MSM_APPROX_CUBIC |
#define | DEFAULT_SPLIT NL_MSM_SPLIT_TAYLOR2 |
#define | DEFAULT_NLEVELS 0 /* set number of levels as needed */ |
#define | DEFAULT_DENSITY 0.1 |
#define | DEFAULT_BINFILL 0.8 |
#define | DEFAULT_NBINSLOTS 8 |
#define | SPOLY(pg, pdg, ra, split) |
#define | SPOLY_SPREC(pg, pdg, ra, split) |
Functions | |
GRID_TEMPLATE (double) | |
GRID_TEMPLATE (float) | |
void | NL_msm_cleanup (NL_Msm *pm) |
int | NL_msm_compute_short_range (NL_Msm *pm) |
int | NL_msm_compute_long_range (NL_Msm *pm) |
int | NL_msm_compute_short_range_sprec (NL_Msm *pm) |
int | NL_msm_compute_long_range_sprec (NL_Msm *pm) |
#define ASSERT | ( | expr | ) |
Definition at line 113 of file msm_defn.h.
#define DEFAULT_APPROX NL_MSM_APPROX_CUBIC |
Definition at line 120 of file msm_defn.h.
Referenced by NL_msm_create().
#define DEFAULT_BINFILL 0.8 |
Definition at line 125 of file msm_defn.h.
Referenced by NL_msm_create().
#define DEFAULT_DENSITY 0.1 |
Definition at line 124 of file msm_defn.h.
Referenced by NL_msm_create().
#define DEFAULT_GRIDSPACING 2.5 |
#define DEFAULT_NBINSLOTS 8 |
Definition at line 126 of file msm_defn.h.
Referenced by NL_msm_create().
#define DEFAULT_NLEVELS 0 /* set number of levels as needed */ |
Definition at line 122 of file msm_defn.h.
Referenced by NL_msm_create().
#define DEFAULT_SPLIT NL_MSM_SPLIT_TAYLOR2 |
Definition at line 121 of file msm_defn.h.
Referenced by NL_msm_create().
#define GRID_DONE | ( | _p | ) | free((_p)->buffer) |
Finished with grid, free its memory
Definition at line 61 of file msm_defn.h.
Referenced by NL_msm_cleanup().
#define GRID_INDEX | ( | _p, | |
_i, | |||
_j, | |||
_k | |||
) | (((_k)*((_p)->nj) + (_j))*((_p)->ni) + (_i)) |
Determine the signed flattened index for 3D grid datum
Definition at line 66 of file msm_defn.h.
Referenced by anterpolation(), gridcutoff(), interpolation(), and setup_grids().
#define GRID_INDEX_CHECK | ( | a, | |
_i, | |||
_j, | |||
_k | |||
) |
Definition at line 114 of file msm_defn.h.
Referenced by anterpolation(), gridcutoff(), interpolation(), and setup_grids().
#define GRID_INIT | ( | _p | ) |
Initialize grid to empty
Definition at line 55 of file msm_defn.h.
Referenced by setup_grids().
#define GRID_POINTER | ( | _p, | |
_i, | |||
_j, | |||
_k | |||
) | ((_p)->data + GRID_INDEX(_p, _i, _j, _k)) |
Obtain pointer to 3D grid datum
Definition at line 71 of file msm_defn.h.
#define GRID_RESIZE | ( | _p, | |
TYPE, | |||
__i0, | |||
__ni, | |||
__j0, | |||
__nj, | |||
__k0, | |||
__nk | |||
) |
Resize 3D grid buffer, setup its indexing. Grab more memory when needed (must be used within function returning int).
Definition at line 77 of file msm_defn.h.
Referenced by setup_grids().
#define GRID_TEMPLATE | ( | TYPE | ) |
Template to create a 3D grid to access data of given TYPE
Definition at line 43 of file msm_defn.h.
#define GRID_ZERO | ( | _p | ) | memset((_p)->buffer, 0, (_p)->numbytes) /* ; */ |
Definition at line 98 of file msm_defn.h.
Referenced by anterpolation().
#define NELEMS | ( | arr | ) | (sizeof(arr)/sizeof(arr[0])) |
Return number of elements in static array
Definition at line 39 of file msm_defn.h.
Referenced by NL_msm_approx(), NL_msm_approx_name(), NL_msm_split(), and NL_msm_split_name().
#define Q 3 |
Definition at line 35 of file msm_defn.h.
Referenced by bin_evaluation_1away(), and bin_evaluation_k_away().
#define SPOLY | ( | pg, | |
pdg, | |||
ra, | |||
split | |||
) |
SPOLY() calculates the polynomial part of the normalized smoothing of 1/r.
Returns g(R), where R=r/a, and (d/dR)g(R).
pg - float*, points to variable to receive g(R) pdg - float*, points to variable to receive (d/dR)g(R) ra - (r/a), assumed to be between 0 and 1 split - identify the type of smoothing used to split the potential
Definition at line 140 of file msm_defn.h.
Referenced by bin_evaluation_1away(), bin_evaluation_k_away(), ComputeNonbondedUtil::select(), and setup_grids().
#define SPOLY_SPREC | ( | pg, | |
pdg, | |||
ra, | |||
split | |||
) |
SPOLY_SPREC() calculates the polynomial part of the normalized smoothing of 1/r. Single precision version.
Returns g(R), where R=r/a, and (d/dR)g(R).
pg - float*, points to variable to receive g(R) pdg - float*, points to variable to receive (d/dR)g(R) ra - (r/a), assumed to be between 0 and 1 split - identify the type of smoothing used to split the potential
Definition at line 351 of file msm_defn.h.
Referenced by bin_evaluation_1away(), and bin_evaluation_k_away().
#define X 0 |
Index vectors for x,y,z,q coordinates
Definition at line 29 of file msm_defn.h.
Referenced by bin_evaluation_1away(), bin_evaluation_k_away(), ETITLE(), FEPTITLE(), FEPTITLE2(), FEPTITLE_BACK(), FORMAT(), QMETITLE(), setup_bins_1away(), setup_bins_k_away(), setup_cell_vectors(), spatial_hashing(), TITITLE(), write_dcdstep(), and write_dcdstep_par_slave().
#define Y 1 |
Definition at line 31 of file msm_defn.h.
Referenced by bin_evaluation_1away(), bin_evaluation_k_away(), setup_bins_1away(), setup_bins_k_away(), setup_cell_vectors(), spatial_hashing(), write_dcdstep(), and write_dcdstep_par_slave().
#define Z 2 |
Definition at line 33 of file msm_defn.h.
Referenced by bin_evaluation_1away(), bin_evaluation_k_away(), setup_bins_1away(), setup_bins_k_away(), setup_cell_vectors(), spatial_hashing(), write_dcdstep(), and write_dcdstep_par_slave().
GRID_TEMPLATE | ( | double | ) |
GRID_TEMPLATE | ( | float | ) |
void NL_msm_cleanup | ( | NL_Msm * | pm | ) |
Definition at line 7 of file msm_setup.c.
References NL_Msm_t::eh, NL_Msm_t::eh_f, NL_Msm_t::gc, NL_Msm_t::gc_f, GRID_DONE, NL_Msm_t::lyzd, NL_Msm_t::lyzd_f, NL_Msm_t::lzd, NL_Msm_t::lzd_f, NL_Msm_t::maxlevels, NL_Msm_t::msmflags, NL_MSM_COMPUTE_CUDA_GRID_CUTOFF, NL_MSM_COMPUTE_SPREC, NL_Msm_t::qh, and NL_Msm_t::qh_f.
Referenced by NL_msm_destroy().
int NL_msm_compute_long_range | ( | NL_Msm * | pm | ) |
Definition at line 52 of file msm_longrng.c.
References anterpolation(), gridcutoff(), interpolation(), NL_MSM_COMPUTE_CUDA_FALL_BACK, NL_MSM_COMPUTE_CUDA_GRID_CUTOFF, NL_MSM_COMPUTE_NONFACTORED, NL_MSM_ERROR_SUPPORT, NL_MSM_SUCCESS, prolongation(), prolongation_factored(), restriction(), restriction_factored(), wkf_timer_start(), wkf_timer_stop(), and wkf_timer_time().
Referenced by NL_msm_compute_force().
int NL_msm_compute_long_range_sprec | ( | NL_Msm * | pm | ) |
Definition at line 52 of file msm_longrng_sprec.c.
References anterpolation(), gridcutoff(), interpolation(), NL_MSM_COMPUTE_CUDA_FALL_BACK, NL_MSM_COMPUTE_CUDA_GRID_CUTOFF, NL_MSM_COMPUTE_NONFACTORED, NL_MSM_ERROR_SUPPORT, NL_MSM_SUCCESS, prolongation(), prolongation_factored(), restriction(), restriction_factored(), wkf_timer_start(), wkf_timer_stop(), and wkf_timer_time().
Referenced by NL_msm_compute_force_sprec().
int NL_msm_compute_short_range | ( | NL_Msm * | pm | ) |
Definition at line 37 of file msm_shortrng.c.
References bin_evaluation_1away(), bin_evaluation_k_away(), NL_Msm_t::maxatoms, NL_Msm_t::msmflags, NL_MSM_COMPUTE_1AWAY, NL_MSM_SUCCESS, NL_Msm_t::numatoms, setup_bin_data(), and spatial_hashing().
Referenced by NL_msm_compute_force().
int NL_msm_compute_short_range_sprec | ( | NL_Msm * | pm | ) |
Definition at line 37 of file msm_shortrng_sprec.c.
References bin_evaluation_1away(), bin_evaluation_k_away(), NL_Msm_t::maxatoms, NL_Msm_t::msmflags, NL_MSM_COMPUTE_1AWAY, NL_MSM_SUCCESS, NL_Msm_t::numatoms, setup_bin_data(), and spatial_hashing().
Referenced by NL_msm_compute_force_sprec().