1 |
< |
/* NOTICE: this source code file has been modified for use with FreeMOL */ |
2 |
< |
#define EXTERN extern |
3 |
< |
|
4 |
< |
#include "pcwin.h" |
5 |
< |
#include "pcmod.h" |
6 |
< |
#include "pot.h" |
7 |
< |
#include "field.h" |
8 |
< |
#include "cutoffs.h" |
9 |
< |
#include "energies.h" |
10 |
< |
#include "utility.h" |
11 |
< |
#include "fix.h" |
12 |
< |
#include "substr.h" |
13 |
< |
#include "atom_k.h" |
14 |
< |
|
15 |
< |
void reset_atom_data(void); |
16 |
< |
void reset_calc_parameters(void); |
17 |
< |
FILE * fopen_path ( char * , char * , char * ) ; |
18 |
< |
void InitialTransform(void); |
19 |
< |
void zero_data(void); |
20 |
< |
void read_datafiles(char *); |
21 |
< |
void initialize_pcmodel(char *); |
22 |
< |
void fixdisreset(void); |
23 |
< |
void coordreset(void); |
24 |
< |
void ddrivereset(void); |
25 |
< |
void hbondreset(void); |
26 |
< |
void pireset(void); |
27 |
< |
void generate_bonds(void); |
28 |
< |
void set_field(void); |
29 |
< |
void fixangle_reset(void); |
30 |
< |
void message_alert(char *, char *); |
31 |
< |
int strmessage_alert(char *); |
32 |
< |
void gettoken(void); |
33 |
< |
void free_dotmem(void); |
34 |
< |
void init_pov(void); |
35 |
< |
void reset_fixtype(void); |
36 |
< |
void set_window_title(void); |
37 |
< |
void remove_file(char *,char *); |
38 |
< |
|
39 |
< |
struct t_optimize { |
40 |
< |
int param_avail, converge; |
41 |
< |
float initial_energy, final_energy, initial_heat, final_heat; |
42 |
< |
} optimize_data; |
43 |
< |
|
44 |
< |
|
45 |
< |
struct t_ts_bondorder { |
46 |
< |
float fbnd[15]; |
47 |
< |
} ts_bondorder; |
48 |
< |
|
49 |
< |
EXTERN struct t_files { |
50 |
< |
int nfiles, append, batch, icurrent; |
51 |
< |
int ibatno; |
52 |
< |
} files; |
53 |
< |
|
54 |
< |
EXTERN struct t_minim_control { |
55 |
< |
int type, method, field, added_const; |
56 |
< |
char added_path[256],added_name[256]; |
57 |
< |
} minim_control; |
58 |
< |
|
59 |
< |
EXTERN struct t_minim_values { |
60 |
< |
int iprint, ndc, nconst; |
61 |
< |
float dielc; |
62 |
< |
} minim_values; |
63 |
< |
|
64 |
< |
|
65 |
< |
EXTERN struct t_units { |
66 |
< |
double bndunit, cbnd, qbnd; |
67 |
< |
double angunit, cang, qang, pang, sang, aaunit; |
68 |
< |
double stbnunit, ureyunit, torsunit, storunit, v14scale; |
69 |
< |
double aterm, bterm, cterm, dielec, chgscale; |
70 |
< |
} units; |
71 |
< |
|
72 |
< |
|
73 |
< |
struct t_user { |
74 |
< |
int dielec; |
75 |
< |
} user; |
76 |
< |
|
77 |
< |
EXTERN struct t_pcmfile { |
78 |
< |
char string[200]; |
79 |
< |
int head; |
80 |
< |
char token[20]; |
81 |
< |
int state; |
82 |
< |
unsigned int nocaps; |
83 |
< |
} pcmfile; |
84 |
< |
|
85 |
< |
EXTERN struct t_residues { |
86 |
< |
int nchain, ichainstart[10]; |
87 |
< |
int ngroup, iresnum[200], irestype[200], istartatom[200]; |
88 |
< |
} residues; |
89 |
< |
|
90 |
< |
EXTERN struct t_dipolemom { |
91 |
< |
double total, xdipole, ydipole, zdipole; |
92 |
< |
} dipolemom; |
93 |
< |
|
94 |
< |
struct t_dmomv { |
95 |
< |
float xn,yn,zn,xp,yp,zp; |
96 |
< |
} dmomv; |
97 |
< |
|
98 |
< |
#define NL gettoken(); if (pcmfile.head == 1000) goto L_30; |
99 |
< |
#define ALPHABETIC 2 |
100 |
< |
#define NUMERIC 1 |
101 |
< |
|
102 |
< |
// ======================================= |
103 |
< |
void message_alert(char *astring, char *title) |
104 |
< |
{ |
105 |
< |
// MessageBox(NULL, astring, title, MB_ICONEXCLAMATION); |
106 |
< |
printf("%s\n",astring); |
107 |
< |
} |
108 |
< |
// =================================== |
109 |
< |
void initialize_pcmodel(char *pfile) |
110 |
< |
{ |
111 |
< |
int i; |
112 |
< |
char string[256]; |
113 |
< |
strcpy(pcwindir,""); |
114 |
< |
user.dielec = FALSE; |
115 |
< |
units.dielec = 1.0; |
116 |
< |
dipolemom.total = 0.0; |
117 |
< |
use_external_chrg = FALSE; |
118 |
< |
use_gast_chrg = FALSE; |
119 |
< |
zero_data(); |
120 |
< |
// strcpy(string,mmxfile); |
121 |
< |
read_datafiles(pfile); |
122 |
< |
set_field(); |
123 |
< |
// initialize atom definitions |
124 |
< |
atom_def.natomtype = atom_k.natomtype; |
125 |
< |
for (i=1; i < MAXATOMTYPE; i++) |
126 |
< |
{ |
127 |
< |
atom_def.type[i] = atom_k.type[i]; |
128 |
< |
atom_def.valency[i] = atom_k.valency[i]; |
129 |
< |
atom_def.number[i] = atom_k.number[i]; |
130 |
< |
atom_def.ligands[i] = atom_k.ligands[i]; |
131 |
< |
atom_def.weight[i] = atom_k.weight[i]; |
132 |
< |
strcpy(atom_def.symbol[i],atom_k.symbol[i]); |
133 |
< |
} |
134 |
< |
LPTYPE = 20; |
135 |
< |
if (field.type == MMX ||field.type == MM2 ||field.type == MM3 ) |
136 |
< |
LPTYPE = 20; |
137 |
< |
else |
138 |
< |
LPTYPE = 0; |
139 |
< |
Openbox.ftype = FTYPE_PCM; |
140 |
< |
Savebox.ftype = FTYPE_PCM; |
141 |
< |
default_intype = MMX; |
142 |
< |
default_outtype = MMX; |
143 |
< |
strcpy(Openbox.path,pcwindir); |
144 |
< |
strcpy(Savebox.path,pcwindir); |
145 |
< |
hbond_flag = TRUE; |
146 |
< |
pot.use_hbond = TRUE; |
147 |
< |
reset_calc_parameters(); |
148 |
< |
curtype = 1; |
149 |
< |
natom = 0; |
150 |
< |
bonds.numbonds = -1; |
151 |
< |
residues.ngroup = 0; |
152 |
< |
/* minimizer control */ |
153 |
< |
minim_control.method = 3; |
154 |
< |
minim_control.field = MMX; |
155 |
< |
minim_control.added_const = FALSE; |
156 |
< |
// printout |
157 |
< |
minim_values.iprint = FALSE; |
158 |
< |
/* cutoffs */ |
159 |
< |
cutoffs.vdwcut = 10.0; |
160 |
< |
cutoffs.pmecut = 9.0; |
161 |
< |
cutoffs.chrgcut = 100.0; |
162 |
< |
cutoffs.dipcut = 8.0; |
163 |
< |
/* solvation stuff */ |
164 |
< |
pot.use_bounds = FALSE; |
165 |
< |
pot.use_image = FALSE; |
166 |
< |
pot.use_deform = FALSE; |
167 |
< |
pot.use_solv = FALSE; |
168 |
< |
} |
169 |
< |
|
170 |
< |
int initialize(void) |
171 |
< |
{ |
172 |
< |
curtype = 1; |
173 |
< |
natom = 0; |
174 |
< |
bonds.numbonds = -1; |
175 |
< |
reset_calc_parameters(); |
176 |
< |
pot.use_bounds = FALSE; |
177 |
< |
pot.use_image = FALSE; |
178 |
< |
pot.use_deform = FALSE; |
179 |
< |
dipolemom.total = 0.0; |
180 |
< |
// optimization flags |
181 |
< |
optimize_data.param_avail = FALSE; |
182 |
< |
optimize_data.converge = FALSE; |
183 |
< |
optimize_data.initial_energy = 0.0; |
184 |
< |
optimize_data.final_energy = 0.0; |
185 |
< |
optimize_data.initial_heat = 0.0; |
186 |
< |
optimize_data.final_heat = 0.0; |
187 |
< |
// |
188 |
< |
reset_atom_data(); |
189 |
< |
return(0); |
190 |
< |
} |
191 |
< |
/* ============================================== */ |
192 |
< |
void reset_calc_parameters(void) |
193 |
< |
{ |
194 |
< |
flags.noh = False; |
195 |
< |
flags.nohyd = False; |
196 |
< |
flags.immx = True; |
197 |
< |
|
198 |
< |
/* default to hydrogen bonding on */ |
199 |
< |
minim_values.ndc = 4; |
200 |
< |
minim_values.nconst= 0; |
201 |
< |
} |
202 |
< |
/* =============================================== */ |
203 |
< |
void pireset() |
204 |
< |
{ |
205 |
< |
long int i,mask; |
206 |
< |
mask = 1L << PI_MASK; |
207 |
< |
} |
208 |
< |
/* =============================================== */ |
209 |
< |
void reset_fixtype() |
210 |
< |
{ |
211 |
< |
long int i,mask; |
212 |
< |
mask = 1L << NO_RETYPE; |
213 |
< |
for (i = 1; i <= natom; i++) |
214 |
< |
atom[i].flags &= ~mask; |
215 |
< |
} |
216 |
< |
/* ------------------------- */ |
217 |
< |
void hbondreset() |
218 |
< |
{ |
219 |
< |
long int i,mask; |
220 |
< |
|
221 |
< |
mask = 1L << HBOND_MASK; |
222 |
< |
for (i = 1; i <= natom; i++) |
223 |
< |
atom[i].flags &= ~mask; |
224 |
< |
} |
225 |
< |
/* ------------------------- */ |
226 |
< |
void resetsubstrmem() |
227 |
< |
{ |
228 |
< |
} |
229 |
< |
/* ------------------------- */ |
230 |
< |
void coordreset() |
231 |
< |
{ |
232 |
< |
long int i,j, mask4,mask5,mask6,mask7,mask8; |
233 |
< |
|
234 |
< |
mask4 = 1L << METCOORD_MASK; |
235 |
< |
mask5 = 1L << SATMET_MASK; |
236 |
< |
mask6 = 1L << GT18e_MASK; |
237 |
< |
mask7 = 1L << LOWSPIN_MASK; |
238 |
< |
mask8 = 1L << SQPLAN_MASK; |
239 |
< |
|
240 |
< |
for (i=1; i <= natom; i++) |
241 |
< |
{ |
242 |
< |
atom[i].flags &= ~mask4; |
243 |
< |
atom[i].flags &= ~mask5; |
244 |
< |
atom[i].flags &= ~mask6; |
245 |
< |
atom[i].flags &= ~mask7; |
246 |
< |
atom[i].flags &= ~mask8; |
247 |
< |
|
248 |
< |
for (j=0; j < MAXIAT; j++) |
249 |
< |
{ |
250 |
< |
if (atom[i].bo[j] == 9) |
251 |
< |
{ |
252 |
< |
atom[i].bo[j] = 0; |
253 |
< |
atom[i].iat[j] = 0; |
254 |
< |
} |
255 |
< |
} |
256 |
< |
} |
257 |
< |
generate_bonds(); |
258 |
< |
} |
259 |
< |
/* ------------------------- */ |
260 |
< |
void fixdisreset() |
261 |
< |
{ |
262 |
< |
} |
263 |
< |
/* ============================================== */ |
264 |
< |
void fixangle_reset() |
265 |
< |
{ |
266 |
< |
} |
267 |
< |
/* ============================================== */ |
268 |
< |
void reset_atom_data(void) |
269 |
< |
{ |
270 |
< |
int i, j; |
271 |
< |
|
272 |
< |
for (i = 0; i < MAXATOM; i++) |
273 |
< |
{ |
274 |
< |
selatom[i] = 0; |
275 |
< |
atom[i].use = 0; |
276 |
< |
atom[i].x = 0.0F; atom[i].y = 0.0F; atom[i].z = 0.0F; |
277 |
< |
atom[i].color = 0; |
278 |
< |
atom[i].chrg_color = 7; |
279 |
< |
atom[i].charge = 0.0F; |
280 |
< |
atom[i].energy = 0.0F; |
281 |
< |
atom[i].atomnum = 0; |
282 |
< |
atom[i].serno = 0; |
283 |
< |
atom[i].molecule = 0; |
284 |
< |
atom[i].residue = 0; |
285 |
< |
atom[i].formal_charge = 0; |
286 |
< |
atom[i].atomwt = 0.0; |
287 |
< |
atom[i].type = 0; |
288 |
< |
atom[i].mmx_type = 0; |
289 |
< |
atom[i].mm3_type = 0; |
290 |
< |
atom[i].mmff_type = 0; |
291 |
< |
atom[i].tclass = 0; |
292 |
< |
*atom[i].name = '\0'; |
293 |
< |
atom[i].flags = 0; |
294 |
< |
for (j = 0; j < MAXIAT; j++) |
295 |
< |
{ |
296 |
< |
atom[i].bo[j] = 0; |
297 |
< |
atom[i].iat[j] = 0; |
298 |
< |
} |
299 |
< |
for (j=0; j < MAXSS; j++) |
300 |
< |
{ |
301 |
< |
atom[i].substr[j] = 0; |
302 |
< |
substr.istract[j] = 0; |
303 |
< |
} |
304 |
< |
} |
305 |
< |
} |
306 |
< |
#ifdef PCM_WIN |
307 |
< |
// ======================================= |
308 |
< |
/*int strcasecmp(char *str1,char *str2) |
309 |
< |
{ |
310 |
< |
char c1,c2; |
311 |
< |
while(1) |
312 |
< |
{ |
313 |
< |
c1 = tolower(*str1++); |
314 |
< |
c2 = tolower(*str2++); |
315 |
< |
if (c1 < c2) return -1; |
316 |
< |
if (c1 > c2) return 1; |
317 |
< |
if (c1 == 0) return 0; |
318 |
< |
} |
319 |
< |
} */ |
320 |
< |
// ======================================== |
321 |
< |
/*int strncasecmp(char *s1,char *s2,int n) |
322 |
< |
{ |
323 |
< |
int i; |
324 |
< |
char c1, c2; |
325 |
< |
for (i=0; i<n; i++) |
326 |
< |
{ |
327 |
< |
c1 = tolower(*s1++); |
328 |
< |
c2 = tolower(*s2++); |
329 |
< |
if (c1 < c2) return -1; |
330 |
< |
if (c1 > c2) return 1; |
331 |
< |
if (!c1) return 0; |
332 |
< |
} |
333 |
< |
return 0; |
334 |
< |
}*/ |
335 |
< |
#endif |
336 |
< |
// void itoa(int n,char *s, int radix) |
337 |
< |
//{ |
338 |
< |
// sprintf(s,"%d",n); |
339 |
< |
//} |
340 |
< |
// ======================================== |
341 |
< |
void remove_file(char *path,char *name) |
342 |
< |
{ |
343 |
< |
char tempname[255]; |
344 |
< |
int ix; |
345 |
< |
|
346 |
< |
strcpy(tempname,""); |
347 |
< |
if ( (ix = strlen(path)) != 0) |
348 |
< |
{ |
349 |
< |
strcpy(tempname,path); |
350 |
< |
strcat(tempname,"\\"); |
351 |
< |
strcat(tempname,name); |
352 |
< |
} else |
353 |
< |
{ |
354 |
< |
strcpy(tempname,name); |
355 |
< |
} |
356 |
< |
remove(tempname); |
357 |
< |
} |
1 |
> |
#define EXTERN extern |
2 |
> |
|
3 |
> |
#include "pcwin.h" |
4 |
> |
#include "pcmod.h" |
5 |
> |
#include "pot.h" |
6 |
> |
#include "field.h" |
7 |
> |
#include "cutoffs.h" |
8 |
> |
#include "energies.h" |
9 |
> |
#include "utility.h" |
10 |
> |
#include "fix.h" |
11 |
> |
#include "atom_k.h" |
12 |
> |
|
13 |
> |
void reset_atom_data(void); |
14 |
> |
void reset_calc_parameters(void); |
15 |
> |
FILE * fopen_path ( char * , char * , char * ) ; |
16 |
> |
void InitialTransform(void); |
17 |
> |
void zero_data(void); |
18 |
> |
void read_datafiles(char *); |
19 |
> |
void initialize_pcmodel(char *); |
20 |
> |
void fixdisreset(void); |
21 |
> |
void coordreset(void); |
22 |
> |
void ddrivereset(void); |
23 |
> |
void hbondreset(void); |
24 |
> |
void pireset(void); |
25 |
> |
void generate_bonds(void); |
26 |
> |
void set_field(void); |
27 |
> |
void fixangle_reset(void); |
28 |
> |
void message_alert(char *, char *); |
29 |
> |
int strmessage_alert(char *); |
30 |
> |
void gettoken(void); |
31 |
> |
void remove_file(char *,char *); |
32 |
> |
|
33 |
> |
struct t_optimize { |
34 |
> |
int param_avail, converge; |
35 |
> |
float initial_energy, final_energy, initial_heat, final_heat; |
36 |
> |
} optimize_data; |
37 |
> |
|
38 |
> |
EXTERN struct t_files { |
39 |
> |
int nfiles, append, batch, icurrent; |
40 |
> |
int ibatno; |
41 |
> |
} files; |
42 |
> |
|
43 |
> |
EXTERN struct t_minim_control { |
44 |
> |
int type, method, field, added_const; |
45 |
> |
char added_path[256],added_name[256]; |
46 |
> |
} minim_control; |
47 |
> |
|
48 |
> |
EXTERN struct t_minim_values { |
49 |
> |
int iprint, ndc, nconst; |
50 |
> |
float dielc; |
51 |
> |
} minim_values; |
52 |
> |
|
53 |
> |
EXTERN struct t_units { |
54 |
> |
double bndunit, cbnd, qbnd; |
55 |
> |
double angunit, cang, qang, pang, sang, aaunit; |
56 |
> |
double stbnunit, ureyunit, torsunit, storunit, v14scale; |
57 |
> |
double aterm, bterm, cterm, dielec, chgscale; |
58 |
> |
} units; |
59 |
> |
|
60 |
> |
struct t_user { |
61 |
> |
int dielec; |
62 |
> |
} user; |
63 |
> |
|
64 |
> |
EXTERN struct t_pcmfile { |
65 |
> |
char string[200]; |
66 |
> |
int head; |
67 |
> |
char token[20]; |
68 |
> |
int state; |
69 |
> |
unsigned int nocaps; |
70 |
> |
} pcmfile; |
71 |
> |
|
72 |
> |
EXTERN struct t_dipolemom { |
73 |
> |
double total, xdipole, ydipole, zdipole; |
74 |
> |
} dipolemom; |
75 |
> |
|
76 |
> |
|
77 |
> |
#define NL gettoken(); if (pcmfile.head == 1000) goto L_30; |
78 |
> |
#define ALPHABETIC 2 |
79 |
> |
#define NUMERIC 1 |
80 |
> |
|
81 |
> |
// ======================================= |
82 |
> |
void message_alert(char *astring, char *title) |
83 |
> |
{ |
84 |
> |
// MessageBox(NULL, astring, title, MB_ICONEXCLAMATION); |
85 |
> |
fprintf(pcmlogfile,"%s\n",astring); |
86 |
> |
} |
87 |
> |
// =================================== |
88 |
> |
void initialize_pcmodel(char *mmxfilename) |
89 |
> |
{ |
90 |
> |
int i; |
91 |
> |
user.dielec = FALSE; |
92 |
> |
units.dielec = 1.0; |
93 |
> |
dipolemom.total = 0.0; |
94 |
> |
zero_data(); |
95 |
> |
read_datafiles(mmxfilename); |
96 |
> |
set_field(); |
97 |
> |
// initialize atom definitions |
98 |
> |
atom_def.natomtype = atom_k.natomtype; |
99 |
> |
for (i=1; i < MAXATOMTYPE; i++) |
100 |
> |
{ |
101 |
> |
atom_def.type[i] = atom_k.type[i]; |
102 |
> |
atom_def.valency[i] = atom_k.valency[i]; |
103 |
> |
atom_def.number[i] = atom_k.number[i]; |
104 |
> |
atom_def.ligands[i] = atom_k.ligands[i]; |
105 |
> |
atom_def.weight[i] = atom_k.weight[i]; |
106 |
> |
strcpy(atom_def.symbol[i],atom_k.symbol[i]); |
107 |
> |
} |
108 |
> |
LPTYPE = 20; |
109 |
> |
if (field.type == MMX ||field.type == MM2 ||field.type == MM3 ) |
110 |
> |
LPTYPE = 20; |
111 |
> |
else |
112 |
> |
LPTYPE = 0; |
113 |
> |
Openbox.ftype = FTYPE_PCM; |
114 |
> |
Savebox.ftype = FTYPE_PCM; |
115 |
> |
default_intype = MMX; |
116 |
> |
default_outtype = MMX; |
117 |
> |
strcpy(Openbox.path,pcwindir); |
118 |
> |
strcpy(Savebox.path,pcwindir); |
119 |
> |
hbond_flag = TRUE; |
120 |
> |
pot.use_hbond = TRUE; |
121 |
> |
reset_calc_parameters(); |
122 |
> |
natom = 0; |
123 |
> |
bonds.numbonds = -1; |
124 |
> |
/* minimizer control */ |
125 |
> |
minim_control.method = 3; |
126 |
> |
minim_control.field = MMX; |
127 |
> |
minim_control.added_const = FALSE; |
128 |
> |
// printout |
129 |
> |
minim_values.iprint = FALSE; |
130 |
> |
/* cutoffs */ |
131 |
> |
cutoffs.vdwcut = 10.0; |
132 |
> |
cutoffs.pmecut = 9.0; |
133 |
> |
cutoffs.chrgcut = 100.0; |
134 |
> |
cutoffs.dipcut = 8.0; |
135 |
> |
/* solvation stuff */ |
136 |
> |
pot.use_bounds = FALSE; |
137 |
> |
pot.use_image = FALSE; |
138 |
> |
pot.use_deform = FALSE; |
139 |
> |
pot.use_solv = FALSE; |
140 |
> |
// fixed stuff |
141 |
> |
fx_atom.natom_fix = 0; |
142 |
> |
fx_dist.ndfix = 0; |
143 |
> |
fx_angle.nafix = 0; |
144 |
> |
fx_torsion.ntfix = 0; |
145 |
> |
restrain_atom.natom_restrain = 0; |
146 |
> |
} |
147 |
> |
|
148 |
> |
int initialize(void) |
149 |
> |
{ |
150 |
> |
natom = 0; |
151 |
> |
bonds.numbonds = -1; |
152 |
> |
reset_calc_parameters(); |
153 |
> |
pot.use_bounds = FALSE; |
154 |
> |
pot.use_image = FALSE; |
155 |
> |
pot.use_deform = FALSE; |
156 |
> |
dipolemom.total = 0.0; |
157 |
> |
// optimization flags |
158 |
> |
optimize_data.param_avail = FALSE; |
159 |
> |
optimize_data.converge = FALSE; |
160 |
> |
optimize_data.initial_energy = 0.0; |
161 |
> |
optimize_data.final_energy = 0.0; |
162 |
> |
optimize_data.initial_heat = 0.0; |
163 |
> |
optimize_data.final_heat = 0.0; |
164 |
> |
// |
165 |
> |
reset_atom_data(); |
166 |
> |
return(0); |
167 |
> |
} |
168 |
> |
/* ============================================== */ |
169 |
> |
void reset_calc_parameters(void) |
170 |
> |
{ |
171 |
> |
|
172 |
> |
/* default to hydrogen bonding on */ |
173 |
> |
minim_values.ndc = 4; |
174 |
> |
minim_values.nconst= 0; |
175 |
> |
} |
176 |
> |
/* =============================================== */ |
177 |
> |
void pireset() |
178 |
> |
{ |
179 |
> |
} |
180 |
> |
/* =============================================== */ |
181 |
> |
void reset_fixtype() |
182 |
> |
{ |
183 |
> |
} |
184 |
> |
/* ------------------------- */ |
185 |
> |
void hbondreset() |
186 |
> |
{ |
187 |
> |
long int i,mask; |
188 |
> |
|
189 |
> |
mask = 1L << HBOND_MASK; |
190 |
> |
for (i = 1; i <= natom; i++) |
191 |
> |
atom[i].flags &= ~mask; |
192 |
> |
} |
193 |
> |
/* ------------------------- */ |
194 |
> |
void resetsubstrmem() |
195 |
> |
{ |
196 |
> |
} |
197 |
> |
/* ------------------------- */ |
198 |
> |
void coordreset() |
199 |
> |
{ |
200 |
> |
long int i,j, mask4,mask5,mask6,mask7,mask8; |
201 |
> |
|
202 |
> |
mask4 = 1L << METCOORD_MASK; |
203 |
> |
mask5 = 1L << SATMET_MASK; |
204 |
> |
mask6 = 1L << GT18e_MASK; |
205 |
> |
mask7 = 1L << LOWSPIN_MASK; |
206 |
> |
mask8 = 1L << SQPLAN_MASK; |
207 |
> |
|
208 |
> |
for (i=1; i <= natom; i++) |
209 |
> |
{ |
210 |
> |
atom[i].flags &= ~mask4; |
211 |
> |
atom[i].flags &= ~mask5; |
212 |
> |
atom[i].flags &= ~mask6; |
213 |
> |
atom[i].flags &= ~mask7; |
214 |
> |
atom[i].flags &= ~mask8; |
215 |
> |
|
216 |
> |
for (j=0; j < MAXIAT; j++) |
217 |
> |
{ |
218 |
> |
if (atom[i].bo[j] == 9) |
219 |
> |
{ |
220 |
> |
atom[i].bo[j] = 0; |
221 |
> |
atom[i].iat[j] = 0; |
222 |
> |
} |
223 |
> |
} |
224 |
> |
} |
225 |
> |
generate_bonds(); |
226 |
> |
} |
227 |
> |
/* ------------------------- */ |
228 |
> |
void fixdisreset() |
229 |
> |
{ |
230 |
> |
} |
231 |
> |
/* ============================================== */ |
232 |
> |
void fixangle_reset() |
233 |
> |
{ |
234 |
> |
} |
235 |
> |
/* ============================================== */ |
236 |
> |
void reset_atom_data(void) |
237 |
> |
{ |
238 |
> |
int i, j; |
239 |
> |
|
240 |
> |
for (i = 0; i < MAXATOM; i++) |
241 |
> |
{ |
242 |
> |
atom[i].use = 0; |
243 |
> |
atom[i].x = 0.0F; atom[i].y = 0.0F; atom[i].z = 0.0F; |
244 |
> |
atom[i].charge = 0.0F; |
245 |
> |
atom[i].energy = 0.0F; |
246 |
> |
atom[i].atomnum = 0; |
247 |
> |
atom[i].formal_charge = 0; |
248 |
> |
atom[i].atomwt = 0.0; |
249 |
> |
atom[i].type = 0; |
250 |
> |
atom[i].mmx_type = 0; |
251 |
> |
atom[i].mm3_type = 0; |
252 |
> |
atom[i].mmff_type = 0; |
253 |
> |
atom[i].tclass = 0; |
254 |
> |
*atom[i].name = '\0'; |
255 |
> |
atom[i].flags = 0; |
256 |
> |
for (j = 0; j < MAXIAT; j++) |
257 |
> |
{ |
258 |
> |
atom[i].bo[j] = 0; |
259 |
> |
atom[i].iat[j] = 0; |
260 |
> |
} |
261 |
> |
} |
262 |
> |
} |
263 |
> |
// ======================================== |
264 |
> |
void remove_file(char *path,char *name) |
265 |
> |
{ |
266 |
> |
char tempname[255]; |
267 |
> |
int ix; |
268 |
> |
|
269 |
> |
strcpy(tempname,""); |
270 |
> |
if ( (ix = strlen(path)) != 0) |
271 |
> |
{ |
272 |
> |
strcpy(tempname,path); |
273 |
> |
strcat(tempname,"\\"); |
274 |
> |
strcat(tempname,name); |
275 |
> |
} else |
276 |
> |
{ |
277 |
> |
strcpy(tempname,name); |
278 |
> |
} |
279 |
> |
remove(tempname); |
280 |
> |
} |