Changeset 3a48772 in sasmodels for sasmodels/models/vesicle.c


Ignore:
Timestamp:
Oct 14, 2016 5:23:40 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:
a5b6997
Parents:
b716cc6
Message:

use predefined constants for fractions of pi

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/vesicle.c

    r2c74c11 r3a48772  
    88{ 
    99    //note that for the vesicle model, the volume is ONLY the shell volume 
    10     double volume; 
    11     volume =4.*M_PI*(radius+thickness)*(radius+thickness)*(radius+thickness)/3; 
    12     volume -=4.*M_PI*radius*radius*radius/3.; 
    13     return volume; 
     10    return M_4PI_3*(cube(radius+thickness) - cube(radius)); 
    1411} 
    1512 
     
    3229    // core first, then add in shell 
    3330    contrast = sld_solvent-sld; 
    34     vol = 4.0*M_PI/3.0*radius*radius*radius; 
    35     f = vol*sph_j1c(q*radius)*contrast; 
     31    vol = M_4PI_3*cube(radius); 
     32    f = vol * sph_j1c(q*radius) * contrast; 
    3633  
    3734    //now the shell. No volume normalization as this is done by the caller 
    3835    contrast = sld-sld_solvent; 
    39     vol = 4.0*M_PI/3.0*(radius+thickness)*(radius+thickness)*(radius+thickness); 
    40     f += vol*sph_j1c(q*(radius+thickness))*contrast; 
     36    vol = M_4PI_3*cube(radius+thickness); 
     37    f += vol * sph_j1c(q*(radius+thickness)) * contrast; 
    4138 
    4239    //rescale to [cm-1].  
    43     f2 = volfraction*f*f*1.0e-4; 
     40    f2 = volfraction * f*f*1.0e-4; 
    4441     
    45     return(f2); 
     42    return f2; 
    4643} 
Note: See TracChangeset for help on using the changeset viewer.