3 |
|
#include "pcwin.h" |
4 |
|
#include "pcmod.h" |
5 |
|
|
6 |
+ |
#include "attached.h" |
7 |
|
#include "energies.h" |
7 |
– |
#include "angles.h" |
8 |
– |
#include "rings.h" |
9 |
– |
#include "torsions.h" |
8 |
|
#include "bonds_ff.h" |
9 |
|
#include "derivs.h" |
12 |
– |
#include "hess.h" |
10 |
|
#include "pot.h" |
14 |
– |
#include "gmmx.h" |
11 |
|
#include "utility.h" |
12 |
|
#include "solv.h" |
13 |
< |
#include "field.h" |
18 |
< |
|
19 |
< |
EXTERN struct t_optimize { |
20 |
< |
int param_avail, converge; |
21 |
< |
float initial_energy, final_energy, initial_heat, final_heat; |
22 |
< |
} optimize_data; |
23 |
< |
EXTERN struct t_units { |
24 |
< |
double bndunit, cbnd, qbnd; |
25 |
< |
double angunit, cang, qang, pang, sang, aaunit; |
26 |
< |
double stbnunit, ureyunit, torsunit, storunit, v14scale; |
27 |
< |
double aterm, bterm, cterm, dielec, chgscale; |
28 |
< |
} units; |
13 |
> |
#include "dipmom.h" |
14 |
|
|
30 |
– |
struct t_cbonds { |
31 |
– |
int nbnd, icbonds[MAXCBND][3], lpd[MAXCBND], ia1[MAXCBND],ia2[MAXCBND]; |
32 |
– |
double vrad[MAXCBND],veps[MAXCBND]; |
33 |
– |
} cbonds; |
34 |
– |
EXTERN struct t_high_coord { |
35 |
– |
int ncoord, i13[400][3]; |
36 |
– |
} high_coord; |
37 |
– |
|
15 |
|
EXTERN struct t_minim_control { |
16 |
|
int type, method, field, added_const; |
17 |
|
char added_path[256],added_name[256]; |
18 |
|
} minim_control; |
42 |
– |
|
43 |
– |
struct t_dipolemom { |
44 |
– |
double total, xdipole, ydipole, zdipole; |
45 |
– |
} dipolemom; |
19 |
|
|
20 |
|
EXTERN struct t_minim_values { |
21 |
|
int iprint, ndc, nconst; |
28 |
|
} solvent; |
29 |
|
|
30 |
|
int Missing_constants; |
58 |
– |
FILE *errfile; |
31 |
|
|
60 |
– |
FILE * fopen_path ( char * , char * , char * ) ; |
32 |
|
void message_alert(char *,char *); |
62 |
– |
void get_added_const(void); |
63 |
– |
void assign_gast_charge(); |
64 |
– |
void lattice(void); |
65 |
– |
void bounds(void); |
33 |
|
void pcm7_min(void); |
67 |
– |
int iscoord_bond(int, int); |
68 |
– |
void get_coordbonds(void); |
34 |
|
int isbond(int, int); |
70 |
– |
int isangle(int,int); |
71 |
– |
int ishbond(int, int); |
72 |
– |
int istorsion(int, int); |
73 |
– |
void get_hbond(void); |
74 |
– |
void mark_hbond(void); |
75 |
– |
void reset_atom_data(void); |
35 |
|
int initialise(void); |
36 |
|
void get_bonds(void); |
78 |
– |
void get_angles(void); |
37 |
|
void get_torsions(void); |
38 |
|
void get_rings(void); |
39 |
|
void set_field(void); |
40 |
|
double energy(void); |
41 |
|
double print_energy(void); |
42 |
|
void pcmfout(int); |
85 |
– |
void orbital(void); |
86 |
– |
void free_orbit(void); |
43 |
|
void set_active(void); |
44 |
< |
void estrtor(void); |
45 |
< |
void echarge(void); |
46 |
< |
void ewald(void); |
47 |
< |
void eurey(void); |
48 |
< |
void ebuck(void); |
49 |
< |
void ebuckmm3(void); |
44 |
> |
int setup_calculation(void); |
45 |
> |
void end_calculation(void); |
46 |
> |
|
47 |
> |
void egeom1(void); |
48 |
> |
void esolv1(void); |
49 |
> |
void egeom(void); |
50 |
> |
void esolv(void); |
51 |
> |
|
52 |
> |
void ehal(void); |
53 |
> |
void ehal1(void); |
54 |
> |
void ebufcharge(void); |
55 |
> |
void ebufcharge1(void); |
56 |
> |
void eopbend_wilson(void); |
57 |
> |
void eopbend_wilson1(void); |
58 |
> |
|
59 |
|
void estrbnd(void); |
95 |
– |
void edipole(void); |
60 |
|
void etorsion(void); |
61 |
|
void eangang(void); |
62 |
|
void eangle(void); |
63 |
|
void ebond(void); |
64 |
< |
void eopbend(void); |
101 |
< |
void ehbond(void); |
102 |
< |
void eimprop(void); |
103 |
< |
void eimptors(void); |
104 |
< |
void elj(void); |
105 |
< |
void ecoord_bond(void); |
106 |
< |
void elj_qq(void); |
107 |
< |
void ebuck_charge(void); |
108 |
< |
void ehigh_coord(void); |
109 |
< |
|
110 |
< |
void estrtor1(void); |
111 |
< |
void echarge1(void); |
112 |
< |
void ebuck1(void); |
113 |
< |
void ebuckmm31(void); |
64 |
> |
|
65 |
|
void estrbnd1(void); |
115 |
– |
void edipole1(void); |
66 |
|
void etorsion1(void); |
117 |
– |
void eangang1(void); |
67 |
|
void eangle1(void); |
68 |
|
void ebond1(void); |
120 |
– |
void eopbend1(void); |
121 |
– |
void ehbond1(void); |
122 |
– |
void eimprop1(void); |
123 |
– |
void eimptors1(void); |
124 |
– |
void elj1(void); |
125 |
– |
void ecoord_bond1(void); |
126 |
– |
void ewald1(void); |
127 |
– |
void eurey1(void); |
128 |
– |
void elj_qq1(void); |
129 |
– |
void ebuck_charge1(void); |
130 |
– |
void ehigh_coord1(void); |
69 |
|
|
70 |
|
void kangle(void); |
133 |
– |
void korbit(void); |
71 |
|
void ktorsion(void); |
135 |
– |
void kdipole(void); |
72 |
|
void kstrbnd(void); |
73 |
|
void kcharge(void); |
74 |
|
void ksolv(void); |
139 |
– |
void kangang(void); |
75 |
|
void kopbend(void); |
141 |
– |
void kstrtor(void); |
142 |
– |
void khbond(void); |
143 |
– |
void piseq(int, int); |
144 |
– |
void kimprop(void); |
145 |
– |
void kimptors(void); |
146 |
– |
void kcoord_bonds(void); |
76 |
|
void kvdw(void); |
77 |
|
int kbond(void); |
149 |
– |
void kewald(void); |
150 |
– |
void kurey(void); |
78 |
|
|
79 |
|
void get_memory(void); |
80 |
|
void free_memory(void); |
81 |
|
void gradient(void); |
82 |
|
void minimize(void); |
156 |
– |
void dynamics(void); |
83 |
|
void read_datafiles(char *); |
84 |
+ |
void get_added_const(void); |
85 |
|
void attach(void); |
159 |
– |
void eheat(void); |
160 |
– |
void pirite(void); |
161 |
– |
void charge_dipole(void); |
162 |
– |
void dipole_dipole(void); |
163 |
– |
void piden(void); |
86 |
|
void hdel(int); |
87 |
|
void set_atomtypes(int); |
88 |
|
void type(void); |
167 |
– |
void generate_bonds(void); |
89 |
|
void zero_data(void); |
169 |
– |
void ehal(void); |
170 |
– |
void ehal1(void); |
171 |
– |
void ebufcharge(void); |
172 |
– |
void ebufcharge1(void); |
173 |
– |
void eopbend_wilson(void); |
174 |
– |
void eopbend_wilson1(void); |
175 |
– |
void hbondreset(void); |
176 |
– |
void vibrate(void); |
177 |
– |
void pireset(void); |
178 |
– |
void adjust_mmfftypes(void); |
179 |
– |
void build_neighbor_list(int); |
180 |
– |
int setup_calculation(void); |
181 |
– |
void end_calculation(void); |
182 |
– |
void egeom1(void); |
183 |
– |
void esolv1(void); |
184 |
– |
void egeom(void); |
185 |
– |
void esolv(void); |
90 |
|
void xlogp(float *); |
91 |
|
|
188 |
– |
void mmxsub(int ia) |
189 |
– |
{ |
190 |
– |
int nret; |
191 |
– |
|
192 |
– |
minim_control.type = ia; // 0 to minimize, 1 for single point |
193 |
– |
nret = setup_calculation(); |
194 |
– |
if (nret == FALSE) |
195 |
– |
{ |
196 |
– |
end_calculation(); |
197 |
– |
return; |
198 |
– |
} |
199 |
– |
|
200 |
– |
pcm7_min(); |
201 |
– |
end_calculation(); |
202 |
– |
} |
203 |
– |
// ================================================================ |
204 |
– |
void pcm7_min() |
205 |
– |
{ |
206 |
– |
int i, print; |
207 |
– |
double etot; |
208 |
– |
|
209 |
– |
print = FALSE; |
210 |
– |
if (minim_values.iprint == TRUE) |
211 |
– |
{ |
212 |
– |
print = TRUE; |
213 |
– |
minim_values.iprint = FALSE; |
214 |
– |
} |
215 |
– |
|
216 |
– |
optimize_data.initial_energy = energies.total; |
217 |
– |
|
218 |
– |
if (minim_control.type == 1) // single point calculation |
219 |
– |
return; |
220 |
– |
|
221 |
– |
minimize(); |
222 |
– |
|
223 |
– |
if (print == TRUE) |
224 |
– |
minim_values.iprint = TRUE; |
225 |
– |
|
226 |
– |
if (minim_values.iprint == TRUE) |
227 |
– |
etot = print_energy(); |
228 |
– |
else |
229 |
– |
etot = energy(); |
230 |
– |
|
231 |
– |
optimize_data.final_energy = energies.total; |
232 |
– |
|
233 |
– |
// compute dipole moment here |
234 |
– |
dipolemom.xdipole = 0.0; |
235 |
– |
dipolemom.ydipole = 0.0; |
236 |
– |
dipolemom.zdipole = 0.0; |
237 |
– |
if (pot.use_charge || pot.use_bufcharge || use_gast_chrg) charge_dipole(); |
238 |
– |
if (pot.use_dipole && !use_gast_chrg) dipole_dipole(); |
239 |
– |
dipolemom.total = sqrt(dipolemom.xdipole*dipolemom.xdipole + |
240 |
– |
dipolemom.ydipole*dipolemom.ydipole + |
241 |
– |
dipolemom.zdipole*dipolemom.zdipole); |
242 |
– |
} |
92 |
|
// ================================================================== |
93 |
|
int setup_calculation() |
94 |
|
{ |
95 |
< |
int nRet; |
95 |
> |
int i,j,nRet; |
96 |
|
char string[30]; |
97 |
|
double etot; |
98 |
< |
if (minim_control.field == MM3) |
250 |
< |
{ |
251 |
< |
// copy mm3 types into type file and retype |
252 |
< |
pot.use_hbond = FALSE; |
253 |
< |
hbondreset(); |
254 |
< |
hdel(1); |
255 |
< |
strcpy(string,"mm3.prm"); |
256 |
< |
zero_data(); |
257 |
< |
read_datafiles(string); |
258 |
< |
set_field(); |
259 |
< |
default_intype = MM3; |
260 |
< |
default_outtype = MM3; |
261 |
< |
set_atomtypes(MM3); |
262 |
< |
generate_bonds(); |
263 |
< |
if (minim_control.added_const) |
264 |
< |
get_added_const(); |
265 |
< |
} else if (minim_control.field == MMFF94) |
98 |
> |
if (minim_control.field == MMFF94) |
99 |
|
{ |
100 |
|
// copy mm3 types into type file and retype |
101 |
|
pot.use_hbond = FALSE; |
102 |
|
pot.use_picalc = FALSE; |
270 |
– |
hbondreset(); |
271 |
– |
pireset(); |
103 |
|
hdel(1); |
104 |
|
set_field(); |
274 |
– |
default_intype = MMFF94; |
275 |
– |
default_outtype = MMFF94; |
105 |
|
set_atomtypes(MMFF94); |
277 |
– |
generate_bonds(); |
278 |
– |
if (minim_control.added_const) |
279 |
– |
get_added_const(); |
280 |
– |
} else if (minim_control.field == AMBER) |
281 |
– |
{ |
282 |
– |
pot.use_hbond = FALSE; |
283 |
– |
pot.use_picalc = FALSE; |
284 |
– |
hbondreset(); |
285 |
– |
pireset(); |
286 |
– |
hdel(2); |
287 |
– |
set_field(); |
288 |
– |
generate_bonds(); |
289 |
– |
if (minim_control.added_const) |
290 |
– |
get_added_const(); |
291 |
– |
} else if (minim_control.field == OPLSAA) |
292 |
– |
{ |
293 |
– |
pot.use_hbond = FALSE; |
294 |
– |
pot.use_picalc = FALSE; |
295 |
– |
hbondreset(); |
296 |
– |
pireset(); |
297 |
– |
hdel(1); |
298 |
– |
set_field(); |
299 |
– |
generate_bonds(); |
106 |
|
if (minim_control.added_const) |
107 |
|
get_added_const(); |
108 |
|
} else |
116 |
|
} |
117 |
|
type(); |
118 |
|
set_field(); |
313 |
– |
generate_bonds(); |
119 |
|
} |
120 |
|
|
121 |
|
|
126 |
|
get_bonds(); |
127 |
|
get_angles(); |
128 |
|
get_torsions(); |
324 |
– |
get_coordbonds(); |
325 |
– |
|
326 |
– |
if (high_coord.ncoord > 0) |
327 |
– |
pot.use_highcoord = TRUE; |
129 |
|
|
130 |
|
attach(); |
330 |
– |
|
331 |
– |
|
131 |
|
get_rings(); |
132 |
|
// need allene |
133 |
|
|
134 |
|
// set active atoms |
135 |
|
set_active(); |
136 |
< |
|
136 |
> |
// setup non_bonded list of atoms to skip |
137 |
> |
for (i=1; i <= natom; i++) |
138 |
> |
{ |
139 |
> |
for (j=0; j < MAXIAT; j++) |
140 |
> |
if (atom[i].iat[j] != 0 && atom[i].bo[j] != 9) |
141 |
> |
{ |
142 |
> |
skip[i][atom[i].iat[j]] = i; |
143 |
> |
skip[atom[i].iat[j]][i] = atom[i].iat[j]; |
144 |
> |
} |
145 |
> |
for (j=0; j < attached.n13[i]; j++) |
146 |
> |
{ |
147 |
> |
skip[i][attached.i13[j][i]] = i; |
148 |
> |
skip[attached.i13[j][i]][i] = attached.i13[j][i]; |
149 |
> |
} |
150 |
> |
for(j=0; j < attached.n14[i]; j++) |
151 |
> |
{ |
152 |
> |
skip[i][attached.i14[j][i]] = -i; |
153 |
> |
skip[attached.i14[j][i]][i] = -attached.i14[j][i]; |
154 |
> |
} |
155 |
> |
} |
156 |
|
/* assign local geometry potential function parameters */ |
157 |
|
Missing_constants = FALSE; |
340 |
– |
// errfile = fopen_path(pcwindir,"pcmod.err","w"); |
158 |
|
if (pot.use_bond || pot.use_strbnd) nRet = kbond(); |
159 |
|
if (nRet == FALSE) // use end_calc to free memory |
160 |
|
{ |
344 |
– |
// message_alert("Parameters missing. See pcmod.err for information","Error"); |
345 |
– |
optimize_data.param_avail = 1; |
346 |
– |
// fclose(errfile); |
161 |
|
energies.total = 9999.; |
162 |
|
return FALSE; |
163 |
|
} |
167 |
|
if (pot.use_strbnd) kstrbnd(); |
168 |
|
|
169 |
|
if (pot.use_buck || pot.use_hal || pot.use_lj) kvdw(); |
170 |
< |
if ((pot.use_charge || pot.use_bufcharge || pot.use_ewald) && !use_external_chrg && !use_gast_chrg) kcharge(); |
170 |
> |
if ((pot.use_charge || pot.use_bufcharge || pot.use_ewald)) kcharge(); |
171 |
|
|
172 |
|
if (Missing_constants == TRUE) |
173 |
|
{ |
360 |
– |
// message_alert("Parameters missing. See pcmod.err for information","Error"); |
361 |
– |
// fclose(errfile); |
362 |
– |
optimize_data.param_avail = 1; |
174 |
|
energies.total = 9999.0; |
175 |
|
return (FALSE); |
365 |
– |
} else |
366 |
– |
{ |
367 |
– |
// fclose(errfile); |
368 |
– |
// remove("pcmod.err"); |
176 |
|
} |
177 |
|
if (minim_values.iprint == TRUE) |
178 |
|
etot = print_energy(); |
207 |
|
energies.eimptors = 0.0; |
208 |
|
energies.eurey = 0.0; |
209 |
|
energies.esolv = 0.0; |
210 |
< |
|
404 |
< |
virial.virx = 0.0; |
405 |
< |
virial.viry = 0.0; |
406 |
< |
virial.virz = 0.0; |
210 |
> |
energies.egeom =0.0; |
211 |
|
|
212 |
|
for (i=1; i <= natom; i++) |
213 |
|
atom[i].energy = 0.0; |
229 |
|
deriv.deimprop[i][j] = 0.0; |
230 |
|
deriv.dehb[i][j] = 0.0; |
231 |
|
deriv.desolv[i][j] = 0.0; |
232 |
+ |
deriv.degeom[i][j] = 0.0; |
233 |
|
} |
234 |
|
} |
235 |
|
|
242 |
|
// mmff |
243 |
|
if (pot.use_hal) ehal1(); |
244 |
|
if (pot.use_bufcharge) ebufcharge1(); |
245 |
+ |
|
246 |
+ |
if (pot.use_geom) egeom1(); |
247 |
|
|
248 |
|
energies.total = energies.estr + energies.ebend + energies.etor + energies.estrbnd + energies.e14+ |
249 |
|
energies.evdw + energies.eu + energies.ehbond + energies.eangang + energies.estrtor + |
250 |
< |
energies.eimprop + energies.eimptors + energies.eopb + energies.eurey + energies.esolv; |
250 |
> |
energies.eimprop + energies.eimptors + energies.eopb + energies.eurey + energies.esolv + energies.egeom; |
251 |
|
for (i=1; i <= natom; i++) |
252 |
|
{ |
253 |
|
for (j=0; j < 3; j++) |
255 |
|
deriv.d1[i][j] = deriv.deb[i][j] + deriv.dea[i][j] + deriv.deaa[i][j] + |
256 |
|
deriv.destb[i][j] + deriv.detor[i][j] + deriv.deopb[i][j] + deriv.dehb[i][j] + |
257 |
|
deriv.destor[i][j] + deriv.deqq[i][j] + deriv.devdw[i][j] + deriv.de14[i][j] + |
258 |
< |
deriv.deimprop[i][j] + deriv.deub[i][j] + deriv.desolv[i][j]; |
258 |
> |
deriv.deimprop[i][j] + deriv.deub[i][j] + deriv.desolv[i][j] + deriv.degeom[i][j]; |
259 |
|
|
260 |
|
} |
261 |
|
} |
265 |
|
{ |
266 |
|
double etot; |
267 |
|
int i; |
461 |
– |
// struct timeb start,end; |
268 |
|
|
269 |
|
energies.total = 0.0; |
270 |
|
energies.estr = 0.0; |
282 |
|
energies.eopb = 0.0; |
283 |
|
energies.eurey = 0.0; |
284 |
|
energies.esolv = 0.0; |
285 |
+ |
energies.egeom = 0.0; |
286 |
|
|
287 |
|
for (i=1; i <= natom; i++) |
288 |
|
atom[i].energy = 0.0; |
295 |
|
// mmff |
296 |
|
if (pot.use_hal) ehal(); |
297 |
|
if (pot.use_bufcharge) ebufcharge(); |
298 |
+ |
|
299 |
+ |
if (pot.use_geom) egeom(); |
300 |
|
|
301 |
|
energies.total = energies.estr + energies.ebend + energies.etor + energies.estrbnd |
302 |
|
+ energies.evdw + energies.e14 + energies.ehbond + energies.eu + energies.eangang + |
303 |
< |
energies.estrtor + energies.eimprop + energies.eimptors + energies.eopb + energies.eurey + energies.esolv; |
303 |
> |
energies.estrtor + energies.eimprop + energies.eimptors + energies.eopb + energies.eurey + energies.esolv + energies.egeom; |
304 |
|
etot = energies.total; |
305 |
|
return (etot); |
306 |
|
} |
326 |
|
energies.eopb = 0.0; |
327 |
|
energies.eurey = 0.0; |
328 |
|
energies.esolv = 0.0; |
329 |
+ |
energies.egeom = 0.0; |
330 |
|
|
331 |
|
for (i=1; i <= natom; i++) |
332 |
|
atom[i].energy = 0.0; |
340 |
|
if (pot.use_hal) ehal(); |
341 |
|
if (pot.use_bufcharge) ebufcharge(); |
342 |
|
|
343 |
+ |
if (pot.use_geom) egeom(); |
344 |
+ |
|
345 |
|
energies.total = energies.estr + energies.ebend + energies.etor + energies.estrbnd |
346 |
|
+ energies.evdw + energies.e14 + energies.ehbond + energies.eu + energies.eangang + |
347 |
< |
energies.estrtor + energies.eimprop + energies.eimptors + energies.eopb + energies.eurey + energies.esolv; |
347 |
> |
energies.estrtor + energies.eimprop + energies.eimptors + energies.eopb + energies.eurey + energies.esolv + energies.egeom; |
348 |
|
etot = energies.total; |
349 |
|
|
350 |
|
return (etot); |
351 |
|
} |
352 |
|
|
353 |
|
/* ================================================================== */ |
542 |
– |
|
543 |
– |
int iscoord_bond(int i, int j) |
544 |
– |
{ |
545 |
– |
int k; |
546 |
– |
long int mask; |
547 |
– |
|
548 |
– |
mask = 1 << METCOORD_MASK ; |
549 |
– |
|
550 |
– |
for (k=0; k < MAXIAT; k++) |
551 |
– |
{ |
552 |
– |
if (atom[i].iat[k] == j && atom[i].bo[k] == 9) |
553 |
– |
{ |
554 |
– |
if (atom[i].type >= 300) |
555 |
– |
{ |
556 |
– |
if (atom[j].type == 2 || atom[j].type == 4 || atom[j].type == 29 || |
557 |
– |
atom[j].type == 30 || atom[j].type == 40 || atom[j].type == 48 ) |
558 |
– |
return TRUE; |
559 |
– |
} |
560 |
– |
if (atom[j].type >= 300) |
561 |
– |
{ |
562 |
– |
if (atom[i].type == 2 || atom[i].type == 4 || atom[i].type == 29 || |
563 |
– |
atom[i].type == 30 || atom[i].type == 40 || atom[i].type == 48 ) |
564 |
– |
return TRUE; |
565 |
– |
} |
566 |
– |
} |
567 |
– |
} |
568 |
– |
// throughout Metal-lone pairs if coordinated bond |
569 |
– |
// metal to donor atom |
570 |
– |
if ( (atom[i].type >= 300) && atom[j].flags & mask) |
571 |
– |
return TRUE; |
572 |
– |
if ( (atom[j].type >= 300) && atom[i].flags & mask) |
573 |
– |
return TRUE; |
574 |
– |
|
575 |
– |
return FALSE; |
576 |
– |
} |
577 |
– |
|
578 |
– |
void get_coordbonds() |
579 |
– |
{ |
580 |
– |
int i, j, k, iatype, jatm; |
581 |
– |
|
582 |
– |
cbonds.nbnd = 0; |
583 |
– |
pot.use_coordb = FALSE; |
584 |
– |
|
585 |
– |
for (i=1; i <= natom; i++) |
586 |
– |
{ |
587 |
– |
if (atom[i].mmx_type >= 300) |
588 |
– |
{ |
589 |
– |
for (j=0; j <= MAXIAT; j++) |
590 |
– |
{ |
591 |
– |
if (atom[i].bo[j] == 9) // coord bond |
592 |
– |
{ |
593 |
– |
iatype = atom[atom[i].iat[j]].mmx_type; |
594 |
– |
if (iatype == 2 || iatype == 4 || iatype == 29 || |
595 |
– |
iatype == 30 || iatype == 40 || iatype == 48 ) |
596 |
– |
{ |
597 |
– |
cbonds.icbonds[cbonds.nbnd][0] = i; |
598 |
– |
cbonds.icbonds[cbonds.nbnd][1] = atom[i].iat[j]; |
599 |
– |
cbonds.icbonds[cbonds.nbnd][2] = 0; |
600 |
– |
cbonds.nbnd++; |
601 |
– |
} else |
602 |
– |
{ |
603 |
– |
jatm = atom[i].iat[j]; |
604 |
– |
for (k = 0; k < MAXIAT; k++) |
605 |
– |
{ |
606 |
– |
if (atom[atom[jatm].iat[k]].mmx_type == 20) // lp |
607 |
– |
{ |
608 |
– |
cbonds.icbonds[cbonds.nbnd][0] = i; |
609 |
– |
cbonds.icbonds[cbonds.nbnd][1] = jatm; |
610 |
– |
cbonds.icbonds[cbonds.nbnd][2] = atom[jatm].iat[k]; |
611 |
– |
cbonds.nbnd++; |
612 |
– |
} |
613 |
– |
} |
614 |
– |
} |
615 |
– |
if (cbonds.nbnd > MAXCBND) |
616 |
– |
{ |
617 |
– |
fprintf(pcmoutfile,"Error - Too many coordinated bonds!\nProgram will now quit.\n"); |
618 |
– |
exit(0); |
619 |
– |
} |
620 |
– |
} |
621 |
– |
} |
622 |
– |
} |
623 |
– |
} |
624 |
– |
if (cbonds.nbnd > 0) |
625 |
– |
pot.use_coordb = TRUE; |
626 |
– |
} |
354 |
|
int isbond(int i, int j) |
355 |
|
{ |
356 |
|
int k; |
361 |
|
} |
362 |
|
return FALSE; |
363 |
|
} |
364 |
< |
|
364 |
> |
// ========================== |
365 |
|
void get_bonds() |
366 |
|
{ |
367 |
|
int i, j; |
641 |
– |
long int mask; |
368 |
|
|
369 |
< |
bonds_ff.nbnd = 0; |
644 |
< |
mask = 1L << 0; // flag for pi atoms |
645 |
< |
|
369 |
> |
bonds_ff.nbnd = 0; |
370 |
|
for (i=1; i <= natom; i++) |
371 |
|
{ |
372 |
|
for (j=i+1; j <= natom; j++) |
378 |
|
bonds_ff.nbnd++; |
379 |
|
if (bonds_ff.nbnd > MAXBND) |
380 |
|
{ |
381 |
< |
fprintf(pcmoutfile,"Error - Too many bonds!\nProgram will now quit.\n"); |
381 |
> |
fprintf(pcmlogfile,"Error - Too many bonds!\nProgram will now quit.\n"); |
382 |
|
exit(0); |
383 |
|
} |
384 |
|
} |