ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/freemol/trunk/src/mengine/src/initiali.c
Revision: 104
Committed: Fri Feb 20 14:09:46 2009 UTC (12 years, 5 months ago) by gilbertke
File size: 3100 byte(s)
Log Message:
full dynamic memory allocation of molecule
Line File contents
1 #define EXTERN extern
2
3 #include "pcwin.h"
4 #include "pcmod.h"
5 #include "cutoffs.h"
6 #include "utility.h"
7 #include "fix.h"
8 #include "atom_k.h"
9 #include "job_control.h"
10
11 void reset_atom_data(void);
12 void reset_calc_parameters(void);
13 void zero_data(void);
14 void read_datafiles(char *);
15 void initialize_pcmodel(char *);
16 void set_field(int);
17 int get_field(void);
18 void message_alert(char *, char *);
19
20
21 EXTERN struct t_files {
22 int nfiles, append, batch, icurrent;
23 int ibatno;
24 } files;
25
26 EXTERN struct t_minim_control {
27 int type, method, field, added_const;
28 char added_path[256],added_name[256];
29 } minim_control;
30
31 EXTERN struct t_minim_values {
32 int iprint, ndc, nconst;
33 float dielc;
34 } minim_values;
35
36 struct t_user {
37 int dielec;
38 } user;
39
40 EXTERN struct t_pcmfile {
41 char string[200];
42 int head;
43 char token[20];
44 int state;
45 unsigned int nocaps;
46 } pcmfile;
47
48
49 // =======================================
50 void message_alert(char *astring, char *title)
51 {
52 fprintf(pcmlogfile,"%s\n",astring);
53 }
54 // ===================================
55 void initialize_pcmodel(char *mmxfilename)
56 {
57 int i,field;
58 user.dielec = FALSE;
59 units.dielec = 1.0;
60 zero_data();
61 read_datafiles(mmxfilename);
62 set_field(MMX);
63 // initialize atom definitions
64 atom_def.natomtype = atom_k.natomtype;
65 for (i=1; i < MAXATOMTYPE; i++)
66 {
67 atom_def.type[i] = atom_k.type[i];
68 atom_def.valency[i] = atom_k.valency[i];
69 atom_def.number[i] = atom_k.number[i];
70 atom_def.ligands[i] = atom_k.ligands[i];
71 atom_def.weight[i] = atom_k.weight[i];
72 strcpy(atom_def.symbol[i],atom_k.symbol[i]);
73 }
74 field = get_field();
75 Openbox.ftype = FTYPE_PCM;
76 Savebox.ftype = FTYPE_PCM;
77 strcpy(Openbox.path,pcwindir);
78 strcpy(Savebox.path,pcwindir);
79 reset_calc_parameters();
80 natom = 0;
81 /* minimizer control */
82 minim_control.method = 3;
83 minim_control.field = MMX;
84 minim_control.added_const = FALSE;
85 // printout
86 minim_values.iprint = FALSE;
87 /* cutoffs */
88 cutoffs.vdwcut = 10.0;
89 cutoffs.pmecut = 9.0;
90 cutoffs.chrgcut = 100.0;
91 cutoffs.dipcut = 8.0;
92 // fixed stuff
93 fx_atom.natom_fix = 0;
94 fx_dist.ndfix = 0;
95 fx_angle.nafix = 0;
96 fx_torsion.ntfix = 0;
97 restrain_atom.natom_restrain = 0;
98 // job control
99 job_control.use_charge = FALSE;
100 job_control.use_scale_charge = FALSE;
101 job_control.use_gbsa = FALSE;
102 job_control.scale = 1.0;
103 }
104
105 int initialize(void)
106 {
107 natom = 0;
108 reset_calc_parameters();
109 // reset_atom_data();
110 return(0);
111 }
112 /* ============================================== */
113 void reset_calc_parameters(void)
114 {
115
116 /* default to hydrogen bonding on */
117 minim_values.ndc = 4;
118 minim_values.nconst= 0;
119 }
120 /* ============================================== */
121 void reset_atom_data(void)
122 {
123
124 }