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 366 of file PmeSolver.C.

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

366  {
367  __sdag_init();
368  setMigratable(false);
369  fftCompute = NULL;
370  pmeTranspose = NULL;
371  pmeKSpaceCompute = NULL;
373  doEnergy = false;
374  doVirial = false;
375  numStrayAtoms = 0;
376 }
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 378 of file PmeSolver.C.

References NAMD_bug().

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

Definition at line 386 of file PmeSolver.C.

References fftCompute, pmeKSpaceCompute, and pmeTranspose.

386  {
387  if (fftCompute != NULL) delete fftCompute;
388  if (pmeTranspose != NULL) delete pmeTranspose;
389  if (pmeKSpaceCompute != NULL) delete pmeKSpaceCompute;
390  delete reduction;
391 }
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 411 of file PmeSolver.C.

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

411  {
412  blockSizes.resize(pmeGrid.zBlocks);
413  for (int z=0;z < pmeGrid.zBlocks;z++) {
414  int i0, i1, j0, j1, k0, k1;
415  getBlockDim(pmeGrid, Perm_Z_cX_Y, z, thisIndex.x, thisIndex.y,
416  i0, i1, j0, j1, k0, k1);
417  int size = (i1-i0+1)*(j1-j0+1)*(k1-k0+1);
418  blockSizes[z] = size;
419  }
420 }
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 462 of file PmeSolver.C.

References SubmitReduction::submit().

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

Definition at line 428 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().

428  {
429  if (pmeKSpaceCompute == NULL)
430  NAMD_bug("PmePencilZ::submitReductions, pmeKSpaceCompute not initialized");
431  double virial[9];
432  double energy = pmeKSpaceCompute->getEnergy();
433  // fprintf(stderr, "PmePencilZ::submitReductions(), numStrayAtoms %d\n", numStrayAtoms);
434  pmeKSpaceCompute->getVirial(virial);
435  reduction->item(REDUCTION_ELECT_ENERGY_SLOW) += energy;
436  reduction->item(REDUCTION_VIRIAL_SLOW_XX) += virial[0];
437  reduction->item(REDUCTION_VIRIAL_SLOW_XY) += virial[1];
438  reduction->item(REDUCTION_VIRIAL_SLOW_XZ) += virial[2];
439  reduction->item(REDUCTION_VIRIAL_SLOW_YX) += virial[3];
440  reduction->item(REDUCTION_VIRIAL_SLOW_YY) += virial[4];
441  reduction->item(REDUCTION_VIRIAL_SLOW_YZ) += virial[5];
442  reduction->item(REDUCTION_VIRIAL_SLOW_ZX) += virial[6];
443  reduction->item(REDUCTION_VIRIAL_SLOW_ZY) += virial[7];
444  reduction->item(REDUCTION_VIRIAL_SLOW_ZZ) += virial[8];
446  reduction->submit();
447  numStrayAtoms = 0;
448 }
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: