Changeset e83f2a0 in sasmodels
- Timestamp:
- Dec 20, 2016 4:33:01 PM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 21fbab1
- Parents:
- 2586093f
- Location:
- sasmodels/models
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/spherical_sld.c
r54bcd4a re83f2a0 1 1 static double form_volume( 2 intn_shells,2 double fp_n_shells, 3 3 double thickness[], 4 4 double interface[]) 5 5 { 6 int n_shells= (int)(fp_n_shells + 0.5); 6 7 double r = 0.0; 7 8 for (int i=0; i < n_shells; i++) { … … 20 21 return pow(z, nu); 21 22 } else if (shape==2) { 22 return 1.0 - pow(1. - z, nu);23 return 1.0 - pow(1.0 - z, nu); 23 24 } else if (shape==3) { 24 25 return expm1(-nu*z)/expm1(-nu); … … 44 45 static double Iq( 45 46 double q, 46 intn_shells,47 double fp_n_shells, 47 48 double sld_solvent, 48 49 double sld[], … … 51 52 double shape[], 52 53 double nu[], 53 intn_steps)54 double fp_n_steps) 54 55 { 55 56 // iteration for # of shells + core + solvent 57 int n_shells = (int)(fp_n_shells + 0.5); 58 int n_steps = (int)(fp_n_steps + 0.5); 56 59 double f=0.0; 57 60 double r=0.0; -
sasmodels/models/spherical_sld.py
r2d65d51 re83f2a0 233 233 """ 234 234 235 n_shells = int(n_shells + 0.5) 236 n_steps = int(n_steps + 0.5) 235 237 z = [] 236 238 rho = [] … … 240 242 rho.append(sld[0]) 241 243 242 for i in range(0, int(n_shells)):244 for i in range(0, n_shells): 243 245 z_next += thickness[i] 244 246 z.append(z_next) … … 261 263 def ER(n_shells, thickness, interface): 262 264 """Effective radius""" 263 n_shells = int(n_shells )265 n_shells = int(n_shells + 0.5) 264 266 total = (np.sum(thickness[:n_shells], axis=1) 265 267 + np.sum(interface[:n_shells], axis=1))
Note: See TracChangeset
for help on using the changeset viewer.