ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/freemol/trunk/src/mengine/src/vibrate.c
(Generate patch)
# Line 1 | Line 1
1   #define EXTERN extern
2  
3   #include "pcwin.h"
4 #include "pcmod.h"
4  
5   #include "asnsym.h"
6   #include "utility.h"
# Line 24 | Line 23
23  
24   static void tred2(double **,int , double *, double *);
25   static void tqli(double *,double *,int ,double **);
26 < static void assign_vibsym(char *,char *,int *,double **);
26 > static void assign_vibsym(int, char *,char *,int *,double **);
27   double get_total_energy(void);
28   void hessian(int, double *,int *, int *, int *,double *);
29 + void vibrate(int natom,double *atomwt,double *x,double *y,double *z,double *charge);
30   //void vibcharge_dipole(double **);
31   //void vibdipole_dipole(double **);
32  
33 < void vibrate()
33 > void vibrate(int natom,double *atomwt,double *x,double *y,double *z,double *charge)
34   {
35      int i, k, j, ii, jj, nsym,imix,mm;
36      int maxvar, maxhess, ihess, nfreq, maxvib;
# Line 58 | Line 58
58  
59      for (i=1; i <= natom; i++)
60      {
61 <        if (atom.atomwt[i] <= 0.0)
62 <           atom.atomwt[i] = 0.001;
61 >        if (atomwt[i] <= 0.0)
62 >           atomwt[i] = 0.001;
63      }
64            
65      maxvar = 3*natom;
# Line 81 | Line 81
81      dipole = dvector(0,maxvar);
82  
83      for (i=1; i <= natom; i++)
84 <        mass2[i] = sqrt(atom.atomwt[i]);
84 >        mass2[i] = sqrt(atomwt[i]);
85  
86       hesscut = 0.0;
87       hessian(maxhess, h, hinit, hstop, hindex, hdiag);
# Line 107 | Line 107
107      for (i=0; i < maxvar; i++)
108      {
109          jj = i/3 + 1;
110 <        matrix[i][i] = hdiag[i]/atom.atomwt[jj];
110 >        matrix[i][i] = hdiag[i]/atomwt[jj];
111          ii = i;
112          for (k = hinit[i]; k < hstop[i]; k++)
113          {
# Line 157 | Line 157
157   // get overall molecular symmetry
158        for (i=1; i <= natom; i++)
159        {
160 <          acoord[i][0] = atom.x[i];
161 <          acoord[i][1] = atom.y[i];
162 <          acoord[i][2] = atom.z[i];
160 >          acoord[i][0] = x[i];
161 >          acoord[i][1] = y[i];
162 >          acoord[i][2] = z[i];
163        }
164        strcpy(ngrp,"   ");
165        ptgrp(2,ngrp,acoord);
# Line 179 | Line 179
179            {
180                strcpy(vsym,"   ");
181                k = j/3 + 1;
182 <              acoord[k][0] = atom.x[k] + matrix[j][i];
183 <              acoord[k][1] = atom.y[k] + matrix[j+1][i];
184 <              acoord[k][2] = atom.z[k] + matrix[j+2][i];
185 <              dqx += atom.charge[k]*matrix[j][i];
186 <              dqy += atom.charge[k]*matrix[j+1][i];
187 <              dqz += atom.charge[k]*matrix[j+2][i];
182 >              acoord[k][0] = x[k] + matrix[j][i];
183 >              acoord[k][1] = y[k] + matrix[j+1][i];
184 >              acoord[k][2] = z[k] + matrix[j+2][i];
185 >              dqx += charge[k]*matrix[j][i];
186 >              dqy += charge[k]*matrix[j+1][i];
187 >              dqz += charge[k]*matrix[j+2][i];
188                              
189            }
190  
191            ptgrp(1,vsym,acoord);
192 <          assign_vibsym(ngrp,vsym,&nsym,acoord);
192 >          assign_vibsym(natom,ngrp,vsym,&nsym,acoord);
193            vibsym[i] = nsym;
194            
195        }
# Line 301 | Line 301
301        temp = 298.15;
302        mass = 0.0;
303        for (i=1; i <= natom; i++)
304 <         mass += atom.atomwt[i];
304 >         mass += atomwt[i];
305        efact = 1.987;
306        cnosym = symmetry.numsym;
307        cimix = (double)imix;
# Line 411 | Line 411
411      free_dvector(dipole,0,maxvar);
412   }
413   /* =============================================== */
414 < void assign_vibsym(char *ngrp,char *vsym,int *nsym,double **a)
414 > void assign_vibsym(int natom, char *ngrp,char *vsym,int *nsym,double **a)
415   {
416      int iz;
417      double  **b;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines