54 |
|
|
55 |
|
#include "brains/DataStorage.hpp" |
56 |
|
#include "brains/Stats.hpp" |
57 |
– |
#include "UseTheForce/DarkSide/simulation_interface.h" |
57 |
|
|
59 |
– |
|
58 |
|
namespace OpenMD{ |
59 |
|
|
60 |
|
/** |
61 |
|
* @class Snapshot Snapshot.hpp "brains/Snapshot.hpp" |
62 |
|
* @brief Snapshot class is a repository class for storing dynamic data during |
63 |
|
* Simulation |
64 |
< |
* Every snapshot class will contain one DataStorage for atoms and one DataStorage |
64 |
> |
* Every snapshot class will contain one DataStorage for atoms and one DataStorage |
65 |
|
* for rigid bodies. |
66 |
|
*/ |
67 |
|
class Snapshot { |
68 |
|
public: |
69 |
|
|
70 |
< |
Snapshot(int nAtoms, int nRigidbodies) : atomData(nAtoms), |
71 |
< |
rigidbodyData(nRigidbodies), |
72 |
< |
currentTime_(0), |
73 |
< |
orthoTolerance_(1e-6), |
74 |
< |
orthoRhombic_(0), |
75 |
< |
chi_(0.0), |
76 |
< |
integralOfChiDt_(0.0), |
77 |
< |
eta_(0.0), id_(-1), |
78 |
< |
hasCOM_(false), hasVolume_(false), volume_(0.0) { |
70 |
> |
Snapshot(int nAtoms, int nRigidbodies, |
71 |
> |
int nCutoffGroups) : atomData(nAtoms), |
72 |
> |
rigidbodyData(nRigidbodies), |
73 |
> |
cgData(nCutoffGroups, DataStorage::dslPosition), |
74 |
> |
currentTime_(0), |
75 |
> |
orthoTolerance_(1e-6), |
76 |
> |
orthoRhombic_(0), |
77 |
> |
chi_(0.0), |
78 |
> |
integralOfChiDt_(0.0), |
79 |
> |
eta_(0.0), id_(-1), hasCOM_(false), |
80 |
> |
hasVolume_(false), volume_(0.0) { |
81 |
|
|
82 |
|
} |
83 |
|
|
84 |
< |
Snapshot(int nAtoms, int nRigidbodies, int storageLayout) |
85 |
< |
: atomData(nAtoms, storageLayout), |
86 |
< |
rigidbodyData(nRigidbodies, storageLayout), |
87 |
< |
currentTime_(0), orthoTolerance_(1e-6), orthoRhombic_(0), chi_(0.0), |
88 |
< |
integralOfChiDt_(0.0), eta_(0.0), id_(-1), hasCOM_(false), hasVolume_(false),volume_(0.0) { |
89 |
< |
|
90 |
< |
} |
91 |
< |
|
84 |
> |
Snapshot(int nAtoms, int nRigidbodies, int nCutoffGroups, |
85 |
> |
int storageLayout) : atomData(nAtoms, storageLayout), |
86 |
> |
rigidbodyData(nRigidbodies, storageLayout), |
87 |
> |
cgData(nCutoffGroups, DataStorage::dslPosition), |
88 |
> |
currentTime_(0), orthoTolerance_(1e-6), |
89 |
> |
orthoRhombic_(0), chi_(0.0), |
90 |
> |
integralOfChiDt_(0.0), eta_(0.0), id_(-1), |
91 |
> |
hasCOM_(false), hasVolume_(false), |
92 |
> |
volume_(0.0) { |
93 |
> |
} |
94 |
> |
|
95 |
|
/** Returns the id of this Snapshot */ |
96 |
|
int getID() { |
97 |
|
return id_; |
116 |
|
return rigidbodyData.getSize(); |
117 |
|
} |
118 |
|
|
119 |
+ |
/** Returns the number of rigid bodies */ |
120 |
+ |
int getNumberOfCutoffGroups() { |
121 |
+ |
return cgData.getSize(); |
122 |
+ |
} |
123 |
+ |
|
124 |
|
/** Returns the H-Matrix */ |
125 |
|
Mat3x3d getHmat() { |
126 |
|
return hmat_; |
206 |
|
COMw_ = COMw; |
207 |
|
hasCOM_ = true; |
208 |
|
} |
209 |
< |
|
209 |
> |
|
210 |
|
DataStorage atomData; |
211 |
|
DataStorage rigidbodyData; |
212 |
+ |
DataStorage cgData; |
213 |
|
Stats statData; |
214 |
< |
|
214 |
> |
|
215 |
|
private: |
216 |
|
RealType currentTime_; |
217 |
|
|