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 6231 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.

6231  {
6232  mgr = pmgr;
6233  map = &(mgr->mapData());
6234  patchID = pid;
6235  //PatchMap *pm = PatchMap::Object();
6236  pd = &(map->patchList[pid]);
6240  subgrid_c1hermite.resize(map->bsx[0] * map->bsy[0] * map->bsz[0]);
6241  }
6242  else {
6243  qh.init(pd->nrange);
6244  eh.init(pd->nrange);
6245  subgrid.resize(map->bsx[0] * map->bsy[0] * map->bsz[0]);
6246  }
6247 #ifdef MSM_TIMING
6248  mgr->addTiming();
6249 #endif
6250  }
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 6406 of file ComputeMsm.C.

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

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

Definition at line 6682 of file ComputeMsm.C.

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

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

Definition at line 6269 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.

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

Definition at line 6547 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.

6547  {
6548 #ifdef DEBUG_MSM_GRID
6549  printf("patchID %d: anterpolationC1Hermite\n", patchID);
6550 #endif
6551 
6552 #ifdef MSM_TIMING
6553  double startTime, stopTime;
6554  startTime = CkWallTimer();
6555 #endif
6556 #ifndef MSM_COMM_ONLY
6557  Float xphi[2], xpsi[2];
6558  Float yphi[2], ypsi[2];
6559  Float zphi[2], zpsi[2];
6560 
6561  const Float hx = Float(mgr->hxlen); // real space grid spacing
6562  const Float hy = Float(mgr->hylen);
6563  const Float hz = Float(mgr->hzlen);
6564 
6565  const int ia = qh_c1hermite.ia();
6566  const int ib = qh_c1hermite.ib();
6567  const int ja = qh_c1hermite.ja();
6568  const int jb = qh_c1hermite.jb();
6569  const int ka = qh_c1hermite.ka();
6570  const int kb = qh_c1hermite.kb();
6571  const int ni = qh_c1hermite.ni();
6572  const int nj = qh_c1hermite.nj();
6573  C1Vector *qhbuffer = qh_c1hermite.data().buffer();
6574 
6575  // loop over atoms
6576  for (int n = 0; n < coord.len(); n++) {
6577  Float q = coord[n].charge;
6578  if (0==q) continue;
6579 
6580  ScaledPosition s = mgr->lattice.scale(coord[n].position);
6581 
6582  BigReal sx_hx = (s.x - mgr->sglower.x) * mgr->shx_1;
6583  BigReal sy_hy = (s.y - mgr->sglower.y) * mgr->shy_1;
6584  BigReal sz_hz = (s.z - mgr->sglower.z) * mgr->shz_1;
6585 
6586  BigReal xlo = floor(sx_hx);
6587  BigReal ylo = floor(sy_hy);
6588  BigReal zlo = floor(sz_hz);
6589 
6590  // calculate Phi stencils along each dimension
6591  Float xdelta = Float(sx_hx - xlo);
6592  mgr->stencil_1d_c1hermite(xphi, xpsi, xdelta, hx);
6593  Float ydelta = Float(sy_hy - ylo);
6594  mgr->stencil_1d_c1hermite(yphi, ypsi, ydelta, hy);
6595  Float zdelta = Float(sz_hz - zlo);
6596  mgr->stencil_1d_c1hermite(zphi, zpsi, zdelta, hz);
6597 
6598  int ilo = int(xlo);
6599  int jlo = int(ylo);
6600  int klo = int(zlo);
6601 
6602  // test to see if stencil is within edges of grid
6603  int iswithin = ( ia <= ilo && ilo < ib &&
6604  ja <= jlo && jlo < jb &&
6605  ka <= klo && klo < kb );
6606 
6607  if ( ! iswithin ) {
6608  char msg[100];
6609  snprintf(msg, sizeof(msg), "Atom %d is outside of the MSM grid.",
6610  coord[n].id);
6611  NAMD_die(msg);
6612  }
6613 
6614  // determine charge on cube of grid points around atom
6615  for (int k = 0; k < 2; k++) {
6616  int koff = ((k+klo) - ka) * nj;
6617  Float c_zphi = zphi[k] * q;
6618  Float c_zpsi = zpsi[k] * q;
6619  for (int j = 0; j < 2; j++) {
6620  int jkoff = (koff + (j+jlo) - ja) * ni;
6621  Float c_yphi_zphi = yphi[j] * c_zphi;
6622  Float c_ypsi_zphi = ypsi[j] * c_zphi;
6623  Float c_yphi_zpsi = yphi[j] * c_zpsi;
6624  Float c_ypsi_zpsi = ypsi[j] * c_zpsi;
6625  for (int i = 0; i < 2; i++) {
6626  int ijkoff = jkoff + (i+ilo) - ia;
6627  qhbuffer[ijkoff].velem[D000] += xphi[i] * c_yphi_zphi;
6628  qhbuffer[ijkoff].velem[D100] += xpsi[i] * c_yphi_zphi;
6629  qhbuffer[ijkoff].velem[D010] += xphi[i] * c_ypsi_zphi;
6630  qhbuffer[ijkoff].velem[D001] += xphi[i] * c_yphi_zpsi;
6631  qhbuffer[ijkoff].velem[D110] += xpsi[i] * c_ypsi_zphi;
6632  qhbuffer[ijkoff].velem[D101] += xpsi[i] * c_yphi_zpsi;
6633  qhbuffer[ijkoff].velem[D011] += xphi[i] * c_ypsi_zpsi;
6634  qhbuffer[ijkoff].velem[D111] += xpsi[i] * c_ypsi_zpsi;
6635  }
6636  }
6637  }
6638 
6639  } // end loop over atoms
6640 
6641 #endif // !MSM_COMM_ONLY
6642 #ifdef MSM_TIMING
6643  stopTime = CkWallTimer();
6644  mgr->msmTiming[MsmTimer::ANTERP] += stopTime - startTime;
6645 #endif
6646 
6648  }
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:6650
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:114
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 6252 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().

