ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/freemol/trunk/src/mengine/src/mengine.c
Revision: 48
Committed: Thu Jul 31 16:34:52 2008 UTC (11 years, 1 month ago) by tjod
File size: 3519 byte(s)
Log Message:
Add modification notice to files modified for Freemol
per mengine/smi23d license requirements

Line User Rev File contents
1 tjod 48 /* NOTICE: this source code file has been modified for use with FreeMOL */
2 tjod 15 #define EXTERN
3     #include "pcwin.h"
4     #include "pcmod.h"
5     #include "energies.h"
6     #include "substr.h"
7     #include "pot.h"
8     #include "angles.h"
9    
10     #include "rings.h"
11     #include "torsions.h"
12     #include "nonbond.h"
13     #include "bonds_ff.h"
14     #include "derivs.h"
15     #include "hess.h"
16     #include "field.h"
17     #include "atom_k.h"
18     #include "cutoffs.h"
19     #include "solv.h"
20     #include "gmmx.h"
21     #include "fix.h"
22    
23     #include <stdio.h>
24     #include <stdlib.h>
25     #include <unistd.h>
26     #include <string.h>
27 tjod 34 //#include <malloc.h>
28 tjod 15
29     EXTERN FILE *pcmoutfile;
30    
31     struct t_rotbond {
32     int nbonds, bond[200][2], bond_res[200];
33     int incl_amide, incl_alkene;
34     } rotbond;
35     struct t_minim_values {
36     int iprint, ndc, nconst;
37     float dielc;
38     } minim_values;
39    
40     struct t_minim_control {
41     int type, method, field, added_const;
42     char added_path[256],added_name[256];
43     } minim_control;
44     EXTERN struct t_files {
45     int nfiles, append, batch, icurrent, ibatno;
46     } files;
47     char Savename[80];
48    
49     /*
50     void initialize_pcmodel(char*);
51     void mmp22mod(int,int);
52     void pcmfin(int, int);
53     void initialize(void);
54     void mmxsub(int);
55     void check_numfile(int, char *);
56     void mac2mod(int, int);
57     void bbchk(void);
58     void type(void);
59     void initialize_gmmx(void);
60     void read_gmmxinp(char*, char*, char*, FILE*, int);
61     void run_gmmx(void);
62     void search_rings(int);
63     */
64    
65 tjod 16
66     void usage(void) {
67     printf("\nUsage: mengine [-hvdxi] reads sdf on stdin, writes on stdout\n\n"
68     "-h\tThis help page\n"
69     "-v\tVerbose output\n"
70 tjod 20 "-a\tAdd hydrogen atoms; delete existing ones\n"
71 tjod 16 "-d\tEvaluate dipole moment\n"
72     "-x\tEvaluate XlogP\n"
73     "-i\tEvaluate vibrational data\n\n");
74     }
75    
76 tjod 15 /* ==================================================== */
77     int main(int argc, char *argv[])
78     {
79     int i;
80     char *filename = NULL;
81     char *line = NULL;
82    
83     char *outfile = NULL;
84     char *mmff94file = NULL;
85 tjod 25 //char *mmxfile = NULL;
86 tjod 15
87     int flags = 0;
88    
89     /*
90     filename = strdup("caffeine.sdf");
91     outfile = strdup("output.sdf");
92     */
93     mmff94file = strdup("mmff94.prm");
94 tjod 25 // mmxfile = strdup("mmxconst.prm");
95 tjod 15
96 tjod 16 int c;
97 tjod 20 while ((c = getopt(argc, argv, "e:o:p:c:havdxi")) != -1) {
98 tjod 16 switch(c) {
99 tjod 20 case 'a':
100     flags = flags | DO_ADDH;
101     break;
102 tjod 16 case 'd':
103     flags = flags | DO_DIPOLE;
104     break;
105     case 'x':
106     flags = flags | DO_XLOGP;
107     break;
108     case 'i':
109     flags = flags | DO_VIBRATION;
110     break;
111     case 'v':
112     VERBOSE = 1;
113     break;
114     case 'h':
115     usage();
116     exit(-1);
117     /*
118     case 'o':
119     outfile = strdup(optarg);
120     break;
121     case 'p':
122     mmff94file = strdup(optarg);
123     break;
124     case 'c':
125     mmxfile = strdup(optarg);
126     break;
127     case 'e':
128     logfilename = strdup(optarg);
129     break;
130     */
131     case '?':
132     if (isprint (optopt))
133     fprintf (stderr, "Unknown option `-%c'.\n", optopt);
134     else
135     fprintf (stderr,
136     "Unknown option character `\\x%x'.\n",
137     optopt);
138     return 1;
139     default:
140     abort ();
141     }
142     }
143    
144 tjod 15 pcmoutfile = stdout;
145 tjod 25 initialize_pcmodel("mmxconst");
146 tjod 15 initialize();
147     minim_values.iprint = 0; //FALSE;
148     initialize_gmmx();
149    
150 tjod 25 read_gmmxinp("mmff94", stdin, flags);
151 tjod 15
152     fclose(pcmoutfile);
153    
154     free(mmff94file);
155 tjod 25 // free(mmxfile);
156 tjod 15 /*
157     free(filename);
158     free(outfile);
159     */
160    
161     exit(0);
162     }
163     //