Changeset 292fe08 in sasmodels


Ignore:
Timestamp:
Mar 18, 2016 11:38:55 AM (9 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:
3a45c2c
Parents:
934f906 (diff), 08376e7 (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:

Merge branch 'master' of https://github.com/SasView/sasmodels

Location:
sasmodels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/sasview_model.py

    rde97440 r08376e7  
    3838    model_info = core.load_model_info(model_name) 
    3939    def __init__(self, multfactor=1): 
    40         SasviewModel.__init__(self, model_info) 
    41     attrs = dict(__init__=__init__) 
     40        SasviewModel.__init__(self) 
     41    attrs = dict(__init__=__init__, _model_info=model_info) 
    4242    ConstructedModel = type(model_info[namestyle], (SasviewModel,), attrs) 
    4343    return ConstructedModel 
     
    4747    Sasview wrapper for opencl/ctypes model. 
    4848    """ 
    49     def __init__(self, model_info): 
    50         self._model_info = model_info 
     49    def __init__(self): 
    5150        self._kernel = None 
     51        model_info = self._model_info 
    5252 
    5353        self.name = model_info['name'] 
  • sasmodels/models/hardsphere.py

    re98c1e0 r934f906  
    7575Iq = """ 
    7676      double D,A,B,G,X,X2,X4,S,C,FF,HARDSPH; 
     77      // these are c compiler instructions, can also put normal code inside the "if else" structure  
     78      #if FLOAT_SIZE > 4 
     79      // double precision    orig had 0.2, don't call the variable cutoff as PAK already has one called that! Must use UPPERCASE name please. 
     80      //  0.05 better, 0.1 OK 
     81      #define CUTOFFHS 0.05 
     82      #else 
     83      // 0.1 bad, 0.2 OK, 0.3 good, 0.4 better, 0.8 no good 
     84      #define CUTOFFHS 0.4   
     85      #endif 
    7786 
    7887      if(fabs(radius_effective) < 1.E-12) { 
     
    97106      G=0.5*volfraction*A; 
    98107 
    99       if(X < 0.2) { 
    100       // RKH Feb 2016, use Taylor series expansion for small X, IT IS VERY PICKY ABOUT THE X CUT OFF VALUE, ought to be lower in double.  
     108      if(X < CUTOFFHS) { 
     109      // RKH Feb 2016, use Taylor series expansion for small X 
    101110      // else no obvious way to rearrange the equations to avoid needing a very high number of significant figures.  
    102111      // Series expansion found using Mathematica software. Numerical test in .xls showed terms to X^2 are sufficient  
Note: See TracChangeset for help on using the changeset viewer.