ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/brains/Snapshot.hpp
(Generate patch)

Comparing branches/development/src/brains/Snapshot.hpp (file contents):
Revision 1465 by chuckv, Fri Jul 9 23:08:25 2010 UTC vs.
Revision 1540 by gezelter, Mon Jan 17 21:34:36 2011 UTC

# Line 63 | Line 63 | namespace OpenMD{
63     * @class Snapshot Snapshot.hpp "brains/Snapshot.hpp"
64     * @brief Snapshot class is a repository class for storing dynamic data during
65     *  Simulation
66 <   * Every snapshot class will contain one DataStorage  for atoms and one DataStorage
66 >   * Every snapshot class will contain one DataStorage for atoms and one DataStorage
67     *  for rigid bodies.
68     */
69    class Snapshot {
70    public:
71              
72 <    Snapshot(int nAtoms, int nRigidbodies) : atomData(nAtoms),
73 <                                             rigidbodyData(nRigidbodies),
74 <                                             currentTime_(0),
75 <                                             orthoTolerance_(1e-6),
76 <                                             orthoRhombic_(0),
77 <                                             chi_(0.0),
78 <                                             integralOfChiDt_(0.0),
79 <                                             eta_(0.0), id_(-1),
80 <                                             hasCOM_(false), hasVolume_(false), volume_(0.0) {
72 >    Snapshot(int nAtoms, int nRigidbodies,
73 >             int nCutoffGroups) : atomData(nAtoms),
74 >                                  rigidbodyData(nRigidbodies),
75 >                                  cgData(nCutoffGroups, DataStorage::dslPosition),
76 >                                  currentTime_(0),
77 >                                  orthoTolerance_(1e-6),
78 >                                  orthoRhombic_(0),
79 >                                  chi_(0.0),
80 >                                  integralOfChiDt_(0.0),
81 >                                  eta_(0.0), id_(-1), hasCOM_(false),
82 >                                  hasVolume_(false), volume_(0.0) {
83  
84      }
85  
86 <    Snapshot(int nAtoms, int nRigidbodies, int storageLayout)
87 <      : atomData(nAtoms, storageLayout),
88 <        rigidbodyData(nRigidbodies, storageLayout),
89 <        currentTime_(0), orthoTolerance_(1e-6), orthoRhombic_(0), chi_(0.0),
90 <        integralOfChiDt_(0.0), eta_(0.0), id_(-1), hasCOM_(false), hasVolume_(false),volume_(0.0)  {
91 <
92 <      }
93 <            
86 >    Snapshot(int nAtoms, int nRigidbodies, int nCutoffGroups,
87 >             int storageLayout) : atomData(nAtoms, storageLayout),
88 >                                  rigidbodyData(nRigidbodies, storageLayout),
89 >                                  cgData(nCutoffGroups, DataStorage::dslPosition),
90 >                                  currentTime_(0), orthoTolerance_(1e-6),
91 >                                  orthoRhombic_(0), chi_(0.0),
92 >                                  integralOfChiDt_(0.0), eta_(0.0), id_(-1),
93 >                                  hasCOM_(false), hasVolume_(false),
94 >                                  volume_(0.0)  {
95 >    }
96 >    
97      /** Returns the id of this Snapshot */
98      int getID() {
99        return id_;
# Line 198 | Line 203 | namespace OpenMD{
203        COMw_ = COMw;
204        hasCOM_ = true;
205      }
206 <                  
206 >
207 >    Vector3d getAtomPosByIindex(int iIndex) {
208 > #ifdef IS_MPI
209 >      return atomIData.position[iIndex];
210 > #else
211 >      return atomData.position[iIndex];
212 > #endif
213 >    }
214 >    Vector3d getAtomPosByJindex(int jIndex) {
215 > #ifdef IS_MPI
216 >      return atomJData.position[jIndex];
217 > #else
218 >      return atomData.position[jIndex];
219 > #endif
220 >    }
221 >
222 >    Vector3d getCutoffGroupPosByIindex(int iIndex) {
223 > #ifdef IS_MPI
224 >      return cgIData.position[iIndex];
225 > #else
226 >      return cgData.position[iIndex];
227 > #endif
228 >    }
229 >    Vector3d getCutoffGroupPosByJindex(int jIndex) {
230 > #ifdef IS_MPI
231 >      return cgJData.position[jIndex];
232 > #else
233 >      return cgData.position[jIndex];
234 > #endif
235 >    }
236 >
237      DataStorage atomData;
238      DataStorage rigidbodyData;
239 +    DataStorage cgData;
240 +
241 + #ifdef IS_MPI
242 +    DataStorage atomIData;
243 +    DataStorage atomJData;
244 +    DataStorage cgIData;
245 +    DataStorage cgJData;
246 + #endif
247 +    
248      Stats statData;
249              
250    private:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines