| 58 |
|
* @class DataStorage |
| 59 |
|
* @warning do not try to insert element into (or ease element from) private member data |
| 60 |
|
* of DataStorage directly. |
| 61 |
< |
* @todo DataStorage may need refactorying. Every std::vector can inherit from the same base class |
| 61 |
> |
* @todo DataStorage may need refactoring. Every std::vector can inherit from the same base class |
| 62 |
|
* which will make it easy to maintain |
| 63 |
|
*/ |
| 64 |
|
class DataStorage { |
| 105 |
|
/** Sets the storage layout */ |
| 106 |
|
void setStorageLayout(int layout); |
| 107 |
|
/** Returns the pointer of internal array */ |
| 108 |
< |
double *getArrayPointer(int whichArray); |
| 108 |
> |
RealType *getArrayPointer(int whichArray); |
| 109 |
|
|
| 110 |
|
std::vector<Vector3d> position; /** position array */ |
| 111 |
|
std::vector<Vector3d> velocity; /** velocity array */ |
| 112 |
|
std::vector<RotMat3x3d> aMat; /** rotation matrix array */ |
| 113 |
|
std::vector<Vector3d> angularMomentum;/** angular momentum array (body-fixed) */ |
| 114 |
|
std::vector<Mat3x3d> electroFrame; /** the lab frame unit std::vector array*/ |
| 115 |
< |
std::vector<double> zAngle; /** z -angle array */ |
| 115 |
> |
std::vector<RealType> zAngle; /** z -angle array */ |
| 116 |
|
std::vector<Vector3d> force; /** force array */ |
| 117 |
|
std::vector<Vector3d> torque; /** torque array */ |
| 118 |
|
|
| 120 |
|
|
| 121 |
|
private: |
| 122 |
|
|
| 123 |
< |
double* internalGetArrayPointer(std::vector<Vector3d>& v); |
| 123 |
> |
RealType* internalGetArrayPointer(std::vector<Vector3d>& v); |
| 124 |
|
|
| 125 |
< |
double* internalGetArrayPointer(std::vector<RotMat3x3d>& v); |
| 126 |
< |
double* internalGetArrayPointer(std::vector<double>& v); |
| 125 |
> |
RealType* internalGetArrayPointer(std::vector<RotMat3x3d>& v); |
| 126 |
> |
RealType* internalGetArrayPointer(std::vector<RealType>& v); |
| 127 |
> |
|
| 128 |
|
|
| 129 |
|
template<typename T> |
| 130 |
|
void internalResize(std::vector<T>& v, int newSize); |