Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/core_shell_bicelle_elliptical_belt_rough.c

    r71b751d rd299327  
    99    return M_PI*(  (r_minor + thick_rim)*(r_minor*x_core + thick_rim)* length + 
    1010                 square(r_minor)*x_core*2.0*thick_face  ); 
     11} 
     12 
     13static double 
     14radius_from_volume(double r_minor, double x_core, double thick_rim, double thick_face, double length) 
     15{ 
     16    const double volume_bicelle = form_volume(r_minor, x_core, thick_rim,thick_face,length); 
     17    return cbrt(0.75*volume_bicelle/M_PI); 
     18} 
     19 
     20static double 
     21radius_from_diagonal(double r_minor, double x_core, double thick_rim, double thick_face, double length) 
     22{ 
     23    const double radius_max = (x_core < 1.0 ? r_minor : x_core*r_minor); 
     24    const double radius_max_tot = radius_max + thick_rim; 
     25    const double length_tot = length + 2.0*thick_face; 
     26    return sqrt(radius_max_tot*radius_max_tot + 0.25*length_tot*length_tot); 
     27} 
     28 
     29static double 
     30effective_radius(int mode, double r_minor, double x_core, double thick_rim, double thick_face, double length) 
     31{ 
     32    switch (mode) { 
     33    case 1: // equivalent sphere 
     34        return radius_from_volume(r_minor, x_core, thick_rim, thick_face, length); 
     35    case 2: // outer rim average radius 
     36        return 0.5*r_minor*(1.0 + x_core) + thick_rim; 
     37    case 3: // outer rim min radius 
     38        return (x_core < 1.0 ? x_core*r_minor+thick_rim : r_minor+thick_rim); 
     39    case 4: // outer max radius 
     40        return (x_core > 1.0 ? x_core*r_minor+thick_rim : r_minor+thick_rim); 
     41    case 5: // half outer thickness 
     42        return 0.5*length + thick_face; 
     43    case 6: // half diagonal (this ignores the missing "corners", so may give unexpected answer if thick_face 
     44            //  or thick_rim is extremely large) 
     45        return radius_from_diagonal(r_minor,x_core,thick_rim,thick_face,length); 
     46    } 
    1147} 
    1248 
Note: See TracChangeset for help on using the changeset viewer.