Changeset e7678b2 in sasmodels for sasmodels/models/core_shell_ellipsoid.c
- Timestamp:
- Feb 29, 2016 8:21:55 AM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 73860b6
- Parents:
- deac08c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_shell_ellipsoid.c
r81dd619 re7678b2 44 44 double solvent_sld) 45 45 { 46 double delpc,delps;47 double uplim,lolim; //upper and lower integration limits48 double summ,zi,yyy,answer; //running tally of integration49 46 50 lolim = 0.0; 51 uplim = 1.0; 47 //upper and lower integration limits 48 const double lolim = 0.0; 49 const double uplim = 1.0; 52 50 53 51 double summ = 0.0; //initialize intergral 54 52 55 delpc = core_sld - shell_sld;//core - shell56 53 const double delpc = core_sld - shell_sld; //core - shell 54 const double delps = shell_sld - solvent_sld; //shell - solvent 57 55 58 for(int i=0;i<76;i++) {59 60 61 62 63 64 65 66 67 68 69 56 for(int i=0;i<N_POINTS_76;i++) { 57 double zi = ( Gauss76Z[i]*(uplim-lolim) + uplim + lolim )/2.0; 58 double yyy = Gauss76Wt[i] * gfn4(zi, 59 equat_core, 60 polar_core, 61 equat_shell, 62 polar_shell, 63 delpc, 64 delps, 65 q); 66 summ += yyy; 67 } 70 68 71 69 double answer = (uplim-lolim)/2.0*summ; 72 70 73 74 71 //convert to [cm-1] 72 answer *= 1.0e-4; 75 73 76 74 return answer; 77 75 } 78 76 … … 89 87 double phi) 90 88 { 91 double cyl_x, cyl_y;92 double cos_val;93 double answer;94 double sldcs,sldss;95 96 89 //convert angle degree to radian 97 theta = theta * M_PI /180.0;98 phi = phi * M_PI /180.0;90 theta = theta * M_PI_180; 91 phi = phi * M_PI_180; 99 92 100 93 101 94 // ellipsoid orientation, the axis of the rotation is consistent with the ploar axis. 102 c yl_x = cos(theta) * cos(phi);103 c yl_y = sin(theta);95 const double cyl_x = cos(theta) * cos(phi); 96 const double cyl_y = sin(theta); 104 97 105 sldcs = core_sld - shell_sld;106 sldss = shell_sld- solvent_sld;98 const double sldcs = core_sld - shell_sld; 99 const double sldss = shell_sld- solvent_sld; 107 100 108 101 // Compute the angle btw vector q and the 109 102 // axis of the cylinder 110 co s_val = cyl_x*q_x + cyl_y*q_y;103 const double cos_val = cyl_x*q_x + cyl_y*q_y; 111 104 112 105 // Call the IGOR library function to get the kernel: MUST use gfn4 not gf2 because of the def of params. 113 answer = gfn4(cos_val,106 double answer = gfn4(cos_val, 114 107 equat_core, 115 108 polar_core,
Note: See TracChangeset
for help on using the changeset viewer.