Changeset 64ca163 in sasmodels


Ignore:
Timestamp:
Apr 20, 2017 11:59:12 AM (8 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:
4a43871
Parents:
7e0b281
Message:

add code to switch between sc/bcc/fcc in explore/sc.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • explore/sc.c

    r7e0b281 r64ca163  
    44    // Rewriting equations for efficiency, accuracy and readability, and so 
    55    // code is reusable between 1D and 2D models. 
     6    #if 1  // SC 
    67    const double a1 = qa; 
    78    const double a2 = qb; 
    89    const double a3 = qc; 
     10    #elif 1 // BCC 
     11    const double a1 = (+qa + qb + qc)/2.; 
     12    const double a2 = (-qa - qb + qc)/2.; 
     13    const double a3 = (-qa + qb - qc)/2.; 
     14    #elif 1 // FCC 
     15    const double a1 = ( qa + qb)/2.0; 
     16    const double a2 = (-qa + qc)/2.0; 
     17    const double a3 = (-qa + qb)/2.0; 
     18    #endif 
    919 
    1020    const double arg = -0.5*square(dnn*d_factor)*(a1*a1 + a2*a2 + a3*a3); 
     
    113123} 
    114124 
    115     return Zq; 
     125    //return Zq; 
    116126    const double Pq = sphere_form(q, radius, sld, solvent_sld); 
    117127    return sc_volume_fraction(radius, dnn) * Pq * Zq; 
     
    134144    const double Pq = sphere_form(q, radius, sld, solvent_sld); 
    135145    const double Zq = sc_Zq(qa, qb, qc, dnn, d_factor); 
     146    return Zq; 
    136147    return sc_volume_fraction(radius, dnn) * Pq * Zq; 
    137148} 
Note: See TracChangeset for help on using the changeset viewer.