ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/freemol/trunk/src/mengine/src/field.c
(Generate patch)
# Line 5 | Line 5
5   #include "pot.h"
6   #include "field.h"
7   #include "fix.h"
8 + #include "job_control.h"
9  
10   EXTERN struct t_minim_values {
11          int iprint, ndc, nconst;
12          float dielc;
13          } minim_values;
14  
15 < void set_field(void);
15 > void set_field(int type);
16   void potoff(void);
17 + int get_field(void);
18 + int use_solvation(void);
19 + void set_solvation(int);
20 + int use_bond(void);
21 + int use_angle(void);
22 + int use_strbnd(void);
23 + int use_opbend_wilson(void);
24 + int use_tors(void);
25 + int use_strtor(void);
26 + int use_hal(void);
27 + int use_charge(void);
28 + int use_bufcharge(void);
29 + int use_geom(void);
30 + int use_solv(void);
31  
32 < void set_field()
32 > void set_field_name(char *);
33 > void set_field_bondunit(float ftemp);
34 > void set_field_bondcubic(float ftemp);
35 > void set_field_bondquartic(float ftemp);
36 > void set_field_angleunit(float ftemp);
37 > void set_field_anglecubic(float ftemp);
38 > void set_field_anglequartic(float ftemp);
39 > void set_field_anglepentic(float ftemp);
40 > void set_field_anglesextic(float ftemp);
41 > void set_field_strbndunit(float ftemp);
42 > void set_field_angangunit(float ftemp);
43 > void set_field_strtorunit(float ftemp);
44 > void set_field_torsionunit(float ftemp);
45 > void set_field_vdwtype(char *name);
46 > void set_field_radiustype(char *name);
47 > void set_field_radiussize(char *name);
48 > void set_field_radiusrule(char *name);
49 > void set_field_epsrule(char *name);
50 > void set_field_aterm(float ftemp);
51 > void set_field_bterm(float ftemp);
52 > void set_field_cterm(float ftemp);
53 > void set_field_vdwscale(float ftemp);
54 > void set_field_chrgscale(float ftemp);
55 > void set_field_dielectric(float ftemp);
56 >
57 > char * get_radiustype(void);
58 > char * get_radiussize(void);
59 > char * get_radiusrule(void);
60 > char * get_epsrule(void);
61 > // ======================
62 > int get_field()
63 > {
64 >  return field.type;
65 > }
66 > // ====================
67 > char * get_radiustype()
68 > {
69 >  return field.radiustype;
70 > }
71 > char * get_radiussize()
72 > {
73 >  return field.radiussize;
74 > }
75 > char * get_radiusrule()
76 > {
77 >  return field.radiusrule;
78 > }
79 > char * get_epsrule()
80 > {
81 >  return field.radiusrule;
82 > }
83 > // =================
84 > void set_field_name(char *name)
85 > {
86 >  strcpy(field.name,name);
87 > }
88 > // =========== bonds =============
89 > void set_field_bondunit(float ftemp)
90 > {
91 >  field.bondunit = ftemp;
92 > }
93 > void set_field_bondcubic(float ftemp)
94 > {
95 >  field.bond_cubic = ftemp;
96 > }
97 > void set_field_bondquartic(float ftemp)
98 > {
99 >  field.bond_quartic = ftemp;
100 > }
101 > // ============ angles ==============
102 > void set_field_angleunit(float ftemp)
103 > {
104 >  field.angleunit = ftemp;
105 > }
106 > void set_field_anglecubic(float ftemp)
107 > {
108 >  field.angle_cubic = ftemp;
109 > }
110 > void set_field_anglequartic(float ftemp)
111 > {
112 >  field.angle_quartic = ftemp;
113 > }
114 > void set_field_anglepentic(float ftemp)
115 > {
116 >  field.angle_pentic = ftemp;
117 > }
118 > void set_field_anglesextic(float ftemp)
119 > {
120 >  field.angle_sextic = ftemp;
121 > }
122 > // =========== cross terms ===============
123 > void set_field_strbndunit(float ftemp)
124 > {
125 >  field.str_bndunit = ftemp;
126 > }
127 > void set_field_angangunit(float ftemp)
128 > {
129 >  field.ang_angunit = ftemp;
130 > }
131 > void set_field_strtorunit(float ftemp)
132 > {
133 >  field.str_torunit = ftemp;
134 > }
135 > // =============== torsions ===========
136 > void set_field_torsionunit(float ftemp)
137 > {
138 >  field.torsionunit = ftemp;
139 > }
140 > // ================ vdw ==============
141 > void set_field_vdwtype(char *name)
142 > {
143 >  strcpy(field.vdwtype,name);
144 > }
145 > void set_field_radiustype(char *name)
146 > {
147 >  strcpy(field.radiustype,name);
148 > }
149 > void set_field_radiussize(char *name)
150 > {
151 >  strcpy(field.radiussize,name);
152 > }
153 > void set_field_radiusrule(char *name)
154   {
155 +  strcpy(field.radiusrule,name);
156 + }
157 + void set_field_epsrule(char *name)
158 + {
159 +  strcpy(field.epsrule,name);
160 + }
161 + void set_field_aterm(float ftemp)
162 + {
163 +  field.a_expterm = ftemp;
164 + }
165 + void set_field_bterm(float ftemp)
166 + {
167 +  field.b_expterm = ftemp;
168 + }
169 + void set_field_cterm(float ftemp)
170 + {
171 +  field.c_expterm = ftemp;
172 + }
173 + void set_field_vdwscale(float ftemp)
174 + {
175 +  field.vdw_14scale = ftemp;
176 + }
177 + void set_field_dielectric(float ftemp)
178 + {
179 +  field.dielectric = ftemp;
180 + }
181 + void set_field_chrgscale(float ftemp)
182 + {
183 +  field.chg_14scale = ftemp;
184 + }
185 + // ================
186 + void set_field(int type)
187 + {
188 +  field.type = type;
189        pot.use_bond = FALSE;
190        pot.use_angle = FALSE;
191        pot.use_strbnd = FALSE;
# Line 45 | Line 215
215        pot.use_opbend_wilson = FALSE;
216        pot.use_highcoord = FALSE;
217  
218 <    if (field.type == MMX )
218 >    if (type == MMX )
219      {
220          pot.use_bond = TRUE;
221          pot.use_angle = TRUE;
# Line 58 | Line 228
228          pot.use_lj = FALSE;
229          pot.use_hal = FALSE;
230          pot.use_gauss = FALSE;
231 <        if (hbond_flag == TRUE)
62 <          pot.use_hbond = TRUE;
63 <        else
64 <          pot.use_hbond = FALSE;
231 >        pot.use_hbond = FALSE;
232          
233          pot.use_bufcharge= FALSE;
234          if (minim_values.ndc == 4)
# Line 80 | Line 247
247          pot.use_imptor = FALSE;
248          pot.use_strtor = FALSE;
249          pot.use_tortor = FALSE;
250 <    } else if (field.type == MM3)
250 >    } else if (type == MM3)
251      {
252          pot.use_bond = TRUE;
253          pot.use_angle = TRUE;
# Line 103 | Line 270
270          pot.use_imptor = FALSE;
271          pot.use_angang = TRUE;
272          pot.use_strtor = TRUE;
273 <    } else if (field.type == MMFF94)
273 >    } else if (type == MMFF94)
274      {
275          pot.use_bond = TRUE;
276          pot.use_angle = TRUE;
# Line 118 | Line 285
285          pot.use_hal = TRUE;
286          
287          pot.use_hbond = FALSE;
288 +        pot.use_picalc = FALSE;
289          
290          pot.use_gauss = FALSE;
291          pot.use_charge = FALSE;
# Line 133 | Line 301
301      if (fx_angle.nafix > 0) pot.use_geom = TRUE;
302      if (fx_torsion.ntfix > 0) pot.use_geom = TRUE;
303      if (restrain_atom.natom_restrain > 0) pot.use_geom = TRUE;
304 +    if (job_control.use_gbsa) pot.use_solv = TRUE;
305   }
306   // ============================
307   void potoff()
# Line 166 | Line 335
335        pot.use_coordb = FALSE;
336        pot.use_opbend_wilson = FALSE;
337   }
338 + // ================ Solvation information  ===========
339 + static int SOLVATION = FALSE;
340  
341 + int use_solvation()
342 + {
343 +  if (SOLVATION)
344 +    return TRUE;
345 +  else
346 +    return FALSE;
347 + }
348 + void set_solvation(int mode)
349 + {
350 +  if (mode)
351 +    SOLVATION = TRUE;
352 +  else
353 +    SOLVATION = FALSE;
354 + }
355 + // ==================
356 + int use_bond(void)
357 + {
358 +  if (pot.use_bond)
359 +    return TRUE;
360 +  else
361 +    return FALSE;
362 + }
363 + int use_angle(void)
364 + {
365 +  if (pot.use_angle)
366 +    return TRUE;
367 +  else
368 +    return FALSE;
369 + }
370 + int use_strbnd(void)
371 + {
372 +  if (pot.use_strbnd)
373 +    return TRUE;
374 +  else
375 +    return FALSE;
376 + }
377 + int use_opbend_wilson(void)
378 + {
379 +  if (pot.use_opbend_wilson)
380 +    return TRUE;
381 +  else
382 +    return FALSE;
383 + }
384 + int use_tors(void)
385 + {
386 +  if (pot.use_tors)
387 +    return TRUE;
388 +  else
389 +    return FALSE;
390 + }
391 + int use_strtor(void)
392 + {
393 +  if (pot.use_strtor)
394 +    return TRUE;
395 +  else
396 +    return FALSE;
397 + }
398 + int use_hal(void)
399 + {
400 +  if (pot.use_hal)
401 +    return TRUE;
402 +  else
403 +    return FALSE;
404 + }
405 + int use_charge(void)
406 + {
407 +  if (pot.use_charge)
408 +    return TRUE;
409 +  else
410 +    return FALSE;
411 + }
412 + int use_bufcharge(void)
413 + {
414 +  if (pot.use_bufcharge)
415 +    return TRUE;
416 +  else
417 +    return FALSE;
418 + }
419 + int use_geom(void)
420 + {
421 +  if (pot.use_geom)
422 +    return TRUE;
423 +  else
424 +    return FALSE;
425 + }
426 + int use_solv(void)
427 + {
428 +  if (pot.use_solv)
429 +    return TRUE;
430 +  else
431 +    return FALSE;
432 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines