| 1 |
+ |
/********************************************************************** |
| 2 |
+ |
* Copyright (C) 2002-2003 by Gezelter's Group |
| 3 |
+ |
*This program is free software; you can redistribute it and/or modify |
| 4 |
+ |
*it under the terms of the GNU General Public License as published by |
| 5 |
+ |
*the Free Software Foundation version 2 of the License. |
| 6 |
+ |
* |
| 7 |
+ |
*This program is distributed in the hope that it will be useful, |
| 8 |
+ |
*but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 |
+ |
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 |
+ |
*GNU General Public License for more details. |
| 11 |
+ |
* |
| 12 |
+ |
************************************************************************ |
| 13 |
+ |
*Author: Teng Lin Email: tlin@nd.edu |
| 14 |
+ |
*Date: 08/13/2002 Version: 1.0 |
| 15 |
+ |
* |
| 16 |
+ |
************************************************************************ |
| 17 |
+ |
*Description: |
| 18 |
+ |
* |
| 19 |
+ |
***********************************************************************/ |
| 20 |
|
#include <iostream> |
| 21 |
|
#include <vector> |
| 22 |
+ |
#include <map> |
| 23 |
+ |
#include "extradata.h" |
| 24 |
|
|
| 25 |
|
using namespace std; |
| 26 |
|
|
| 29 |
|
protected: |
| 30 |
|
int _numAtom; |
| 31 |
|
int _numPseudo; |
| 32 |
+ |
float _boxLen[3]; |
| 33 |
+ |
float _alpha; |
| 34 |
+ |
float _beta; |
| 35 |
+ |
float _gamma; |
| 36 |
+ |
float _dt; |
| 37 |
+ |
int _timeSteps; |
| 38 |
|
|
| 39 |
+ |
bool _initialized; |
| 40 |
+ |
|
| 41 |
|
vector<float> _coor; |
| 42 |
|
vector<float> _velo; |
| 14 |
– |
vector<float> _force; |
| 15 |
– |
map<string, float> _energy; |
| 16 |
– |
map<string, > _extra; |
| 43 |
|
|
| 44 |
+ |
vector<TExtraData *> _extraDataList; |
| 45 |
+ |
|
| 46 |
+ |
void Clear(); |
| 47 |
+ |
|
| 48 |
|
public: |
| 49 |
< |
float _boxLen[3]; |
| 50 |
< |
float _alpha; |
| 51 |
< |
float _beta; |
| 52 |
< |
float _gamma; |
| 23 |
< |
|
| 49 |
> |
TFrame(); |
| 50 |
> |
TFrame(const TFrame &src); |
| 51 |
> |
~TFrame(); |
| 52 |
> |
|
| 53 |
|
int GetNumAtom() { return _numAtom;} |
| 54 |
< |
float * GetNumPseudo() { return _numPseudo;} |
| 55 |
< |
float * GetEnergy(string energyName); |
| 56 |
< |
vector<float> *GetCoor(); |
| 57 |
< |
vector<float> *GetVelo(); |
| 58 |
< |
vector<float> *GetForce(); |
| 59 |
< |
map<string, float> *GetEnergy(); |
| 60 |
< |
|
| 61 |
< |
void SetNumAtom(int numAtom) { return _numAtom = numAtom;} |
| 62 |
< |
|
| 54 |
> |
int GetNumPseudo() { return _numPseudo;} |
| 55 |
> |
float GetDT() { return _dt;} |
| 56 |
> |
int GetTimeSteps() { return _timeSteps;} |
| 57 |
> |
vector<float> &GetCoor() { return _coor;} |
| 58 |
> |
vector<float> &GetVelo() { return _velo;} |
| 59 |
> |
|
| 60 |
> |
float GetAlpha() { return _alpha;} |
| 61 |
> |
float GetBeta() { return _beta;} |
| 62 |
> |
float GetGamma() { return _gamma;} |
| 63 |
> |
float GetBoxLenX() { return _boxLen[0];} |
| 64 |
> |
float GetBoxLenY() { return _boxLen[1];} |
| 65 |
> |
float GetBoxLenZ() { return _boxLen[2];} |
| 66 |
> |
float *GetBoxLen() { return _boxLen;} |
| 67 |
> |
|
| 68 |
> |
void SetNumAtom(int numAtom) { _numAtom = numAtom;} |
| 69 |
> |
void SetNumPseudo(int numPseudo) { _numPseudo = numPseudo;} |
| 70 |
> |
void SetDT(float dt) { _dt = dt;} |
| 71 |
> |
void SetTimeSteps(int timeSteps) { _timeSteps = timeSteps;} |
| 72 |
> |
void SetCoor(const vector<float> &coor) { _coor = coor;} |
| 73 |
> |
void SetVelo(const vector<float> &velo) { _velo = velo;} |
| 74 |
> |
|
| 75 |
> |
void SetAlpha(int alpha) { _alpha = alpha;} |
| 76 |
> |
void SetBeta(int beta) { _beta = beta;} |
| 77 |
> |
void SetGamma(int gamma) { _gamma = gamma;} |
| 78 |
> |
void SetBoxLenX(float boxLenX) { _boxLen[0] = boxLenX;} |
| 79 |
> |
void SetBoxLenY(float boxLenY) { _boxLen[1] = boxLenY;} |
| 80 |
> |
void SetBoxLenZ(float boxLenZ) { _boxLen[2] = boxLenZ;} |
| 81 |
> |
|
| 82 |
> |
void AddExtraData(TExtraData *extraData); |
| 83 |
> |
void RemoveExtraData(TExtraData *extraData); |
| 84 |
> |
TExtraData *GetExtraData(int extraDataType); |
| 85 |
> |
TExtraData *GetExtraData(string attr); |
| 86 |
> |
vector<TExtraData *> &GetExraDataList() { return _extraDataList;} |
| 87 |
> |
void SetExraDataList(vector<TExtraData *> &extraDataList) |
| 88 |
> |
{ _extraDataList = extraDataList;} |
| 89 |
> |
|
| 90 |
|
void Reserve(int numAtom); |
| 91 |
< |
TFrame(TFrame &frame); |
| 92 |
< |
~TFrame(); |
| 93 |
< |
|
| 91 |
> |
|
| 92 |
> |
void Init(); |
| 93 |
> |
|
| 94 |
|
}; |