NAMD
Public Member Functions | Public Attributes | List of all members
msm::PatchData Struct Reference

Public Member Functions

AtomCoordArraycoordArray ()
 
ForceArrayforceArray ()
 
 PatchData (ComputeMsmMgr *pmgr, int pid)
 
void init (int natoms)
 
void anterpolation ()
 
void sendCharge ()
 
void addPotential (const Grid< Float > &epart)
 
void interpolation ()
 
void anterpolationC1Hermite ()
 
void sendChargeC1Hermite ()
 
void addPotentialC1Hermite (const Grid< C1Vector > &epart)
 
void interpolationC1Hermite ()
 

Public Attributes

ComputeMsmMgrmgr
 
Mapmap
 
PatchDiagrampd
 
AtomCoordArray coord
 
ForceArray force
 
Grid< Floatqh
 
Grid< Floateh
 
Grid< Floatsubgrid
 
Grid< C1Vectorqh_c1hermite
 
Grid< C1Vectoreh_c1hermite
 
Grid< C1Vectorsubgrid_c1hermite
 
BigReal energy
 
int cntRecvs
 
int patchID
 
int sequence
 

Detailed Description

Definition at line 1738 of file ComputeMsm.C.

Constructor & Destructor Documentation

msm::PatchData::PatchData ( ComputeMsmMgr pmgr,
int  pid 
)

Definition at line 6227 of file ComputeMsm.C.

References ComputeMsmMgr::approx, msm::Map::bsx, msm::Map::bsy, msm::Map::bsz, ComputeMsmMgr::C1HERMITE, eh, eh_c1hermite, msm::Grid< T >::init(), map, ComputeMsmMgr::mapData(), mgr, msm::PatchDiagram::nrange, patchID, msm::Map::patchList, pd, qh, qh_c1hermite, msm::Grid< T >::resize(), subgrid, and subgrid_c1hermite.

6227  {
6228  mgr = pmgr;
6229  map = &(mgr->mapData());
6230  patchID = pid;
6231  //PatchMap *pm = PatchMap::Object();
6232  pd = &(map->patchList[pid]);
6236  subgrid_c1hermite.resize(map->bsx[0] * map->bsy[0] * map->bsz[0]);
6237  }
6238  else {
6239  qh.init(pd->nrange);
6240  eh.init(pd->nrange);
6241  subgrid.resize(map->bsx[0] * map->bsy[0] * map->bsz[0]);
6242  }
6243 #ifdef MSM_TIMING
6244  mgr->addTiming();
6245 #endif
6246  }
Array< int > bsz
Definition: MsmMap.h:960
Array< PatchDiagram > patchList
Definition: MsmMap.h:955
Grid< C1Vector > qh_c1hermite
Definition: ComputeMsm.C:1747
Grid< Float > eh
Definition: ComputeMsm.C:1745
msm::Map & mapData()
Definition: ComputeMsm.C:447
Grid< C1Vector > subgrid_c1hermite
Definition: ComputeMsm.C:1749
Array< int > bsy
Definition: MsmMap.h:960
void init(const IndexRange &n)
Definition: MsmMap.h:603
Array< int > bsx
Definition: MsmMap.h:960
void resize(int n)
Definition: MsmMap.h:616
IndexRange nrange
Definition: MsmMap.h:898
Grid< C1Vector > eh_c1hermite
Definition: ComputeMsm.C:1748
PatchDiagram * pd
Definition: ComputeMsm.C:1741
Grid< Float > qh
Definition: ComputeMsm.C:1744
ComputeMsmMgr * mgr
Definition: ComputeMsm.C:1739
Grid< Float > subgrid
Definition: ComputeMsm.C:1746

Member Function Documentation

void msm::PatchData::addPotential ( const Grid< Float > &  epart)

Definition at line 6402 of file ComputeMsm.C.

References cntRecvs, MsmTimer::COMM, eh, interpolation(), mgr, msm::PatchDiagram::numRecvs, and pd.

6402  {
6403 #ifdef MSM_TIMING
6404  double startTime, stopTime;
6405  startTime = CkWallTimer();
6406 #endif
6407  eh += epart;
6408 #ifdef MSM_TIMING
6409  stopTime = CkWallTimer();
6410  mgr->msmTiming[MsmTimer::COMM] += stopTime - startTime;
6411 #endif
6412  if (++cntRecvs == pd->numRecvs) {
6413  interpolation();
6414  }
6415  }
Grid< Float > eh
Definition: ComputeMsm.C:1745
void interpolation()
Definition: ComputeMsm.C:6417
PatchDiagram * pd
Definition: ComputeMsm.C:1741
ComputeMsmMgr * mgr
Definition: ComputeMsm.C:1739
void msm::PatchData::addPotentialC1Hermite ( const Grid< C1Vector > &  epart)

Definition at line 6678 of file ComputeMsm.C.

References cntRecvs, MsmTimer::COMM, eh_c1hermite, interpolationC1Hermite(), mgr, msm::PatchDiagram::numRecvs, and pd.

6678  {
6679 #ifdef MSM_TIMING
6680  double startTime, stopTime;
6681  startTime = CkWallTimer();
6682 #endif
6683  eh_c1hermite += epart;
6684 #ifdef MSM_TIMING
6685  stopTime = CkWallTimer();
6686  mgr->msmTiming[MsmTimer::COMM] += stopTime - startTime;
6687 #endif
6688  if (++cntRecvs == pd->numRecvs) {
6690  }
6691  }
Grid< C1Vector > eh_c1hermite
Definition: ComputeMsm.C:1748
void interpolationC1Hermite()
Definition: ComputeMsm.C:6693
PatchDiagram * pd
Definition: ComputeMsm.C:1741
ComputeMsmMgr * mgr
Definition: ComputeMsm.C:1739
void msm::PatchData::anterpolation ( )

Definition at line 6265 of file ComputeMsm.C.

References MsmTimer::ANTERP, ComputeMsmMgr::approx, msm::Array< T >::buffer(), coord, msm::Grid< T >::data(), msm::IndexRange::ia(), msm::IndexRange::ib(), msm::IndexRange::ja(), msm::IndexRange::jb(), msm::IndexRange::ka(), msm::IndexRange::kb(), ComputeMsmMgr::lattice, msm::Array< T >::len(), ComputeMsmMgr::MAX_POLY_DEGREE, mgr, NAMD_die(), msm::IndexRange::ni(), msm::IndexRange::nj(), patchID, ComputeMsmMgr::PolyDegree, qh, ComputeMsmMgr::s_edge, Lattice::scale(), sendCharge(), ComputeMsmMgr::sglower, ComputeMsmMgr::shx_1, ComputeMsmMgr::shy_1, ComputeMsmMgr::shz_1, ComputeMsmMgr::stencil_1d(), Vector::x, Vector::y, and Vector::z.

