-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataStructures.h
More file actions
117 lines (88 loc) · 2.35 KB
/
Copy pathdataStructures.h
File metadata and controls
117 lines (88 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
//
// Created by Mingqiu Wang on 5/7/16.
//
#ifndef NANOAD_DATASTRUCTURES_H
#define NANOAD_DATASTRUCTURES_H
#include <ostream>
struct coord {
double x;
double y;
double z;
coord() : x{0}, y{0}, z{0} {}
coord(double xx, double yy, double zz): x{xx}, y{yy}, z{zz} {}
};
const coord operator+( const coord &a, const coord &b );
const coord operator-( const coord &a, const coord &b );
const coord operator*( const coord &a, double b );
const coord operator*( double a, const coord &b );
std::ostream& operator<<( std::ostream &os, const coord &vec);
class receptor {
public:
coord position;
bool bound;
int pair;
receptor() : bound{false}, pair {-1} {}
void unpairing() {
bound = false;
pair = -1;
}
void pairing(int i) {
bound = true;
pair = i;
}
};
class ligand {
public:
coord position;
coord position_origin;
bool bound;
int pair;
ligand() : bound{false}, pair {-1} {}
void updatePO(const coord& origin, const coord& np) {
position_origin = origin;
position = position_origin + np;
}
void updatePA(const coord& pos, const coord& np) {
position = pos;
position_origin = position - np;
}
void unpairing() {
bound = false;
pair = -1;
}
void pairing(int i) {
bound = true;
pair = i;
}
};
struct np {
int name = 0;
coord position;
coord lastPairPos;
coord velocity;
coord rot_velocity;
coord acc;
coord rot_acc;
};
struct bond {
int name = -1;
bool bound = false;
int ligand = -1;
int receptor = -1;
double formTime = 0; // (s)
coord formPositionLigand; // (nm)
coord formPositionReceptor; // (nm)
double breakTime = -1; // (s)
coord breakPositionLigand; // (nm)
coord breakPositionReceptor; // (nm)
double delta = -1.0; // (nm) = current bond length - equilibrium length; (+) extension (-) compression
};
struct cutoff {
double bondLMax; // max bond length (nm)
double bondLMin; // min bond length (nm)
double deltaMax; // max bond length - equilibrium bond length (nm)
cutoff() {}
cutoff(double bondL, double ratio) : deltaMax{0.05 * bondL}, bondLMax{0.05 * bondL + bondL},
bondLMin{-0.05 * bondL + bondL} {}
};
#endif //NANOAD_DATASTRUCTURES_H