Changeset d277229 in sasmodels for sasmodels/models/core_shell_bicelle.c


Ignore:
Timestamp:
Sep 7, 2018 3:29:38 AM (6 years ago)
Author:
grethevj
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
3c60146
Parents:
2a12351b
Message:

Models updated to include choices for effective interaction radii

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/core_shell_bicelle.c

    r71b751d rd277229  
    3434 
    3535    return t; 
     36} 
     37 
     38static double 
     39radius_from_volume(double radius, double thick_rim, double thick_face, double length) 
     40{ 
     41    const double volume_bicelle = form_volume(radius,thick_rim,thick_face,length); 
     42    return cbrt(0.75*volume_bicelle/M_PI); 
     43} 
     44 
     45static double 
     46radius_from_diagonal(double radius, double thick_rim, double thick_face, double length) 
     47{ 
     48    const double radius_tot = radius + thick_rim; 
     49    const double length_tot = length + 2.0*thick_face; 
     50    return sqrt(radius_tot*radius_tot + 0.25*length_tot*length_tot); 
     51} 
     52 
     53static double 
     54effective_radius(int mode, double radius, double thick_rim, double thick_face, double length) 
     55{ 
     56    if (mode == 1) { 
     57        return radius_from_volume(radius, thick_rim, thick_face, length); 
     58    } else if (mode == 2) { 
     59        return radius + thick_rim; 
     60    } else if (mode == 3) { 
     61        return 0.5*length + thick_face; 
     62    } else { 
     63        return radius_from_diagonal(radius,thick_rim,thick_face,length); 
     64    } 
    3665} 
    3766 
Note: See TracChangeset for help on using the changeset viewer.