msm::Map Struct Reference

#include <MsmMap.h>

List of all members.

Public Member Functions

Ivec clipIndexToLevel (const Ivec &n, int level) const
BlockIndex blockOfGridIndex (const Ivec &n, int level) const
BlockIndex blockOfGridIndexFold (const Ivec &n, int level) const
IndexRange indexRangeOfBlock (const BlockIndex &nb) const
IndexRange indexRangeOfBlockFold (const BlockIndex &nb) const
IndexRange clipBlockToIndexRange (const BlockIndex &nb, const IndexRange &nrange) const
IndexRange clipBlockToIndexRangeFold (const BlockIndex &nb, const IndexRange &nrange) const
void wrapBlockSend (BlockSend &bs) const
void wrapBlockSendFold (BlockSend &bs) const
void wrapBlockIndex (BlockIndex &bn) const

Public Attributes

Array< IndexRangegridrange
Array< Grid< Float > > gc
Array< Grid< Float > > gvc
Grid< Floatgrespro
Array< Grid< C1Matrix > > gc_c1hermite
Array< Grid< C1Matrix > > gvc_c1hermite
Array< Grid< C1Matrix > > gres_c1hermite
Array< Grid< C1Matrix > > gpro_c1hermite
Array< PatchDiagrampatchList
Array< Grid< BlockDiagram > > blockLevel
int ispx
int ispy
int ispz
Array< int > bsx
Array< int > bsy
Array< int > bsz
Array< FoldFactorfoldfactor


Detailed Description

Definition at line 941 of file MsmMap.h.


Member Function Documentation

BlockIndex msm::Map::blockOfGridIndex ( const Ivec n,
int  level 
) const [inline]

Definition at line 991 of file MsmMap.h.

References ASSERT, bsx, bsy, bsz, gridrange, msm::Ivec::i, msm::Ivec::j, and msm::Ivec::k.

Referenced by MsmGridCutoffKernel< C1Vector, C1Matrix >::setup().

00991                                                                 {
00992       ASSERT(level >= 0 && level < gridrange.len());
00993       BlockIndex bn;
00994       // we want floor((i - ia) / bsx), etc.
00995       // modify case i < ia to avoid integer division of negative numbers
00996       int d = n.i - gridrange[level].ia();
00997       bn.n.i = (d >= 0 ? d / bsx[level] : -((-d+bsx[level]-1) / bsx[level]));
00998       d = n.j - gridrange[level].ja();
00999       bn.n.j = (d >= 0 ? d / bsy[level] : -((-d+bsy[level]-1) / bsy[level]));
01000       d = n.k - gridrange[level].ka();
01001       bn.n.k = (d >= 0 ? d / bsz[level] : -((-d+bsz[level]-1) / bsz[level]));
01002       bn.level = level;
01003       return bn;
01004     }

BlockIndex msm::Map::blockOfGridIndexFold ( const Ivec n,
int  level 
) const [inline]

Definition at line 1008 of file MsmMap.h.

References ASSERT, bsx, bsy, bsz, foldfactor, gridrange, msm::Ivec::i, msm::Ivec::j, and msm::Ivec::k.

01008                                                                     {
01009       ASSERT(level >= 0 && level < gridrange.len());
01010       BlockIndex bn;
01011       int bsi = foldfactor[level].numrep.i * bsx[level];
01012       int bsj = foldfactor[level].numrep.j * bsy[level];
01013       int bsk = foldfactor[level].numrep.k * bsz[level];
01014       // we want floor((i - ia) / bsx), etc.
01015       // modify case i < ia to avoid integer division of negative numbers
01016       int d = n.i - gridrange[level].ia();
01017       bn.n.i = (d >= 0 ? d / bsi : -((-d+bsi-1) / bsi));
01018       d = n.j - gridrange[level].ja();
01019       bn.n.j = (d >= 0 ? d / bsj : -((-d+bsj-1) / bsj));
01020       d = n.k - gridrange[level].ka();
01021       bn.n.k = (d >= 0 ? d / bsk : -((-d+bsk-1) / bsk));
01022       bn.level = level;
01023       return bn;
01024     }

IndexRange msm::Map::clipBlockToIndexRange ( const BlockIndex nb,
const IndexRange nrange 
) const [inline]

Definition at line 1053 of file MsmMap.h.

References msm::IndexRange::ia(), msm::IndexRange::ib(), indexRangeOfBlock(), msm::IndexRange::ja(), msm::IndexRange::jb(), msm::IndexRange::ka(), msm::IndexRange::kb(), and msm::IndexRange::setbounds().

