ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/freemol/trunk/src/mengine/src/initiali.c
(Generate patch)
# Line 2 | Line 2
2  
3   #include "pcwin.h"
4   #include "pcmod.h"
5 #include "pot.h"
6 #include "field.h"
5   #include "cutoffs.h"
8 #include "energies.h"
6   #include "utility.h"
7   #include "fix.h"
8   #include "atom_k.h"
9 < #include "dipmom.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(void);
16 > void set_field(int);
17 > int get_field(void);
18   void message_alert(char *, char *);
19  
20  
# Line 56 | Line 54
54   // ===================================
55   void initialize_pcmodel(char *mmxfilename)
56   {
57 <    int i;
57 >  int i,field;
58      user.dielec = FALSE;
59      units.dielec = 1.0;
62    dipolemom.total = 0.0;
60      zero_data();
61      read_datafiles(mmxfilename);
62 <    set_field();
62 >    set_field(MMX);
63      // initialize atom definitions
64      atom_def.natomtype = atom_k.natomtype;
65      for (i=1; i < MAXATOMTYPE; i++)
# Line 74 | Line 71
71          atom_def.weight[i] = atom_k.weight[i];
72          strcpy(atom_def.symbol[i],atom_k.symbol[i]);
73        }
74 <    LPTYPE = 20;
78 <    if (field.type == MMX ||field.type == MM2 ||field.type == MM3  )
79 <      LPTYPE = 20;
80 <    else
81 <      LPTYPE = 0;
74 >    field = get_field();
75      Openbox.ftype = FTYPE_PCM;
76      Savebox.ftype = FTYPE_PCM;
84    default_intype = MMX;
85    default_outtype = MMX;
77      strcpy(Openbox.path,pcwindir);
78      strcpy(Savebox.path,pcwindir);
88    hbond_flag = TRUE;
89    pot.use_hbond = TRUE;
79      reset_calc_parameters();
80      natom = 0;
81      /*  minimizer control */
# Line 100 | Line 89
89      cutoffs.pmecut = 9.0;
90      cutoffs.chrgcut = 100.0;
91      cutoffs.dipcut = 8.0;
103    /*  solvation stuff  */
104    pot.use_bounds = FALSE;
105    pot.use_image = FALSE;
106    pot.use_deform = FALSE;
107    pot.use_solv = FALSE;
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 <  pot.use_bounds = FALSE;
121 <    pot.use_image = FALSE;
122 <    pot.use_deform = FALSE;
123 <    dipolemom.total = 0.0;
124 <    reset_atom_data();
109 >    //    reset_atom_data();
110      return(0);
111   }
112   /* ============================================== */
# Line 139 | Line 124
124  
125      for (i = 0; i < MAXATOM; i++)
126      {
127 <        atom[i].use = 0;
128 <        atom[i].x = 0.0F; atom[i].y = 0.0F; atom[i].z = 0.0F;
129 <        atom[i].charge = 0.0F;
130 <        atom[i].energy = 0.0F;
131 <        atom[i].atomnum = 0;
132 <        atom[i].formal_charge = 0;
133 <        atom[i].atomwt = 0.0;
134 <        atom[i].type = 0;
135 <        atom[i].mmx_type = 0;
136 <        atom[i].mm3_type = 0;
137 <        atom[i].mmff_type = 0;
138 <        atom[i].tclass = 0;
139 <        *atom[i].name = '\0';
155 <        atom[i].flags = 0;
127 >        atom.use[i] = 0;
128 >        atom.x[i] = 0.0F; atom.y[i] = 0.0F; atom.z[i] = 0.0F;
129 >        atom.charge[i] = 0.0F;
130 >        atom.atomnum[i] = 0;
131 >        atom.formal_charge[i] = 0;
132 >        atom.atomwt[i] = 0.0;
133 >        atom.type[i] = 0;
134 >        atom.mmx_type[i] = 0;
135 >        atom.mm3_type[i] = 0;
136 >        atom.mmff_type[i] = 0;
137 >        atom.tclass[i] = 0;
138 >        *atom.name[i] = '\0';
139 >        atom.flags[i] = 0;
140          for (j = 0; j < MAXIAT; j++)
141          {
142 <           atom[i].bo[j] = 0;
143 <           atom[i].iat[j] = 0;
142 >           atom.bo[i][j] = 0;
143 >           atom.iat[i][j] = 0;
144          }
145       }
146   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines