NAMD
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PmePencilZ Class Reference

#include <PmeSolver.h>

Inheritance diagram for PmePencilZ:

Public Member Functions

PmePencilZ_SDAG_CODE PmePencilZ ()
 
 PmePencilZ (CkMigrateMessage *m)
 
virtual ~PmePencilZ ()
 
void skip ()
 

Protected Member Functions

void initBlockSizes ()
 
void submitReductions ()
 

Protected Attributes

PmeGrid pmeGrid
 
bool doEnergy
 
bool doVirial
 
FFTComputefftCompute
 
PmeTransposepmeTranspose
 
PmeKSpaceComputepmeKSpaceCompute
 
std::vector< int > blockSizes
 
Lattice lattice
 
int numStrayAtoms
 
int imsg
 

Detailed Description

Definition at line 239 of file PmeSolver.h.

Constructor & Destructor Documentation

PmePencilZ::PmePencilZ ( )

Definition at line 368 of file PmeSolver.C.

References doEnergy, doVirial, fftCompute, numStrayAtoms, ReductionMgr::Object(), pmeKSpaceCompute, pmeTranspose, REDUCTIONS_BASIC, and ReductionMgr::willSubmit().

368  {
369  __sdag_init();
370  setMigratable(false);
371  fftCompute = NULL;
372  pmeTranspose = NULL;
373  pmeKSpaceCompute = NULL;
375  doEnergy = false;
376  doVirial = false;
377  numStrayAtoms = 0;
378 }
bool doEnergy
Definition: PmeSolver.h:248
PmeKSpaceCompute * pmeKSpaceCompute
Definition: PmeSolver.h:251
SubmitReduction * willSubmit(int setID, int size=-1)
Definition: ReductionMgr.C:365
static ReductionMgr * Object(void)
Definition: ReductionMgr.h:278
bool doVirial
Definition: PmeSolver.h:248
PmeTranspose * pmeTranspose
Definition: PmeSolver.h:250
int numStrayAtoms
Definition: PmeSolver.h:254
FFTCompute * fftCompute
Definition: PmeSolver.h:249
PmePencilZ::PmePencilZ ( CkMigrateMessage *  m)

Definition at line 380 of file PmeSolver.C.

References NAMD_bug().

380  {
381  NAMD_bug("PmePencilZ cannot be migrated");
382  //__sdag_init();
383  // setMigratable(false);
384  // fftCompute = NULL;
385  // pmeTranspose = NULL;
386 }
void NAMD_bug(const char *err_msg)
Definition: common.C:123
PmePencilZ::~PmePencilZ ( )
virtual

Definition at line 388 of file PmeSolver.C.

References fftCompute, pmeKSpaceCompute, and pmeTranspose.

388  {
389  if (fftCompute != NULL) delete fftCompute;
390  if (pmeTranspose != NULL) delete pmeTranspose;
391  if (pmeKSpaceCompute != NULL) delete pmeKSpaceCompute;
392  delete reduction;
393 }
PmeKSpaceCompute * pmeKSpaceCompute
Definition: PmeSolver.h:251
PmeTranspose * pmeTranspose
Definition: PmeSolver.h:250
FFTCompute * fftCompute
Definition: PmeSolver.h:249

Member Function Documentation

void PmePencilZ::initBlockSizes ( )
protected

Definition at line 413 of file PmeSolver.C.

References blockSizes, getBlockDim(), Perm_Z_cX_Y, pmeGrid, z, and PmeGrid::zBlocks.

413  {
414  blockSizes.resize(pmeGrid.zBlocks);
415  for (int z=0;z < pmeGrid.zBlocks;z++) {
416  int i0, i1, j0, j1, k0, k1;
417  getBlockDim(pmeGrid, Perm_Z_cX_Y, z, thisIndex.x, thisIndex.y,
418  i0, i1, j0, j1, k0, k1);
419  int size = (i1-i0+1)*(j1-j0+1)*(k1-k0+1);
420  blockSizes[z] = size;
421  }
422 }
int zBlocks
Definition: PmeBase.h:22
std::vector< int > blockSizes
Definition: PmeSolver.h:252
PmeGrid pmeGrid
Definition: PmeSolver.h:247
gridSize z
static void getBlockDim(const PmeGrid &pmeGrid, const int permutation, const int iblock, const int jblock, const int kblock, int &i0, int &i1, int &j0, int &j1, int &k0, int &k1)
Definition: PmeSolverUtil.h:86
void PmePencilZ::skip ( void  )