01054                                         {
01055       IndexRange nr = indexRangeOfBlock(nb);
01056       int nia = nrange.ia();
01057       int nib = nrange.ib();
01058       int nja = nrange.ja();
01059       int njb = nrange.jb();
01060       int nka = nrange.ka();
01061       int nkb = nrange.kb();
01062       int ia = nr.ia();
01063       if (ia < nia) ia = nia;
01064       int ib = nr.ib();
01065       if (ib > nib) ib = nib;
01066       int ja = nr.ja();
01067       if (ja < nja) ja = nja;
01068       int jb = nr.jb();
01069       if (jb > njb) jb = njb;
01070       int ka = nr.ka();
01071       if (ka < nka) ka = nka;
01072       int kb = nr.kb();
01073       if (kb > nkb) kb = nkb;
01074       nr.setbounds(ia, ib, ja, jb, ka, kb);
01075       return nr;
01076     }

IndexRange msm::Map::clipBlockToIndexRangeFold ( const BlockIndex nb,
const IndexRange nrange 
) const [inline]

Definition at line 1080 of file MsmMap.h.

References msm::IndexRange::ia(), msm::IndexRange::ib(), indexRangeOfBlockFold(), msm::IndexRange::ja(), msm::IndexRange::jb(), msm::IndexRange::ka(), msm::IndexRange::kb(), and msm::IndexRange::setbounds().

01081                                         {
01082       IndexRange nr = indexRangeOfBlockFold(nb);
01083       int nia = nrange.ia();
01084       int nib = nrange.ib();
01085       int nja = nrange.ja();
01086       int njb = nrange.jb();
01087       int nka = nrange.ka();
01088       int nkb = nrange.kb();
01089       int ia = nr.ia();
01090       if (ia < nia) ia = nia;
01091       int ib = nr.ib();
01092       if (ib > nib) ib = nib;
01093       int ja = nr.ja();
01094       if (ja < nja) ja = nja;
01095       int jb = nr.jb();
01096       if (jb > njb) jb = njb;
01097       int ka = nr.ka();
01098       if (ka < nka) ka = nka;
01099       int kb = nr.kb();
01100       if (kb > nkb) kb = nkb;
01101       nr.setbounds(ia, ib, ja, jb, ka, kb);
01102       return nr;
01103     }

Ivec msm::Map::clipIndexToLevel ( const Ivec n,
int  level 
) const [inline]

Definition at line 966 of file MsmMap.h.

References ASSERT, gridrange, ispx, ispy, and ispz.

00966                                                           {
00967       ASSERT(level >= 0 && level < gridrange.len());
00968       Ivec pn(n);
00969       if ( ! ispx) {
00970         int a = gridrange[level].ia();
00971         int b = gridrange[level].ib();
00972         if (pn.i < a) pn.i = a;
00973         if (pn.i > b) pn.i = b;
00974       }
00975       if ( ! ispy) {
00976         int a = gridrange[level].ja();
00977         int b = gridrange[level].jb();
00978         if (pn.j < a) pn.j = a;
00979         if (pn.j > b) pn.j = b;
00980       }
00981       if ( ! ispz) {
00982         int a = gridrange[level].ka();
00983         int b = gridrange[level].kb();
00984         if (pn.k < a) pn.k = a;
00985         if (pn.k > b) pn.k = b;
00986       }
00987       return pn;
00988     }

IndexRange msm::Map::indexRangeOfBlock ( const BlockIndex nb  )  const [inline]

Definition at line 1027 of file MsmMap.h.

References ASSERT, bsx, bsy, bsz, gridrange, msm::Ivec::i, msm::Ivec::j, msm::Ivec::k, msm::BlockIndex::level, and msm::BlockIndex::n.

Referenced by clipBlockToIndexRange().

01027                                                              {
01028       ASSERT(nb.level >= 0 && nb.level < gridrange.len());
01029       IndexRange nr;
01030       int ia = nb.n.i * bsx[nb.level] + gridrange[nb.level].ia();
01031       int ja = nb.n.j * bsy[nb.level] + gridrange[nb.level].ja();
01032       int ka = nb.n.k * bsz[nb.level] + gridrange[nb.level].ka();
01033       nr.set(ia, bsx[nb.level], ja, bsy[nb.level], ka, bsz[nb.level]);
01034       return nr;
01035     }

IndexRange msm::Map::indexRangeOfBlockFold ( const BlockIndex nb  )  const [inline]

Definition at line 1039 of file MsmMap.h.

