Changeset c95dc908 in sasmodels


Ignore:
Timestamp:
Feb 17, 2015 6:18:18 PM (10 years ago)
Author:
ajj
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
87fce00
Parents:
0706431
Message:

Fixes to bcc paracrystal model

Note - this model requires calculation using double precision

Location:
sasmodels/models
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/bcc.c

    r754c454 rc95dc908  
    3939    double sn, cn; 
    4040    SINCOS(qr, sn, cn); 
    41     const double bes = qr==0.0 ? 1.0 : 3.0*(sn-qr*cn)/(qr*qr*qr); 
     41    const double bes = (qr == 0.0 ? 1.0 : 3.0*(sn-qr*cn)/(qr*qr*qr)); 
    4242    const double fq = bes * (sld - solvent_sld)*form_volume(radius); 
    4343    return 1.0e-4*fq*fq; 
     
    6767                //setup inner integral over the ellipsoidal cross-section 
    6868                double summj=0.0; 
    69                 const double zi = ( Gauss150Z[i]*(vb-va) + va + vb )/2.0;               //the outer dummy is phi 
     69                const double zphi = ( Gauss150Z[i]*(vb-va) + va + vb )/2.0;             //the outer dummy is phi 
    7070                for(int j=0;j<150;j++) { 
    7171                        //20 gauss points for the inner integral 
    72                         double zij = ( Gauss150Z[j]*(vbj-vaj) + vaj + vbj )/2.0;                //the inner dummy is theta 
    73                         double yyy = Gauss150Wt[j] * _BCC_Integrand(q,dnn,d_factor,zi,zij); 
     72                        double ztheta = ( Gauss150Z[j]*(vbj-vaj) + vaj + vbj )/2.0;             //the inner dummy is theta 
     73                        double yyy = Gauss150Wt[j] * _BCC_Integrand(q,dnn,d_factor,ztheta,zphi); 
    7474                        summj += yyy; 
    7575                } 
  • sasmodels/models/bcc.py

    r754c454 rc95dc908  
    11#bcc paracrystal model 
    22#note model title and parameter table are automatically inserted 
     3#note - calculation requires double precision 
    34""" 
    45Calculates the scattering from a **body-centered cubic lattice** with paracrystalline distortion. Thermal vibrations 
     
    107108demo = dict( 
    108109    scale=1, background=0, 
    109     dnn=200, d_factor=0.05, sld=6, solvent_sld=1, 
    110     radius=20, 
     110    dnn=220, d_factor=0.06, sld=4, solvent_sld=1, 
     111    radius=40, 
    111112    theta=60, phi=60, psi=60, 
    112     radius_pd=.2, radius_pd_n=8, 
     113    radius_pd=.2, radius_pd_n=0.2, 
    113114    theta_pd=15, theta_pd_n=0, 
    114115    phi_pd=15, phi_pd_n=0, 
Note: See TracChangeset for help on using the changeset viewer.