Changeset c3ebc71 in sasmodels


Ignore:
Timestamp:
Oct 18, 2016 9:09:23 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:
3e8ea5d
Parents:
ed23abe
Message:

polymer_micelle: minor code cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/polymer_micelle.c

    ra807206 rc3ebc71  
    3232    // Self-correlation term of the core 
    3333    const double bes_core = sph_j1c(q*radius_core); 
    34     const double term1 = n_aggreg*n_aggreg*beta_core*beta_core*bes_core*bes_core; 
     34    const double term1 = square(n_aggreg*beta_core*bes_core); 
    3535 
    3636    // Self-correlation term of the chains 
    37     const double qrg2 = q*rg*q*rg; 
     37    const double qrg2 = square(q*rg); 
    3838    const double debye_chain = (qrg2 == 0.0) ? 1.0 : 2.0*(expm1(-qrg2)+qrg2)/(qrg2*qrg2); 
    3939    const double term2 = n_aggreg * beta_corona * beta_corona * debye_chain; 
     
    4242    const double chain_ampl = (qrg2 == 0.0) ? 1.0 : -expm1(-qrg2)/qrg2; 
    4343    const double bes_corona = sinc(q*(radius_core + d_penetration * rg)); 
    44     const double term3 = 2 * n_aggreg * n_aggreg * beta_core * beta_corona * 
     44    const double term3 = 2.0 * n_aggreg * n_aggreg * beta_core * beta_corona * 
    4545                 bes_core * chain_ampl * bes_corona; 
    4646 
    4747    // Interference cross-term between chains 
    48     const double term4 = n_aggreg * (n_aggreg - 1.0) * beta_corona * beta_corona * 
    49                  chain_ampl * chain_ampl * bes_corona * bes_corona; 
     48    const double term4 = n_aggreg * (n_aggreg - 1.0) 
     49                 * square(beta_corona * chain_ampl * bes_corona); 
    5050 
    5151    // I(q)_micelle : Sum of 4 terms computed above 
Note: See TracChangeset for help on using the changeset viewer.