Changeset 925ad6e in sasmodels
- Timestamp:
- Jan 11, 2017 8:27:54 AM (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:
- 592343f
- Parents:
- 1e7b0db0
- Location:
- sasmodels/models
- Files:
-
- 41 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/bcc_paracrystal.py
rb0c4271 r925ad6e 128 128 # pylint: enable=bad-whitespace, line-too-long 129 129 130 source = ["lib/s ph_j1c.c", "lib/gauss150.c", "lib/sphere_form.c", "bcc_paracrystal.c"]130 source = ["lib/sas_3j1x_x.c", "lib/gauss150.c", "lib/sphere_form.c", "bcc_paracrystal.c"] 131 131 132 132 # parameters for demo -
sasmodels/models/binary_hard_sphere.c
r4f79d94 r925ad6e 58 58 qr2 = r2*q; 59 59 60 sc1 = s ph_j1c(qr1);61 sc2 = s ph_j1c(qr2);60 sc1 = sas_3j1x_x(qr1); 61 sc2 = sas_3j1x_x(qr2); 62 62 b1 = r1*r1*r1*(rho1-rhos)*M_4PI_3*sc1; 63 63 b2 = r2*r2*r2*(rho2-rhos)*M_4PI_3*sc2; -
sasmodels/models/binary_hard_sphere.py
rb0c4271 r925ad6e 108 108 ] 109 109 110 source = ["lib/s ph_j1c.c", "binary_hard_sphere.c"]110 source = ["lib/sas_3j1x_x.c", "binary_hard_sphere.c"] 111 111 112 112 # parameters for demo and documentation -
sasmodels/models/core_multi_shell.c
rc5ac2b2 r925ad6e 3 3 f_constant(double q, double r, double sld) 4 4 { 5 const double bes = s ph_j1c(q * r);5 const double bes = sas_3j1x_x(q * r); 6 6 const double vol = M_4PI_3 * cube(r); 7 7 return sld * vol * bes; … … 33 33 f = 0.; 34 34 for (int i=0; i<n; i++) { 35 f += M_4PI_3 * cube(r) * (sld[i] - last_sld) * s ph_j1c(q*r);35 f += M_4PI_3 * cube(r) * (sld[i] - last_sld) * sas_3j1x_x(q*r); 36 36 last_sld = sld[i]; 37 37 r += thickness[i]; 38 38 } 39 f += M_4PI_3 * cube(r) * (solvent_sld - last_sld) * s ph_j1c(q*r);39 f += M_4PI_3 * cube(r) * (solvent_sld - last_sld) * sas_3j1x_x(q*r); 40 40 return f * f * 1.0e-4; 41 41 } -
sasmodels/models/core_multi_shell.py
r2d73a53 r925ad6e 101 101 ] 102 102 103 source = ["lib/s ph_j1c.c", "core_multi_shell.c"]103 source = ["lib/sas_3j1x_x.c", "core_multi_shell.c"] 104 104 105 105 def profile(sld_core, radius, sld_solvent, n, sld, thickness): -
sasmodels/models/core_shell_ellipsoid.py
rfcb33e4 r925ad6e 137 137 # pylint: enable=bad-whitespace, line-too-long 138 138 139 source = ["lib/s ph_j1c.c", "lib/gfn.c", "lib/gauss76.c",139 source = ["lib/sas_3j1x_x.c", "lib/gfn.c", "lib/gauss76.c", 140 140 "core_shell_ellipsoid.c"] 141 141 -
sasmodels/models/core_shell_sphere.py
r4962519 r925ad6e 75 75 # pylint: enable=bad-whitespace, line-too-long 76 76 77 source = ["lib/s ph_j1c.c", "lib/core_shell.c", "core_shell_sphere.c"]77 source = ["lib/sas_3j1x_x.c", "lib/core_shell.c", "core_shell_sphere.c"] 78 78 79 79 demo = dict(scale=1, background=0, radius=60, thickness=10, -
sasmodels/models/ellipsoid.c
r73e08ae r925ad6e 18 18 const double r = radius_equatorial 19 19 * sqrt(1.0 + sin_alpha*sin_alpha*(ratio*ratio - 1.0)); 20 const double f = s ph_j1c(q*r);20 const double f = sas_3j1x_x(q*r); 21 21 22 22 return f*f; -
sasmodels/models/ellipsoid.py
r0d6e865 r925ad6e 135 135 ] 136 136 137 source = ["lib/s ph_j1c.c", "lib/gauss76.c", "ellipsoid.c"]137 source = ["lib/sas_3j1x_x.c", "lib/gauss76.c", "ellipsoid.c"] 138 138 139 139 def ER(radius_polar, radius_equatorial): -
sasmodels/models/fcc_paracrystal.py
r0bef47b r925ad6e 116 116 # pylint: enable=bad-whitespace, line-too-long 117 117 118 source = ["lib/s ph_j1c.c", "lib/gauss150.c", "lib/sphere_form.c", "fcc_paracrystal.c"]118 source = ["lib/sas_3j1x_x.c", "lib/gauss150.c", "lib/sphere_form.c", "fcc_paracrystal.c"] 119 119 120 120 # parameters for demo -
sasmodels/models/fractal.c
r217590b r925ad6e 14 14 //calculate P(q) for the spherical subunits 15 15 const double V = M_4PI_3*cube(radius); 16 const double pq = V * square((sld_block-sld_solvent)*s ph_j1c(q*radius));16 const double pq = V * square((sld_block-sld_solvent)*sas_3j1x_x(q*radius)); 17 17 18 18 // scale to units cm-1 sr-1 (assuming data on absolute scale) -
sasmodels/models/fractal.py
rfef353f r925ad6e 97 97 # pylint: enable=bad-whitespace, line-too-long 98 98 99 source = ["lib/s ph_j1c.c", "lib/sas_gamma.c", "lib/fractal_sq.c", "fractal.c"]99 source = ["lib/sas_3j1x_x.c", "lib/sas_gamma.c", "lib/fractal_sq.c", "fractal.c"] 100 100 101 101 demo = dict(volfraction=0.05, -
sasmodels/models/fractal_core_shell.py
rd6f60c3 r925ad6e 95 95 # pylint: enable=bad-whitespace, line-too-long 96 96 97 source = ["lib/s ph_j1c.c", "lib/sas_gamma.c", "lib/core_shell.c",97 source = ["lib/sas_3j1x_x.c", "lib/sas_gamma.c", "lib/core_shell.c", 98 98 "lib/fractal_sq.c", "fractal_core_shell.c"] 99 99 -
sasmodels/models/fuzzy_sphere.py
r3a48772 r925ad6e 81 81 # pylint: enable=bad-whitespace,line-too-long 82 82 83 source = ["lib/s ph_j1c.c"]83 source = ["lib/sas_3j1x_x.c"] 84 84 85 85 # No volume normalization despite having a volume parameter … … 91 91 Iq = """ 92 92 const double qr = q*radius; 93 const double bes = s ph_j1c(qr);93 const double bes = sas_3j1x_x(qr); 94 94 const double qf = q*fuzziness; 95 95 const double fq = bes * (sld - sld_solvent) * form_volume(radius) * exp(-0.5*qf*qf); -
sasmodels/models/lib/core_shell.c
r3a48772 r925ad6e 16 16 const double core_qr = q * radius; 17 17 const double core_contrast = core_sld - shell_sld; 18 const double core_bes = s ph_j1c(core_qr);18 const double core_bes = sas_3j1x_x(core_qr); 19 19 const double core_volume = M_4PI_3 * cube(radius); 20 20 double f = core_volume * core_bes * core_contrast; … … 23 23 const double shell_qr = q * (radius + thickness); 24 24 const double shell_contrast = shell_sld - solvent_sld; 25 const double shell_bes = s ph_j1c(shell_qr);25 const double shell_bes = sas_3j1x_x(shell_qr); 26 26 const double shell_volume = M_4PI_3 * cube(radius + thickness); 27 27 f += shell_volume * shell_bes * shell_contrast; -
sasmodels/models/lib/gfn.c
r3a48772 r925ad6e 18 18 // changing to more accurate sph_j1c since the following inexplicably fails on Radeon Nano. 19 19 //const double siq = (uq == 0.0 ? 1.0 : 3.0*(sin(uq)/uq/uq - cos(uq)/uq)/uq); 20 const double siq = s ph_j1c(uq);20 const double siq = sas_3j1x_x(uq); 21 21 const double vc = M_4PI_3*aa*aa*bb; 22 22 const double gfnc = siq*vc*delpc; … … 26 26 const double vt = M_4PI_3*trmaj*trmaj*trmin; 27 27 //const double sit = (ut == 0.0 ? 1.0 : 3.0*(sin(ut)/ut/ut - cos(ut)/ut)/ut); 28 const double sit = s ph_j1c(ut);28 const double sit = sas_3j1x_x(ut); 29 29 const double gfnt = sit*vt*delps; 30 30 -
sasmodels/models/lib/sphere_form.c
rba32cdd r925ad6e 9 9 double sphere_form(double q, double radius, double sld, double solvent_sld) 10 10 { 11 const double fq = sphere_volume(radius) * s ph_j1c(q*radius);11 const double fq = sphere_volume(radius) * sas_3j1x_x(q*radius); 12 12 const double contrast = (sld - solvent_sld); 13 13 return 1.0e-4*square(contrast * fq); -
sasmodels/models/linear_pearls.c
r1e7b0db0 r925ad6e 44 44 45 45 //sine functions of a pearl 46 double psi = s ph_j1c(q * radius);46 double psi = sas_3j1x_x(q * radius); 47 47 48 48 // N pearls contribution -
sasmodels/models/linear_pearls.py
r4962519 r925ad6e 63 63 single = False 64 64 65 source = ["lib/s ph_j1c.c", "linear_pearls.c"]65 source = ["lib/sas_3j1x_x.c", "linear_pearls.c"] 66 66 67 67 demo = dict(scale=1.0, background=0.0, -
sasmodels/models/mass_fractal.c
r6d96b66 r925ad6e 5 5 { 6 6 //calculate P(q) 7 const double pq = square(s ph_j1c(q*radius));7 const double pq = square(sas_3j1x_x(q*radius)); 8 8 9 9 //calculate S(q) -
sasmodels/models/mass_fractal.py
r6d96b66 r925ad6e 86 86 # pylint: enable=bad-whitespace, line-too-long 87 87 88 source = ["lib/s ph_j1c.c", "lib/sas_gamma.c", "mass_fractal.c"]88 source = ["lib/sas_3j1x_x.c", "lib/sas_gamma.c", "mass_fractal.c"] 89 89 90 90 demo = dict(scale=1, background=0, -
sasmodels/models/multilayer_vesicle.c
r3a48772 r925ad6e 20 20 // layer 1 21 21 voli = M_4PI_3*ri*ri*ri; 22 fval += voli*sldi*s ph_j1c(ri*q);22 fval += voli*sldi*sas_3j1x_x(ri*q); 23 23 24 24 ri += thick_shell; … … 26 26 // layer 2 27 27 voli = M_4PI_3*ri*ri*ri; 28 fval -= voli*sldi*s ph_j1c(ri*q);28 fval -= voli*sldi*sas_3j1x_x(ri*q); 29 29 30 30 //do 2 layers at a time -
sasmodels/models/multilayer_vesicle.py
r041bc75 r925ad6e 107 107 # pylint: enable=bad-whitespace, line-too-long 108 108 109 source = ["lib/s ph_j1c.c", "multilayer_vesicle.c"]109 source = ["lib/sas_3j1x_x.c", "multilayer_vesicle.c"] 110 110 111 111 polydispersity = ["radius", "n_pairs"] -
sasmodels/models/onion.c
r9762341 r925ad6e 6 6 const double vol = M_4PI_3 * cube(r); 7 7 const double qr = q * r; 8 const double bes = s ph_j1c(qr);8 const double bes = sas_3j1x_x(qr); 9 9 const double alpha = A * r/thickness; 10 10 double result; -
sasmodels/models/onion.py
r9762341 r925ad6e 314 314 # pylint: enable=bad-whitespace, line-too-long 315 315 316 source = ["lib/s ph_j1c.c", "onion.c"]316 source = ["lib/sas_3j1x_x.c", "onion.c"] 317 317 single = False 318 318 -
sasmodels/models/pearl_necklace.c
r1e7b0db0 r925ad6e 36 36 const double beta = (Si(q*(A_s-radius)) - Si(q*radius)) / q_edge; 37 37 const double gamma = Si(q_edge) / q_edge; 38 const double psi = s ph_j1c(q*radius);38 const double psi = sas_3j1x_x(q*radius); 39 39 40 40 // Precomputed sinc terms -
sasmodels/models/pearl_necklace.py
r2126131 r925ad6e 92 92 ] 93 93 94 source = ["lib/Si.c", "lib/s ph_j1c.c", "pearl_necklace.c"]94 source = ["lib/Si.c", "lib/sas_3j1x_x.c", "pearl_necklace.c"] 95 95 single = False # use double precision unless told otherwise 96 96 -
sasmodels/models/polymer_micelle.c
r1e7b0db0 r925ad6e 31 31 32 32 // Self-correlation term of the core 33 const double bes_core = s ph_j1c(q*radius_core);33 const double bes_core = sas_3j1x_x(q*radius_core); 34 34 const double term1 = square(n_aggreg*beta_core*bes_core); 35 35 -
sasmodels/models/polymer_micelle.py
rbba9361 r925ad6e 104 104 single = False 105 105 106 source = ["lib/s ph_j1c.c", "polymer_micelle.c"]106 source = ["lib/sas_3j1x_x.c", "polymer_micelle.c"] 107 107 108 108 demo = dict(scale=1, background=0, -
sasmodels/models/raspberry.c
r1e7b0db0 r925ad6e 51 51 52 52 //Form factors for each particle 53 psiL = s ph_j1c(q*rL);54 psiS = s ph_j1c(q*rS);53 psiL = sas_3j1x_x(q*rL); 54 psiS = sas_3j1x_x(q*rS); 55 55 56 56 //Cross term between large and small particles -
sasmodels/models/raspberry.py
r40a87fa r925ad6e 152 152 ] 153 153 154 source = ["lib/s ph_j1c.c", "raspberry.c"]154 source = ["lib/sas_3j1x_x.c", "raspberry.c"] 155 155 156 156 # parameters for demo -
sasmodels/models/sc_paracrystal.py
r0bef47b r925ad6e 133 133 # pylint: enable=bad-whitespace, line-too-long 134 134 135 source = ["lib/s ph_j1c.c", "lib/sphere_form.c", "lib/gauss150.c", "sc_paracrystal.c"]135 source = ["lib/sas_3j1x_x.c", "lib/sphere_form.c", "lib/gauss150.c", "sc_paracrystal.c"] 136 136 137 137 demo = dict(scale=1, background=0, -
sasmodels/models/sphere.py
r7e6bea81 r925ad6e 66 66 ] 67 67 68 source = ["lib/s ph_j1c.c", "lib/sphere_form.c"]68 source = ["lib/sas_3j1x_x.c", "lib/sphere_form.c"] 69 69 70 70 # No volume normalization despite having a volume parameter -
sasmodels/models/spherical_sld.c
r54bcd4a r925ad6e 34 34 const double qr = q * r; 35 35 const double qrsq = qr * qr; 36 const double bes = s ph_j1c(qr);36 const double bes = sas_3j1x_x(qr); 37 37 double sinqr, cosqr; 38 38 SINCOS(qr, sinqr, cosqr); … … 60 60 61 61 // uniform shell; r=0 => r^3=0 => f=0, so works for core as well. 62 f -= M_4PI_3 * cube(r) * sld_l * s ph_j1c(q*r);62 f -= M_4PI_3 * cube(r) * sld_l * sas_3j1x_x(q*r); 63 63 r += thickness[shell]; 64 f += M_4PI_3 * cube(r) * sld_l * s ph_j1c(q*r);64 f += M_4PI_3 * cube(r) * sld_l * sas_3j1x_x(q*r); 65 65 66 66 // iterate over sub_shells in the interface … … 92 92 } 93 93 // add in solvent effect 94 f -= M_4PI_3 * cube(r) * sld_solvent * s ph_j1c(q*r);94 f -= M_4PI_3 * cube(r) * sld_solvent * sas_3j1x_x(q*r); 95 95 96 96 const double f2 = f * f * 1.0e-4; -
sasmodels/models/spherical_sld.py
r2d65d51 r925ad6e 214 214 ] 215 215 # pylint: enable=bad-whitespace, line-too-long 216 source = ["lib/polevl.c", "lib/sas_erf.c", "lib/s ph_j1c.c", "spherical_sld.c"]216 source = ["lib/polevl.c", "lib/sas_erf.c", "lib/sas_3j1x_x.c", "spherical_sld.c"] 217 217 single = False # TODO: fix low q behaviour 218 218 -
sasmodels/models/surface_fractal.c
rb716cc6 r925ad6e 15 15 { 16 16 // calculate P(q) 17 const double pq = square(s ph_j1c(q*radius));17 const double pq = square(sas_3j1x_x(q*radius)); 18 18 19 19 // calculate S(q) -
sasmodels/models/surface_fractal.py
r5c94f41 r925ad6e 72 72 # pylint: enable=bad-whitespace, line-too-long 73 73 74 source = ["lib/s ph_j1c.c", "lib/sas_gamma.c", "surface_fractal.c"]74 source = ["lib/sas_3j1x_x.c", "lib/sas_gamma.c", "surface_fractal.c"] 75 75 76 76 demo = dict(scale=1, background=1e-5, -
sasmodels/models/triaxial_ellipsoid.c
r3a48772 r925ad6e 37 37 const double ysq = square(Gauss76Z[j]*zm + zb); 38 38 const double t = q*sqrt(acosx2 + bsinx2*(1.0-ysq) + c2*ysq); 39 const double fq = s ph_j1c(t);39 const double fq = sas_3j1x_x(t); 40 40 inner += Gauss76Wt[j] * fq * fq ; 41 41 } … … 64 64 + radius_equat_major*radius_equat_major*cmu*cmu 65 65 + radius_polar*radius_polar*calpha*calpha); 66 const double fq = s ph_j1c(t);66 const double fq = sas_3j1x_x(t); 67 67 const double s = (sld - sld_solvent) * form_volume(radius_equat_minor, radius_equat_major, radius_polar); 68 68 -
sasmodels/models/triaxial_ellipsoid.py
r416f5c7 r925ad6e 104 104 ] 105 105 106 source = ["lib/s ph_j1c.c", "lib/gauss76.c", "triaxial_ellipsoid.c"]106 source = ["lib/sas_3j1x_x.c", "lib/gauss76.c", "triaxial_ellipsoid.c"] 107 107 108 108 def ER(radius_equat_minor, radius_equat_major, radius_polar): -
sasmodels/models/vesicle.c
r3a48772 r925ad6e 30 30 contrast = sld_solvent-sld; 31 31 vol = M_4PI_3*cube(radius); 32 f = vol * s ph_j1c(q*radius) * contrast;32 f = vol * sas_3j1x_x(q*radius) * contrast; 33 33 34 34 //now the shell. No volume normalization as this is done by the caller 35 35 contrast = sld-sld_solvent; 36 36 vol = M_4PI_3*cube(radius+thickness); 37 f += vol * s ph_j1c(q*(radius+thickness)) * contrast;37 f += vol * sas_3j1x_x(q*(radius+thickness)) * contrast; 38 38 39 39 //rescale to [cm-1]. -
sasmodels/models/vesicle.py
r3a48772 r925ad6e 94 94 ] 95 95 96 source = ["lib/s ph_j1c.c", "vesicle.c"]96 source = ["lib/sas_3j1x_x.c", "vesicle.c"] 97 97 98 98 def ER(radius, thickness):
Note: See TracChangeset
for help on using the changeset viewer.