6265  {
6266 #ifdef DEBUG_MSM_GRID
6267  printf("patchID %d: anterpolation\n", patchID);
6268 #endif
6269 
6270 #ifdef MSM_TIMING
6271  double startTime, stopTime;
6272  startTime = CkWallTimer();
6273 #endif
6274 #ifndef MSM_COMM_ONLY
6278 
6279  const Double rs_edge = Double( mgr->s_edge );
6280  const int s_size = ComputeMsmMgr::PolyDegree[mgr->approx] + 1;
6281 
6282  const int ia = qh.ia();
6283  const int ib = qh.ib();
6284  const int ja = qh.ja();
6285  const int jb = qh.jb();
6286  const int ka = qh.ka();
6287  const int kb = qh.kb();
6288  const int ni = qh.ni();
6289  const int nj = qh.nj();
6290  Float *qhbuffer = qh.data().buffer();
6291 
6292  // loop over atoms
6293  for (int n = 0; n < coord.len(); n++) {
6294  Float q = coord[n].charge;
6295  if (0==q) continue;
6296 
6297  ScaledPosition s = mgr->lattice.scale(coord[n].position);
6298 
6299  BigReal sx_hx = (s.x - mgr->sglower.x) * mgr->shx_1;
6300  BigReal sy_hy = (s.y - mgr->sglower.y) * mgr->shy_1;
6301  BigReal sz_hz = (s.z - mgr->sglower.z) * mgr->shz_1;
6302 
6303  BigReal xlo = floor(sx_hx) - rs_edge;
6304  BigReal ylo = floor(sy_hy) - rs_edge;
6305  BigReal zlo = floor(sz_hz) - rs_edge;
6306 
6307  // calculate Phi stencils along each dimension
6308  Float xdelta = Float(sx_hx - xlo);
6309  mgr->stencil_1d(xphi, xdelta);
6310  Float ydelta = Float(sy_hy - ylo);
6311  mgr->stencil_1d(yphi, ydelta);
6312  Float zdelta = Float(sz_hz - zlo);
6313  mgr->stencil_1d(zphi, zdelta);
6314 
6315  int ilo = int(xlo);
6316  int jlo = int(ylo);
6317  int klo = int(zlo);
6318 
6319  // test to see if stencil is within edges of grid
6320  int iswithin = ( ia <= ilo && (ilo+(s_size-1)) <= ib &&
6321  ja <= jlo && (jlo+(s_size-1)) <= jb &&
6322  ka <= klo && (klo+(s_size-1)) <= kb );
6323 
6324  if ( ! iswithin ) {
6325 #if 0
6326  printf("PE %d: atom %d: pos= %g %g %g patchID=%d\n",
6327  CkMyPe(), coord[n].id,
6328  coord[n].position.x, coord[n].position.y, coord[n].position.z,
6329  patchID);
6330  printf("PE %d: atom subgrid [%d..%d] x [%d..%d] x [%d..%d]\n",
6331  CkMyPe(),
6332  ilo, ilo+s_size-1, jlo, jlo+s_size-1, klo, klo+s_size-1);
6333  printf("PE %d: patch grid [%d..%d] x [%d..%d] x [%d..%d]\n",
6334  CkMyPe(),
6335  ia, ib, ja, jb, ka, kb);
6336 #endif
6337  char msg[100];
6338  snprintf(msg, sizeof(msg), "Atom %d is outside of the MSM grid.",
6339  coord[n].id);
6340  NAMD_die(msg);
6341  }
6342 
6343  // determine charge on cube of grid points around atom
6344  for (int k = 0; k < s_size; k++) {
6345  int koff = ((k+klo) - ka) * nj;
6346  Float ck = zphi[k] * q;
6347  for (int j = 0; j < s_size; j++) {
6348  int jkoff = (koff + (j+jlo) - ja) * ni;
6349  Float cjk = yphi[j] * ck;
6350  for (int i = 0; i < s_size; i++) {
6351  int ijkoff = jkoff + (i+ilo) - ia;
6352  qhbuffer[ijkoff] += xphi[i] * cjk;
6353  }
6354  }
6355  }
6356 
6357  } // end loop over atoms
6358 #endif // !MSM_COMM_ONLY
6359 #ifdef MSM_TIMING
6360  stopTime = CkWallTimer();
6361  mgr->msmTiming[MsmTimer::ANTERP] += stopTime - startTime;
6362 #endif
6363 
6364  sendCharge();
6365  }
int len() const
Definition: MsmMap.h:218
const Array< T > & data() const
Definition: MsmMap.h:666
int ka() const
Definition: MsmMap.h:438
Definition: Vector.h:64
double Double
Definition: MsmMap.h:75
BigReal z
Definition: Vector.h:66
int ia() const
Definition: MsmMap.h:434
BigReal shy_1
Definition: ComputeMsm.C:614
BigReal shz_1
Definition: ComputeMsm.C:614
void sendCharge()
Definition: ComputeMsm.C:6367
void stencil_1d(Float phi[], Float t)
Definition: ComputeMsm.C:761
Vector sglower
Definition: ComputeMsm.C:610
int kb() const
Definition: MsmMap.h:439
int jb() const
Definition: MsmMap.h:437
int nj() const
Definition: MsmMap.h:441
BigReal x
Definition: Vector.h:66
void NAMD_die(const char *err_msg)
Definition: common.C:83
float Float
Definition: MsmMap.h:74
BigReal y
Definition: Vector.h:66
static const int PolyDegree[NUM_APPROX]
Definition: ComputeMsm.C:649
AtomCoordArray coord
Definition: ComputeMsm.C:1742
ScaledPosition scale(Position p) const
Definition: Lattice.h:83
int ib() const
Definition: MsmMap.h:435
int ja() const
Definition: MsmMap.h:436
Grid< Float > qh
Definition: ComputeMsm.C:1744
int ni() const
Definition: MsmMap.h:440
BigReal shx_1
Definition: ComputeMsm.C:614
ComputeMsmMgr * mgr
Definition: ComputeMsm.C:1739
const T * buffer() const
Definition: MsmMap.h:259
double BigReal
Definition: common.h:112
Lattice lattice
Definition: ComputeMsm.C:592
void msm::PatchData::anterpolationC1Hermite ( )

Definition at line 6543 of file ComputeMsm.C.

References MsmTimer::ANTERP, msm::Array< T >::buffer(), coord, D000, D001, D010, D011, D100, D101, D110, D111, msm::Grid< T >::data(), ComputeMsmMgr::hxlen, ComputeMsmMgr::hylen, ComputeMsmMgr::hzlen, msm::IndexRange::ia(), msm::IndexRange::ib(), msm::IndexRange::ja(), msm::IndexRange::jb(), msm::IndexRange::ka(), msm::IndexRange::kb(), ComputeMsmMgr::lattice, msm::Array< T >::len(), mgr, NAMD_die(), msm::IndexRange::ni(), msm::IndexRange::nj(), patchID, qh_c1hermite, Lattice::scale(), sendChargeC1Hermite(), ComputeMsmMgr::sglower, ComputeMsmMgr::shx_1, ComputeMsmMgr::shy_1, ComputeMsmMgr::shz_1, ComputeMsmMgr::stencil_1d_c1hermite(), C1Vector::velem, Vector::x, Vector::y, and Vector::z.

