AtomMap Class Reference

#include <AtomMap.h>

List of all members.

Public Member Functions

 ~AtomMap (void)
void checkMap ()
void allocateMap (int nAtomIDs)
LocalID localID (AtomID id)

Static Public Member Functions

static AtomMapInstance ()
static AtomMapObject ()

Protected Member Functions

 AtomMap (void)

Friends

class AtomMapper


Detailed Description

Definition at line 32 of file AtomMap.h.


Constructor & Destructor Documentation

AtomMap::~AtomMap ( void   ) 

Definition at line 150 of file AtomMap.C.

00151 {
00152   delete [] localIDTable;  // Delete on a NULL pointer should be ok
00153 
00154 #ifdef MEM_OPT_VERSION
00155   delete [] entries;
00156 #endif
00157 }

AtomMap::AtomMap ( void   )  [protected]

Definition at line 133 of file AtomMap.C.

00134 {
00135   localIDTable = NULL;
00136   tableSz = 0;
00137 
00138 #ifdef MEM_OPT_VERSION
00139   entries = NULL;
00140   onlyUseTbl = false;
00141 #endif
00142 }


Member Function Documentation

void AtomMap::allocateMap ( int  nAtomIDs  ) 

Definition at line 161 of file AtomMap.C.

References notUsed.

Referenced by Node::resendMolecule2(), and Node::startup().

00162 {
00163 #ifdef MEM_OPT_VERSION
00164   if ( nAtomIds > MAXNUMATOMS ) {
00165     entries = new AtomMapEntry*[MAXNUMATOMS];
00166     memset(entries,0,MAXNUMATOMS*sizeof(AtomMapEntry*));
00167     return;
00168   } // else use non-memopt strategy
00169   onlyUseTbl = true;    
00170 #endif
00171   if ( nAtomIds <= tableSz ) return;
00172   LocalID *oldTable = localIDTable;
00173   localIDTable = new LocalID[nAtomIds];
00174   for(int i=0; i < tableSz; i++)
00175     localIDTable[i] = oldTable[i];
00176   for(int i=tableSz; i < nAtomIds; i++)
00177     localIDTable[i].pid = localIDTable[i].index = notUsed;
00178   delete [] oldTable;
00179   tableSz = nAtomIds;
00180 }

void AtomMap::checkMap (  ) 

Definition at line 145 of file AtomMap.C.

00146 { }

AtomMap * AtomMap::Instance (  )  [static]

Definition at line 125 of file AtomMap.C.

Referenced by Node::Node().

00125                            {
00126   if (CkpvAccess(AtomMap_instance) == 0) {
00127     CkpvAccess(AtomMap_instance) = new AtomMap; // this is never deleted!
00128   }
00129   return CkpvAccess(AtomMap_instance);
00130 }

LocalID AtomMap::localID ( AtomID  id  )  [inline]

Definition at line 74 of file AtomMap.h.

Referenced by ComputeHomeTuples< AnisoElem, aniso, aniso >::loadTuples(), PatchMgr::moveAtom(), and ComputeGlobal::recvResults().

00075 {
00076   return localIDTable[id];
00077 }

static AtomMap* AtomMap::Object (  )  [inline, static]

Definition at line 36 of file AtomMap.h.

Referenced by ComputeHomeTuples< AnisoElem, aniso, aniso >::ComputeHomeTuples(), ComputeNonbondedCUDA::ComputeNonbondedCUDA(), ComputeHomeTuples< AnisoElem, aniso, aniso >::doWork(), PatchMgr::moveAtom(), ComputeGlobal::recvResults(), Node::resendMolecule2(), and Node::startup().

00036 { return CkpvAccess(AtomMap_instance); }


Friends And Related Function Documentation

friend class AtomMapper [friend]

Definition at line 44 of file AtomMap.h.


The documentation for this class was generated from the following files:
Generated on Sat Sep 23 01:17:17 2017 for NAMD by  doxygen 1.4.7