Changeset e2afadf in sasview for sansmodels/src/sans/models/c_extensions
- Timestamp:
- Aug 25, 2009 3:31:36 PM (15 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- ff85cc5
- Parents:
- c8727c5
- Location:
- sansmodels/src/sans/models/c_extensions
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/c_extensions/hollow_cylinder.c
r27fea3f re2afadf 18 18 double hollow_cylinder_analytical_1D(HollowCylinderParameters *pars, double q) { 19 19 double dp[6]; 20 20 21 21 dp[0] = pars->scale; 22 22 dp[1] = pars->core_radius; 23 dp[2] = pars-> shell_radius;23 dp[2] = pars->radius; 24 24 dp[3] = pars->length; 25 25 dp[4] = pars->contrast; 26 26 dp[5] = pars->background; 27 27 28 28 return HollowCylinder(dp, q); 29 29 } 30 30 31 31 /** 32 32 * Function to evaluate 2D scattering function … … 39 39 q = sqrt(qx*qx+qy*qy); 40 40 return hollow_cylinder_analytical_2D_scaled(pars, q, qx/q, qy/q); 41 } 41 } 42 42 43 43 /** … … 50 50 double hollow_cylinder_analytical_2D(HollowCylinderParameters *pars, double q, double phi) { 51 51 return hollow_cylinder_analytical_2D_scaled(pars, q, cos(phi), sin(phi)); 52 } 52 } 53 53 54 54 /** … … 65 65 double alpha,vol, cos_val; 66 66 double answer; 67 67 68 68 // Cylinder orientation 69 69 cyl_x = sin(pars->axis_theta) * cos(pars->axis_phi); 70 70 cyl_y = sin(pars->axis_theta) * sin(pars->axis_phi); 71 71 cyl_z = cos(pars->axis_theta); 72 72 73 73 // q vector 74 74 q_z = 0; 75 75 76 76 // Compute the angle btw vector q and the 77 77 // axis of the cylinder 78 78 cos_val = cyl_x*q_x + cyl_y*q_y + cyl_z*q_z; 79 79 80 80 // The following test should always pass 81 81 if (fabs(cos_val)>1.0) { … … 83 83 return 0; 84 84 } 85 85 86 86 alpha = acos( cos_val ); 87 87 88 88 // Call the IGOR library function to get the kernel 89 answer = HolCylKernel(q, pars->core_radius, pars-> shell_radius, pars->length, cos_val);90 89 answer = HolCylKernel(q, pars->core_radius, pars->radius, pars->length, cos_val); 90 91 91 //normalize by cylinder volume 92 vol=acos(-1.0)*((pars->core_radius *pars->core_radius)-(pars-> shell_radius*pars->shell_radius))92 vol=acos(-1.0)*((pars->core_radius *pars->core_radius)-(pars->radius*pars->radius)) 93 93 *(pars->length); 94 94 answer /= vol; 95 95 96 96 //convert to [cm-1] 97 97 answer *= 1.0e8; 98 98 99 99 //Scale 100 100 answer *= pars->scale; 101 101 102 102 // add in the background 103 103 answer += pars->background; 104 104 105 105 return answer; 106 106 } -
sansmodels/src/sans/models/c_extensions/hollow_cylinder.h
r27fea3f re2afadf 6 6 */ 7 7 //[PYTHONCLASS] = HollowCylinderModel 8 //[DISP_PARAMS] = core_radius, shell_radius, length, axis_theta, axis_phi8 //[DISP_PARAMS] = core_radius, radius, length, axis_theta, axis_phi 9 9 //[DESCRIPTION] = <text></text> 10 //[FIXED]= <text> axis_phi.width; axis_theta.width; length.width;core_radius.width; shell_radius</text>10 //[FIXED]= <text> axis_phi.width; axis_theta.width; length.width;core_radius.width; radius</text> 11 11 //[ORIENTATION_PARAMS]= axis_phi; axis_theta;axis_phi.width; axis_theta.width 12 12 … … 22 22 23 23 /// Shell radius [A] 24 // [DEFAULT]= shell_radius=30.0 [A]25 double shell_radius;24 // [DEFAULT]=radius=30.0 [A] 25 double radius; 26 26 27 27 /// Hollow cylinder length [A] -
sansmodels/src/sans/models/c_extensions/vesicle.c
r3d25331f re2afadf 17 17 double vesicle_analytical_1D(VesicleParameters *pars, double q) { 18 18 double dp[6]; 19 19 20 20 dp[0] = pars->scale; 21 dp[1] = pars-> core_radius;21 dp[1] = pars->radius; 22 22 dp[2] = pars->thickness; 23 23 dp[3] = pars->core_sld; … … 25 25 dp[5] = pars->background; 26 26 27 27 28 28 return VesicleForm(dp, q); 29 29 } 30 30 31 31 /** 32 32 * Function to evaluate 2D scattering function … … 40 40 41 41 double vesicle_analytical_2DXY(VesicleParameters *pars, double qx, double qy){ 42 return vesicle_analytical_1D(pars,sqrt(qx*qx+qy*qy)); 42 return vesicle_analytical_1D(pars,sqrt(qx*qx+qy*qy)); 43 43 } -
sansmodels/src/sans/models/c_extensions/vesicle.h
r42f193a re2afadf 5 5 * Structure definition for vesicle parameters 6 6 [PYTHONCLASS] = VesicleModel 7 [DISP_PARAMS] = core_radius,thickness8 [DESCRIPTION] =<text>Model parameters: core_radius : Core radius of the vesicle7 [DISP_PARAMS] = radius,thickness 8 [DESCRIPTION] =<text>Model parameters: radius : core radius of the vesicle 9 9 thickness: shell thickness 10 10 core_sld: core scattering length density … … 13 13 scale : scale factor 14 14 </text> 15 [FIXED]= core_radius.width; thickness.width15 [FIXED]= radius.width; thickness.width 16 16 [ORIENTATION_PARAMS]= <text> </text> 17 17 */ … … 22 22 23 23 /// Core radius of the vesicle [A] 24 // [DEFAULT]= core_radius= 100.0 [A]25 double core_radius;24 // [DEFAULT]=radius= 100.0 [A] 25 double radius; 26 26 27 27 /// shell thickness [Å]
Note: See TracChangeset
for help on using the changeset viewer.