6252  {
6253  coord.resize(natoms);
6254  force.resize(natoms);
6255  cntRecvs = 0;
6256  energy = 0;
6257  //memset(virial, 0, 3*3*sizeof(BigReal));
6258  for (int i = 0; i < natoms; i++) force[i] = 0;
6260  qh_c1hermite.reset(0);
6261  eh_c1hermite.reset(0);
6262  }
6263  else {
6264  qh.reset(0);
6265  eh.reset(0);
6266  }
6267  }
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 6421 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().

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

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

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

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

6371  {
6372 #ifdef MSM_TIMING
6373  double startTime, stopTime;
6374 #endif
6375  int priority = 1;
6376  // buffer portions of grid to send to Blocks on level 0
6377  // allocate the largest buffer space we'll need
6378  //Grid<BigReal> subgrid;
6379  //subgrid.resize(map->bsx[0] * map->bsy[0] * map->bsz[0]);
6380  for (int n = 0; n < pd->send.len(); n++) {
6381 #ifdef MSM_TIMING
6382  startTime = CkWallTimer();
6383 #endif
6384  // initialize the proper subgrid indexing range
6385  subgrid.init( pd->send[n].nrange );
6386  // extract the values from the larger grid into the subgrid
6387  qh.extract(subgrid);
6388  // translate the subgrid indexing range to match the MSM block
6389  subgrid.updateLower( pd->send[n].nrange_wrap.lower() );
6390  // add the subgrid charges into the block
6391  BlockIndex& bindex = pd->send[n].nblock_wrap;
6392  // place subgrid into message
6393  int msgsz = subgrid.data().len() * sizeof(Float);
6394  GridMsg *gm = new(msgsz, sizeof(int)) GridMsg;
6395  SET_PRIORITY(gm, sequence, MSM_PRIORITY + priority);
6396  gm->put(subgrid, bindex.level, sequence);
6397 #ifdef MSM_TIMING
6398  stopTime = CkWallTimer();
6399  mgr->msmTiming[MsmTimer::COMM] += stopTime - startTime;
6400 #endif
6401  mgr->msmBlock[bindex.level](
6402  bindex.n.i, bindex.n.j, bindex.n.k).addCharge(gm);
6403  }
6404  }
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 6650 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().

6650  {
6651 #ifdef MSM_TIMING
6652  double startTime, stopTime;
6653 #endif
6654  int priority = 1;
6655  // buffer portions of grid to send to Blocks on level 0
6656  for (int n = 0; n < pd->send.len(); n++) {
6657 #ifdef MSM_TIMING
6658  startTime = CkWallTimer();
6659 #endif
6660  // initialize the proper subgrid indexing range
6661  subgrid_c1hermite.init( pd->send[n].nrange );
6662  // extract the values from the larger grid into the subgrid
6664  // translate the subgrid indexing range to match the MSM block
6665  subgrid_c1hermite.updateLower( pd->send[n].nrange_wrap.lower() );
6666  // add the subgrid charges into the block
6667  BlockIndex& bindex = pd->send[n].nblock_wrap;
6668  // place subgrid into message
6669  int msgsz = subgrid_c1hermite.data().len() * sizeof(C1Vector);
6670  GridMsg *gm = new(msgsz, sizeof(int)) GridMsg;
6671  SET_PRIORITY(gm, sequence, MSM_PRIORITY + priority);
6672  gm->put(subgrid_c1hermite, bindex.level, sequence);
6673 #ifdef MSM_TIMING
6674  stopTime = CkWallTimer();
6675  mgr->msmTiming[MsmTimer::COMM] += stopTime - startTime;
6676 #endif
6677  mgr->msmC1HermiteBlock[bindex.level](
6678  bindex.n.i, bindex.n.j, bindex.n.k).addCharge(gm);
6679  }
6680  }
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: