Changeset 2cb89e7 in sasview for sansmodels/src/sans/models/c_extensions
- Timestamp:
- Aug 16, 2009 12:30:27 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:
- 7d11b81
- Parents:
- b0d0723
- Location:
- sansmodels/src/sans/models/c_extensions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/c_extensions/parallelepiped.c
rd5bd424 r2cb89e7 22 22 // Fill paramater array 23 23 dp[0] = pars->scale; 24 dp[1] = pars->short_ edgeA;25 dp[2] = pars->long er_edgeB;26 dp[3] = pars->long uest_edgeC;24 dp[1] = pars->short_a; 25 dp[2] = pars->long_b; 26 dp[3] = pars->longer_c; 27 27 dp[4] = pars->contrast; 28 28 dp[5] = pars->background; … … 38 38 39 39 //handle arg=0 separately, as sin(t)/t -> 1 as t->0 40 argA = a*ala ;41 argB = b*alb ;42 argC = c*alc ;40 argA = a*ala/2; 41 argB = b*alb/2; 42 argC = c*alc/2; 43 43 if(argA==0.0) { 44 44 tmp1 = 1.0; … … 105 105 double pi = 4.0*atan(1.0); 106 106 107 edgeA = pars->short_ edgeA;108 edgeB = pars->long er_edgeB;109 edgeC = pars->long uest_edgeC;107 edgeA = pars->short_a; 108 edgeB = pars->long_b; 109 edgeC = pars->longer_c; 110 110 111 111 … … 152 152 //normalize by cylinder volume 153 153 //NOTE that for this (Fournet) definition of the integral, one must MULTIPLY by Vparallel 154 vol = 8*edgeA* edgeB * edgeC;154 vol = edgeA* edgeB * edgeC; 155 155 answer *= vol; 156 156 -
sansmodels/src/sans/models/c_extensions/parallelepiped.h
r975ec8e r2cb89e7 7 7 /** Structure definition for Parallelepiped parameters 8 8 * [PYTHONCLASS] = ParallelepipedModel 9 * [DISP_PARAMS] = short_ edgeA, longer_edgeB, longuest_edgeC,parallel_phi,parallel_psi, parallel_theta10 [DESCRIPTION] = <text> Calculates the form factor for a rectangular solid with uniform scattering length density.9 * [DISP_PARAMS] = short_a, long_b, longer_c,parallel_phi,parallel_psi, parallel_theta 10 [DESCRIPTION] = <text> Form factor for a rectangular solid with uniform scattering length density. 11 11 12 12 scale:Scale factor 13 short_ edgeA: Shortest edge of the parallelepiped [A]14 long er_edgeB: Longer edge of the parallelepiped [A]15 long uest_edgeC: Longuest edge of the parallelepiped [A]16 con strast: particle_sld - solvent_sld13 short_a: length of short side of the parallelepiped [A] 14 long_b: length of long side of the parallelepiped [A] 15 longer_c: length of longer side of the parallelepiped [A] 16 contrast: particle_sld - solvent_sld 17 17 background:Incoherent Background [1/cm] 18 18 </text> 19 [FIXED]= <text>short_ edgeA.width; longer_edgeB.width; longuest_edgeC.width;parallel_phi.width;parallel_psi.width; parallel_theta.width</text>19 [FIXED]= <text>short_a.width; long_b.width; longer_c.width;parallel_phi.width;parallel_psi.width; parallel_theta.width</text> 20 20 [ORIENTATION_PARAMS]= <text>parallel_phi;parallel_psi; parallel_theta; parallel_phi.width;parallel_psi.width; parallel_theta.width</text> 21 21 … … 26 26 // [DEFAULT]=scale=1.0 27 27 double scale; 28 /// Shortest edge of the parallelepiped [A]29 // [DEFAULT]=short_ edgeA=35 [A]30 double short_ edgeA;31 /// L ongeredge of the parallelepiped [A]32 // [DEFAULT]=long er_edgeB=75 [A]33 double long er_edgeB;34 /// L onguest edge of the parallelepiped [A]35 // [DEFAULT]=long uest_edgeC=400 [A]36 double long uest_edgeC;28 /// Length of short side of the parallelepiped [A] 29 // [DEFAULT]=short_a=35 [A] 30 double short_a; 31 /// Length of long side edge of the parallelepiped [A] 32 // [DEFAULT]=long_b=75 [A] 33 double long_b; 34 /// Length of longer side of the parallelepiped [A] 35 // [DEFAULT]=longer_c=400 [A] 36 double longer_c; 37 37 /// Contrast [1/A²] 38 38 // [DEFAULT]=contrast=5.3e-6 [1/A²]
Note: See TracChangeset
for help on using the changeset viewer.