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, unsigned int grid=0)
 
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 ()
 
void setGrid (unsigned int i)
 

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
 
unsigned int multipleGridIndex
 

Detailed Description

Definition at line 317 of file PmeSolverUtil.h.

Constructor & Destructor Documentation

◆ PmeRealSpaceCompute()

PmeRealSpaceCompute::PmeRealSpaceCompute ( PmeGrid  pmeGrid,
const int  jblock,
const int  kblock,
unsigned int  grid = 0 
)
inline

Definition at line 336 of file PmeSolverUtil.h.

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

336  :
338  int x0, x1, y1, z1;
339  getPencilDim(pmeGrid, Perm_X_Y_Z, jblock, kblock, x0, x1, y0, y1, z0, z1);
340  xsize = x1-x0+1;
341  ysize = y1-y0+1;
342  zsize = z1-z0+1;
343  // Allocate enough data for storing the complex data
344  // dataSize = 2*(xsize/2+1)*ysize*zsize;
345  // Only allocate enough data for storing the real-space data
346  // Complex data is stored in FFTCompute
348  }
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:32
unsigned int multipleGridIndex

◆ ~PmeRealSpaceCompute()

virtual PmeRealSpaceCompute::~PmeRealSpaceCompute ( )
inlinevirtual

Definition at line 349 of file PmeSolverUtil.h.

349 {}

Member Function Documentation

◆ calcGridCoord() [1/5]

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

Definition at line 367 of file PmeSolverUtil.h.

Referenced by PmeAtomFiler::fileAtoms().

367  {
368  double w;
369  w = x*recip11 + 2.0;
370  return (double)((double)nfftx*(w - (floor(w + 0.5) - 0.5)));
371  }

◆ calcGridCoord() [2/5]

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 373 of file PmeSolverUtil.h.

376  {
377  double w;
378  w = x*recip11 + 2.0;
379  frx = (double)((double)nfftx*(w - (floor(w + 0.5) - 0.5)));
380  w = y*recip22 + 2.0;
381  fry = (double)((double)nffty*(w - (floor(w + 0.5) - 0.5)));
382  w = z*recip33 + 2.0;
383  frz = (double)((double)nfftz*(w - (floor(w + 0.5) - 0.5)));
384  }

◆ calcGridCoord() [3/5]

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 386 of file PmeSolverUtil.h.

389  {
390  float w;
391  w = x*recip11 + 2.0f;
392  frx = (float)(nfftx*(w - (floorf(w + 0.5f) - 0.5f)));
393  w = y*recip22 + 2.0f;
394  fry = (float)(nffty*(w - (floorf(w + 0.5f) - 0.5f)));
395  w = z*recip33 + 2.0f;
396  frz = (float)(nfftz*(w - (floorf(w + 0.5f) - 0.5f)));
397  }

◆ calcGridCoord() [4/5]

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 399 of file PmeSolverUtil.h.

400  {
401  frx = (float)(nfftx)*x;
402  fry = (float)(nffty)*y;
403  frz = (float)(nfftz)*z;
404  }

◆ calcGridCoord() [5/5]

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 406 of file PmeSolverUtil.h.

407  {
408  frx = (double)(nfftx)*x;
409  fry = (double)(nffty)*y;
410  frz = (double)(nfftz)*z;
411  }

◆ copyAtoms()

virtual void PmeRealSpaceCompute::copyAtoms ( const int  numAtoms,
const CudaAtom atoms 
)
pure virtual

Implemented in CudaPmeRealSpaceCompute.

◆ gatherForce()

virtual void PmeRealSpaceCompute::gatherForce ( Lattice lattice,
CudaForce force 
)
pure virtual

Implemented in CudaPmeRealSpaceCompute.

◆ getData()

float* PmeRealSpaceCompute::getData ( )
inline

Definition at line 361 of file PmeSolverUtil.h.

References data.

361 {return data;}

◆ getDataSize()

int PmeRealSpaceCompute::getDataSize ( )
inline

Definition at line 362 of file PmeSolverUtil.h.

References dataSize.

362 {return dataSize;}

◆ setGrid()

void PmeRealSpaceCompute::setGrid ( unsigned int  i)
inline

Definition at line 363 of file PmeSolverUtil.h.

References multipleGridIndex.

363  {
364  multipleGridIndex = i;
365  }
unsigned int multipleGridIndex

◆ spreadCharge()

virtual void PmeRealSpaceCompute::spreadCharge ( Lattice lattice)
pure virtual

Implemented in CudaPmeRealSpaceCompute.

Member Data Documentation

◆ data

float* PmeRealSpaceCompute::data
protected

◆ dataSize

int PmeRealSpaceCompute::dataSize
protected

◆ jblock

const int PmeRealSpaceCompute::jblock
protected

Definition at line 332 of file PmeSolverUtil.h.

Referenced by PmeRealSpaceCompute().

◆ kblock

const int PmeRealSpaceCompute::kblock
protected

Definition at line 332 of file PmeSolverUtil.h.

Referenced by PmeRealSpaceCompute().

◆ multipleGridIndex

unsigned int PmeRealSpaceCompute::multipleGridIndex
protected

Definition at line 334 of file PmeSolverUtil.h.

Referenced by setGrid().

◆ numAtoms

int PmeRealSpaceCompute::numAtoms
protected

◆ pmeGrid

PmeGrid PmeRealSpaceCompute::pmeGrid
protected

◆ xsize

int PmeRealSpaceCompute::xsize
protected

◆ y0

int PmeRealSpaceCompute::y0
protected

◆ ysize

int PmeRealSpaceCompute::ysize
protected

◆ z0

int PmeRealSpaceCompute::z0
protected

◆ zsize

int PmeRealSpaceCompute::zsize
protected

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