From b7d53b1ec0f49cba3801c14f752726a00fa2f691 Mon Sep 17 00:00:00 2001 From: Per Larsson Date: Thu, 13 Aug 2009 16:50:46 +0200 Subject: [PATCH] Fixed a few compiler warnings in genborn.c --- src/mdlib/genborn.c | 448 ---------------------------------------------------- 1 file changed, 448 deletions(-) diff --git a/src/mdlib/genborn.c b/src/mdlib/genborn.c index 4d9b9cbc24..aa81cbcf63 100644 --- a/src/mdlib/genborn.c +++ b/src/mdlib/genborn.c @@ -1802,454 +1802,6 @@ real calc_gb_forces(t_commrec *cr, t_mdatoms *md, gmx_genborn_t *born, gmx_local } -/* Skriv om den här rutinen så att den får samma format som Charmm SASA - * Antagligen kan man då beräkna derivatan i samma loop som ytan, - * vilket är snabbare (görs inte i Charmm, men det borde gå :-) ) - */ -int calc_surfStill(t_inputrec *ir, - t_idef *idef, - t_atoms *atoms, - rvec x[], - rvec f[], - gmx_genborn_t *born, - t_atomtypes *atype, - double *faction, - int natoms, - t_nblist *nl, - t_iparams forceparams[], - t_iatom forceatoms[], - int nbonds) -{ - int i,j,n,ia,ib,ic; - - real pc[3],radp,probd,radnp,s,prob,bmlt; - real dx,dy,dz,d,rni,dist,bee,ri,rn,asurf,t1ij,t2ij,bij,bji,dbijp; - real dbjip,tip,tmp,tij,tji,t3ij,t4ij,t5ij,t3ji,t4ji,t5ji,dbij,dbji; - real dpf,dpx,dpy,dpz,pi,pn,si,sn; - real *aprob; - - int factor=1; - - int k,type,ai,aj,nj0,nj1; - real dr2,sar,rai,raj,fij; - rvec dxx; - - aprob = born->work; - /*bonds_t *bonds,*bonds13;*/ - - /*snew(bonds,natoms);*/ - /*snew(bonds13,natoms);*/ - - /* Zero out the forces to compare only surface area contribution */ - /* - printf("Zeroing out forces before surface area..\n"); - - for(i=0;iatomname[i]))) - { - printf("x=%g, s=%g, p=%g, r=%g\n", - x[i][0], - atype->vol[atoms->atom[i].type], - atype->surftens[atoms->atom[i].type], - factor*atype->radius[atoms->atom[i].type]); - - } - - printf("faction[i]=%g\n",faction[i*3]); - faction[i*3]=0; - faction[i*3+1]=0; - faction[i*3+2]=0; - - f[i][0]=f[i][1]=f[i][2]=0; - } - exit(1); - */ - /* Radius of probe */ - radp=0.14; - probd=2*radp; - - /********************************************************* - ********************************************************* - ********************************************************* - ********************************************************* - ********************************************************* - Begin SA calculation Gromacs-style - ********************************************************* - ********************************************************* - ********************************************************* - ********************************************************* - *********************************************************/ - - /* First set up the individual areas */ - for(n=0;nradius[atoms->atom[n].type]; - born->asurf[n]=(4*M_PI*(rn+radp)*(rn+radp)); - } - - /* Then loop over the bonded interactions */ - for(i=0;iatomname[ai])) && - !is_hydrogen(*(atoms->atomname[aj]))) - { - - /*printf("genborn.c: xi=%g, xj=%g\n",factor*x[ai][0],factor*x[aj][0]); */ - - rvec_sub(x[ai],x[aj],dxx); - dr2 = iprod(dxx,dxx); - - sar = forceparams[type].gb.sar; - bmlt = forceparams[type].gb.bmlt; - rni = sar+probd; - - rn = atype->radius[atoms->atom[ai].type]; - ri = atype->radius[atoms->atom[aj].type]; - pn = atype->surftens[atoms->atom[ai].type]; - pi = atype->surftens[atoms->atom[aj].type]; - /*sn = atype->vol[atoms->atom[ai].type]; */ - /*si = atype->vol[atoms->atom[aj].type]; */ - - /*rni = rn + ri +probd; */ - /*printf("genborn.c: rn=%g, ri=%g\n",ri,rn); */ - if(dr2asurf[ai] = born->asurf[ai]*(1-tij); - born->asurf[aj] = born->asurf[aj]*(1-tji); - } - } - } - - /* Now loop over interactions >= 1-4 */ - bmlt=0.3516; - - /*printf("NONBONDED INTERACTIONS\n");*/ - - for(i=0;ijindex[ai]; - nj1 = nl->jindex[ai+1]; - - rai = factor*atype->radius[atoms->atom[ai].type]; - pn = atype->surftens[atoms->atom[ai].type]; - /*sn = atype->vol[atoms->atom[ai].type];*/ - - for(k=nj0;kjjnr[k]; - - if(!is_hydrogen(*(atoms->atomname[ai])) && - !is_hydrogen(*(atoms->atomname[aj]))) - { - raj = factor*atype->radius[atoms->atom[aj].type]; - pi = atype->surftens[atoms->atom[aj].type]; - /*si = atype->vol[atoms->atom[aj].type];*/ - rvec_sub(x[ai],x[aj],dxx); - - dr2 = factor*factor*iprod(dxx,dxx); - rni = rai + raj + probd; - /*printf("genborn.c: rn=%g, ri=%g, sar=%g, dr2=%g\n",rai,raj,sar,dr2); */ - /*printf("genborn.c: xi=%g, xj=%g\n",factor*x[ai][0],factor*x[aj][0]); */ - - if(dr2asurf[ai]=born->asurf[ai]*(1-tij); - born->asurf[aj]=born->asurf[aj]*(1-tji); - } - } - } - } - /* - printf("AFTER BOTH AREA CALCULATIONS\n"); - n=0; - for(i=0;iatomname[i])) - { - printf("%d, Still=%g, gromacs=%g\n",n,born->asurf[i], born->asurf[i]); - - born->as=born->as+born->asurf[i]; - born->as=born->as+born->asurf[i]; - } - n++; - } - */ - /*printf("Total Still area=%g, Total new area=%g\n",born->as, born->as);*/ - /*printf("nbonds=%d\n",nbonds);*/ - /* Start to calculate the forces */ - for(i=0;iatomname[ai])) && - !is_hydrogen(*(atoms->atomname[aj]))) - { - rvec_sub(x[ai],x[aj],dxx); - - dr2 = factor*factor*iprod(dxx,dxx); - - sar = factor*forceparams[type].gb.sar; - bmlt = forceparams[type].gb.bmlt; - rni = sar+probd; - - rn = factor*atype->radius[atoms->atom[ai].type]; - ri = factor*atype->radius[atoms->atom[aj].type]; - pn = atype->surftens[atoms->atom[ai].type]; - pi = atype->surftens[atoms->atom[aj].type]; - sn = atype->vol[atoms->atom[ai].type]; - si = atype->vol[atoms->atom[aj].type]; - - if(dr2asurf[ai]*dbij; - t4ij = (4*M_PI*(rn+radp)*(rn+radp))/(pn*bmlt)-bij; - t5ij = t3ij/t4ij; - - t3ji = si*born->asurf[aj]*dbji; - t4ji = (4*M_PI*(ri+radp)*(ri+radp))/(pi*bmlt)-bji; - t5ji = t3ji/t4ji; - - dpf = (t5ij+t5ji)/(dr2*dist); - /*printf("deriv_cut: ai=%d, xi=%g aj=%d, xj=%g\n",ai,x[ai][0], aj,x[aj][0]);*/ - for(k=0;k= 1-4 */ - bmlt = 0.3516; - - for(i=0;ijindex[ai]; - nj1 = nl->jindex[ai+1]; - - rai = factor*atype->radius[atoms->atom[ai].type]; - pn = atype->surftens[atoms->atom[ai].type]; - sn = atype->vol[atoms->atom[ai].type]; - - for(k=nj0;kjjnr[k]; - - if(!is_hydrogen(*(atoms->atomname[ai])) && - !is_hydrogen(*(atoms->atomname[aj]))) - { - raj = factor*atype->radius[atoms->atom[aj].type]; - pi = atype->surftens[atoms->atom[aj].type]; - si = atype->vol[atoms->atom[aj].type]; - - rvec_sub(x[ai],x[aj],dxx); - - dr2 = factor*factor*iprod(dxx,dxx); - rni = rai + raj + probd; - - if(dr2asurf[ai]*dbij; - t4ij = (4*M_PI*(rai+radp)*(rai+radp))/(pn*bmlt)-bij; - t5ij = t3ij/t4ij; - - t3ji = si*born->asurf[aj]*dbji; - t4ji = (4*M_PI*(raj+radp)*(raj+radp))/(pi*bmlt)-bji; - t5ji = t3ji/t4ji; - - dpf = (t5ij+t5ji)/(dr2*dist); - /*printf("deriv_cut: ai=%d, xi=%g aj=%d, xj=%g\n",ai,x[ai][0], aj,x[aj][0]);*/ - for(n=0;natomname[i])) - { - printf("%d, gx=%g, gy=%g, gz=%g\n", - n, - faction[i*3], - faction[i*3+1], - faction[i*3+2], - f[i][0], - f[i][1], - f[i][2]); - } - n++; - } - */ - return 0; -} - -int calc_surfBrooks(t_inputrec *ir, - t_idef *idef, - t_atoms *atoms, - rvec x[], - gmx_genborn_t *born, - t_atomtypes *atype, - double *faction, - int natoms) -{ - int i,j,k; - real xi,yi,zi,dx,dy,dz,ri,rj; - real rho,rho2,rho6,r2,r,aij,aijsum,daij; - real kappa,sassum,tx,ty,tz,fix1,fiy1,fiz1; - - real ck[5]; - real *Aij; - real *sasi; - - Aij = born->work; - sasi = born->work; - - /* Brooks parameter for cutoff between atom pairs - * Increasing kappa will increase the number of atom pairs - * included in the calculation, which will also slow the calculation - */ - kappa=0; - - sassum=0; - - /* Hydrogen atoms are included in via the ck parameters for the - * heavy atoms - */ - for(i=0;iatomname[i],"H",1)!=0) */ - /*{ */ - xi=x[i][0]; - yi=x[i][1]; - zi=x[i][2]; - - fix1=0; - fiy1=0; - fiz1=0; - - ri=atype->radius[atoms->atom[i].type]; - aijsum=0; - - for(j=0;jatomname[j],"H",1)!=0 && i!=j) */ - if(i!=j) - { - dx=xi-x[j][0]; - dy=yi-x[j][1]; - dz=zi-x[j][2]; - - r2=dx*dx+dy*dy+dz*dz; - r=sqrt(r2); - rj=atype->radius[atoms->atom[j].type]; - - rho=ri+rj+kappa; - rho2=rho*rho; - rho6=rho2*rho2*rho2; - - /* Cutoff test */ - if(r<=rho) - { - aij=pow((rho2-r2)*(rho2+2*r2),2)/rho6; - daij=((4*r*(rho2-r2)*(rho2-r2))/rho6)-((4*r*(rho2-r2)*(2*r2+rho2))/rho6); - tx=daij*dx; - ty=daij*dy; - tz=daij*dz; - - fix1=fix1+tx; - fiy1=fiy1+ty; - fiz1=fiz1+tz; - - faction[j*3]=faction[j*3]-tx; - faction[j*3+1]=faction[j*3+1]-ty; - faction[j*3+2]=faction[j*3+2]-tz; - - aijsum=aijsum+aij; - printf("xi=%g, xj=%g, fscal=%g\n",xi,x[j][0],daij); - } - } - } - - faction[i*3]=faction[i*3]+fix1; - faction[i*3+1]=faction[i*3+1]+fiy1; - faction[i*3+2]=faction[i*3+2]+fiz1; - - /* Calculate surface area coefficient */ - Aij[i]=pow(aijsum,1/4); - - for(k=0;k<5;k++) - { - sasi[i]=sasi[i]+ck[k]*(pow(Aij[i],k)); - } - - /* Increase total surface area */ - sassum=sassum+sasi[i]; - - /*}*/ - } - - printf("Brooks total surface area is: %g\n", sassum); - - - return 0; -} - int make_gb_nblist(t_commrec *cr, int natoms, int gb_algorithm, real gbcut, rvec x[], t_forcerec *fr, t_idef *idef, gmx_genborn_t *born) { -- 2.11.4.GIT