Changeset e7678b2 in sasmodels for sasmodels/models/core_shell_ellipsoid_xt.c
- Timestamp:
- Feb 29, 2016 6: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_xt.c
r81bb668 re7678b2 30 30 double x_polar_shell) 31 31 { 32 double equat_shell, polar_shell; 33 equat_shell = equat_core + t_shell; 34 polar_shell = equat_core*x_core + t_shell*x_polar_shell; 32 const double equat_shell = equat_core + t_shell; 33 const double polar_shell = equat_core*x_core + t_shell*x_polar_shell; 35 34 double vol = 4.0*M_PI/3.0*equat_shell*equat_shell*polar_shell; 36 35 return vol; … … 47 46 double solvent_sld) 48 47 { 49 double delpc,delps; 50 double uplim,lolim; //upper and lower integration limits 51 double summ,zi,yyy,answer; //running tally of integration 52 double polar_core, equat_shell, polar_shell; 48 const double lolim = 0.0; 49 const double uplim = 1.0; 53 50 54 lolim = 0.0; 55 uplim = 1.0; 51 double summ = 0.0; //initialize intergral 56 52 57 summ = 0.0; //initialize intergral 58 59 delpc = core_sld - shell_sld; //core - shell 60 delps = shell_sld - solvent_sld; //shell - solvent 53 const double delpc = core_sld - shell_sld; //core - shell 54 const double delps = shell_sld - solvent_sld; //shell - solvent 61 55 62 56 63 polar_core = equat_core*x_core;64 equat_shell = equat_core + t_shell;65 polar_shell = equat_core*x_core + t_shell*x_polar_shell;57 const double polar_core = equat_core*x_core; 58 const double equat_shell = equat_core + t_shell; 59 const double polar_shell = equat_core*x_core + t_shell*x_polar_shell; 66 60 67 for(int i=0;i<76;i++) {68 69 70 61 for(int i=0;i<N_POINTS_76;i++) { 62 double zi = ( Gauss76Z[i]*(uplim-lolim) + uplim + lolim )/2.0; 63 double yyy = Gauss76Wt[i] * gfn4(zi, 64 equat_core, 71 65 polar_core, 72 66 equat_shell, 73 67 polar_shell, 74 75 76 77 78 68 delpc, 69 delps, 70 q); 71 summ += yyy; 72 } 79 73 80 answer = (uplim-lolim)/2.0*summ; 74 double answer = (uplim-lolim)/2.0*summ; 75 //convert to [cm-1] 76 answer *= 1.0e-4; 81 77 82 //convert to [cm-1] 83 answer *= 1.0e-4; 84 85 return answer; 78 return answer; 86 79 } 87 80 … … 98 91 double phi) 99 92 { 100 double cyl_x, cyl_y;101 double cos_val;102 double answer;103 double sldcs,sldss;104 double polar_core, equat_shell, polar_shell;105 106 93 //convert angle degree to radian 107 theta = theta * M_PI/180.0; 108 phi = phi * M_PI/180.0; 109 94 theta = theta * M_PI_180; 95 phi = phi * M_PI_180; 110 96 111 97 // ellipsoid orientation, the axis of the rotation is consistent with the ploar axis. 112 c yl_x = cos(theta) * cos(phi);113 c yl_y = sin(theta);98 const double cyl_x = cos(theta) * cos(phi); 99 const double cyl_y = sin(theta); 114 100 115 sldcs = core_sld - shell_sld;116 sldss = shell_sld- solvent_sld;101 const double sldcs = core_sld - shell_sld; 102 const double sldss = shell_sld- solvent_sld; 117 103 118 104 // Compute the angle btw vector q and the 119 105 // axis of the cylinder 120 co s_val = cyl_x*q_x + cyl_y*q_y;106 const double cos_val = cyl_x*q_x + cyl_y*q_y; 121 107 122 polar_core = equat_core*x_core;123 equat_shell = equat_core + t_shell;124 polar_shell = equat_core*x_core + t_shell*x_polar_shell;108 const double polar_core = equat_core*x_core; 109 const double equat_shell = equat_core + t_shell; 110 const double polar_shell = equat_core*x_core + t_shell*x_polar_shell; 125 111 126 112 // Call the IGOR library function to get the kernel: 127 113 // MUST use gfn4 not gf2 because of the def of params. 128 answer = gfn4(cos_val,114 double answer = gfn4(cos_val, 129 115 equat_core, 130 116 polar_core,
Note: See TracChangeset
for help on using the changeset viewer.