3 |
|
#include "pcmod.h" |
4 |
|
#include "field.h" |
5 |
|
#include "atom_k.h" |
6 |
– |
#include "pot.h" |
7 |
– |
#include "energies.h" |
8 |
– |
#include "solv.h" |
6 |
|
#include "draw.h" |
7 |
|
|
8 |
|
EXTERN struct t_minim_values { |
13 |
|
int type, method, field, added_const; |
14 |
|
char added_path[256],added_name[256]; |
15 |
|
} minim_control; |
19 |
– |
EXTERN struct t_vdw1 { |
20 |
– |
int nvdw; |
21 |
– |
float rad[MAXVDWCONST], eps[MAXVDWCONST]; |
22 |
– |
int lpd[MAXVDWCONST], ihtyp[MAXVDWCONST], ihdon[MAXVDWCONST]; |
23 |
– |
float alpha[MAXVDWCONST],n[MAXVDWCONST],a[MAXVDWCONST],g[MAXVDWCONST]; |
24 |
– |
char da[MAXVDWCONST][2]; |
25 |
– |
} vdw1; |
16 |
|
|
17 |
|
EXTERN struct { |
18 |
< |
int mm3, mmff, amber, opls; |
18 |
> |
int mm3, mmff, amber, opls; |
19 |
|
} AtomTypes[]; |
20 |
|
|
21 |
|
EXTERN struct ElementType { char symbol[3]; |
26 |
|
|
27 |
|
EXTERN int mm3_mmx[], mmff_mmx[]; |
28 |
|
// =============================================== |
29 |
< |
void set_atomdata(int ia, int mmxtype, int mm3type, int mmfftype,int ambertype,int oplstype) |
29 |
> |
void set_atomdata(int ia, int mmxtype, int mm3type, int mmfftype) |
30 |
|
{ |
31 |
|
int type; |
32 |
|
|
36 |
|
atom[ia].mm3_type = mm3type; |
37 |
|
if (mmfftype > 0) |
38 |
|
atom[ia].mmff_type = mmfftype; |
49 |
– |
if (ambertype > 0) |
50 |
– |
atom[ia].amber_type = ambertype; |
51 |
– |
if (oplstype > 0) |
52 |
– |
atom[ia].opls_type = oplstype; |
39 |
|
|
40 |
|
if (field.type == MMX || field.type == MM2) |
41 |
|
{ |
43 |
|
} else if (field.type == MM3) |
44 |
|
{ |
45 |
|
type = mm3type; |
46 |
< |
}else if (field.type == AMBER) |
61 |
< |
{ |
62 |
< |
type = ambertype; |
63 |
< |
} else if (field.type == MMFF94) |
46 |
> |
} else if (field.type == MMFF94) |
47 |
|
{ |
48 |
|
type = mmfftype; |
66 |
– |
} else if (field.type == OPLSAA) |
67 |
– |
{ |
68 |
– |
type = oplstype; |
49 |
|
} |
70 |
– |
|
50 |
|
if ( type < 300) |
51 |
|
{ |
52 |
|
atom[ia].tclass = atom_k.tclass[type]; |
56 |
|
} |
57 |
|
} |
58 |
|
// =============================================== |
59 |
< |
void set_atomtype(int ia, int mmxtype, int mm3type, int mmfftype,int ambertype,int oplstype) |
59 |
> |
void set_atomtype(int ia, int mmxtype, int mm3type, int mmfftype) |
60 |
|
{ |
61 |
|
if (mmxtype > 0) |
62 |
|
atom[ia].mmx_type = mmxtype; |
63 |
|
if (mm3type > 0) |
64 |
|
atom[ia].mm3_type = mm3type; |
65 |
|
if (mmfftype > 0) |
66 |
< |
atom[ia].mmff_type = mmfftype; |
88 |
< |
if (ambertype > 0) |
89 |
< |
atom[ia].amber_type = ambertype; |
90 |
< |
if (oplstype > 0) |
91 |
< |
atom[ia].opls_type = oplstype; |
92 |
< |
|
66 |
> |
atom[ia].mmff_type = mmfftype; |
67 |
|
} |
68 |
|
// ====================================================== |
69 |
|
int make_atom(int type, float x, float y, float z,char *name) |
70 |
|
{ |
71 |
|
int i,iz; |
72 |
< |
int mmxtype, mm3type, mmfftype,ambertype,oplstype; |
72 |
> |
int mmxtype, mm3type, mmfftype; |
73 |
|
|
74 |
|
natom++; |
75 |
|
if (natom >= MAXATOM - 10) |
96 |
|
mmxtype = mmff_mmxtype(type); |
97 |
|
mm3type = 0; |
98 |
|
mmfftype = type; |
99 |
< |
ambertype = 0; |
126 |
< |
oplstype = 0; |
127 |
< |
set_atomtype(natom,mmxtype,mm3type,mmfftype,ambertype,oplstype); |
99 |
> |
set_atomtype(natom,mmxtype,mm3type,mmfftype); |
100 |
|
if (mmfftype == 0) return -1; |
101 |
|
} else if (field.type == MMX || field.type == MM2) |
102 |
|
{ |
104 |
|
mmxtype = type; |
105 |
|
mm3type = AtomTypes[type-1].mm3; |
106 |
|
mmfftype = AtomTypes[type-1].mmff; |
107 |
< |
ambertype = AtomTypes[type-1].amber; |
136 |
< |
oplstype = AtomTypes[type-1].opls; |
137 |
< |
set_atomtype(natom,mmxtype,mm3type,mmfftype,ambertype,oplstype); |
107 |
> |
set_atomtype(natom,mmxtype,mm3type,mmfftype); |
108 |
|
} else if (field.type == MM3) |
109 |
|
{ |
110 |
|
atom[natom].mm3_type = type; |
111 |
|
mmxtype = mm3_mmxtype(type); |
112 |
|
mm3type = type; |
113 |
|
mmfftype = AtomTypes[mmxtype-1].mmff; |
114 |
< |
ambertype = AtomTypes[mmxtype-1].amber; |
145 |
< |
oplstype = AtomTypes[mmxtype-1].opls; |
146 |
< |
set_atomtype(natom,mmxtype,mm3type,mmfftype,ambertype,oplstype); |
114 |
> |
set_atomtype(natom,mmxtype,mm3type,mmfftype); |
115 |
|
} else if (field.type == MMFF94) |
116 |
|
{ |
117 |
|
atom[natom].mmff_type = type; |
118 |
|
mmxtype = mmff_mmxtype(type); |
119 |
|
mm3type = AtomTypes[mmxtype-1].mm3; |
120 |
|
mmfftype = type; |
121 |
< |
ambertype = AtomTypes[mmxtype-1].amber; |
154 |
< |
oplstype = AtomTypes[mmxtype-1].opls; |
155 |
< |
set_atomtype(natom,mmxtype,mm3type,mmfftype,ambertype,oplstype); |
121 |
> |
set_atomtype(natom,mmxtype,mm3type,mmfftype); |
122 |
|
} |
123 |
|
|
124 |
|
atom[natom].x = x; atom[natom].y = y; atom[natom].z = z; |
145 |
|
atom[natom].mm3_type = type; |
146 |
|
else if (field.type == MMFF94) |
147 |
|
atom[natom].mmff_type = type; |
182 |
– |
else if (field.type == AMBER) |
183 |
– |
atom[natom].amber_type = type; |
184 |
– |
else if (field.type == OPLSAA) |
185 |
– |
atom[natom].opls_type = type; |
148 |
|
} |
149 |
|
if (type != 0) atom[natom].type = type; |
150 |
|
atom[natom].x = x; atom[natom].y = y; atom[natom].z = z; |
281 |
|
} |
282 |
|
} |
283 |
|
} |
322 |
– |
/* --------------------------- */ |
323 |
– |
void generate_bonds(void) |
324 |
– |
{ |
325 |
– |
int i,j; |
326 |
– |
|
327 |
– |
bonds.numbonds = 0; |
328 |
– |
for (i= 0; i <= natom; i++) |
329 |
– |
{ |
330 |
– |
bonds.ia1[i] = 0; |
331 |
– |
bonds.ia2[i] = 0; |
332 |
– |
bonds.bondorder[i] = 0; |
333 |
– |
} |
334 |
– |
|
335 |
– |
for (i = 1; i <= natom; i++) |
336 |
– |
{ |
337 |
– |
for (j = 0; j < MAXIAT; j++) |
338 |
– |
{ |
339 |
– |
if (atom[i].iat[j] > i && atom[i].iat[j] != 0) |
340 |
– |
{ |
341 |
– |
bonds.ia1[bonds.numbonds] = i; |
342 |
– |
bonds.ia2[bonds.numbonds] = atom[i].iat[j]; |
343 |
– |
bonds.bondorder[bonds.numbonds] = atom[i].bo[j]; |
344 |
– |
bonds.numbonds++; |
345 |
– |
} |
346 |
– |
} |
347 |
– |
} |
348 |
– |
} |
284 |
|
// ======================================================== |
285 |
|
int mm3_mmxtype(int mm3type) |
286 |
|
{ |