36 |
|
|
37 |
|
#include <vector> |
38 |
|
|
39 |
< |
#include "math/Vector3.hpp" |
40 |
< |
#include "math/SquareMatrix3.hpp" |
39 |
> |
#include "brains/DataStorage.hpp" |
40 |
|
|
41 |
|
using namespace std; |
42 |
|
|
43 |
|
namespace oopse{ |
44 |
|
|
46 |
– |
|
47 |
– |
//forward declaration |
48 |
– |
class Snapshot; |
49 |
– |
class SnapshotManager; |
45 |
|
class StuntDouble; |
46 |
|
|
47 |
|
/** |
53 |
– |
* @class DataStorage |
54 |
– |
* @warning do not try to insert element into (or ease element from) private member data |
55 |
– |
* of DataStorage directly. |
56 |
– |
*/ |
57 |
– |
class DataStorage { |
58 |
– |
public: |
59 |
– |
|
60 |
– |
enum{ |
61 |
– |
slPosition = 1, |
62 |
– |
slVelocity = 2, |
63 |
– |
slAmat = 4, |
64 |
– |
slAngularMomentum = 8, |
65 |
– |
slUnitVector = 16, |
66 |
– |
slZAngle = 32, |
67 |
– |
slForce = 64, |
68 |
– |
slTorque = 128 |
69 |
– |
}; |
70 |
– |
|
71 |
– |
DataStorage(int size); |
72 |
– |
|
73 |
– |
/** return the size of this DataStorage */ |
74 |
– |
int size(); |
75 |
– |
void resize(int size); |
76 |
– |
void reserve(int size); |
77 |
– |
|
78 |
– |
void move(int source, int num, int target); |
79 |
– |
int getStorageLayout(); |
80 |
– |
void setStorageLayout(int layout); |
81 |
– |
|
82 |
– |
double *getArrayPointer(int ); |
83 |
– |
|
84 |
– |
friend class StuntDouble; |
85 |
– |
|
86 |
– |
private: |
87 |
– |
int size_; |
88 |
– |
int storageLayout_; |
89 |
– |
vector<Vector3d> position; /** position array */ |
90 |
– |
vector<Vector3d> velocity; /** velocity array */ |
91 |
– |
vector<RotMat3x3d> aMat; /** rotation matrix array */ |
92 |
– |
vector<Vector3d> angularMomentum;/** velocity array */ |
93 |
– |
vector<Vector3d> unitVector; /** the lab frame unit vector array*/ |
94 |
– |
vector<double> zAngle; /** z -angle array */ |
95 |
– |
vector<Vector3d> force; /** force array */ |
96 |
– |
vector<Vector3d> torque; /** torque array */ |
97 |
– |
}; |
98 |
– |
|
99 |
– |
/** |
48 |
|
* @class Snapshot Snapshot.hpp "brains/Snapshot.hpp" |
49 |
|
* @brief Snapshot class is a repository class for storing dynamic data during |
50 |
|
* Simulation |
80 |
|
//} |
81 |
|
|
82 |
|
int getSize() { |
83 |
< |
return atomData.size() + rigidbodyData.size(); |
83 |
> |
return atomData.getSize() + rigidbodyData.getSize(); |
84 |
|
} |
85 |
|
|
86 |
|
/** Returns the number of atoms */ |
87 |
|
int getNumberOfAtoms() { |
88 |
< |
return atomData.size(); |
88 |
> |
return atomData.getSize(); |
89 |
|
} |
90 |
|
|
91 |
|
/** Returns the number of rigid bodies */ |
92 |
|
int getNumberOfRigidBodies() { |
93 |
< |
return rigidbodyData.size(); |
93 |
> |
return rigidbodyData.getSize(); |
94 |
|
} |
95 |
|
|
96 |
|
/** Returns the H-Matrix */ |
106 |
|
|
107 |
|
/** Returns the inverse H-Matrix */ |
108 |
|
Mat3x3d getInvHmat() { |
109 |
< |
return invHmat_ |
109 |
> |
return invHmat_; |
110 |
|
} |
111 |
|
|
112 |
|
double getTimeStamp() { |