6543  {
6544 #ifdef DEBUG_MSM_GRID
6545  printf("patchID %d: anterpolationC1Hermite\n", patchID);
6546 #endif
6547 
6548 #ifdef MSM_TIMING
6549  double startTime, stopTime;
6550  startTime = CkWallTimer();
6551 #endif
6552 #ifndef MSM_COMM_ONLY
6553  Float xphi[2], xpsi[2];
6554  Float yphi[2], ypsi[2];
6555  Float zphi[2], zpsi[2];
6556 
6557  const Float hx = Float(mgr->hxlen); // real space grid spacing
6558  const Float hy = Float(mgr->hylen);
6559  const Float hz = Float(mgr->hzlen);
6560 
6561  const int ia = qh_c1hermite.ia();
6562  const int ib = qh_c1hermite.ib();
6563  const int ja = qh_c1hermite.ja();
6564  const int jb = qh_c1hermite.jb();
6565  const int ka = qh_c1hermite.ka();
6566  const int kb = qh_c1hermite.kb();
6567  const int ni = qh_c1hermite.ni();
6568  const int nj = qh_c1hermite.nj();
6569  C1Vector *qhbuffer = qh_c1hermite.data().buffer();
6570 
6571  // loop over atoms
6572  for (int n = 0; n < coord.len(); n++) {
6573  Float q = coord[n].charge;
6574  if (0==q) continue;
6575 
6576  ScaledPosition s = mgr->lattice.scale(coord[n].position);
6577 
6578  BigReal sx_hx = (s.x - mgr->sglower.x) * mgr->shx_1;
6579  BigReal sy_hy = (s.y - mgr->sglower.y) * mgr->shy_1;
6580  BigReal sz_hz = (s.z - mgr->sglower.z) * mgr->shz_1;
6581 
6582  BigReal xlo = floor(sx_hx);
6583  BigReal ylo = floor(sy_hy);
6584  BigReal zlo = floor(sz_hz);
6585 
6586  // calculate Phi stencils along each dimension
6587  Float xdelta = Float(sx_hx - xlo);
6588  mgr->stencil_1d_c1hermite(xphi, xpsi, xdelta, hx);
6589  Float ydelta = Float(sy_hy - ylo);
6590  mgr->stencil_1d_c1hermite(yphi, ypsi, ydelta, hy);
6591  Float zdelta = Float(sz_hz - zlo);
6592  mgr->stencil_1d_c1hermite(zphi, zpsi, zdelta, hz);
6593 
6594  int ilo = int(xlo);
6595  int jlo = int(ylo);
6596  int klo = int(zlo);
6597 
6598  // test to see if stencil is within edges of grid
6599  int iswithin = ( ia <= ilo && ilo < ib &&
6600  ja <= jlo && jlo < jb &&
6601  ka <= klo && klo < kb );
6602 
6603  if ( ! iswithin ) {
6604  char msg[100];
6605  snprintf(msg, sizeof(msg), "Atom %d is outside of the MSM grid.",
6606  coord[n].id);
6607  NAMD_die(msg);
6608  }
6609 
6610  // determine charge on cube of grid points around atom
6611  for (int k = 0; k < 2; k++) {
6612  int koff = ((k+klo) - ka) * nj;
6613  Float c_zphi = zphi[k] * q;
6614  Float c_zpsi = zpsi[k] * q;
6615  for (int j = 0; j < 2; j++) {
6616  int jkoff = (koff + (j+jlo) - ja) * ni;
6617  Float c_yphi_zphi = yphi[j] * c_zphi;
6618  Float c_ypsi_zphi = ypsi[j] * c_zphi;
6619  Float c_yphi_zpsi = yphi[j] * c_zpsi;
6620  Float c_ypsi_zpsi = ypsi[j] * c_zpsi;
6621  for (int i = 0; i < 2; i++) {
6622  int ijkoff = jkoff + (i+ilo) - ia;
6623  qhbuffer[ijkoff].velem[D000] += xphi[i] * c_yphi_zphi;
6624  qhbuffer[ijkoff].velem[D100] += xpsi[i] * c_yphi_zphi;
6625  qhbuffer[ijkoff].velem[D010] += xphi[i] * c_ypsi_zphi;
6626  qhbuffer[ijkoff].velem[D001] += xphi[i] * c_yphi_zpsi;
6627  qhbuffer[ijkoff].velem[D110] += xpsi[i] * c_ypsi_zphi;
6628  qhbuffer[ijkoff].velem[D101] += xpsi[i] * c_yphi_zpsi;
6629  qhbuffer[ijkoff].velem[D011] += xphi[i] * c_ypsi_zpsi;
6630  qhbuffer[ijkoff].velem[D111] += xpsi[i] * c_ypsi_zpsi;
6631  }
6632  }
6633  }
6634 
6635  } // end loop over atoms
6636 
6637 #endif // !MSM_COMM_ONLY
6638 #ifdef MSM_TIMING
6639  stopTime = CkWallTimer();
6640  mgr->msmTiming[MsmTimer::ANTERP] += stopTime - startTime;
6641 #endif
6642 
6644  }
Grid< C1Vector > qh_c1hermite
Definition: ComputeMsm.C:1747
int len() const
Definition: MsmMap.h:218
Definition: MsmMap.h:187
Definition: MsmMap.h:187
const Array< T > & data() const
Definition: MsmMap.h:666
int ka() const
Definition: MsmMap.h:438
Definition: Vector.h:64
BigReal z
Definition: Vector.h:66
int ia() const
Definition: MsmMap.h:434
BigReal shy_1
Definition: ComputeMsm.C:614
Definition: MsmMap.h:187
BigReal shz_1
Definition: ComputeMsm.C:614
Vector sglower
Definition: ComputeMsm.C:610
BigReal hxlen
Definition: ComputeMsm.C:599
Definition: MsmMap.h:187
int kb() const
Definition: MsmMap.h:439
BigReal hzlen
Definition: ComputeMsm.C:599
int jb() const
Definition: MsmMap.h:437
int nj() const
Definition: MsmMap.h:441
BigReal x
Definition: Vector.h:66
void NAMD_die(const char *err_msg)
Definition: common.C:83
Definition: MsmMap.h:187
float Float
Definition: MsmMap.h:74
Definition: MsmMap.h:187
BigReal y
Definition: Vector.h:66
Definition: MsmMap.h:187
void stencil_1d_c1hermite(Float phi[], Float psi[], Float t, Float h)
Definition: ComputeMsm.C:1244
AtomCoordArray coord
Definition: ComputeMsm.C:1742
ScaledPosition scale(Position p) const
Definition: Lattice.h:83
int ib() const
Definition: MsmMap.h:435
void sendChargeC1Hermite()
Definition: ComputeMsm.C:6646
Definition: MsmMap.h:187
int ja() const
Definition: MsmMap.h:436
int ni() const
Definition: MsmMap.h:440
BigReal shx_1
Definition: ComputeMsm.C:614
ComputeMsmMgr * mgr
Definition: ComputeMsm.C:1739
BigReal hylen
Definition: ComputeMsm.C:599
Float velem[C1_VECTOR_SIZE]
Definition: MsmMap.h:87
const T * buffer() const
Definition: MsmMap.h:259
double BigReal
Definition: common.h:112
Lattice lattice
Definition: ComputeMsm.C:592
AtomCoordArray& msm::PatchData::coordArray ( )
inline

