Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

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

AtomMapInstance ()
AtomMapObject ()

Protected Member Functions

 AtomMap (void)

Friends

class AtomMapper


Constructor & Destructor Documentation

AtomMap::~AtomMap void   ) 
 

Definition at line 149 of file AtomMap.C.

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

AtomMap::AtomMap void   )  [protected]
 

Definition at line 133 of file AtomMap.C.

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


Member Function Documentation

void AtomMap::allocateMap int  nAtomIDs  ) 
 

Definition at line 160 of file AtomMap.C.

References LocalID::index, and LocalID::pid.

Referenced by Node::startup().

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

void AtomMap::checkMap  ) 
 

Definition at line 144 of file AtomMap.C.

00145 { }

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 69 of file AtomMap.h.

Referenced by ComputeHomeTuples< TholeElem, Thole, TholeValue >::loadTuples(), PatchMgr::moveAtom(), and ComputeGlobal::recvResults().

00070 {
00071   return localIDTable[id];
00072 }

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

Definition at line 36 of file AtomMap.h.

Referenced by ComputeHomeTuples< TholeElem, Thole, TholeValue >::ComputeHomeTuples(), ComputeNonbondedCUDA::ComputeNonbondedCUDA(), PatchMgr::moveAtom(), ComputeGlobal::recvResults(), 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 Fri May 25 04:07:19 2012 for NAMD by  doxygen 1.3.9.1