Changeset 71b751d in sasmodels for sasmodels/models/binary_hard_sphere.c
- Timestamp:
- Aug 14, 2018 10:09:34 AM (6 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 86aa992
- Parents:
- 2f8cbb9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/binary_hard_sphere.c
r925ad6e r71b751d 1 1 double form_volume(void); 2 2 3 double Iq(double q, 3 double Iq(double q, 4 4 double lg_radius, double sm_radius, 5 5 double lg_vol_frac, double sm_vol_frac, 6 6 double lg_sld, double sm_sld, double solvent_sld 7 7 ); 8 8 9 9 void calculate_psfs(double qval, 10 10 double r2, double nf2, … … 22 22 double lg_vol_frac, double sm_vol_frac, 23 23 double lg_sld, double sm_sld, double solvent_sld) 24 25 24 { 26 25 double r2,r1,nf2,phi,aa,rho2,rho1,rhos,inten; //my local names … … 28 27 double phi1,phi2,phr,a3; 29 28 double v1,v2,n1,n2,qr1,qr2,b1,b2,sc1,sc2; 30 29 31 30 r2 = lg_radius; 32 31 r1 = sm_radius; … … 36 35 rho1 = sm_sld; 37 36 rhos = solvent_sld; 38 39 37 38 40 39 phi = phi1 + phi2; 41 40 aa = r1/r2; … … 46 45 // calculate the PSF's here 47 46 calculate_psfs(q,r2,nf2,aa,phi,&psf11,&psf22,&psf12); 48 47 49 48 // /* do form factor calculations */ 50 49 51 50 v1 = M_4PI_3*r1*r1*r1; 52 51 v2 = M_4PI_3*r2*r2*r2; 53 52 54 53 n1 = phi1/v1; 55 54 n2 = phi2/v2; 56 55 57 56 qr1 = r1*q; 58 57 qr2 = r2*q; … … 68 67 inten *= 1.0e8; 69 68 ///*convert rho^2 in 10^-6A to A*/ 70 inten *= 1.0e-12; 69 inten *= 1.0e-12; 71 70 return(inten); 72 71 } … … 77 76 double aa, double phi, 78 77 double *s11, double *s22, double *s12) 79 80 78 { 81 79 // variable qval,r2,nf2,aa,phi,&s11,&s22,&s12 82 80 83 81 // calculate constant terms 84 82 double s2,v,a3,v1,v2,g11,g12,g22,wmv,wmv3,wmv4; … … 87 85 double c11,c22,c12,f12,f22,ttt1,ttt2,ttt3,ttt4,yl,y13; 88 86 double t21,t22,t23,t31,t32,t33,t41,t42,yl3,wma3,y1; 89 87 90 88 s2 = 2.0*r2; 91 89 // s1 = aa*s2; why is this never used? check original paper? … … 108 106 gm1=(v1*a1+a3*v2*a2)*.5; 109 107 gm12=2.*gm1*(1.-aa)/aa; 110 //c 108 //c 111 109 //c calculate the direct correlation functions and print results 112 110 //c 113 111 // do 20 j=1,npts 114 112 115 113 yy=qval*s2; 116 114 //c calculate direct correlation functions … … 123 121 t3=gm1*((4.*ay*ay2-24.*ay)*sin(ay)-(ay2*ay2-12.*ay2+24.)*cos(ay)+24.)/ay3; 124 122 f11=24.*v1*(t1+t2+t3)/ay3; 125 123 126 124 //c ------c22 127 125 y2=yy*yy; … … 131 129 tt3=gm1*((4.*y3-24.*yy)*sin(yy)-(y2*y2-12.*y2+24.)*cos(yy)+24.)/ay3; 132 130 f22=24.*v2*(tt1+tt2+tt3)/y3; 133 131 134 132 //c -----c12 135 133 yl=.5*yy*(1.-aa); … … 151 149 ttt4=a1*(t41+t42)/y1; 152 150 f12=ttt1+24.*v*sqrt(nf2)*sqrt(1.-nf2)*a3*(ttt2+ttt3+ttt4)/(nf2+(1.-nf2)*a3); 153 151 154 152 c11=f11; 155 153 c22=f22; 156 154 c12=f12; 157 155 *s11=1./(1.+c11-(c12)*c12/(1.+c22)); 158 *s22=1./(1.+c22-(c12)*c12/(1.+c11)); 159 *s12=-c12/((1.+c11)*(1.+c22)-(c12)*(c12)); 160 156 *s22=1./(1.+c22-(c12)*c12/(1.+c11)); 157 *s12=-c12/((1.+c11)*(1.+c22)-(c12)*(c12)); 158 161 159 return; 162 160 } 163
Note: See TracChangeset
for help on using the changeset viewer.