Changeset 5959da2 in sasmodels


Ignore:
Timestamp:
Mar 9, 2015 11:45:23 AM (10 years ago)
Author:
richardh
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:
2e35a40
Parents:
ab87a12 (diff), 4840bec (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

sorted HayterMSAsq

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extra/pylint.rc

    r3c56da87 r4840bec  
    6060disable= 
    6161    multiple-statements, 
    62     global-statement, 
    6362    bare-except, 
    6463    broad-except, 
    65     bad-whitespace, 
    66     bad-continuation, 
    67     too-many-statements, 
    68     too-many-branches, 
    69     too-many-locals, 
    70     too-many-instance-attributes, 
    71     too-many-arguments, 
    7264    star-args, 
    7365    unbalanced-tuple-unpacking, 
    7466    locally-disabled, 
    75     old-style-class, 
    7667 
    7768[REPORTS] 
     
    205196 
    206197# Maximum number of characters on a single line. 
    207 #max-line-length=100 
    208 max-line-length=80 
     198max-line-length=100 
    209199 
    210200# Regexp for a line that is allowed to be longer than the limit. 
  • sasmodels/models/HayterMSAsq.py

    rab87a12 r5959da2  
    5050from numpy import pi, inf 
    5151 
    52 source=["HayterMSAsq_kernel.c"] 
     52source = ["HayterMSAsq_kernel.c"] 
    5353 
    5454name = "HayterMSAsq" 
    5555title = "Hayter-Penfold MSA charged sphere interparticle S(Q) structure factor" 
    5656description = """\ 
    57         [Hayter-Penfold MSA charged sphere interparticle S(Q) structure factor] 
     57    [Hayter-Penfold MSA charged sphere interparticle S(Q) structure factor] 
    5858        Interparticle structure factor S(Q)for a charged hard spheres. 
    59         Routine takes absolute value of charge, use HardSphere if charge goes to zero.           
    60                 In sasview the effective radius will be calculated from the  
    61                 parameters used in P(Q). 
     59        Routine takes absolute value of charge, use HardSphere if charge goes to zero. 
     60        In sasview the effective radius will be calculated from the 
     61        parameters used in P(Q). 
    6262""" 
     63#             [ "name", "units", default, [lower, upper], "type", "description" ], 
     64parameters = [["effect_radius", "Ang", 20.75, [0, inf], "volume", 
     65               "effective radius of hard sphere"], 
     66              ["charge", "e", 19.0, [0, inf], "", 
     67               "charge on sphere (in electrons)"], 
     68              ["volfraction", "", 0.0192, [0, 0.74], "", 
     69               "volume fraction of spheres"], 
     70              ["temperature", "K", 318.16, [0, inf], "", 
     71               "temperature, in Kelvin, for Debye length calculation"], 
     72              ["saltconc", "M", 0.0, [-inf, inf], "", 
     73               "conc of salt, 1:1 electolyte, for Debye length"], 
     74              ["dielectconst", "", 71.08, [-inf, inf], "", 
     75               "dielectric constant of solvent (default water), for Debye length"], 
     76             ] 
    6377 
    64 parameters = [ 
    65 #   [ "name", "units", default, [lower, upper], "type", 
    66 #     "description" ], 
    67     [ "effect_radius", "Ang",  20.75, [0, inf], "volume", 
    68       "effective radius of hard sphere" ], 
    69     [ "charge", "e",  19.0, [0, inf], "", 
    70       "charge on sphere (in electrons)" ], 
    71     [ "volfraction", "",  0.0192, [0, 0.74], "", 
    72       "volume fraction of spheres" ], 
    73     [ "temperature", "K", 318.16, [0, inf], "", 
    74       "temperature, in Kelvin, for Debye length calculation" ], 
    75     [ "saltconc", "M",  0.0, [-inf,inf], "", 
    76       "conc of salt, 1:1 electolyte, for Debye length" ], 
    77     [ "dielectconst", "",  71.08, [-inf,inf], "", 
    78       "dielectric constant of solvent (default water), for Debye length" ], 
    79     ] 
    80          
    8178# No volume normalization despite having a volume parameter 
    8279# This should perhaps be volume normalized? 
     
    8683Iqxy = """ 
    8784    // never called since no orientation or magnetic parameters. 
    88     return -1.0; 
     85    return Iq(sqrt(qx*qx+qy*qy), IQ_PARAMETERS); 
    8986    """ 
    9087# ER defaults to 0.0 
  • sasmodels/models/HayterMSAsq_kernel.c

    rd60b433 rab87a12  
    1212double 
    1313sqhcal(double qq, double gMSAWave[]); 
    14  
    15            
     14   
    1615double Iq(double QQ, 
    1716      double effect_radius, double zz, double VolFrac, double Temp, double csalt, double dialec)   
     
    487486} 
    488487 
    489 // called as DiamCyl(hcyl,rcyl) 
    490 double 
    491 DiamCyl(double hcyl, double rcyl) 
    492 { 
    493          
    494         double diam,a,b,t1,t2,ddd; 
    495         double pi; 
    496          
    497         pi = 4.0*atan(1.0); 
    498         if (rcyl == 0 || hcyl == 0) { 
    499                 return 0.0; 
    500         } 
    501         a = rcyl; 
    502         b = hcyl/2.0; 
    503         t1 = a*a*2.0*b/2.0; 
    504         t2 = 1.0 + (b/a)*(1.0+a/b/2.0)*(1.0+pi*a/b/2.0); 
    505         ddd = 3.0*t1*t2; 
    506         diam = pow(ddd,(1.0/3.0)); 
    507          
    508         return(diam); 
    509 } 
    510  
    511 //prolate OR oblate ellipsoids                     THIS ROUTINE CURRENTLY UNUSED AS SASVIEW ONLY ALLOWS SPHERES 
    512 //aa is the axis of rotation 
    513 //if aa>bb, then PROLATE 
    514 //if aa<bb, then OBLATE 
    515 // A. Isihara, J. Chem. Phys. 18, 1446 (1950) 
    516 //returns DIAMETER 
    517 // called as DiamEllip(aa,bb) 
    518 double 
    519 DiamEllip(double aa, double bb) 
    520 { 
    521          
    522         double ee,e1,bd,b1,bL,b2,del,ddd,diam; 
    523  
    524         if (aa == 0 || bb == 0) { 
    525                 return 0.0; 
    526         } 
    527         if (aa == bb) { 
    528                 return 2.0*aa; 
    529         } 
    530         if(aa>bb) { 
    531                 ee = (aa*aa - bb*bb)/(aa*aa); 
    532         }else{ 
    533                 ee = (bb*bb - aa*aa)/(bb*bb); 
    534         } 
    535          
    536         bd = 1.0-ee; 
    537         e1 = sqrt(ee); 
    538         b1 = 1.0 + asin(e1)/(e1*sqrt(bd)); 
    539         bL = (1.0+e1)/(1.0-e1); 
    540         b2 = 1.0 + bd/2/e1*log(bL); 
    541         del = 0.75*b1*b2; 
    542          
    543         ddd = 2.0*(del+1.0)*aa*bb*bb;           //volume is always calculated correctly 
    544         diam = pow(ddd,(1.0/3.0)); 
    545          
    546         return(diam); 
    547 } 
    548  
    549488double 
    550489sqhcal(double qq, double gMSAWave[]) 
Note: See TracChangeset for help on using the changeset viewer.