Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

msmpot_compute.c File Reference

#include "msmpot_internal.h"

Go to the source code of this file.

Defines

#define USE_BIN_HASHING

Functions

int Msmpot_compute (Msmpot *msm, float *epotmap, int mx, int my, int mz, float lx, float ly, float lz, float x0, float y0, float z0, float vx, float vy, float vz, const float *atom, int natoms)
 Calculate the electrostatic potential map for the provided array of charged atoms. The result is stored in epotmap. Returns MSMPOT_SUCCESS for success or nonzero error code indicating failure. More...

int Msmpot_compute_longrng (Msmpot *msm)
int bin_evaluation (Msmpot *msm)
int Msmpot_compute_shortrng_bins (Msmpot *msm)
int Msmpot_compute_shortrng_bin_neighborhood (Msmpot *msm, float rx, float ry, float rz)
int Msmpot_compute_shortrng_bin_hashing (Msmpot *msm)
int linklist_hashing (Msmpot *msm, const float *atom, int natoms)
int linklist_evaluation (Msmpot *msm, const float *atom)
int Msmpot_compute_shortrng_linklist (Msmpot *msm, const float *atom, int natoms)


Define Documentation

#define USE_BIN_HASHING
 

Definition at line 34 of file msmpot_compute.c.


Function Documentation

int bin_evaluation Msmpot   msm [static]
 

Definition at line 458 of file msmpot_compute.c.

References Msmpot_t::a, ATOM_SIZE, Msmpot_t::bin, Msmpot_t::bincount, Msmpot_t::bindepth, Msmpot_t::boff, Msmpot_t::dx, Msmpot_t::dy, Msmpot_t::dz, Msmpot_t::epotmap, Msmpot_t::invbx, Msmpot_t::invby, Msmpot_t::invbz, IS_SET_X, IS_SET_Y, IS_SET_Z, Msmpot_t::isperiodic, Msmpot_t::lx0, Msmpot_t::ly0, Msmpot_t::lz0, MSMPOT_SUCCESS, Msmpot_t::mx, Msmpot_t::my, Msmpot_t::mz, n, Msmpot_t::nboff, Msmpot_t::nbx, Msmpot_t::nby, Msmpot_t::nbz, Msmpot_t::px, Msmpot_t::py, Msmpot_t::pz, Msmpot_t::split, SPOLY, and z.

Referenced by Msmpot_compute_shortrng_bins.

int linklist_evaluation Msmpot   msm,
const float *    atom
[static]
 

Definition at line 704 of file msmpot_compute.c.

References Msmpot_t::a, ATOM_Q, ATOM_X, ATOM_Y, ATOM_Z, Msmpot_t::dx, Msmpot_t::dy, Msmpot_t::dz, Msmpot_t::epotmap, Msmpot_t::first_atom_index, IS_SET_X, IS_SET_Y, IS_SET_Z, Msmpot_t::isperiodic, Msmpot_t::lx, Msmpot_t::lx0, Msmpot_t::ly, Msmpot_t::ly0, Msmpot_t::lz, Msmpot_t::lz0, MSMPOT_SUCCESS, Msmpot_t::mx, Msmpot_t::my, Msmpot_t::mz, n, Msmpot_t::nbx, Msmpot_t::nby, Msmpot_t::nbz, Msmpot_t::next_atom_index, NULL, Msmpot_t::px, Msmpot_t::py, Msmpot_t::pz, Msmpot_t::split, SPOLY, and z.

Referenced by Msmpot_compute_shortrng_linklist.

int linklist_hashing Msmpot   msm,
const float *    atom,
int    natoms
[static]
 

Definition at line 629 of file msmpot_compute.c.

References ATOM_Q, ATOM_X, ATOM_Y, ATOM_Z, Msmpot_t::first_atom_index, Msmpot_t::invbx, Msmpot_t::invby, Msmpot_t::invbz, IS_SET_X, IS_SET_Y, IS_SET_Z, Msmpot_t::isperiodic, MSMPOT_SUCCESS, n, Msmpot_t::nbx, Msmpot_t::nby, Msmpot_t::nbz, Msmpot_t::next_atom_index, Msmpot_t::px0, Msmpot_t::py0, Msmpot_t::pz0, and z.

Referenced by Msmpot_compute_shortrng_linklist.

int Msmpot_compute Msmpot   pm,
float *    epotmap,
int    mx,
int    my,
int    mz,
float    lx,
float    ly,
float    lz,
float    x0,
float    y0,
float    z0,
float    vx,
float    vy,
float    vz,
const float *    atom,
int    natoms
 

Calculate the electrostatic potential map for the provided array of charged atoms. The result is stored in epotmap. Returns MSMPOT_SUCCESS for success or nonzero error code indicating failure.

am[in,out] pm Handle to #Msmpot
am[out] epotmap Buffer space for electrostatic potential map
calculation, assumed to be at least length stored "flat" in row-major order, i.e.,
&ep[i,j,k] == ep + ((k*my+j)*mx+i) 
am[in] mx Number of map lattice voxels in x-direction
am[in] my Number of map lattice voxels in y-direction
am[in] mz Number of map lattice voxels in z-direction
am[in] lx Map lattice length in x-direction,
must have lx
am[in] ly Map lattice length in y-direction,
must have ly
am[in] lz Map lattice length in z-direction,
must have lz
am[in] x0 Origin of map, lowest x-coordinate
am[in] y0 Origin of map, lowest y-coordinate
am[in] z0 Origin of map, lowest z-coordinate
am[in] vx Length of periodic cell side in x-direction,
must either have vx lx or set vx to indicate x-direction is non-periodic
am[in] vy Length of periodic cell side in y-direction,
must either have vy ly or set vy to indicate y-direction is non-periodic
am[in] vz Length of periodic cell side in z-direction,
must either have vz lz or set vz to indicate z-direction is non-periodic
am[in] atom Array of atoms, storing 4 floats x/y/z/q
for each atom giving position and charge
am[in] natoms Number of atoms, must be positive
The map lattice spacings are , , . The lattice voxel ep[i,j,k] (i=0,..,mx-1, etc.) is represented by rectangular coordinate: . This defines a cell-centered geometry, although the calculation is at the lower-lefthand corner of each cell.
There is some setup overhead on first call. The overhead is reduced for subsequent calls if map dimensions and number of atoms remain the same and if atoms have the same bounding box. Calls to Msmpot_compute() will allocate as much additional memory as needed, held until call to Msmpot_destroy().

Definition at line 36 of file msmpot_compute.c.

References Msmpot_t::atom, Msmpot_t::dx, Msmpot_t::dy, Msmpot_t::dz, Msmpot_t::epotmap, ERROR, Msmpot_t::isperiodic, Msmpot_t::lx, Msmpot_t::lx0, Msmpot_t::ly, Msmpot_t::ly0, Msmpot_t::lz, Msmpot_t::lz0, Msmpot_check_params, Msmpot_compute_longrng, Msmpot_compute_shortrng_bins, Msmpot_compute_shortrng_linklist, Msmpot_cuda_compute_shortrng, Msmpot_setup, MSMPOT_SUCCESS, Msmpot_t::mx, Msmpot_t::my, Msmpot_t::mz, Msmpot_t::natoms, Msmpot_t::px, Msmpot_t::py, Msmpot_t::pz, REPORT, SET_X, SET_Y, and SET_Z.

Referenced by VolMapCreateCoulombPotentialMSM::compute_frame.

int Msmpot_compute_longrng Msmpot   msm
 

Definition at line 139 of file msmpot_compute.c.

References ERRMSG, ERROR, Msmpot_t::interp, Msmpot_compute_longrng_cubic, MSMPOT_ERROR_SUPPORT, MSMPOT_INTERP_CUBIC, and MSMPOT_SUCCESS.

int Msmpot_compute_shortrng_bin_hashing Msmpot   msm
 

Definition at line 351 of file msmpot_compute.c.

References ASSERT, Msmpot_t::atom, ATOM_Q, ATOM_SIZE, ATOM_X, ATOM_Y, ATOM_Z, Msmpot_t::bin, bin, Msmpot_t::bincount, Msmpot_t::bindepth, ERROR, Msmpot_t::invbx, Msmpot_t::invby, Msmpot_t::invbz, IS_SET_X, IS_SET_Y, IS_SET_Z, Msmpot_t::isperiodic, Msmpot_t::maxover, MSMPOT_ERROR_ASSERT, MSMPOT_ERROR_MALLOC, MSMPOT_SUCCESS, n, Msmpot_t::natoms, Msmpot_t::nbx, Msmpot_t::nby, Msmpot_t::nbz, Msmpot_t::nover, NULL, Msmpot_t::over, Msmpot_t::px, Msmpot_t::px0, Msmpot_t::py, Msmpot_t::py0, Msmpot_t::pz, Msmpot_t::pz0, and z.

int Msmpot_compute_shortrng_bin_neighborhood Msmpot   msm,
float    rx,
float    ry,
float    rz
 

Definition at line 218 of file msmpot_compute.c.

References Msmpot_t::a, Msmpot_t::boff, Msmpot_t::bx, Msmpot_t::by, Msmpot_t::bz, ERROR, Msmpot_t::invbx, Msmpot_t::invby, Msmpot_t::invbz, Msmpot_t::maxboff, MSMPOT_ERROR_MALLOC, MSMPOT_SUCCESS, Msmpot_t::nboff, and NULL.

int Msmpot_compute_shortrng_bins Msmpot   msm
 

Definition at line 167 of file msmpot_compute.c.

References bin_evaluation, Msmpot_t::bx, Msmpot_t::by, Msmpot_t::bz, ERROR, Msmpot_compute_shortrng_bin_hashing, Msmpot_compute_shortrng_bin_neighborhood, Msmpot_compute_shortrng_linklist, MSMPOT_SUCCESS, Msmpot_t::nover, Msmpot_t::over, and REPORT.

int Msmpot_compute_shortrng_linklist Msmpot   msm,
const float *    atom,
int    natoms
 

Definition at line 608 of file msmpot_compute.c.

References ERROR, linklist_evaluation, linklist_hashing, MSMPOT_SUCCESS, and REPORT.


Generated on Fri Nov 8 02:46:04 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002