Definition at line 1756 of file ComputeMsm.C.

Referenced by ComputeMsm::doWork().

1756 { return coord; }
AtomCoordArray coord
Definition: ComputeMsm.C:1742
ForceArray& msm::PatchData::forceArray ( )
inline

Definition at line 1757 of file ComputeMsm.C.

1757 { return force; }
ForceArray force
Definition: ComputeMsm.C:1743
void msm::PatchData::init ( int  natoms)

Definition at line 6248 of file ComputeMsm.C.

References ComputeMsmMgr::approx, ComputeMsmMgr::C1HERMITE, cntRecvs, coord, eh, eh_c1hermite, energy, force, mgr, qh, qh_c1hermite, msm::Grid< T >::reset(), and msm::Array< T >::resize().

Referenced by ComputeMsm::doWork().

6248  {
6249  coord.resize(natoms);
6250  force.resize(natoms);
6251  cntRecvs = 0;
6252  energy = 0;
6253  //memset(virial, 0, 3*3*sizeof(BigReal));
6254  for (int i = 0; i < natoms; i++) force[i] = 0;
6256  qh_c1hermite.reset(0);
6257  eh_c1hermite.reset(0);
6258  }
6259  else {
6260  qh.reset(0);
6261  eh.reset(0);
6262  }
6263  }
Grid< C1Vector > qh_c1hermite
Definition: ComputeMsm.C:1747
void reset(const T &t)
Definition: MsmMap.h:670
void resize(int n)
Definition: MsmMap.h:254
Grid< Float > eh
Definition: ComputeMsm.C:1745
BigReal energy
Definition: ComputeMsm.C:1750
ForceArray force
Definition: ComputeMsm.C:1743
AtomCoordArray coord
Definition: ComputeMsm.C:1742
Grid< C1Vector > eh_c1hermite
Definition: ComputeMsm.C:1748
Grid< Float > qh
Definition: ComputeMsm.C:1744
ComputeMsmMgr * mgr
Definition: ComputeMsm.C:1739
void msm::PatchData::interpolation ( )

Definition at line 6417 of file ComputeMsm.C.

References ComputeMsmMgr::approx, msm::Array< T >::buffer(), coord, ComputeMsmMgr::d_stencil_1d(), msm::Grid< T >::data(), ComputeMsmMgr::doneCompute(), eh, energy, force, ComputeMsmMgr::gzero, ComputeMsmMgr::hxlen_1, ComputeMsmMgr::hylen_1, ComputeMsmMgr::hzlen_1, msm::IndexRange::ia(), msm::IndexRange::ib(), MsmTimer::INTERP, msm::IndexRange::ja(), msm::IndexRange::jb(), msm::IndexRange::ka(), msm::IndexRange::kb(), ComputeMsmMgr::lattice, msm::Array< T >::len(), ComputeMsmMgr::MAX_POLY_DEGREE, mgr, NAMD_die(), msm::IndexRange::ni(), msm::IndexRange::nj(), patchID, ComputeMsmMgr::PolyDegree, ComputeMsmMgr::s_edge, Lattice::scale(), ComputeMsmMgr::sglower, ComputeMsmMgr::shx_1, ComputeMsmMgr::shy_1, ComputeMsmMgr::shz_1, ComputeMsmMgr::srx_x, ComputeMsmMgr::srx_y, ComputeMsmMgr::srx_z, ComputeMsmMgr::sry_x, ComputeMsmMgr::sry_y, ComputeMsmMgr::sry_z, ComputeMsmMgr::srz_x, ComputeMsmMgr::srz_y, ComputeMsmMgr::srz_z, Vector::x, Vector::y, and Vector::z.

Referenced by addPotential().