References ASSERT, bsx, bsy, bsz, foldfactor, gridrange, msm::Ivec::i, msm::Ivec::j, msm::Ivec::k, msm::BlockIndex::level, msm::BlockIndex::n, and msm::IndexRange::set().

Referenced by clipBlockToIndexRangeFold().

01039                                                                  {
01040       ASSERT(nb.level >= 0 && nb.level < gridrange.len());
01041       int bsi = foldfactor[nb.level].numrep.i * bsx[nb.level];
01042       int bsj = foldfactor[nb.level].numrep.j * bsy[nb.level];
01043       int bsk = foldfactor[nb.level].numrep.k * bsz[nb.level];
01044       IndexRange nr;
01045       int ia = nb.n.i * bsi + gridrange[nb.level].ia();
01046       int ja = nb.n.j * bsj + gridrange[nb.level].ja();
01047       int ka = nb.n.k * bsk + gridrange[nb.level].ka();
01048       nr.set(ia, bsi, ja, bsj, ka, bsk);
01049       return nr;
01050     }

void msm::Map::wrapBlockIndex ( BlockIndex bn  )  const [inline]

Definition at line 1214 of file MsmMap.h.

References blockLevel, msm::Ivec::i, ispx, ispy, ispz, msm::Ivec::j, msm::Ivec::k, msm::BlockIndex::level, and msm::BlockIndex::n.

Referenced by MsmGridCutoffKernel< C1Vector, C1Matrix >::setup().

01214                                               {
01215       int level = bn.level;
01216       int ni = blockLevel[level].ni();
01217       int nj = blockLevel[level].nj();
01218       int nk = blockLevel[level].nk();
01219       if (ispx) {
01220         while (bn.n.i < 0) {
01221           bn.n.i += ni;
01222         }
01223         while (bn.n.i >= ni) {
01224           bn.n.i -= ni;
01225         }
01226       }
01227       if (ispy) {
01228         while (bn.n.j < 0) {
01229           bn.n.j += nj;
01230         }
01231         while (bn.n.j >= nj) {
01232           bn.n.j -= nj;
01233         }
01234       }
01235       if (ispz) {
01236         while (bn.n.k < 0) {
01237           bn.n.k += nk;
01238         }
01239         while (bn.n.k >= nk) {
01240           bn.n.k -= nk;
01241         }
01242       }
01243     }

void msm::Map::wrapBlockSend ( BlockSend bs  )  const [inline]

Definition at line 1106 of file MsmMap.h.

References ASSERT, blockLevel, bsx, bsy, bsz, msm::Ivec::i, msm::IndexRange::ia(), msm::IndexRange::ib(), ispx, ispy, ispz, msm::Ivec::j, msm::IndexRange::ja(), msm::IndexRange::jb(), msm::Ivec::k, msm::IndexRange::ka(), msm::IndexRange::kb(), msm::BlockIndex::level, msm::BlockIndex::n, msm::BlockSend::nblock, msm::BlockSend::nblock_wrap, msm::BlockSend::nrange, msm::BlockSend::nrange_wrap, and msm::IndexRange::setbounds().

01106                                             {
01107       BlockIndex nb = bs.nblock;
01108       IndexRange nr = bs.nrange;
01109       int level = bs.nblock.level;
01110       ASSERT(level >= 0 && level < blockLevel.len());
01111       int ni = blockLevel[level].ni();
01112       int nj = blockLevel[level].nj();
01113       int nk = blockLevel[level].nk();
01114       int di=0, dj=0, dk=0;
01115       if (ispx) {
01116         while (nb.n.i < 0) {
01117           nb.n.i += ni;
01118           di += ni * bsx[level];
01119         }
01120         while (nb.n.i >= ni) {
01121           nb.n.i -= ni;
01122           di -= ni * bsx[level];
01123         }
01124       }
01125       if (ispy) {
01126         while (nb.n.j < 0) {
01127           nb.n.j += nj;
01128           dj += nj * bsy[level];
01129         }
01130         while (nb.n.j >= nj) {
01131           nb.n.j -= nj;
01132           dj -= nj * bsy[level];
01133         }
01134       }
01135       if (ispz) {
01136         while (nb.n.k < 0) {
01137           nb.n.k += nk;
01138           dk += nk * bsz[level];
01139         }
01140         while (nb.n.k >= nk) {
01141           nb.n.k -= nk;
01142           dk -= nk * bsz[level];
01143         }
01144       }
01145       int ia = nr.ia();
01146       int ib = nr.ib();
01147       int ja = nr.ja();
01148       int jb = nr.jb();
01149       int ka = nr.ka();
01150       int kb = nr.kb();
01151       nr.setbounds(ia + di, ib + di, ja + dj, jb + dj, ka + dk, kb + dk);
01152       bs.nblock_wrap = nb;
01153       bs.nrange_wrap = nr;
01154     }

