NAMD
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
PmeRealSpaceCompute Class Referenceabstract

#include <PmeSolverUtil.h>

Inheritance diagram for PmeRealSpaceCompute:
CudaPmeRealSpaceCompute

Public Member Functions

 PmeRealSpaceCompute (PmeGrid pmeGrid, const int jblock, const int kblock)
 
virtual ~PmeRealSpaceCompute ()
 
virtual void copyAtoms (const int numAtoms, const CudaAtom *atoms)=0
 
virtual void spreadCharge (Lattice &lattice)=0
 
virtual void gatherForce (Lattice &lattice, CudaForce *force)=0
 
float * getData ()
 
int getDataSize ()
 

Static Public Member Functions

static double calcGridCoord (const double x, const double recip11, const int nfftx)
 
static void calcGridCoord (const double x, const double y, const double z, const double recip11, const double recip22, const double recip33, const int nfftx, const int nffty, const int nfftz, double &frx, double &fry, double &frz)
 
static void calcGridCoord (const float x, const float y, const float z, const float recip11, const float recip22, const float recip33, const int nfftx, const int nffty, const int nfftz, float &frx, float &fry, float &frz)
 
static void calcGridCoord (const float x, const float y, const float z, const int nfftx, const int nffty, const int nfftz, float &frx, float &fry, float &frz)
 
static void calcGridCoord (const double x, const double y, const double z, const int nfftx, const int nffty, const int nfftz, double &frx, double &fry, double &frz)
 

Protected Attributes

int numAtoms
 
PmeGrid pmeGrid
 
int y0
 
int z0
 
int xsize
 
int ysize
 
int zsize
 
int dataSize
 
float * data
 
const int jblock
 
const int kblock
 

Detailed Description

Definition at line 309 of file PmeSolverUtil.h.

Constructor & Destructor Documentation

PmeRealSpaceCompute::PmeRealSpaceCompute ( PmeGrid  pmeGrid,
const int  jblock,
const int  kblock 
)
inline

Definition at line 326 of file PmeSolverUtil.h.

References dataSize, getPencilDim(), Perm_X_Y_Z, xsize, y0, ysize, z0, and zsize.

326  :
327  pmeGrid(pmeGrid), jblock(jblock), kblock(kblock), data(NULL) {
328  int x0, x1, y1, z1;
329  getPencilDim(pmeGrid, Perm_X_Y_Z, jblock, kblock, x0, x1, y0, y1, z0, z1);
330  xsize = x1-x0+1;
331  ysize = y1-y0+1;
332  zsize = z1-z0+1;
333  // Allocate enough data for storing the complex data
334  // dataSize = 2*(xsize/2+1)*ysize*zsize;
335  // Only allocate enough data for storing the real-space data
336  // Complex data is stored in FFTCompute
338  }
static void getPencilDim(const PmeGrid &pmeGrid, const int permutation, const int jblock, const int kblock, int &i0, int &i1, int &j0, int &j1, int &k0, int &k1)
Definition: PmeSolverUtil.h:29
virtual PmeRealSpaceCompute::~PmeRealSpaceCompute ( )
inlinevirtual

Definition at line 339 of file PmeSolverUtil.h.

339 {}

Member Function Documentation

static double PmeRealSpaceCompute::calcGridCoord ( const double  x,
const double  recip11,
const int  nfftx 
)
inlinestatic

Definition at line 354 of file PmeSolverUtil.h.

Referenced by PmeAtomFiler::fileAtoms().

354  {
355  double w;
356  w = x*recip11 + 2.0;
357  return (double)((double)nfftx*(w - (floor(w + 0.5) - 0.5)));
358  }
gridSize x
static void PmeRealSpaceCompute::calcGridCoord ( const double  x,
const double  y,
const double  z,
const double  recip11,
const double  recip22,
const double  recip33,
const int  nfftx,
const int  nffty,
const int  nfftz,
double &  frx,
double &  fry,
double &  frz 
)
inlinestatic

Definition at line 360 of file PmeSolverUtil.h.

