Changeset 292fe08 in sasmodels
- Timestamp:
- Mar 18, 2016 11:38:55 AM (9 years ago)
- 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. - Location:
- sasmodels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/sasview_model.py
rde97440 r08376e7 38 38 model_info = core.load_model_info(model_name) 39 39 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) 42 42 ConstructedModel = type(model_info[namestyle], (SasviewModel,), attrs) 43 43 return ConstructedModel … … 47 47 Sasview wrapper for opencl/ctypes model. 48 48 """ 49 def __init__(self, model_info): 50 self._model_info = model_info 49 def __init__(self): 51 50 self._kernel = None 51 model_info = self._model_info 52 52 53 53 self.name = model_info['name'] -
sasmodels/models/hardsphere.py
re98c1e0 r934f906 75 75 Iq = """ 76 76 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 77 86 78 87 if(fabs(radius_effective) < 1.E-12) { … … 97 106 G=0.5*volfraction*A; 98 107 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 101 110 // else no obvious way to rearrange the equations to avoid needing a very high number of significant figures. 102 111 // 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.