ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/freemol/trunk/src/mengine/src/mengine.c
Revision: 16
Committed: Mon Jun 23 21:29:26 2008 UTC (11 years, 5 months ago) by tjod
Original Path: trunk/smi23d/src/mengine/mengine.c
File size: 3312 byte(s)
Log Message:
Add back the command line options -d -i -x for dipole moment, vibrational data and logp.  Have error.log directed to stdout.

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