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 <functional> |
24 |
+ |
#include <algorithm> |
25 |
+ |
//#include "extradata.h" |
26 |
|
|
27 |
+ |
|
28 |
+ |
|
29 |
|
using namespace std; |
30 |
|
|
31 |
< |
class TFrame |
31 |
> |
class TFrame //: public TExtraDataList |
32 |
|
{ |
33 |
|
protected: |
34 |
|
int _numAtom; |
35 |
|
int _numPseudo; |
36 |
+ |
float _boxLen[3]; |
37 |
+ |
float _alpha; |
38 |
+ |
float _beta; |
39 |
+ |
float _gamma; |
40 |
+ |
float _dt; |
41 |
+ |
int _timeSteps; |
42 |
|
|
43 |
+ |
bool _initialized; |
44 |
+ |
|
45 |
|
vector<float> _coor; |
46 |
|
vector<float> _velo; |
14 |
– |
vector<float> _force; |
15 |
– |
map<string, float> _energy; |
16 |
– |
map<string, > _extra; |
47 |
|
|
48 |
+ |
// TExtraDataList _extraDataList; |
49 |
+ |
|
50 |
+ |
void Clear(); |
51 |
+ |
|
52 |
|
public: |
53 |
< |
float _boxLen[3]; |
54 |
< |
float _alpha; |
55 |
< |
float _beta; |
56 |
< |
float _gamma; |
23 |
< |
|
53 |
> |
TFrame(); |
54 |
> |
TFrame(const TFrame &src); |
55 |
> |
~TFrame(); |
56 |
> |
|
57 |
|
int GetNumAtom() { return _numAtom;} |
58 |
< |
float * GetNumPseudo() { return _numPseudo;} |
59 |
< |
float * GetEnergy(string energyName); |
60 |
< |
vector<float> *GetCoor(); |
61 |
< |
vector<float> *GetVelo(); |
62 |
< |
vector<float> *GetForce(); |
63 |
< |
map<string, float> *GetEnergy(); |
64 |
< |
|
65 |
< |
void SetNumAtom(int numAtom) { return _numAtom = numAtom;} |
66 |
< |
|
58 |
> |
int GetNumPseudo() { return _numPseudo;} |
59 |
> |
float GetDT() { return _dt;} |
60 |
> |
int GetTimeSteps() { return _timeSteps;} |
61 |
> |
vector<float> &GetCoor() { return _coor;} |
62 |
> |
vector<float> &GetVelo() { return _velo;} |
63 |
> |
|
64 |
> |
float GetAlpha() { return _alpha;} |
65 |
> |
float GetBeta() { return _beta;} |
66 |
> |
float GetGamma() { return _gamma;} |
67 |
> |
float GetBoxLenX() { return _boxLen[0];} |
68 |
> |
float GetBoxLenY() { return _boxLen[1];} |
69 |
> |
float GetBoxLenZ() { return _boxLen[2];} |
70 |
> |
float *GetBoxLen() { return _boxLen;} |
71 |
> |
|
72 |
> |
void SetNumAtom(int numAtom) { _numAtom = numAtom;} |
73 |
> |
void SetNumPseudo(int numPseudo) { _numPseudo = numPseudo;} |
74 |
> |
void SetDT(float dt) { _dt = dt;} |
75 |
> |
void SetTimeSteps(int timeSteps) { _timeSteps = timeSteps;} |
76 |
> |
void SetCoor(const vector<float> &coor) { _coor = coor;} |
77 |
> |
void SetVelo(const vector<float> &velo) { _velo = velo;} |
78 |
> |
|
79 |
> |
void SetAlpha(int alpha) { _alpha = alpha;} |
80 |
> |
void SetBeta(int beta) { _beta = beta;} |
81 |
> |
void SetGamma(int gamma) { _gamma = gamma;} |
82 |
> |
void SetBoxLenX(float boxLenX) { _boxLen[0] = boxLenX;} |
83 |
> |
void SetBoxLenY(float boxLenY) { _boxLen[1] = boxLenY;} |
84 |
> |
void SetBoxLenZ(float boxLenZ) { _boxLen[2] = boxLenZ;} |
85 |
> |
/* |
86 |
> |
void AddExtraData(TExtraData *extraData); |
87 |
> |
void RemoveExtraData(TExtraData *extraData); |
88 |
> |
TExtraData *GetExtraData(int extraDataType); |
89 |
> |
TExtraData *GetExtraData(string attr); |
90 |
> |
vector<TExtraData *> &GetExraDataList() { return _extraDataList;} |
91 |
> |
void SetExraDataList(vector<TExtraData *> &extraDataList) |
92 |
> |
{ _extraDataList = extraDataList;} |
93 |
> |
*/ |
94 |
|
void Reserve(int numAtom); |
95 |
< |
TFrame(TFrame &frame); |
96 |
< |
~TFrame(); |
97 |
< |
|
95 |
> |
|
96 |
> |
void Init(); |
97 |
> |
|
98 |
|
}; |
99 |
+ |
|
100 |
+ |
|