Ignore:
Timestamp:
Aug 25, 2009 3:31:36 PM (15 years ago)
Author:
Jae Cho <jhjcho@…>
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
Message:

fixed a mistake and changed a para_name

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  
    1818double hollow_cylinder_analytical_1D(HollowCylinderParameters *pars, double q) { 
    1919        double dp[6]; 
    20          
     20 
    2121        dp[0] = pars->scale; 
    2222        dp[1] = pars->core_radius; 
    23         dp[2] = pars->shell_radius; 
     23        dp[2] = pars->radius; 
    2424        dp[3] = pars->length; 
    2525        dp[4] = pars->contrast; 
    2626        dp[5] = pars->background; 
    27          
     27 
    2828        return HollowCylinder(dp, q); 
    2929} 
    30      
     30 
    3131/** 
    3232 * Function to evaluate 2D scattering function 
     
    3939        q = sqrt(qx*qx+qy*qy); 
    4040    return hollow_cylinder_analytical_2D_scaled(pars, q, qx/q, qy/q); 
    41 }  
     41} 
    4242 
    4343/** 
     
    5050double hollow_cylinder_analytical_2D(HollowCylinderParameters *pars, double q, double phi) { 
    5151    return hollow_cylinder_analytical_2D_scaled(pars, q, cos(phi), sin(phi)); 
    52 }  
     52} 
    5353 
    5454/** 
     
    6565        double  alpha,vol, cos_val; 
    6666        double answer; 
    67          
     67 
    6868    // Cylinder orientation 
    6969    cyl_x = sin(pars->axis_theta) * cos(pars->axis_phi); 
    7070    cyl_y = sin(pars->axis_theta) * sin(pars->axis_phi); 
    7171    cyl_z = cos(pars->axis_theta); 
    72       
     72 
    7373    // q vector 
    7474    q_z = 0; 
    75          
     75 
    7676    // Compute the angle btw vector q and the 
    7777    // axis of the cylinder 
    7878    cos_val = cyl_x*q_x + cyl_y*q_y + cyl_z*q_z; 
    79      
     79 
    8080    // The following test should always pass 
    8181    if (fabs(cos_val)>1.0) { 
     
    8383        return 0; 
    8484    } 
    85      
     85 
    8686        alpha = acos( cos_val ); 
    87          
     87 
    8888        // 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 
    9191        //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)) 
    9393                        *(pars->length); 
    9494        answer /= vol; 
    95          
     95 
    9696        //convert to [cm-1] 
    9797        answer *= 1.0e8; 
    98          
     98 
    9999        //Scale 
    100100        answer *= pars->scale; 
    101          
     101 
    102102        // add in the background 
    103103        answer += pars->background; 
    104          
     104 
    105105        return answer; 
    106106} 
  • sansmodels/src/sans/models/c_extensions/hollow_cylinder.h

    r27fea3f re2afadf  
    66 */ 
    77 //[PYTHONCLASS] = HollowCylinderModel 
    8  //[DISP_PARAMS] = core_radius, shell_radius, length, axis_theta, axis_phi 
     8 //[DISP_PARAMS] = core_radius, radius, length, axis_theta, axis_phi 
    99 //[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> 
    1111 //[ORIENTATION_PARAMS]= axis_phi; axis_theta;axis_phi.width; axis_theta.width 
    1212 
     
    2222 
    2323    /// Shell radius [A] 
    24     //  [DEFAULT]=shell_radius=30.0 [A] 
    25     double shell_radius; 
     24    //  [DEFAULT]=radius=30.0 [A] 
     25    double radius; 
    2626 
    2727    /// Hollow cylinder length [A] 
  • sansmodels/src/sans/models/c_extensions/vesicle.c

    r3d25331f re2afadf  
    1717double vesicle_analytical_1D(VesicleParameters *pars, double q) { 
    1818        double dp[6]; 
    19          
     19 
    2020        dp[0] = pars->scale; 
    21         dp[1] = pars->core_radius; 
     21        dp[1] = pars->radius; 
    2222        dp[2] = pars->thickness; 
    2323        dp[3] = pars->core_sld; 
     
    2525        dp[5] = pars->background; 
    2626 
    27          
     27 
    2828        return VesicleForm(dp, q); 
    2929} 
    30      
     30 
    3131/** 
    3232 * Function to evaluate 2D scattering function 
     
    4040 
    4141double 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)); 
    4343} 
  • sansmodels/src/sans/models/c_extensions/vesicle.h

    r42f193a re2afadf  
    55 * Structure definition for vesicle parameters 
    66[PYTHONCLASS] = VesicleModel 
    7 [DISP_PARAMS] = core_radius,thickness 
    8 [DESCRIPTION] =<text>Model parameters:  core_radius : Core radius of the vesicle 
     7[DISP_PARAMS] = radius,thickness 
     8[DESCRIPTION] =<text>Model parameters:  radius : core radius of the vesicle 
    99                thickness: shell thickness 
    1010                core_sld: core scattering length density 
     
    1313                scale : scale factor 
    1414</text> 
    15 [FIXED]=  core_radius.width; thickness.width 
     15[FIXED]=  radius.width; thickness.width 
    1616[ORIENTATION_PARAMS]= <text> </text> 
    1717 */ 
     
    2222 
    2323    /// 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; 
    2626 
    2727        ///     shell thickness [Å] 
Note: See TracChangeset for help on using the changeset viewer.