Ignore:
Timestamp:
Feb 29, 2016 8:21:55 AM (8 years ago)
Author:
piotr
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:
73860b6
Parents:
deac08c
Message:

Code review from PAK

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/core_shell_ellipsoid.c

    r81dd619 re7678b2  
    4444          double solvent_sld) 
    4545{ 
    46         double delpc,delps; 
    47         double uplim,lolim;             //upper and lower integration limits 
    48         double summ,zi,yyy,answer; //running tally of integration 
    4946 
    50         lolim = 0.0; 
    51         uplim = 1.0; 
     47    //upper and lower integration limits 
     48    const double lolim = 0.0; 
     49    const double uplim = 1.0; 
    5250 
    53         summ = 0.0;      //initialize intergral 
     51    double summ = 0.0;   //initialize intergral 
    5452 
    55         delpc = core_sld - shell_sld; //core - shell 
    56         delps = shell_sld - solvent_sld; //shell - solvent 
     53    const double delpc = core_sld - shell_sld;    //core - shell 
     54    const double delps = shell_sld - solvent_sld; //shell - solvent 
    5755 
    58         for(int i=0;i<76;i++) { 
    59                 zi = ( Gauss76Z[i]*(uplim-lolim) + uplim + lolim )/2.0; 
    60                 yyy = Gauss76Wt[i] * gfn4(zi, 
    61                                           equat_core, 
    62                                           polar_core, 
    63                                           equat_shell, 
    64                                           polar_shell, 
    65                                           delpc, 
    66                                           delps, 
    67                                           q); 
    68                 summ += yyy; 
    69         } 
     56    for(int i=0;i<N_POINTS_76;i++) { 
     57        double zi = ( Gauss76Z[i]*(uplim-lolim) + uplim + lolim )/2.0; 
     58        double yyy = Gauss76Wt[i] * gfn4(zi, 
     59                                  equat_core, 
     60                                  polar_core, 
     61                                  equat_shell, 
     62                                  polar_shell, 
     63                                  delpc, 
     64                                  delps, 
     65                                  q); 
     66        summ += yyy; 
     67    } 
    7068 
    71         answer = (uplim-lolim)/2.0*summ; 
     69    double answer = (uplim-lolim)/2.0*summ; 
    7270 
    73         //convert to [cm-1] 
    74         answer *= 1.0e-4; 
     71    //convert to [cm-1] 
     72    answer *= 1.0e-4; 
    7573 
    76         return answer; 
     74    return answer; 
    7775} 
    7876 
     
    8987          double phi) 
    9088{ 
    91     double cyl_x, cyl_y; 
    92     double cos_val; 
    93     double answer; 
    94     double sldcs,sldss; 
    95  
    9689    //convert angle degree to radian 
    97     theta = theta * M_PI/180.0; 
    98     phi = phi * M_PI/180.0; 
     90    theta = theta * M_PI_180; 
     91    phi = phi * M_PI_180; 
    9992 
    10093 
    10194    // ellipsoid orientation, the axis of the rotation is consistent with the ploar axis. 
    102     cyl_x = cos(theta) * cos(phi); 
    103     cyl_y = sin(theta); 
     95    const double cyl_x = cos(theta) * cos(phi); 
     96    const double cyl_y = sin(theta); 
    10497 
    105     sldcs = core_sld - shell_sld; 
    106     sldss = shell_sld- solvent_sld; 
     98    const double sldcs = core_sld - shell_sld; 
     99    const double sldss = shell_sld- solvent_sld; 
    107100 
    108101    // Compute the angle btw vector q and the 
    109102    // axis of the cylinder 
    110     cos_val = cyl_x*q_x + cyl_y*q_y; 
     103    const double cos_val = cyl_x*q_x + cyl_y*q_y; 
    111104 
    112105    // Call the IGOR library function to get the kernel: MUST use gfn4 not gf2 because of the def of params. 
    113     answer = gfn4(cos_val, 
     106    double answer = gfn4(cos_val, 
    114107                  equat_core, 
    115108                  polar_core, 
Note: See TracChangeset for help on using the changeset viewer.