Definition at line 464 of file PmeSolver.C.

References SubmitReduction::submit().

464  {
465  reduction->submit();
466 }
void submit(void)
Definition: ReductionMgr.h:323
void PmePencilZ::submitReductions ( )
protected

Definition at line 430 of file PmeSolver.C.

References PmeKSpaceCompute::getEnergy(), PmeKSpaceCompute::getVirial(), SubmitReduction::item(), NAMD_bug(), numStrayAtoms, pmeKSpaceCompute, REDUCTION_ELECT_ENERGY_SLOW, REDUCTION_STRAY_CHARGE_ERRORS, and SubmitReduction::submit().

430  {
431  if (pmeKSpaceCompute == NULL)
432  NAMD_bug("PmePencilZ::submitReductions, pmeKSpaceCompute not initialized");
433  double virial[9];
434  double energy = pmeKSpaceCompute->getEnergy();
435  // fprintf(stderr, "PmePencilZ::submitReductions(), numStrayAtoms %d\n", numStrayAtoms);
436  pmeKSpaceCompute->getVirial(virial);
437  reduction->item(REDUCTION_ELECT_ENERGY_SLOW) += energy;
438  reduction->item(REDUCTION_VIRIAL_SLOW_XX) += virial[0];
439  reduction->item(REDUCTION_VIRIAL_SLOW_XY) += virial[1];
440  reduction->item(REDUCTION_VIRIAL_SLOW_XZ) += virial[2];
441  reduction->item(REDUCTION_VIRIAL_SLOW_YX) += virial[3];
442  reduction->item(REDUCTION_VIRIAL_SLOW_YY) += virial[4];
443  reduction->item(REDUCTION_VIRIAL_SLOW_YZ) += virial[5];
444  reduction->item(REDUCTION_VIRIAL_SLOW_ZX) += virial[6];
445  reduction->item(REDUCTION_VIRIAL_SLOW_ZY) += virial[7];
446  reduction->item(REDUCTION_VIRIAL_SLOW_ZZ) += virial[8];
448  reduction->submit();
449  numStrayAtoms = 0;
450 }
BigReal & item(int i)
Definition: ReductionMgr.h:312
PmeKSpaceCompute * pmeKSpaceCompute
Definition: PmeSolver.h:251
void NAMD_bug(const char *err_msg)
Definition: common.C:123
virtual void getVirial(double *virial)=0
int numStrayAtoms
Definition: PmeSolver.h:254
void submit(void)
Definition: ReductionMgr.h:323
virtual double getEnergy()=0

Member Data Documentation

std::vector<int> PmePencilZ::blockSizes
protected

Definition at line 252 of file PmeSolver.h.

Referenced by initBlockSizes().

bool PmePencilZ::doEnergy
protected

Definition at line 248 of file PmeSolver.h.

Referenced by PmePencilZ().

bool PmePencilZ::doVirial
protected

Definition at line 248 of file PmeSolver.h.

Referenced by PmePencilZ().

FFTCompute* PmePencilZ::fftCompute
protected

Definition at line 249 of file PmeSolver.h.

Referenced by PmePencilZ(), and ~PmePencilZ().

int PmePencilZ::imsg
protected

Definition at line 257 of file PmeSolver.h.

Lattice PmePencilZ::lattice
protected

Definition at line 253 of file PmeSolver.h.

int PmePencilZ::numStrayAtoms
protected

Definition at line 254 of file PmeSolver.h.

Referenced by PmePencilZ(), and submitReductions().

PmeGrid PmePencilZ::pmeGrid
protected

Definition at line 247 of file PmeSolver.h.

Referenced by initBlockSizes().

PmeKSpaceCompute* PmePencilZ::pmeKSpaceCompute
protected

Definition at line 251 of file PmeSolver.h.

Referenced by PmePencilZ(), submitReductions(), and ~PmePencilZ().

PmeTranspose* PmePencilZ::pmeTranspose
protected

Definition at line 250 of file PmeSolver.h.

Referenced by PmePencilZ(), and ~PmePencilZ().


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