This repository has been archived by the owner on Dec 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
mcopff.h
142 lines (78 loc) · 2.35 KB
/
mcopff.h
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// multicopy-forcefield
//
//
#ifndef _MCOPFF_H_
#define _MCOPFF_H_
#include "attractforcefield.h"
#include "rigidbody.h"
namespace PTools{
// typedef std::vector<AttractRigidbody> ensemble ;
class Region
{
private:
std::vector<AttractRigidbody> _copies;
public:
/*
void AttractEulerRotate(const dbl& phi, const dbl& ssi, const dbl& rot)
{
for (uint i=0; i<_copies.size(); i++)
{
_copies[i].AttractEulerRotate(phi, ssi, rot);
}
};
void Translate(const Coord3D& co)
{
for(uint i =0; i< _copies.size(); ++i)
{
_copies[i].Translate(co);
}
}*/
void addCopy(const AttractRigidbody& cop){_copies.push_back(cop);};
size_t size() const {return _copies.size();};
AttractRigidbody& operator[](uint i){return _copies[i];};
};
class Mcoprigid //multicopy rigidbody
{
public:
Mcoprigid();
//using default copy operator
void setMain(AttractRigidbody& main) ;
void addEnsemble(const Region& reg){ _vregion.push_back(reg); std::vector<dbl> v; _weights.push_back(v); };
void AttractEulerRotate(const dbl& phi, const dbl& ssi, const dbl& rot);
void Translate(const Coord3D& c);
void PrintWeights();
std::vector <std::vector<dbl> > getWeights(){return _weights;};
private:
AttractRigidbody _main;
std::vector< Region > _vregion ;
bool _complete ;
Coord3D _center ; ///<center of mass of the main region
std::vector< std::vector <dbl> > _weights;
friend class McopForceField;
};
/** \brief ForceField with multicopy
needs an attract forcefield (either 1 or 2) in constructor
no normal modes yet
*/
class McopForceField: public ForceField
{
public:
McopForceField(BaseAttractForceField& ff, dbl cutoff)
:_ff(ff), _cutoff(cutoff) {};
dbl Function(const Vdouble&);
void Derivatives(const Vdouble& v, Vdouble & g );
void setReceptor(const Mcoprigid& rec) {_receptor = rec;};
void setLigand(const Mcoprigid& lig) { _centered_ligand = lig; };
void calculate_weights(Mcoprigid& lig, bool print=false);
uint ProblemSize() {return 6;};
void initMinimization(){};
private:
BaseAttractForceField& _ff ;
dbl _cutoff;
bool _update_weights;
Mcoprigid _centered_ligand ;
Mcoprigid _moved_ligand ;
Mcoprigid _receptor;
};
}//namespace PTools
#endif // _MCOPFF_H_