6417  {
6418 #ifdef DEBUG_MSM_GRID
6419  printf("patchID %d: interpolation\n", patchID);
6420 #endif
6421 
6422 #ifdef MSM_TIMING
6423  double startTime, stopTime;
6424  startTime = CkWallTimer();
6425 #endif
6426 #ifndef MSM_COMM_ONLY
6427  BigReal energy_self = 0;
6428 
6435 
6436  const Double rs_edge = Double( mgr->s_edge );
6437  const int s_size = ComputeMsmMgr::PolyDegree[mgr->approx] + 1;
6438 
6439  const Float hx_1 = Float(mgr->hxlen_1); // real space inverse grid spacing
6440  const Float hy_1 = Float(mgr->hylen_1);
6441  const Float hz_1 = Float(mgr->hzlen_1);
6442 
6443  const int ia = eh.ia();
6444  const int ib = eh.ib();
6445  const int ja = eh.ja();
6446  const int jb = eh.jb();
6447  const int ka = eh.ka();
6448  const int kb = eh.kb();
6449  const int ni = eh.ni();
6450  const int nj = eh.nj();
6451  Float *ehbuffer = eh.data().buffer();
6452 
6453  // loop over atoms
6454  for (int n = 0; n < coord.len(); n++) {
6455  Float q = coord[n].charge;
6456  if (0==q) continue;
6457 
6458  ScaledPosition s = mgr->lattice.scale(coord[n].position);
6459 
6460  BigReal sx_hx = (s.x - mgr->sglower.x) * mgr->shx_1;
6461  BigReal sy_hy = (s.y - mgr->sglower.y) * mgr->shy_1;
6462  BigReal sz_hz = (s.z - mgr->sglower.z) * mgr->shz_1;
6463 
6464  BigReal xlo = floor(sx_hx) - rs_edge;
6465  BigReal ylo = floor(sy_hy) - rs_edge;
6466  BigReal zlo = floor(sz_hz) - rs_edge;
6467 
6468  // calculate Phi stencils along each dimension
6469  Float xdelta = Float(sx_hx - xlo);
6470  mgr->d_stencil_1d(dxphi, xphi, xdelta, hx_1);
6471  Float ydelta = Float(sy_hy - ylo);
6472  mgr->d_stencil_1d(dyphi, yphi, ydelta, hy_1);
6473  Float zdelta = Float(sz_hz - zlo);
6474  mgr->d_stencil_1d(dzphi, zphi, zdelta, hz_1);
6475 
6476  int ilo = int(xlo);
6477  int jlo = int(ylo);
6478  int klo = int(zlo);
6479 
6480 #if 0
6481  // XXX don't need to test twice!
6482 
6483  // test to see if stencil is within edges of grid
6484  int iswithin = ( ia <= ilo && (ilo+(s_size-1)) <= ib &&
6485  ja <= jlo && (jlo+(s_size-1)) <= jb &&
6486  ka <= klo && (klo+(s_size-1)) <= kb );
6487 
6488  if ( ! iswithin ) {
6489  char msg[100];
6490  snprintf(msg, sizeof(msg), "Atom %d is outside of the MSM grid.",
6491  coord[n].id);
6492  NAMD_die(msg);
6493  }
6494 #endif
6495 
6496  // determine force on atom from surrounding potential grid points
6497  //Force f = 0;
6498  //BigReal e = 0;
6499  Float fx=0, fy=0, fz=0, e=0;
6500  for (int k = 0; k < s_size; k++) {
6501  int koff = ((k+klo) - ka) * nj;
6502  for (int j = 0; j < s_size; j++) {
6503  int jkoff = (koff + (j+jlo) - ja) * ni;
6504  Float cx = yphi[j] * zphi[k];
6505  Float cy = dyphi[j] * zphi[k];
6506  Float cz = yphi[j] * dzphi[k];
6507  for (int i = 0; i < s_size; i++) {
6508  int ijkoff = jkoff + (i+ilo) - ia;
6509  Float ec = ehbuffer[ijkoff];
6510  fx += ec * dxphi[i] * cx;
6511  fy += ec * xphi[i] * cy;
6512  fz += ec * xphi[i] * cz;
6513  e += ec * xphi[i] * cx;
6514  }
6515  }
6516  }
6517 
6518 #if 0
6519  force[n].x -= q * (mgr->srx_x * fx + mgr->srx_y * fy + mgr->srx_z * fz);
6520  force[n].y -= q * (mgr->sry_x * fx + mgr->sry_y * fy + mgr->sry_z * fz);
6521  force[n].z -= q * (mgr->srz_x * fx + mgr->srz_y * fy + mgr->srz_z * fz);
6522 #endif
6523  force[n].x -= q * fx;
6524  force[n].y -= q * fy;
6525  force[n].z -= q * fz;
6526  energy += q * e;
6527  energy_self += q * q;
6528 
6529  } // end loop over atoms
6530 
6531  energy_self *= mgr->gzero;
6532  energy -= energy_self;
6533  energy *= 0.5;
6534 #endif // !MSM_COMM_ONLY
6535 #ifdef MSM_TIMING
6536  stopTime = CkWallTimer();
6537  mgr->msmTiming[MsmTimer::INTERP] += stopTime - startTime;
6538  mgr->doneTiming();
6539 #endif
6540  mgr->doneCompute();
6541  }
Grid< Float > eh
Definition: ComputeMsm.C:1745
int len() const
Definition: MsmMap.h:218
const Array< T > & data() const
Definition: MsmMap.h:666
int ka() const
Definition: MsmMap.h:438
Definition: Vector.h:64
double Double
Definition: MsmMap.h:75
void doneCompute()
Definition: ComputeMsm.C:6040
BigReal z
Definition: Vector.h:66
int ia() const
Definition: MsmMap.h:434
BigReal shy_1
Definition: ComputeMsm.C:614
BigReal energy
Definition: ComputeMsm.C:1750
BigReal shz_1
Definition: ComputeMsm.C:614
BigReal hylen_1
Definition: ComputeMsm.C:600
Vector sglower
Definition: ComputeMsm.C:610
BigReal hzlen_1
Definition: ComputeMsm.C:600
int kb() const
Definition: MsmMap.h:439
int jb() const
Definition: MsmMap.h:437
int nj() const
Definition: MsmMap.h:441
BigReal x
Definition: Vector.h:66
void NAMD_die(const char *err_msg)
Definition: common.C:83
ForceArray force
Definition: ComputeMsm.C:1743
float Float
Definition: MsmMap.h:74
BigReal y
Definition: Vector.h:66
void d_stencil_1d(Float dphi[], Float phi[], Float t, Float h_1)
Definition: ComputeMsm.C:937
static const int PolyDegree[NUM_APPROX]
Definition: ComputeMsm.C:649
AtomCoordArray coord
Definition: ComputeMsm.C:1742
ScaledPosition scale(Position p) const
Definition: Lattice.h:83
int ib() const
Definition: MsmMap.h:435
int ja() const
Definition: MsmMap.h:436
int ni() const
Definition: MsmMap.h:440
BigReal shx_1
Definition: ComputeMsm.C:614
ComputeMsmMgr * mgr
Definition: ComputeMsm.C:1739
BigReal gzero
Definition: ComputeMsm.C:608
const T * buffer() const
Definition: MsmMap.h:259
double BigReal
Definition: common.h:112
BigReal hxlen_1
Definition: ComputeMsm.C:600
Lattice lattice
Definition: ComputeMsm.C:592
void msm::PatchData::interpolationC1Hermite ( )

Definition at line 6693 of file ComputeMsm.C.

References msm::Array< T >::buffer(), coord, D000, D001, D010, D011, D100, D101, D110, D111, ComputeMsmMgr::d_stencil_1d_c1hermite(), msm::Grid< T >::data(), ComputeMsmMgr::doneCompute(), eh_c1hermite, energy, force, ComputeMsmMgr::gzero, ComputeMsmMgr::hxlen, ComputeMsmMgr::hxlen_1, ComputeMsmMgr::hylen, ComputeMsmMgr::hylen_1, ComputeMsmMgr::hzlen, ComputeMsmMgr::hzlen_1, msm::IndexRange::ia(), msm::IndexRange::ib(), MsmTimer::INTERP, msm::IndexRange::ja(), msm::IndexRange::jb(), msm::IndexRange::ka(), msm::IndexRange::kb(), ComputeMsmMgr::lattice, msm::Array< T >::len(), mgr, NAMD_die(), msm::IndexRange::ni(), msm::IndexRange::nj(), patchID, Lattice::scale(), ComputeMsmMgr::sglower, ComputeMsmMgr::shx_1, ComputeMsmMgr::shy_1, ComputeMsmMgr::shz_1, ComputeMsmMgr::srx_x, ComputeMsmMgr::srx_y, ComputeMsmMgr::srx_z, ComputeMsmMgr::sry_x, ComputeMsmMgr::sry_y, ComputeMsmMgr::sry_z, ComputeMsmMgr::srz_x, ComputeMsmMgr::srz_y, ComputeMsmMgr::srz_z, C1Vector::velem, Vector::x, Vector::y, and Vector::z.

Referenced by addPotentialC1Hermite().

