Changeset 2de9a5e in sasmodels for Kernel-CoreShellCylinder.cpp
- Timestamp:
- Jul 11, 2014 2:47:47 PM (10 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:
- be5d7df
- Parents:
- 8faffcd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Kernel-CoreShellCylinder.cpp
r8faffcd r2de9a5e 11 11 float pi = 4.0*atan(1.0); 12 12 float theta = axis_theta*pi/180.0; 13 float phi = axis_phi*pi/180.0; 14 float cyl_x = cos(theta)*cos(phi); 13 float cyl_x = cos(theta)*cos(axis_phi*pi/180.0); 15 14 float cyl_y = sin(theta); 16 float cos_val = cyl_x*qx[i]/q + cyl_y*qx[i]/q; 17 float alpha = acos(cos_val); 15 float alpha = acos(cyl_x*qx[i]/q + cyl_y*qx[i]/q); 18 16 19 17 if (alpha == 0.0){ … … 23 21 float si1=0; float si2=0; float be1=0; float be2=0; 24 22 25 float dr1 = core_sld-shell_sld;26 float dr2 = shell_sld-solvent_sld;27 float vol1 = pi*radius*radius*(length);28 23 float vol2 = pi*(radius+thickness)*(radius+thickness)*(length+2.0*thickness); 29 24 … … 54 49 si2 = sin(sinarg2)/sinarg2; 55 50 } 51 float tt = 2.0*vol2*(shell_sld-solvent_sld)*si2*be2 + 2.0*(pi*radius*radius*(length))*(core_sld-shell_sld)*si1*be1; 56 52 57 float t1 = 2.0*vol1*dr1*si1*be1; 58 float t2 = 2.0*vol2*dr2*si2*be2; 59 60 float answer = ((t1+t2)*(t1+t2))*sin(alpha)/fabs(sin(alpha)); 53 float answer = (tt*tt)*sin(alpha)/fabs(sin(alpha)); 61 54 float vol=pi*(radius+thickness)*(radius+thickness)*(length+2.0*thickness); 62 55 answer = answer/vol*1.0e8*scale;
Note: See TracChangeset
for help on using the changeset viewer.