3 |
|
|
4 |
|
#include "pcwin.h" |
5 |
|
#include "pcmod.h" |
6 |
< |
#include "atom_k.h" |
7 |
< |
#include "energies.h" |
6 |
> |
|
7 |
|
#include "fix.h" |
9 |
– |
#include "dipmom.h" |
8 |
|
#include "draw.h" |
9 |
+ |
#include "job_control.h" |
10 |
|
#include "vibrate.h" |
11 |
|
#include "utility.h" |
12 |
|
|
24 |
|
EXTERN struct t_logp { |
25 |
|
float logp; |
26 |
|
} logp_calc; |
27 |
+ |
EXTERN struct t_solvent { |
28 |
+ |
int type; |
29 |
+ |
double EPSin, EPSsolv; |
30 |
+ |
double doffset, p1,p2,p3,p4,p5; |
31 |
+ |
double *shct,*asolv,*rsolv,*vsolv,*gpol,*rborn; |
32 |
+ |
} solvent; |
33 |
+ |
|
34 |
+ |
static char Struct_Title[100]; |
35 |
|
|
36 |
|
// ============================ |
37 |
|
void quick_type(void); |
44 |
|
void avgleg(void); |
45 |
|
void get_tag(char *,char *); |
46 |
|
static void mopaco(int start_atom,int end_atom); |
47 |
< |
void get_rings(void); |
47 |
> |
void get_molecule_memory(int); |
48 |
> |
void get_rings(int natom,int (*)[MAXIAT],long int *flags); |
49 |
> |
double get_dipole_moment(void); |
50 |
> |
double get_total_energy(void); |
51 |
> |
char *get_structure_title(void); |
52 |
> |
// ================================== |
53 |
> |
char *get_structure_title() |
54 |
> |
{ |
55 |
> |
if (strlen(Struct_Title) > 0) |
56 |
> |
return Struct_Title; |
57 |
> |
else |
58 |
> |
return NULL; |
59 |
> |
} |
60 |
|
// ================================== |
61 |
|
/* |
62 |
|
* flags - indicates whether dipole, xlogp or vibrational calculations were done |
71 |
|
lptest = 0; |
72 |
|
for( i = 1; i <= natom; i++ ) |
73 |
|
{ |
74 |
< |
if( atom[i].mmx_type == 20 ) |
74 |
> |
if( atom.mmx_type[i] == 20 ) |
75 |
|
{ |
76 |
|
lptest = 1; |
77 |
|
hdel( lptest ); |
84 |
|
{ |
85 |
|
for( i = 0; i < MAXIAT; i++ ) |
86 |
|
{ |
87 |
< |
if( atom[j].iat[i] != 0 ) |
87 |
> |
if( atom.iat[j][i] != 0 ) |
88 |
|
{ |
89 |
< |
if( atom[j].iat[i] < j ) |
89 |
> |
if( atom.iat[j][i] < j ) |
90 |
|
nbond = nbond + 1; |
91 |
|
} |
92 |
|
} |
117 |
|
for (i=1; i <= natom; i++) |
118 |
|
{ |
119 |
|
junk = 0; |
120 |
< |
if (atom[i].mmx_type == 41) junk = 3; |
121 |
< |
else if (atom[i].mmx_type == 42) junk = 5; |
122 |
< |
else if (atom[i].mmx_type == 66) |
120 |
> |
if (atom.mmx_type[i] == 41) junk = 3; |
121 |
> |
else if (atom.mmx_type[i] == 42) junk = 5; |
122 |
> |
else if (atom.mmx_type[i] == 66) |
123 |
|
{ |
124 |
< |
if (atom[i].bo[0] == 1) |
124 |
> |
if (atom.bo[i][0] == 1) |
125 |
|
junk = 5; |
126 |
|
} |
127 |
< |
fprintf(wfile,"%10.4f%10.4f%10.4f %-3s 0 %d 0 0 0 0 \n",atom[i].x, atom[i].y, |
128 |
< |
atom[i].z,Elements[atom[i].atomnum-1].symbol,junk); |
127 |
> |
fprintf(wfile,"%10.4f%10.4f%10.4f %-3s 0 %d 0 0 0 0 \n",atom.x[i], atom.y[i], |
128 |
> |
atom.z[i],Elements[atom.atomnum[i]-1].symbol,junk); |
129 |
|
} |
130 |
|
for (i=1; i <= natom; i++) |
131 |
|
{ |
132 |
|
for (j=0; j < MAXIAT; j++) |
133 |
|
{ |
134 |
< |
if (atom[i].iat[j] != 0 && i < atom[i].iat[j]) |
135 |
< |
fprintf(wfile,"%3d%3d%3d 0\n",i, atom[i].iat[j], atom[i].bo[j]); |
134 |
> |
if (atom.iat[i][j] != 0 && i < atom.iat[i][j]) |
135 |
> |
fprintf(wfile,"%3d%3d%3d 0\n",i, atom.iat[i][j], atom.bo[i][j]); |
136 |
|
} |
137 |
|
} |
138 |
|
fprintf(wfile,"M END\n"); |
140 |
|
fprintf(wfile,"%s\n",Struct_Title); |
141 |
|
|
142 |
|
fprintf(wfile,"> <MMFF94 energy>\n"); |
143 |
< |
fprintf(wfile,"%f\n",energies.total); |
143 |
> |
fprintf(wfile,"%f\n",get_total_energy()); |
144 |
|
|
145 |
< |
fprintf(wfile,"> <MMFF94_Atomtypes>\n"); |
145 |
> |
/* fprintf(wfile,"> <MMFF94_Atomtypes>\n"); |
146 |
|
fprintf(wfile,"+ Atom Atomtype\n"); |
147 |
|
for (i=1; i <=natom; i++) |
148 |
< |
fprintf(wfile,"| %d %d\n",i,atom[i].type); |
149 |
< |
fprintf(wfile,"\n"); |
148 |
> |
fprintf(wfile,"| %d %d\n",i,atom.type[i]); |
149 |
> |
fprintf(wfile,"\n"); */ |
150 |
|
|
151 |
|
if (flags & DO_DIPOLE) { |
152 |
|
fprintf(wfile,"> <dipole moment>\n"); |
153 |
< |
fprintf(wfile,"%f\n",dipolemom.total); |
153 |
> |
fprintf(wfile,"%f\n",get_dipole_moment()); |
154 |
|
} |
155 |
|
|
156 |
|
if (flags & DO_XLOGP) { |
226 |
|
nibond = atoi(c2); |
227 |
|
if (niatom == 0) |
228 |
|
return FALSE; |
229 |
+ |
// get memory for molecule |
230 |
+ |
// get_molecule_memory(niatom); |
231 |
|
// allocate space for aromatic bonds |
232 |
|
numbonds = 0; |
233 |
|
ib1 = ivector(0,nibond); |
259 |
|
} |
260 |
|
newatom = make_atom(itype,xtmp,ytmp,ztmp,atomchar); |
261 |
|
if (itype != 0) |
262 |
< |
atom[newatom].mmx_type = itype; |
262 |
> |
atom.mmx_type[newatom] = itype; |
263 |
|
if (newatom == -1) |
264 |
|
{ |
265 |
|
fprintf(pcmlogfile, "Atom %d %s not recognized structure skipped\n",i,atomchar); |
296 |
|
make_bond(ia1, ia2, ibond); |
297 |
|
if (istereo == 1 && planar) |
298 |
|
{ |
299 |
< |
atom[ia2].z += 0.7; |
300 |
< |
if (atom[ia2].atomnum == 1) |
301 |
< |
atom[ia2].type = 60; |
299 |
> |
atom.z[ia2] += 0.7; |
300 |
> |
if (atom.atomnum[ia2] == 1) |
301 |
> |
atom.type[ia2] = 60; |
302 |
|
} |
303 |
|
if (istereo == 6 && planar) |
304 |
|
{ |
305 |
< |
atom[ia2].z -= 0.7; |
306 |
< |
if (atom[ia2].atomnum == 1) |
307 |
< |
atom[ia2].type = 60; |
305 |
> |
atom.z[ia2] -= 0.7; |
306 |
> |
if (atom.atomnum[ia2] == 1) |
307 |
> |
atom.type[ia2] = 60; |
308 |
|
} |
309 |
|
} |
310 |
|
// read to end of structure |
315 |
|
// <RESTRAINED_DISTANCES> |
316 |
|
// <RESTRAINED_ANGLES> |
317 |
|
// <RESTRAINED_DIHEDRALS> |
318 |
+ |
// <ELECTROSTATICS> |
319 |
+ |
// <PARTIAL_CHARGES> |
320 |
|
|
321 |
|
while (FetchRecord(rfile,inputline)) |
322 |
|
{ |
331 |
|
tab = tabulator_new_from_file_using_header(rfile,"ATOM",0); |
332 |
|
if (tab) |
333 |
|
{ |
311 |
– |
fprintf(pcmlogfile,"got table\n"); |
334 |
|
n_row = tabulator_height(tab); |
335 |
|
for (i=0; i < n_row; i++) |
336 |
|
{ |
358 |
|
restrain_atom.katom_restrain[restrain_atom.natom_restrain] = ia1; |
359 |
|
restrain_atom.restrain_const[restrain_atom.natom_restrain] = fconst; |
360 |
|
restrain_atom.restrain_max[restrain_atom.natom_restrain] = max; |
361 |
< |
restrain_atom.restrain_position[restrain_atom.natom_restrain][0] = atom[ia1].x; // default positions |
362 |
< |
restrain_atom.restrain_position[restrain_atom.natom_restrain][1] = atom[ia1].y; |
363 |
< |
restrain_atom.restrain_position[restrain_atom.natom_restrain][2] = atom[ia1].z; |
361 |
> |
restrain_atom.restrain_position[restrain_atom.natom_restrain][0] = atom.x[ia1]; // default positions |
362 |
> |
restrain_atom.restrain_position[restrain_atom.natom_restrain][1] = atom.y[ia1]; |
363 |
> |
restrain_atom.restrain_position[restrain_atom.natom_restrain][2] = atom.z[ia1]; |
364 |
|
if (strlen(tab[i][3]) > 0) // x postion |
365 |
|
{ |
366 |
|
xtmp = atof(tab[i][3]); |
458 |
|
} |
459 |
|
} |
460 |
|
} |
461 |
< |
} |
461 |
> |
} else if (strcasecmp(tag,"electrostatics") == 0) |
462 |
> |
{ |
463 |
> |
FetchRecord(rfile,inputline); |
464 |
> |
sscanf(inputline,"%s %s %f %f",c1,tag,&min,&max); |
465 |
> |
if (strcmp(tag,"NONE") == 0) |
466 |
> |
{ |
467 |
> |
job_control.use_charge = TRUE; |
468 |
> |
job_control.scale = 0.0; |
469 |
> |
} else if (strcmp(tag,"SCALE") == 0) |
470 |
> |
{ |
471 |
> |
job_control.use_charge = TRUE; |
472 |
> |
job_control.scale = min; |
473 |
> |
} else if (strcmp(tag,"GBSA") == 0) |
474 |
> |
{ |
475 |
> |
job_control.use_gbsa = TRUE; |
476 |
> |
solvent.type = 1; // STILL |
477 |
> |
solvent.EPSin = min; |
478 |
> |
solvent.EPSsolv = max; |
479 |
> |
} |
480 |
> |
} |
481 |
|
} |
482 |
|
} |
483 |
|
// if (has_aromatic) |
484 |
|
// need to deal with aromatic bonds |
485 |
|
L_DONE: |
486 |
< |
get_rings(); |
486 |
> |
get_rings(natom,atom.iat,atom.flags); |
487 |
|
quick_type(); |
488 |
|
if (has_Aromatic) |
489 |
|
{ |
525 |
|
{ |
526 |
|
int ibi, ibj, it, jt, kk; |
527 |
|
|
528 |
< |
it = atom[ia].atomnum; |
529 |
< |
jt = atom[ib].atomnum; |
528 |
> |
it = atom.atomnum[ia]; |
529 |
> |
jt = atom.atomnum[ib]; |
530 |
|
|
531 |
|
if( it == 6 || it == 7 || it == 8 || it == 15 || it == 16 ) |
532 |
|
{ |
538 |
|
ibi = 0; |
539 |
|
for( kk = 0; kk < MAXIAT; kk++ ) |
540 |
|
{ |
541 |
< |
if( atom[ia].bo[kk] != 9 ) |
542 |
< |
ibi = ibi + atom[ia].bo[kk]; |
541 |
> |
if( atom.bo[ia][kk] != 9 ) |
542 |
> |
ibi = ibi + atom.bo[ia][kk]; |
543 |
|
} |
544 |
|
ibj = 0; |
545 |
|
for( kk = 0; kk < MAXIAT; kk++ ) |
546 |
|
{ |
547 |
< |
if( atom[ib].bo[kk] != 9 ) |
548 |
< |
ibj = ibj + atom[ib].bo[kk]; |
547 |
> |
if( atom.bo[ib][kk] != 9 ) |
548 |
> |
ibj = ibj + atom.bo[ib][kk]; |
549 |
|
} |
550 |
|
if( it == 7 ) |
551 |
|
{ |
566 |
|
ibi = 0; |
567 |
|
for( kk = 0; kk < MAXIAT; kk++ ) |
568 |
|
{ |
569 |
< |
if( atom[ia].bo[kk] != 9 ) |
570 |
< |
ibi = ibi + atom[ia].bo[kk]; |
569 |
> |
if( atom.bo[ia][kk] != 9 ) |
570 |
> |
ibi = ibi + atom.bo[ia][kk]; |
571 |
|
} |
572 |
|
ibj = 0; |
573 |
|
for( kk = 0; kk < MAXIAT; kk++ ) |
574 |
|
{ |
575 |
< |
if( atom[ib].bo[kk] != 9 ) |
576 |
< |
ibj = ibj + atom[ib].bo[kk]; |
575 |
> |
if( atom.bo[ib][kk] != 9 ) |
576 |
> |
ibj = ibj + atom.bo[ib][kk]; |
577 |
|
} |
578 |
|
if( ibi <= 3 && ibj <= 3 ) |
579 |
|
{ |