6 |
|
#include "atom_k.h" |
7 |
|
#include "energies.h" |
8 |
|
#include "fix.h" |
9 |
+ |
#include "dipmom.h" |
10 |
+ |
#include "draw.h" |
11 |
+ |
#include "vibrate.h" |
12 |
|
|
13 |
|
#define TABULATOR_INCLUDE_IMPLEMENTATION |
14 |
|
#include "tabulator.h" |
21 |
|
float weight, covradius, vdwradius; |
22 |
|
int s,p,d,f,type ; |
23 |
|
} Elements[]; |
21 |
– |
EXTERN struct t_dipolemom { |
22 |
– |
double total, xdipole, ydipole, zdipole; |
23 |
– |
} dipolemom; |
24 |
|
EXTERN struct t_logp { |
25 |
|
float logp; |
26 |
|
} logp_calc; |
27 |
– |
EXTERN struct t_vibdata { |
28 |
– |
char ptgrp[4]; |
29 |
– |
float mom_ix,mom_iy,mom_iz; |
30 |
– |
float etot,htot,stot,gtot,cptot; |
31 |
– |
} vibdata; |
27 |
|
|
28 |
|
// ============================ |
29 |
|
|
35 |
– |
int make_atom(int, float, float, float,char *); |
36 |
– |
void make_bond(int, int, int); |
30 |
|
int read_sdf(int,int); |
31 |
|
int rd_sdf(FILE *); |
32 |
|
void write_sdf(int); |
40 |
– |
void message_alert(char *, char *); |
33 |
|
void hdel(int); |
34 |
|
FILE * fopen_path ( char * , char * , char * ) ; |
35 |
|
int FetchRecord(FILE *, char *); |
36 |
|
void avgleg(void); |
37 |
|
void get_tag(char *,char *); |
38 |
+ |
static void mopaco(int start_atom,int end_atom); |
39 |
|
// ================================== |
40 |
|
/* |
41 |
|
* flags - indicates whether dipole, xlogp or vibrational calculations were done |
88 |
|
} |
89 |
|
} |
90 |
|
fprintf(wfile,"%s\n",Struct_Title); |
91 |
< |
fprintf(wfile," PCMODEL v9.1 1.00000 0.00000\n"); |
91 |
> |
fprintf(wfile," MENGINE v1.0 1.00000 0.00000\n"); |
92 |
|
fprintf(wfile,"\n"); |
93 |
|
|
94 |
|
fprintf(wfile,"%3d%3d 0 0 0 0 1 V2000\n",natom,nbond); |
121 |
|
fprintf(wfile,"> <MMFF94 energy>\n"); |
122 |
|
fprintf(wfile,"%f\n",energies.total); |
123 |
|
|
124 |
+ |
fprintf(wfile,"> <MMFF94_Atomtypes>\n"); |
125 |
+ |
fprintf(wfile,"+ Atom Atomtype\n"); |
126 |
+ |
for (i=1; i <=natom; i++) |
127 |
+ |
fprintf(wfile,"| %d %d\n",i,atom[i].type); |
128 |
+ |
fprintf(wfile,"\n"); |
129 |
+ |
|
130 |
|
if (flags & DO_DIPOLE) { |
131 |
|
fprintf(wfile,"> <dipole moment>\n"); |
132 |
|
fprintf(wfile,"%f\n",dipolemom.total); |
432 |
|
} |
433 |
|
} |
434 |
|
} |
435 |
+ |
// if (has_aromatic) |
436 |
+ |
// need to deal with aromatic bonds |
437 |
+ |
if (has_Aromatic) |
438 |
+ |
mopaco(1,natom); |
439 |
|
return Ret_Val; |
440 |
|
} |
441 |
|
// ===================== |
463 |
|
} |
464 |
|
} |
465 |
|
} |
466 |
+ |
/* ------------------------------------*/ |
467 |
+ |
// currently based on distance tests |
468 |
+ |
// this should be changed to only look at bonds passed in with bond order >= 4 |
469 |
+ |
// but we need a mechanism to mark this -- Kevin |
470 |
+ |
void mopaco(int istart,int ifinish) |
471 |
+ |
{ |
472 |
+ |
int i, ibi, ibj, it, j, jt, kk; |
473 |
+ |
float disij, dx, dy, dz, r, xii, yii, zii,rbdis[4]; |
474 |
+ |
|
475 |
+ |
rbdis[0] = 1.42; |
476 |
+ |
rbdis[1] = 1.25; |
477 |
+ |
rbdis[2] = 1.37; |
478 |
+ |
rbdis[3] = 1.25; |
479 |
+ |
|
480 |
+ |
/* find all double and triple bonds - search only types for |
481 |
+ |
* carbon, oxygen, nitrogen, sulfur, phosphorous */ |
482 |
+ |
for( i = istart; i <= (ifinish - 1); i++ ) |
483 |
+ |
{ |
484 |
+ |
it = atom[i].atomnum; |
485 |
+ |
if( it == 6 || it == 7 || it == 8 || it == 15 || it == 16 ) |
486 |
+ |
{ |
487 |
+ |
for( j = 0; j < MAXIAT; j++ ) |
488 |
+ |
{ |
489 |
+ |
if( atom[i].iat[j] != 0 ) |
490 |
+ |
{ |
491 |
+ |
jt = atom[atom[i].iat[j]].atomnum; |
492 |
+ |
if( jt == 6 || jt == 7 || jt == 8 || jt == 15 || jt == 16 ) |
493 |
+ |
{ |
494 |
+ |
xii = atom[i].x - atom[atom[i].iat[j]].x; |
495 |
+ |
yii = atom[i].y - atom[atom[i].iat[j]].y; |
496 |
+ |
zii = atom[i].z - atom[atom[i].iat[j]].z; |
497 |
+ |
if( fabs( xii ) <= 2.3 ) |
498 |
+ |
{ |
499 |
+ |
if( fabs( yii ) <= 2.3 ) |
500 |
+ |
{ |
501 |
+ |
if( fabs( zii ) <= 2.3 ) |
502 |
+ |
{ |
503 |
+ |
disij = sqrt( xii*xii + yii*yii + zii*zii ); |
504 |
+ |
/* c=o bond */ |
505 |
+ |
if( ((it == 8 && jt == 6) || (it == 6 && jt == 8)) && disij <= rbdis[3] + 0.05 ) |
506 |
+ |
{ |
507 |
+ |
if( i < atom[i].iat[j] ) |
508 |
+ |
make_bond( i, atom[i].iat[j],1 ); |
509 |
+ |
/* alkyne */ |
510 |
+ |
}else if( (it == 6 && jt == 6) && disij <= rbdis[1] ) |
511 |
+ |
{ |
512 |
+ |
if( i < atom[i].iat[j] ) |
513 |
+ |
make_bond( i, atom[i].iat[j],2 ); |
514 |
+ |
/* c=n */ |
515 |
+ |
}else if( ((it == 7 && jt == 6) || (it == 6 && jt == 7)) |
516 |
+ |
&& disij <= rbdis[2] ) |
517 |
+ |
{ |
518 |
+ |
ibi = 0; |
519 |
+ |
for( kk = 0; kk < MAXIAT; kk++ ) |
520 |
+ |
{ |
521 |
+ |
if( atom[i].bo[kk] != 9 ) |
522 |
+ |
ibi = ibi + atom[i].bo[kk]; |
523 |
+ |
} |
524 |
+ |
ibj = 0; |
525 |
+ |
for( kk = 0; kk < MAXIAT; kk++ ) |
526 |
+ |
{ |
527 |
+ |
if( atom[atom[i].iat[j]].bo[kk] != 9 ) |
528 |
+ |
ibj = ibj + atom[atom[i].iat[j]].bo[kk]; |
529 |
+ |
} |
530 |
+ |
if( it == 7 ) |
531 |
+ |
{ |
532 |
+ |
if( ibi <= 2 && ibj <= 3 ) |
533 |
+ |
{ |
534 |
+ |
if( i < atom[i].iat[j] ) |
535 |
+ |
make_bond( i, atom[i].iat[j], 1 ); |
536 |
+ |
break; |
537 |
+ |
} |
538 |
+ |
}else if( jt == 7 ) |
539 |
+ |
{ |
540 |
+ |
if( ibj <= 2 && ibi <= 3 ) |
541 |
+ |
{ |
542 |
+ |
if( i < atom[i].iat[j] ) |
543 |
+ |
make_bond( i, atom[i].iat[j], 1 ); |
544 |
+ |
break; |
545 |
+ |
} |
546 |
+ |
} |
547 |
+ |
/*nitrile */ }else if( ((it == 7 && jt == 6) || (it == 6 && jt == 7)) && disij <= 1.18 ) |
548 |
+ |
{ |
549 |
+ |
if( i < atom[i].iat[j] ) |
550 |
+ |
make_bond( i, atom[i].iat[j], 2 ); |
551 |
+ |
/* N=O */ }else if ( ((it == 7 && jt == 8) || (it == 8 && jt == 7)) && disij <= 1.26) |
552 |
+ |
{ |
553 |
+ |
ibi = 0; |
554 |
+ |
if (it == 7) |
555 |
+ |
{ |
556 |
+ |
for (kk = 0; kk < MAXIAT; kk++) |
557 |
+ |
{ |
558 |
+ |
if (atom[i].bo[kk] != 9) |
559 |
+ |
ibi += atom[i].bo[kk]; |
560 |
+ |
} |
561 |
+ |
} else |
562 |
+ |
{ |
563 |
+ |
for (kk = 0; kk < MAXIAT; kk++) |
564 |
+ |
{ |
565 |
+ |
if (atom[atom[i].iat[j]].bo[kk] != 9) |
566 |
+ |
ibi += atom[atom[i].iat[j]].bo[kk]; |
567 |
+ |
} |
568 |
+ |
} |
569 |
+ |
if (ibi <= 3) |
570 |
+ |
{ |
571 |
+ |
if ( i < atom[i].iat[j]) |
572 |
+ |
make_bond(i,atom[i].iat[j],1); |
573 |
+ |
break; |
574 |
+ |
} |
575 |
+ |
/* c=c bond */ }else if( (it == 6 && jt == 6) && disij <= rbdis[0] ) |
576 |
+ |
{ |
577 |
+ |
ibi = 0; |
578 |
+ |
for( kk = 0; kk < MAXIAT; kk++ ) |
579 |
+ |
{ |
580 |
+ |
if( atom[i].bo[kk] != 9 ) |
581 |
+ |
ibi = ibi + atom[i].bo[kk]; |
582 |
+ |
} |
583 |
+ |
ibj = 0; |
584 |
+ |
for( kk = 0; kk < MAXIAT; kk++ ) |
585 |
+ |
{ |
586 |
+ |
if( atom[atom[i].iat[j]].bo[kk] != 9 ) |
587 |
+ |
ibj = ibj + atom[atom[i].iat[j]].bo[kk]; |
588 |
+ |
} |
589 |
+ |
if( ibi <= 3 && ibj <= 3 ) |
590 |
+ |
{ |
591 |
+ |
if( i < atom[i].iat[j] ) |
592 |
+ |
make_bond( i, atom[i].iat[j], 1 ); |
593 |
+ |
} |
594 |
+ |
} |
595 |
+ |
} |
596 |
+ |
} |
597 |
+ |
} |
598 |
+ |
} |
599 |
+ |
} |
600 |
+ |
} |
601 |
+ |
} |
602 |
+ |
} |
603 |
+ |
// type(); |
604 |
+ |
return; |
605 |
+ |
} |