Ignore:
Timestamp:
Oct 19, 2018 5:46:26 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
be43e39
Parents:
2586ab72
Message:

support hollow models in structure factor calculations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/hollow_rectangular_prism.c

    ree60aa7 re44432d  
    1 // TODO: interface to form_volume/shell_volume not yet settled 
    21static double 
    3 shell_volume(double *total, double length_a, double b2a_ratio, double c2a_ratio, double thickness) 
     2shell_volume(double length_a, double b2a_ratio, double c2a_ratio, double thickness) 
    43{ 
    5     double length_b = length_a * b2a_ratio; 
    6     double length_c = length_a * c2a_ratio; 
    7     double a_core = length_a - 2.0*thickness; 
    8     double b_core = length_b - 2.0*thickness; 
    9     double c_core = length_c - 2.0*thickness; 
    10     double vol_core = a_core * b_core * c_core; 
    11     *total = length_a * length_b * length_c; 
    12     return *total - vol_core; 
     4    const double length_b = length_a * b2a_ratio; 
     5    const double length_c = length_a * c2a_ratio; 
     6    const double form_volume = length_a * length_b * length_c; 
     7    const double a_core = length_a - 2.0*thickness; 
     8    const double b_core = length_b - 2.0*thickness; 
     9    const double c_core = length_c - 2.0*thickness; 
     10    const double core_volume = a_core * b_core * c_core; 
     11    return form_volume - core_volume; 
    1312} 
    1413 
     
    1615form_volume(double length_a, double b2a_ratio, double c2a_ratio, double thickness) 
    1716{ 
    18     double total; 
    19     return shell_volume(&total, length_a, b2a_ratio, c2a_ratio, thickness); 
     17    const double length_b = length_a * b2a_ratio; 
     18    const double length_c = length_a * c2a_ratio; 
     19    const double form_volume = length_a * length_b * length_c; 
     20    return form_volume; 
    2021} 
    2122 
    2223static double 
    2324effective_radius(int mode, double length_a, double b2a_ratio, double c2a_ratio, double thickness) 
    24 //effective_radius_type = ["equivalent sphere","half length_a", "half length_b", "half length_c", 
    25 //                         "equivalent outer circular cross-section","half ab diagonal","half diagonal"] 
    2625// NOTE length_a is external dimension! 
    2726{ 
Note: See TracChangeset for help on using the changeset viewer.