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

AtomsDisInfo.h

Go to the documentation of this file.
00001 #ifndef ATOMSDISINFO_H
00002 #define ATOMSDISINFO_H
00003 
00004 #include "structures.h"
00005 #include "AtomsDisInfo.decl.h"
00006 
00007 class AtomStaticInfoMsg: public CMessage_AtomStaticInfoMsg{
00008     public:
00009         int actualNumAtoms;
00010         Atom *atoms;
00011 };
00012 
00013 class AtomsCoorMsg: public CMessage_AtomsCoorMsg{
00014     public:
00015         int x;
00016         //Vector coors
00017 };
00018 
00019 class AtomsForcesMsg: public CMessage_AtomsForcesMsg{
00020     public:
00021         int x;
00022         //Vector forces
00023 };
00024 
00025 
00026 class AtomsDisInfo : public CBase_AtomsDisInfo
00027 {
00028 public:
00029     enum { ATOMDISNUM = 500 };
00030 
00031     /* 
00032      * Blindly returns the array index of the atom (specified by atomId).
00033      * In reality, the atomId should be less than the total number of atoms 
00034      */ 
00035     static int getAtomArrayIndex(int atomId){
00036         if(atomId<0){
00037             return -1;
00038         }
00039 
00040         return atomId/ATOMDISNUM;
00041     }
00042 
00043 /* TODO: Need to figure out what data structures are needed later */
00044 
00045     //AtomInfo's array (atoms' static info, mass/charge etc) with size ATOMDISNUM
00046     int atomsCnt;
00047     Atom *disAtoms;
00048     
00049     //Atom's force array 
00050 
00051     //Atom's coordinates' array (Points[ATOMNUM])
00052 
00053 public: //methods
00054     AtomsDisInfo(){
00055         //initialize the atoms' static info array/force array/coordinates array
00056         disAtoms = new Atom[ATOMDISNUM];
00057     }
00058 
00059     AtomsDisInfo(CkMigrateMessage *m){}    
00060 
00061     ~AtomsDisInfo(){
00062         //free allocated memory for static info/force array/coor array
00063         delete disAtoms;
00064     }
00065 
00066     void recvStaticInfo(AtomStaticInfoMsg *msg);
00067     void recvAtomsCoor(AtomsCoorMsg *msg);
00068     void recvAtomsForces(AtomsForcesMsg *msg);
00069 };
00070 
00071 #include "AtomsDisInfo.def.h"
00072 
00073 #endif

Generated on Sun Nov 8 04:07:15 2009 for NAMD by  doxygen 1.3.9.1