Ignore:
Timestamp:
Oct 14, 2016 2:05:39 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
9068f4c
Parents:
0b717c5
Message:

use ORIENT macro for remaining symmetric models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/core_shell_ellipsoid.c

    r0d6e865 r5bddd89  
    3232    const double equat_shell = radius_equat_core + thick_shell; 
    3333    const double polar_shell = radius_equat_core*x_core + thick_shell*x_polar_shell; 
    34     double vol = 4.0*M_PI/3.0*equat_shell*equat_shell*polar_shell; 
     34    double vol = M_4PI_3*equat_shell*equat_shell*polar_shell; 
    3535    return vol; 
    3636} 
     
    6060 
    6161    for(int i=0;i<N_POINTS_76;i++) { 
    62         double zi = ( Gauss76Z[i]*(uplim-lolim) + uplim + lolim )/2.0; 
     62        double zi = 0.5*( Gauss76Z[i]*(uplim-lolim) + uplim + lolim ); 
    6363        double yyy = Gauss76Wt[i] * gfn4(zi, 
    6464                                  radius_equat_core, 
     
    7272    } 
    7373 
    74     double answer = (uplim-lolim)/2.0*summ; 
     74    double answer = 0.5*(uplim-lolim)*summ; 
    7575    //convert to [cm-1] 
    7676    answer *= 1.0e-4; 
     
    8080 
    8181static double 
    82 core_shell_ellipsoid_xt_kernel_2d(double q, double q_x, double q_y, 
     82core_shell_ellipsoid_xt_kernel_2d(double qx, double qy, 
    8383          double radius_equat_core, 
    8484          double x_core, 
     
    9191          double phi) 
    9292{ 
    93     //convert angle degree to radian 
    94     theta = theta * M_PI_180; 
    95     phi = phi * M_PI_180; 
    96  
    97     // ellipsoid orientation, the axis of the rotation is consistent with the ploar axis. 
    98     const double cyl_x = sin(theta) * cos(phi); 
    99     const double cyl_y = sin(theta) * sin(phi); 
     93    double q, sin_alpha, cos_alpha; 
     94    ORIENT_SYMMETRIC(qx, qy, theta, phi, q, sin_alpha, cos_alpha); 
    10095 
    10196    const double sldcs = core_sld - shell_sld; 
    10297    const double sldss = shell_sld- solvent_sld; 
    103  
    104     // Compute the angle btw vector q and the 
    105     // axis of the cylinder 
    106     const double cos_val = cyl_x*q_x + cyl_y*q_y; 
    10798 
    10899    const double polar_core = radius_equat_core*x_core; 
     
    112103    // Call the IGOR library function to get the kernel: 
    113104    // MUST use gfn4 not gf2 because of the def of params. 
    114     double answer = gfn4(cos_val, 
     105    double answer = gfn4(cos_alpha, 
    115106                  radius_equat_core, 
    116107                  polar_core, 
     
    160151          double phi) 
    161152{ 
    162     double q; 
    163     q = sqrt(qx*qx+qy*qy); 
    164     double intensity = core_shell_ellipsoid_xt_kernel_2d(q, qx/q, qy/q, 
     153    double intensity = core_shell_ellipsoid_xt_kernel_2d(qx, qy, 
    165154                       radius_equat_core, 
    166155                       x_core, 
Note: See TracChangeset for help on using the changeset viewer.