void msm::Map::wrapBlockSendFold ( BlockSend bs  )  const [inline]

Definition at line 1158 of file MsmMap.h.

References ASSERT, blockLevel, bsx, bsy, bsz, foldfactor, msm::Ivec::i, msm::IndexRange::ia(), msm::IndexRange::ib(), ispx, ispy, ispz, msm::Ivec::j, msm::IndexRange::ja(), msm::IndexRange::jb(), msm::Ivec::k, msm::IndexRange::ka(), msm::IndexRange::kb(), msm::BlockIndex::level, msm::BlockIndex::n, msm::BlockSend::nblock, msm::BlockSend::nblock_wrap, msm::BlockSend::nrange, msm::BlockSend::nrange_wrap, and msm::IndexRange::setbounds().

01158                                                 {
01159       BlockIndex nb = bs.nblock;
01160       IndexRange nr = bs.nrange;
01161       int level = bs.nblock.level;
01162       ASSERT(level >= 0 && level < blockLevel.len());
01163       int foldi = foldfactor[level].numrep.i;
01164       int foldj = foldfactor[level].numrep.j;
01165       int foldk = foldfactor[level].numrep.k;
01166       int ni = blockLevel[level].ni();
01167       int nj = blockLevel[level].nj();
01168       int nk = blockLevel[level].nk();
01169       int bsi = foldi * bsx[level];
01170       int bsj = foldj * bsy[level];
01171       int bsk = foldk * bsz[level];
01172       int di=0, dj=0, dk=0;
01173       if (ispx) {
01174         while (nb.n.i < 0) {
01175           nb.n.i += ni;
01176           di += ni * bsi;
01177         }
01178         while (nb.n.i >= ni) {
01179           nb.n.i -= ni;
01180           di -= ni * bsi;
01181         }
01182       }
01183       if (ispy) {
01184         while (nb.n.j < 0) {
01185           nb.n.j += nj;
01186           dj += nj * bsj;
01187         }
01188         while (nb.n.j >= nj) {
01189           nb.n.j -= nj;
01190           dj -= nj * bsj;
01191         }
01192       }
01193       if (ispz) {
01194         while (nb.n.k < 0) {
01195           nb.n.k += nk;
01196           dk += nk * bsk;
01197         }
01198         while (nb.n.k >= nk) {
01199           nb.n.k -= nk;
01200           dk -= nk * bsk;
01201         }
01202       }
01203       int ia = nr.ia();
01204       int ib = nr.ib();
01205       int ja = nr.ja();
01206       int jb = nr.jb();
01207       int ka = nr.ka();
01208       int kb = nr.kb();
01209       nr.setbounds(ia + di, ib + di, ja + dj, jb + dj, ka + dk, kb + dk);
01210       bs.nblock_wrap = nb;
01211       bs.nrange_wrap = nr;
01212     }


Member Data Documentation

Array<Grid<BlockDiagram> > msm::Map::blockLevel

Definition at line 956 of file MsmMap.h.

Referenced by ComputeMsmMgr::blockFlatIndex(), ComputeMsmMgr::initialize(), ComputeMsmMgr::initialize_create(), MsmBlockKernel< Vtype, Mtype >::MsmBlockKernel(), MsmC1HermiteGridCutoff::setup(), MsmGridCutoff::setup(), MsmGridCutoffKernel< C1Vector, C1Matrix >::setup(), wrapBlockIndex(), wrapBlockSend(), and wrapBlockSendFold().

Array<int> msm::Map::bsx

Definition at line 960 of file MsmMap.h.

Referenced by blockOfGridIndex(), blockOfGridIndexFold(), ComputeMsmMgr::calcBlockWork(), ComputeMsmMgr::calcGcutWork(), indexRangeOfBlock(), indexRangeOfBlockFold(), ComputeMsmMgr::initialize(), msm::PatchData::PatchData(), MsmGridCutoffKernel< C1Vector, C1Matrix >::setup(), wrapBlockSend(), and wrapBlockSendFold().

Array<int> msm::Map::bsy

Definition at line 960 of file MsmMap.h.

Referenced by blockOfGridIndex(), blockOfGridIndexFold(), ComputeMsmMgr::calcBlockWork(), ComputeMsmMgr::calcGcutWork(), indexRangeOfBlock(), indexRangeOfBlockFold(), ComputeMsmMgr::initialize(), msm::PatchData::PatchData(), MsmGridCutoffKernel< C1Vector, C1Matrix >::setup(), wrapBlockSend(), and wrapBlockSendFold().

Array<int> msm::Map::bsz

Definition at line 960 of file MsmMap.h.

Referenced by blockOfGridIndex(), blockOfGridIndexFold(), ComputeMsmMgr::calcBlockWork(), ComputeMsmMgr::calcGcutWork(), indexRangeOfBlock(), indexRangeOfBlockFold(), ComputeMsmMgr::initialize(), msm::PatchData::PatchData(), MsmGridCutoffKernel< C1Vector, C1Matrix >::setup(), wrapBlockSend(), and wrapBlockSendFold().

Array<FoldFactor> msm::Map::foldfactor

Definition at line 962 of file MsmMap.h.

Referenced by blockOfGridIndexFold(), indexRangeOfBlockFold(), ComputeMsmMgr::initialize(), MsmGridCutoffKernel< C1Vector, C1Matrix >::setup(), and wrapBlockSendFold().

Array<Grid<Float> > msm::Map::gc

Definition at line 944 of file MsmMap.h.

Referenced by ComputeMsmMgr::calcBlockWork(), ComputeMsmMgr::initialize(), MsmBlock::MsmBlock(), and MsmGridCutoff::setup().

Array<Grid<C1Matrix> > msm::Map::gc_c1hermite

Definition at line 949 of file MsmMap.h.

Referenced by ComputeMsmMgr::calcBlockWork(), ComputeMsmMgr::initialize(), MsmC1HermiteBlock::MsmC1HermiteBlock(), and MsmC1HermiteGridCutoff::setup().

Array<Grid<C1Matrix> > msm::Map::gpro_c1hermite

Definition at line 952 of file MsmMap.h.

Referenced by ComputeMsmMgr::initialize(), and MsmC1HermiteBlock::MsmC1HermiteBlock().

Array<Grid<C1Matrix> > msm::Map::gres_c1hermite

Definition at line 951 of file MsmMap.h.

Referenced by ComputeMsmMgr::initialize(), and MsmC1HermiteBlock::MsmC1HermiteBlock().

Grid<Float> msm::Map::grespro

Definition at line 946 of file MsmMap.h.

Referenced by ComputeMsmMgr::initialize(), and MsmBlock::MsmBlock().

Array<IndexRange> msm::Map::gridrange

Definition at line 942 of file MsmMap.h.

Referenced by blockOfGridIndex(), blockOfGridIndexFold(), clipIndexToLevel(), indexRangeOfBlock(), indexRangeOfBlockFold(), ComputeMsmMgr::initialize(), and MsmC1HermiteBlock::MsmC1HermiteBlock().

Array<Grid<Float> > msm::Map::gvc

Definition at line 945 of file MsmMap.h.

Referenced by ComputeMsmMgr::initialize(), and MsmGridCutoff::setup().

Array<Grid<C1Matrix> > msm::Map::gvc_c1hermite

Definition at line 950 of file MsmMap.h.

int msm::Map::ispx

Definition at line 958 of file MsmMap.h.

Referenced by clipIndexToLevel(), ComputeMsmMgr::initialize(), MsmGridCutoffKernel< C1Vector, C1Matrix >::setup(), wrapBlockIndex(), wrapBlockSend(), and wrapBlockSendFold().

int msm::Map::ispy

Definition at line 958 of file MsmMap.h.

Referenced by clipIndexToLevel(), ComputeMsmMgr::initialize(), MsmGridCutoffKernel< C1Vector, C1Matrix >::setup(), wrapBlockIndex(), wrapBlockSend(), and wrapBlockSendFold().

int msm::Map::ispz

Definition at line 958 of file MsmMap.h.

Referenced by clipIndexToLevel(), ComputeMsmMgr::initialize(), MsmGridCutoffKernel< C1Vector, C1Matrix >::setup(), wrapBlockIndex(), wrapBlockSend(), and wrapBlockSendFold().

Array<PatchDiagram> msm::Map::patchList

Definition at line 955 of file MsmMap.h.

Referenced by ComputeMsmMgr::initialize(), msm::PatchData::PatchData(), and ComputeMsm::saveResults().


The documentation for this struct was generated from the following file:
Generated on Wed Nov 22 01:17:23 2017 for NAMD by  doxygen 1.4.7