6693  {
6694 #ifdef DEBUG_MSM_GRID
6695  printf("patchID %d: interpolation\n", patchID);
6696 #endif
6697 
6698 #ifdef MSM_TIMING
6699  double startTime, stopTime;
6700  startTime = CkWallTimer();
6701 #endif
6702 #ifndef MSM_COMM_ONLY
6703  BigReal energy_self = 0;
6704 
6705  Float xphi[2], dxphi[2], xpsi[2], dxpsi[2];
6706  Float yphi[2], dyphi[2], ypsi[2], dypsi[2];
6707  Float zphi[2], dzphi[2], zpsi[2], dzpsi[2];
6708 
6709  const Float hx = Float(mgr->hxlen); // real space grid spacing
6710  const Float hy = Float(mgr->hylen);
6711  const Float hz = Float(mgr->hzlen);
6712 
6713  const Float hx_1 = Float(mgr->hxlen_1); // real space inverse grid spacing
6714  const Float hy_1 = Float(mgr->hylen_1);
6715  const Float hz_1 = Float(mgr->hzlen_1);
6716 
6717  const int ia = eh_c1hermite.ia();
6718  const int ib = eh_c1hermite.ib();
6719  const int ja = eh_c1hermite.ja();
6720  const int jb = eh_c1hermite.jb();
6721  const int ka = eh_c1hermite.ka();
6722  const int kb = eh_c1hermite.kb();
6723  const int ni = eh_c1hermite.ni();
6724  const int nj = eh_c1hermite.nj();
6725  C1Vector *ehbuffer = eh_c1hermite.data().buffer();
6726 
6727  // loop over atoms
6728  for (int n = 0; n < coord.len(); n++) {
6729  Float q = coord[n].charge;
6730  if (0==q) continue;
6731 
6732  ScaledPosition s = mgr->lattice.scale(coord[n].position);
6733 
6734  BigReal sx_hx = (s.x - mgr->sglower.x) * mgr->shx_1;
6735  BigReal sy_hy = (s.y - mgr->sglower.y) * mgr->shy_1;
6736  BigReal sz_hz = (s.z - mgr->sglower.z) * mgr->shz_1;
6737 
6738  BigReal xlo = floor(sx_hx);
6739  BigReal ylo = floor(sy_hy);
6740  BigReal zlo = floor(sz_hz);
6741 
6742  // calculate Phi stencils along each dimension
6743  Float xdelta = Float(sx_hx - xlo);
6744  mgr->d_stencil_1d_c1hermite(dxphi, xphi, dxpsi, xpsi,
6745  xdelta, hx, hx_1);
6746  Float ydelta = Float(sy_hy - ylo);
6747  mgr->d_stencil_1d_c1hermite(dyphi, yphi, dypsi, ypsi,
6748  ydelta, hy, hy_1);
6749  Float zdelta = Float(sz_hz - zlo);
6750  mgr->d_stencil_1d_c1hermite(dzphi, zphi, dzpsi, zpsi,
6751  zdelta, hz, hz_1);
6752 
6753  int ilo = int(xlo);
6754  int jlo = int(ylo);
6755  int klo = int(zlo);
6756 
6757 #if 0
6758  // XXX don't need to test twice!
6759 
6760  // test to see if stencil is within edges of grid
6761  int iswithin = ( ia <= ilo && ilo < ib &&
6762  ja <= jlo && jlo < jb &&
6763  ka <= klo && klo < kb );
6764 
6765  if ( ! iswithin ) {
6766  char msg[100];
6767  snprintf(msg, sizeof(msg), "Atom %d is outside of the MSM grid.",
6768  coord[n].id);
6769  NAMD_die(msg);
6770  }
6771 #endif
6772 
6773  // determine force on atom from surrounding potential grid points
6774  Float fx=0, fy=0, fz=0, e=0;
6775  for (int k = 0; k < 2; k++) {
6776  int koff = ((k+klo) - ka) * nj;
6777  for (int j = 0; j < 2; j++) {
6778  int jkoff = (koff + (j+jlo) - ja) * ni;
6779  Float c_yphi_zphi = yphi[j] * zphi[k];
6780  Float c_ypsi_zphi = ypsi[j] * zphi[k];
6781  Float c_yphi_zpsi = yphi[j] * zpsi[k];
6782  Float c_ypsi_zpsi = ypsi[j] * zpsi[k];
6783  Float c_yphi_dzphi = yphi[j] * dzphi[k];
6784  Float c_ypsi_dzphi = ypsi[j] * dzphi[k];
6785  Float c_yphi_dzpsi = yphi[j] * dzpsi[k];
6786  Float c_ypsi_dzpsi = ypsi[j] * dzpsi[k];
6787  Float c_dyphi_zphi = dyphi[j] * zphi[k];
6788  Float c_dypsi_zphi = dypsi[j] * zphi[k];
6789  Float c_dyphi_zpsi = dyphi[j] * zpsi[k];
6790  Float c_dypsi_zpsi = dypsi[j] * zpsi[k];
6791  for (int i = 0; i < 2; i++) {
6792  int ijkoff = jkoff + (i+ilo) - ia;
6793  fx += dxphi[i] * (c_yphi_zphi * ehbuffer[ijkoff].velem[D000]
6794  + c_ypsi_zphi * ehbuffer[ijkoff].velem[D010]
6795  + c_yphi_zpsi * ehbuffer[ijkoff].velem[D001]
6796  + c_ypsi_zpsi * ehbuffer[ijkoff].velem[D011])
6797  + dxpsi[i] * (c_yphi_zphi * ehbuffer[ijkoff].velem[D100]
6798  + c_ypsi_zphi * ehbuffer[ijkoff].velem[D110]
6799  + c_yphi_zpsi * ehbuffer[ijkoff].velem[D101]
6800  + c_ypsi_zpsi * ehbuffer[ijkoff].velem[D111]);
6801  fy += xphi[i] * (c_dyphi_zphi * ehbuffer[ijkoff].velem[D000]
6802  + c_dypsi_zphi * ehbuffer[ijkoff].velem[D010]
6803  + c_dyphi_zpsi * ehbuffer[ijkoff].velem[D001]
6804  + c_dypsi_zpsi * ehbuffer[ijkoff].velem[D011])
6805  + xpsi[i] * (c_dyphi_zphi * ehbuffer[ijkoff].velem[D100]
6806  + c_dypsi_zphi * ehbuffer[ijkoff].velem[D110]
6807  + c_dyphi_zpsi * ehbuffer[ijkoff].velem[D101]
6808  + c_dypsi_zpsi * ehbuffer[ijkoff].velem[D111]);
6809  fz += xphi[i] * (c_yphi_dzphi * ehbuffer[ijkoff].velem[D000]
6810  + c_ypsi_dzphi * ehbuffer[ijkoff].velem[D010]
6811  + c_yphi_dzpsi * ehbuffer[ijkoff].velem[D001]
6812  + c_ypsi_dzpsi * ehbuffer[ijkoff].velem[D011])
6813  + xpsi[i] * (c_yphi_dzphi * ehbuffer[ijkoff].velem[D100]
6814  + c_ypsi_dzphi * ehbuffer[ijkoff].velem[D110]
6815  + c_yphi_dzpsi * ehbuffer[ijkoff].velem[D101]
6816  + c_ypsi_dzpsi * ehbuffer[ijkoff].velem[D111]);
6817  e += xphi[i] * (c_yphi_zphi * ehbuffer[ijkoff].velem[D000]
6818  + c_ypsi_zphi * ehbuffer[ijkoff].velem[D010]
6819  + c_yphi_zpsi * ehbuffer[ijkoff].velem[D001]
6820  + c_ypsi_zpsi * ehbuffer[ijkoff].velem[D011])
6821  + xpsi[i] * (c_yphi_zphi * ehbuffer[ijkoff].velem[D100]
6822  + c_ypsi_zphi * ehbuffer[ijkoff].velem[D110]
6823  + c_yphi_zpsi * ehbuffer[ijkoff].velem[D101]
6824  + c_ypsi_zpsi * ehbuffer[ijkoff].velem[D111]);
6825  }
6826  }
6827  }
6828 
6829 #if 0
6830  force[n].x -= q * (mgr->srx_x * fx + mgr->srx_y * fy + mgr->srx_z * fz);
6831  force[n].y -= q * (mgr->sry_x * fx + mgr->sry_y * fy + mgr->sry_z * fz);
6832  force[n].z -= q * (mgr->srz_x * fx + mgr->srz_y * fy + mgr->srz_z * fz);
6833 #endif
6834  force[n].x -= q * fx;
6835  force[n].y -= q * fy;
6836  force[n].z -= q * fz;
6837  energy += q * e;
6838  energy_self += q * q;
6839 
6840  } // end loop over atoms
6841 
6842  energy_self *= mgr->gzero;
6843  energy -= energy_self;
6844  energy *= 0.5;
6845 #endif // !MSM_COMM_ONLY
6846 #ifdef MSM_TIMING
6847  stopTime = CkWallTimer();
6848  mgr->msmTiming[MsmTimer::INTERP] += stopTime - startTime;
6849  mgr->doneTiming();
6850 #endif
6851  mgr->doneCompute();
6852  }
int len() const
Definition: MsmMap.h:218
Definition: MsmMap.h:187
Definition: MsmMap.h:187
const Array< T > & data() const
Definition: MsmMap.h:666
int ka() const
Definition: MsmMap.h:438
Definition: Vector.h:64
void doneCompute()
Definition: ComputeMsm.C:6040
BigReal z
Definition: Vector.h:66
int ia() const
Definition: MsmMap.h:434
BigReal shy_1
Definition: ComputeMsm.C:614
Definition: MsmMap.h:187
BigReal energy
Definition: ComputeMsm.C:1750
BigReal shz_1
Definition: ComputeMsm.C:614
BigReal hylen_1
Definition: ComputeMsm.C:600
Vector sglower
Definition: ComputeMsm.C:610
BigReal hzlen_1
Definition: ComputeMsm.C:600
BigReal hxlen
Definition: ComputeMsm.C:599
Definition: MsmMap.h:187
int kb() const
Definition: MsmMap.h:439
BigReal hzlen
Definition: ComputeMsm.C:599
int jb() const
Definition: MsmMap.h:437
int nj() const
Definition: MsmMap.h:441
BigReal x
Definition: Vector.h:66
void NAMD_die(const char *err_msg)
Definition: common.C:83
Definition: MsmMap.h:187
ForceArray force
Definition: ComputeMsm.C:1743
float Float
Definition: MsmMap.h:74
Definition: MsmMap.h:187
void d_stencil_1d_c1hermite(Float dphi[], Float phi[], Float dpsi[], Float psi[], Float t, Float h, Float h_1)
Definition: ComputeMsm.C:1252
BigReal y
Definition: Vector.h:66
Definition: MsmMap.h:187
AtomCoordArray coord
Definition: ComputeMsm.C:1742
Grid< C1Vector > eh_c1hermite
Definition: ComputeMsm.C:1748
ScaledPosition scale(Position p) const
Definition: Lattice.h:83
int ib() const
Definition: MsmMap.h:435
Definition: MsmMap.h:187
int ja() const
Definition: MsmMap.h:436
int ni() const
Definition: MsmMap.h:440
BigReal shx_1
Definition: ComputeMsm.C:614
ComputeMsmMgr * mgr
Definition: ComputeMsm.C:1739
BigReal gzero
Definition: ComputeMsm.C:608
BigReal hylen
Definition: ComputeMsm.C:599
Float velem[C1_VECTOR_SIZE]
Definition: MsmMap.h:87
const T * buffer() const
Definition: MsmMap.h:259
double BigReal
Definition: common.h:112
BigReal hxlen_1
Definition: ComputeMsm.C:600
Lattice lattice
Definition: ComputeMsm.C:592
void msm::PatchData::sendCharge ( )

Definition at line 6367 of file ComputeMsm.C.

References MsmTimer::COMM, msm::Grid< T >::data(), msm::Grid< T >::extract(), msm::Ivec::i, msm::Grid< T >::init(), msm::Ivec::j, msm::Ivec::k, msm::Array< T >::len(), msm::BlockIndex::level, mgr, MSM_PRIORITY, ComputeMsmMgr::msmBlock, msm::BlockIndex::n, pd, GridMsg::put(), qh, msm::PatchDiagram::send, sequence, SET_PRIORITY, subgrid, and msm::Grid< T >::updateLower().

Referenced by anterpolation().

6367  {
6368 #ifdef MSM_TIMING
6369  double startTime, stopTime;
6370 #endif
6371  int priority = 1;
6372  // buffer portions of grid to send to Blocks on level 0
6373  // allocate the largest buffer space we'll need
6374  //Grid<BigReal> subgrid;
6375  //subgrid.resize(map->bsx[0] * map->bsy[0] * map->bsz[0]);
6376  for (int n = 0; n < pd->send.len(); n++) {
6377 #ifdef MSM_TIMING
6378  startTime = CkWallTimer();
6379 #endif
6380  // initialize the proper subgrid indexing range
6381  subgrid.init( pd->send[n].nrange );
6382  // extract the values from the larger grid into the subgrid
6383  qh.extract(subgrid);
6384  // translate the subgrid indexing range to match the MSM block
6385  subgrid.updateLower( pd->send[n].nrange_wrap.lower() );
6386  // add the subgrid charges into the block
6387  BlockIndex& bindex = pd->send[n].nblock_wrap;
6388  // place subgrid into message
6389  int msgsz = subgrid.data().len() * sizeof(Float);
6390  GridMsg *gm = new(msgsz, sizeof(int)) GridMsg;
6391  SET_PRIORITY(gm, sequence, MSM_PRIORITY + priority);
6392  gm->put(subgrid, bindex.level, sequence);
6393 #ifdef MSM_TIMING
6394  stopTime = CkWallTimer();
6395  mgr->msmTiming[MsmTimer::COMM] += stopTime - startTime;
6396 #endif
6397  mgr->msmBlock[bindex.level](
6398  bindex.n.i, bindex.n.j, bindex.n.k).addCharge(gm);
6399  }
6400  }
int len() const
Definition: MsmMap.h:218
const Array< T > & data() const
Definition: MsmMap.h:666
#define MSM_PRIORITY
Definition: Priorities.h:36
void extract(Grid< T > &g)
Definition: MsmMap.h:748
Array< BlockSend > send
Definition: MsmMap.h:899
void init(const IndexRange &n)
Definition: MsmMap.h:603
void put(const msm::Grid< T > &g, int id, int seq)
Definition: ComputeMsm.C:126
float Float
Definition: MsmMap.h:74
void updateLower(const Ivec &n)
Definition: MsmMap.h:677
msm::Array< CProxy_MsmBlock > msmBlock
Definition: ComputeMsm.C:464
PatchDiagram * pd
Definition: ComputeMsm.C:1741
#define SET_PRIORITY(MSG, SEQ, PRIO)
Definition: Priorities.h:18
Grid< Float > qh
Definition: ComputeMsm.C:1744
ComputeMsmMgr * mgr
Definition: ComputeMsm.C:1739
Grid< Float > subgrid
Definition: ComputeMsm.C:1746
void msm::PatchData::sendChargeC1Hermite ( )

Definition at line 6646 of file ComputeMsm.C.

References MsmTimer::COMM, msm::Grid< T >::data(), msm::Grid< T >::extract(), msm::Ivec::i, msm::Grid< T >::init(), msm::Ivec::j, msm::Ivec::k, msm::Array< T >::len(), msm::BlockIndex::level, mgr, MSM_PRIORITY, ComputeMsmMgr::msmC1HermiteBlock, msm::BlockIndex::n, pd, GridMsg::put(), qh_c1hermite, msm::PatchDiagram::send, sequence, SET_PRIORITY, subgrid_c1hermite, and msm::Grid< T >::updateLower().

Referenced by anterpolationC1Hermite().

6646  {
6647 #ifdef MSM_TIMING
6648  double startTime, stopTime;
6649 #endif
6650  int priority = 1;
6651  // buffer portions of grid to send to Blocks on level 0
6652  for (int n = 0; n < pd->send.len(); n++) {
6653 #ifdef MSM_TIMING
6654  startTime = CkWallTimer();
6655 #endif
6656  // initialize the proper subgrid indexing range
6657  subgrid_c1hermite.init( pd->send[n].nrange );
6658  // extract the values from the larger grid into the subgrid
6660  // translate the subgrid indexing range to match the MSM block
6661  subgrid_c1hermite.updateLower( pd->send[n].nrange_wrap.lower() );
6662  // add the subgrid charges into the block
6663  BlockIndex& bindex = pd->send[n].nblock_wrap;
6664  // place subgrid into message
6665  int msgsz = subgrid_c1hermite.data().len() * sizeof(C1Vector);
6666  GridMsg *gm = new(msgsz, sizeof(int)) GridMsg;
6667  SET_PRIORITY(gm, sequence, MSM_PRIORITY + priority);
6668  gm->put(subgrid_c1hermite, bindex.level, sequence);
6669 #ifdef MSM_TIMING
6670  stopTime = CkWallTimer();
6671  mgr->msmTiming[MsmTimer::COMM] += stopTime - startTime;
6672 #endif
6673  mgr->msmC1HermiteBlock[bindex.level](
6674  bindex.n.i, bindex.n.j, bindex.n.k).addCharge(gm);
6675  }
6676  }
Grid< C1Vector > qh_c1hermite
Definition: ComputeMsm.C:1747
int len() const
Definition: MsmMap.h:218
Grid< C1Vector > subgrid_c1hermite
Definition: ComputeMsm.C:1749
const Array< T > & data() const
Definition: MsmMap.h:666
#define MSM_PRIORITY
Definition: Priorities.h:36
void extract(Grid< T > &g)
Definition: MsmMap.h:748
Array< BlockSend > send
Definition: MsmMap.h:899
void init(const IndexRange &n)
Definition: MsmMap.h:603
void put(const msm::Grid< T > &g, int id, int seq)
Definition: ComputeMsm.C:126
void updateLower(const Ivec &n)
Definition: MsmMap.h:677
msm::Array< CProxy_MsmC1HermiteBlock > msmC1HermiteBlock
Definition: ComputeMsm.C:465
PatchDiagram * pd
Definition: ComputeMsm.C:1741
#define SET_PRIORITY(MSG, SEQ, PRIO)
Definition: Priorities.h:18
ComputeMsmMgr * mgr
Definition: ComputeMsm.C:1739

Member Data Documentation

int msm::PatchData::cntRecvs

Definition at line 1752 of file ComputeMsm.C.

Referenced by addPotential(), addPotentialC1Hermite(), and init().

AtomCoordArray msm::PatchData::coord
Grid<Float> msm::PatchData::eh

Definition at line 1745 of file ComputeMsm.C.

Referenced by addPotential(), init(), interpolation(), and PatchData().

Grid<C1Vector> msm::PatchData::eh_c1hermite

Definition at line 1748 of file ComputeMsm.C.

Referenced by addPotentialC1Hermite(), init(), interpolationC1Hermite(), and PatchData().

BigReal msm::PatchData::energy
ForceArray msm::PatchData::force
Map* msm::PatchData::map

Definition at line 1740 of file ComputeMsm.C.

Referenced by PatchData().

ComputeMsmMgr* msm::PatchData::mgr
int msm::PatchData::patchID
PatchDiagram* msm::PatchData::pd
Grid<Float> msm::PatchData::qh

Definition at line 1744 of file ComputeMsm.C.

Referenced by anterpolation(), init(), PatchData(), and sendCharge().

Grid<C1Vector> msm::PatchData::qh_c1hermite

Definition at line 1747 of file ComputeMsm.C.

Referenced by anterpolationC1Hermite(), init(), PatchData(), and sendChargeC1Hermite().

int msm::PatchData::sequence

Definition at line 1754 of file ComputeMsm.C.

Referenced by ComputeMsm::doWork(), sendCharge(), and sendChargeC1Hermite().

Grid<Float> msm::PatchData::subgrid

Definition at line 1746 of file ComputeMsm.C.

Referenced by PatchData(), and sendCharge().

Grid<C1Vector> msm::PatchData::subgrid_c1hermite

Definition at line 1749 of file ComputeMsm.C.

Referenced by PatchData(), and sendChargeC1Hermite().


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