363  {
364  double w;
365  w = x*recip11 + 2.0;
366  frx = (double)((double)nfftx*(w - (floor(w + 0.5) - 0.5)));
367  w = y*recip22 + 2.0;
368  fry = (double)((double)nffty*(w - (floor(w + 0.5) - 0.5)));
369  w = z*recip33 + 2.0;
370  frz = (double)((double)nfftz*(w - (floor(w + 0.5) - 0.5)));
371  }
gridSize z
gridSize y
gridSize x
static void PmeRealSpaceCompute::calcGridCoord ( const float  x,
const float  y,
const float  z,
const float  recip11,
const float  recip22,
const float  recip33,
const int  nfftx,
const int  nffty,
const int  nfftz,
float &  frx,
float &  fry,
float &  frz 
)
inlinestatic

Definition at line 373 of file PmeSolverUtil.h.

376  {
377  float w;
378  w = x*recip11 + 2.0f;
379  frx = (float)(nfftx*(w - (floorf(w + 0.5f) - 0.5f)));
380  w = y*recip22 + 2.0f;
381  fry = (float)(nffty*(w - (floorf(w + 0.5f) - 0.5f)));
382  w = z*recip33 + 2.0f;
383  frz = (float)(nfftz*(w - (floorf(w + 0.5f) - 0.5f)));
384  }
gridSize z
gridSize y
gridSize x
static void PmeRealSpaceCompute::calcGridCoord ( const float  x,
const float  y,
const float  z,
const int  nfftx,
const int  nffty,
const int  nfftz,
float &  frx,
float &  fry,
float &  frz 
)
inlinestatic

Definition at line 386 of file PmeSolverUtil.h.

References x, y, and z.

387  {
388  frx = (float)(nfftx)*x;
389  fry = (float)(nffty)*y;
390  frz = (float)(nfftz)*z;
391  }
gridSize z
gridSize y
gridSize x
static void PmeRealSpaceCompute::calcGridCoord ( const double  x,
const double  y,
const double  z,
const int  nfftx,
const int  nffty,
const int  nfftz,
double &  frx,
double &  fry,
double &  frz 
)
inlinestatic

Definition at line 393 of file PmeSolverUtil.h.

References x, y, and z.

394  {
395  frx = (double)(nfftx)*x;
396  fry = (double)(nffty)*y;
397  frz = (double)(nfftz)*z;
398  }
gridSize z
gridSize y
gridSize x
virtual void PmeRealSpaceCompute::copyAtoms ( const int  numAtoms,
const CudaAtom atoms 
)
pure virtual
virtual void PmeRealSpaceCompute::gatherForce ( Lattice lattice,
CudaForce force 
)
pure virtual
float* PmeRealSpaceCompute::getData ( )
inline

Definition at line 351 of file PmeSolverUtil.h.

References data.

Referenced by ComputePmeCUDADevice::activate_pencils().

351 {return data;}
int PmeRealSpaceCompute::getDataSize ( )
inline

Definition at line 352 of file PmeSolverUtil.h.

References dataSize.

Referenced by ComputePmeCUDADevice::activate_pencils().

352 {return dataSize;}
virtual void PmeRealSpaceCompute::spreadCharge ( Lattice lattice)
pure virtual

Member Data Documentation

float* PmeRealSpaceCompute::data
protected
int PmeRealSpaceCompute::dataSize
protected
const int PmeRealSpaceCompute::jblock
protected

Definition at line 324 of file PmeSolverUtil.h.

const int PmeRealSpaceCompute::kblock
protected

Definition at line 324 of file PmeSolverUtil.h.

int PmeRealSpaceCompute::numAtoms
protected
PmeGrid PmeRealSpaceCompute::pmeGrid
protected
int PmeRealSpaceCompute::xsize
protected
int PmeRealSpaceCompute::y0
protected
int PmeRealSpaceCompute::ysize
protected
int PmeRealSpaceCompute::z0
protected
int PmeRealSpaceCompute::zsize
protected

The documentation for this class was generated from the following file: