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

msmpot.h File Reference

Library interface file. More...

Go to the source code of this file.

Typedefs

typedef Msmpot_t Msmpot
typedef enum MsmpotRetcode_t MsmpotRetcode
 Return codes for Msmpot library calls. More...


Enumerations

enum  {
  MSMPOT_INTERP_CUBIC = 0, MSMPOT_INTERP_QUINTIC, MSMPOT_INTERP_QUINTIC2, MSMPOT_INTERP_SEPTIC,
  MSMPOT_INTERP_SEPTIC3, MSMPOT_INTERP_NONIC, MSMPOT_INTERP_NONIC4, MSMPOT_INTERPMAX
}
enum  {
  MSMPOT_SPLIT_TAYLOR2 = 0, MSMPOT_SPLIT_TAYLOR3, MSMPOT_SPLIT_TAYLOR4, MSMPOT_SPLIT_TAYLOR5,
  MSMPOT_SPLIT_TAYLOR6, MSMPOT_SPLIT_TAYLOR7, MSMPOT_SPLIT_TAYLOR8, MSMPOT_SPLITMAX
}
enum  MsmpotRetcode_t {
  MSMPOT_SUCCESS = 0, MSMPOT_ERROR_ASSERT, MSMPOT_ERROR_MALLOC, MSMPOT_ERROR_PARAM,
  MSMPOT_ERROR_SUPPORT, MSMPOT_ERROR_CUDA_DEVREQ, MSMPOT_ERROR_CUDA_MALLOC, MSMPOT_ERROR_CUDA_MEMCPY,
  MSMPOT_ERROR_CUDA_KERNEL, MSMPOT_ERROR_CUDA_SUPPORT, MSMPOT_ERROR_UNKNOWN
}

Functions

MsmpotMsmpot_create (void)
 Constructor. More...

void Msmpot_destroy (Msmpot *)
 Destructor. More...

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. More...

int Msmpot_compute_exact (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 exact 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_use_cuda (Msmpot *, const int *devlist, int listlen, int cuda_optional)
const char * Msmpot_error_string (int retcode)
int Msmpot_configure (Msmpot *, int interp, int split, float cutoff, float hmin, int nlevels, float density, float binfill, float errtol, int usecuda)


Detailed Description

Library interface file.

Author:
David J. Hardy
Date:
December 2009

Definition in file msmpot.h.


Typedef Documentation

typedef struct Msmpot_t Msmpot
 

Private MSM data structure

Definition at line 33 of file msmpot.h.

typedef enum MsmpotRetcode_t MsmpotRetcode
 

Return codes for Msmpot library calls.

Zero is success, nonzero is failure.


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
MSMPOT_INTERP_CUBIC 
MSMPOT_INTERP_QUINTIC 
MSMPOT_INTERP_QUINTIC2 
MSMPOT_INTERP_SEPTIC 
MSMPOT_INTERP_SEPTIC3 
MSMPOT_INTERP_NONIC 
MSMPOT_INTERP_NONIC4 
MSMPOT_INTERPMAX 

Definition at line 238 of file msmpot.h.

anonymous enum
 

Enumeration values:
MSMPOT_SPLIT_TAYLOR2 
MSMPOT_SPLIT_TAYLOR3 
MSMPOT_SPLIT_TAYLOR4 
MSMPOT_SPLIT_TAYLOR5 
MSMPOT_SPLIT_TAYLOR6 
MSMPOT_SPLIT_TAYLOR7 
MSMPOT_SPLIT_TAYLOR8 
MSMPOT_SPLITMAX 

Definition at line 252 of file msmpot.h.

enum MsmpotRetcode_t
 

Enumeration values:
MSMPOT_SUCCESS  success
MSMPOT_ERROR_ASSERT  assertion failed
MSMPOT_ERROR_MALLOC  unable to allocate memory
MSMPOT_ERROR_PARAM  illegal parameter
MSMPOT_ERROR_SUPPORT  unsupported request
MSMPOT_ERROR_CUDA_DEVREQ  request failed for CUDA device
MSMPOT_ERROR_CUDA_MALLOC  uable to allocate memory on CUDA device
MSMPOT_ERROR_CUDA_MEMCPY  memory copy failed between host and CUDA device
MSMPOT_ERROR_CUDA_KERNEL  CUDA kernel execution failed
MSMPOT_ERROR_CUDA_SUPPORT  CUDA kernel does not support request
MSMPOT_ERROR_UNKNOWN  unknown error number

Definition at line 268 of file msmpot.h.


Function Documentation

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.

int Msmpot_compute_exact 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 exact 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.

The parameters are identical to Msmpot_compute().

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
This is meant only for testing accuracy of calculation and not intended for production use.

Referenced by VolMapCreateCoulombPotentialMSM::compute_frame.

int Msmpot_configure Msmpot  ,
int    interp,
int    split,
float    cutoff,
float    hmin,
int    nlevels,
float    density,
float    binfill,
float    errtol,
int    usecuda
 

Definition at line 75 of file msmpot_setup.c.

Msmpot* Msmpot_create void   
 

Constructor.

Definition at line 69 of file msmpot.c.

void Msmpot_destroy Msmpot  
 

Destructor.

Definition at line 84 of file msmpot.c.

Referenced by VolMapCreateCoulombPotentialMSM::compute_frame, and Msmpot_create.

const char* Msmpot_error_string int    retcode
 

Definition at line 41 of file msmpot.c.

References MSMPOT_INTERP_CUBIC, MSMPOT_INTERP_NONIC, MSMPOT_INTERP_NONIC4, MSMPOT_INTERP_QUINTIC, MSMPOT_INTERP_QUINTIC2, MSMPOT_INTERP_SEPTIC, MSMPOT_INTERP_SEPTIC3, and MSMPOT_INTERPMAX.

Referenced by VolMapCreateCoulombPotentialMSM::compute_frame.

int Msmpot_use_cuda Msmpot  ,
const int *    devlist,
int    listlen,
int    cuda_optional
 

Definition at line 93 of file msmpot.c.


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