ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/freemol/trunk/src/mengine/src/dipmom.c
(Generate patch)
# Line 3 | Line 3
3   #include "pcwin.h"
4   #include "pcmod.h"
5   #include "bonds_ff.h"
6 + #include "dipmom.h"
7  
7 EXTERN struct t_dipolemom {
8        double total, xdipole, ydipole, zdipole;
9       }  dipolemom;
10 struct t_quadmom {
11        double xx,xy,xz,yx,yy,yz,zx,zy,zz;
12       } quadmom;
8  
9 <
10 < void charge_dipole(void);
16 < void dipole_dipole(void);
17 < void vibcharge_dipole(double **);
18 < void vibdipole_dipole(double **);
9 > static void vibcharge_dipole(double **);
10 > static void vibdipole_dipole(double **);
11  
12   void charge_dipole(void)
13   {
# Line 117 | Line 109
109      }
110      dipolemom.xdipole = xsum*debye;
111      dipolemom.ydipole = ysum*debye;
112 <    dipolemom.zdipole = zsum*debye;
121 < // quadrapole moment
122 <    xsum = 0.0;
123 <    ysum = 0.0;
124 <    zsum = 0.0;
125 <    xy = xz = yx = yz = zx = zy = 0.0;
126 <    for(i=1; i <= natom; i++)
127 <    {
128 <        xsum += (acoord[i][0]-xcenter)*(acoord[i][0]-xcenter)*atom[i].charge;
129 <        ysum += (acoord[i][1]-ycenter)*(acoord[i][1]-ycenter)*atom[i].charge;
130 <        zsum += (acoord[i][2]-zcenter)*(acoord[i][2]-zcenter)*atom[i].charge;        
131 <        xy += (acoord[i][0]-xcenter)*(acoord[i][1]-ycenter)*atom[i].charge;
132 <        xz += (acoord[i][0]-xcenter)*(acoord[i][2]-zcenter)*atom[i].charge;      
133 <        yx += (acoord[i][1]-ycenter)*(acoord[i][0]-xcenter)*atom[i].charge;        
134 <        yz += (acoord[i][1]-ycenter)*(acoord[i][2]-zcenter)*atom[i].charge;        
135 <        zx += (acoord[i][2]-zcenter)*(acoord[i][0]-xcenter)*atom[i].charge;        
136 <        zy += (acoord[i][2]-zcenter)*(acoord[i][1]-ycenter)*atom[i].charge;        
137 <    }
138 <    quadmom.xx = xsum;
139 <    quadmom.xy = xy;
140 <    quadmom.xz = xz;
141 <    quadmom.yy = ysum;
142 <    quadmom.yx = yx;
143 <    quadmom.yz = yz;
144 <    quadmom.zz = zsum;
145 <    quadmom.zx = zx;
146 <    quadmom.zy = zy;
147 <    
112 >    dipolemom.zdipole = zsum*debye;    
113   }
114  
115   void vibdipole_dipole(double **acoord)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines