Ignore:
Timestamp:
Aug 25, 2009 1: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

File:
1 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} 
Note: See TracChangeset for help on using the changeset viewer.