Skip to content

Commit

Permalink
Push 6.0.0 docs to website
Browse files Browse the repository at this point in the history
  • Loading branch information
smk78 committed Oct 7, 2024
1 parent bf1af53 commit 5529a3d
Show file tree
Hide file tree
Showing 462 changed files with 88,715 additions and 28,208 deletions.
8 changes: 4 additions & 4 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: fa31d87f544e0cbe6f06c2f39ff5004a
tags: 645f666f9bcd5a90fca523b33c5a78b7
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: a137ee188497ae683b66cd14ad059f9c
tags: 645f666f9bcd5a90fca523b33c5a78b7
5 changes: 5 additions & 0 deletions _downloads/10ed3c9920239a3d8107e1c3ff35d64d/lorentz.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
double Iq(double q, double cor_length)
{
double denominator = 1 + (q*cor_length)*(q*cor_length);
return 1/denominator;
}
7 changes: 1 addition & 6 deletions _downloads/1272b58c6cfe69d71694997b04d09bc5/dab.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,7 @@
["cor_length", "Ang", 50.0, [0, inf], "", "correlation length"],
]

Iq = """
double numerator = cube(cor_length);
double denominator = square(1 + square(q*cor_length));
return numerator / denominator ;
"""
source = ["dab.c"]

def random():
"""Return a random parameter set for the model."""
Expand Down
6 changes: 6 additions & 0 deletions _downloads/1832f7c185470f78530c83e15f9057c9/guinier.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
double Iq(double q, double rg)
{
double exponent = fabs(rg)*rg*q*q/3.0;
double value = exp(-exponent);
return value;
}
5 changes: 1 addition & 4 deletions _downloads/2ab21f89819806abac82ca16c56c7451/gaussian_peak.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@
"Peak width (standard deviation)"],
]

Iq = """
double scaled_dq = (q - peak_pos)/sigma;
return exp(-0.5*scaled_dq*scaled_dq); //sqrt(2*M_PI*sigma*sigma);
"""
source = ["gaussian_peak.c"]

def random():
"""Return a random parameter set for the model."""
Expand Down
7 changes: 2 additions & 5 deletions _downloads/2b3ff85a3673159026796a2738bfe110/guinier.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,8 @@
# ["name", "units", default, [lower, upper], "type","description"],
parameters = [["rg", "Ang", 60.0, [-inf, inf], "", "Radius of Gyration"]]

Iq = """
double exponent = fabs(rg)*rg*q*q/3.0;
double value = exp(-exponent);
return value;
"""
source = ["guinier.c"]


def random():
"""Return a random parameter set for the model."""
Expand Down
67 changes: 67 additions & 0 deletions _downloads/431f2192e6effdcf6fde7c0ce58fa153/stickyhardsphere.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
double Iq(double q, double radius_effective, double volfraction, double perturb, double stickiness)
{
double onemineps,eta;
double sig,aa,etam1,etam1sq,qa,qb,qc,radic;
double lam,lam2,test,mu,alpha,beta;
double kk,k2,k3,ds,dc,aq1,aq2,aq3,aq,bq1,bq2,bq3,bq,sq;

onemineps = 1.0-perturb;
eta = volfraction/onemineps/onemineps/onemineps;

sig = 2.0 * radius_effective;
aa = sig/onemineps;
etam1 = 1.0 - eta;
etam1sq=etam1*etam1;
//C
//C SOLVE QUADRATIC FOR LAMBDA
//C
qa = eta/6.0;
qb = stickiness + eta/etam1;
qc = (1.0 + eta/2.0)/etam1sq;
radic = qb*qb - 2.0*qa*qc;
if(radic<0) {
//if(x>0.01 && x<0.015)
// Print "Lambda unphysical - both roots imaginary"
//endif
return(-1.0);
}
//C KEEP THE SMALLER ROOT, THE LARGER ONE IS UNPHYSICAL
radic = sqrt(radic);
lam = (qb-radic)/qa;
lam2 = (qb+radic)/qa;
if(lam2<lam) {
lam = lam2;
}
test = 1.0 + 2.0*eta;
mu = lam*eta*etam1;
if(mu>test) {
//if(x>0.01 && x<0.015)
// Print "Lambda unphysical mu>test"
//endif
return(-1.0);
}
alpha = (1.0 + 2.0*eta - mu)/etam1sq;
beta = (mu - 3.0*eta)/(2.0*etam1sq);
//C
//C CALCULATE THE STRUCTURE FACTOR
//C
kk = q*aa;
k2 = kk*kk;
k3 = kk*k2;
SINCOS(kk,ds,dc);
//ds = sin(kk);
//dc = cos(kk);
aq1 = ((ds - kk*dc)*alpha)/k3;
aq2 = (beta*(1.0-dc))/k2;
aq3 = (lam*ds)/(12.0*kk);
aq = 1.0 + 12.0*eta*(aq1+aq2-aq3);
//
bq1 = alpha*(0.5/kk - ds/k2 + (1.0 - dc)/k3);
bq2 = beta*(1.0/kk - ds/k2);
bq3 = (lam/12.0)*((1.0 - dc)/kk);
bq = 12.0*eta*(bq1+bq2-bq3);
//
sq = 1.0/(aq*aq +bq*bq);

return(sq);
}
88 changes: 2 additions & 86 deletions _downloads/4a33d5085b9d749a6a7666774e071974/hardsphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,91 +87,7 @@
"volume fraction of hard spheres"],
]

Iq = r"""
double D,A,B,G,X,X2,X4,S,C,FF,HARDSPH;
// these are c compiler instructions, can also put normal code inside the "if else" structure
#if FLOAT_SIZE > 4
// double precision
// orig had 0.2, don't call the variable cutoff as PAK already has one called that!
// Must use UPPERCASE name please.
// 0.05 better, 0.1 OK
#define CUTOFFHS 0.05
#else
// 0.1 bad, 0.2 OK, 0.3 good, 0.4 better, 0.8 no good
#define CUTOFFHS 0.4
#endif
if(fabs(radius_effective) < 1.E-12) {
HARDSPH=1.0;
//printf("HS1 %g: %g\n",q,HARDSPH);
return(HARDSPH);
}
// removing use of pow(xxx,2) and rearranging the calcs
// of A, B & G cut ~40% off execution time ( 0.5 to 0.3 msec)
X = 1.0/( 1.0 -volfraction);
D= X*X;
A= (1.+2.*volfraction)*D;
A *=A;
X=fabs(q*radius_effective*2.0);
if(X < 5.E-06) {
HARDSPH=1./A;
//printf("HS2 %g: %g\n",q,HARDSPH);
return(HARDSPH);
}
X2 =X*X;
B = (1.0 +0.5*volfraction)*D;
B *= B;
B *= -6.*volfraction;
G=0.5*volfraction*A;
if(X < CUTOFFHS) {
// RKH Feb 2016, use Taylor series expansion for small X
// else no obvious way to rearrange the equations to avoid
// needing a very high number of significant figures.
// Series expansion found using Mathematica software. Numerical test
// in .xls showed terms to X^2 are sufficient
// for 5 or 6 significant figures, but I put the X^4 one in anyway
//FF = 8*A +6*B + 4*G - (0.8*A +2.0*B/3.0 +0.5*G)*X2 +(A/35. +B/40. +G/50.)*X4;
// refactoring the polynomial makes it very slightly faster (0.5 not 0.6 msec)
//FF = 8*A +6*B + 4*G + ( -0.8*A -2.0*B/3.0 -0.5*G +(A/35. +B/40. +G/50.)*X2)*X2;
FF = 8.0*A +6.0*B + 4.0*G + ( -0.8*A -B/1.5 -0.5*G +(A/35. +0.0125*B +0.02*G)*X2)*X2;
// combining the terms makes things worse at smallest Q in single precision
//FF = (8-0.8*X2)*A +(3.0-X2/3.)*2*B + (4+0.5*X2)*G +(A/35. +B/40. +G/50.)*X4;
// note that G = -volfraction*A/2, combining this makes no further difference at smallest Q
//FF = (8 +2.*volfraction + ( volfraction/4. -0.8 +(volfraction/100. -1./35.)*X2 )*X2 )*A + (3.0 -X2/3. +X4/40.)*2.*B;
HARDSPH= 1./(1. + volfraction*FF );
//printf("HS3 %g: %g\n",q,HARDSPH);
return(HARDSPH);
}
X4=X2*X2;
SINCOS(X,S,C);
// RKH Feb 2016, use version FISH code as is better than original sasview one
// at small Q in single precision, and more than twice as fast in double.
//FF=A*(S-X*C)/X + B*(2.*X*S -(X2-2.)*C -2.)/X2 + G*( (4.*X2*X -24.*X)*S -(X4 -12.*X2 +24.)*C +24. )/X4;
// refactoring the polynomial here & above makes it slightly faster
FF= (( G*( (4.*X2 -24.)*X*S -(X4 -12.*X2 +24.)*C +24. )/X2 + B*(2.*X*S -(X2-2.)*C -2.) )/X + A*(S-X*C))/X ;
HARDSPH= 1./(1. + 24.*volfraction*FF/X2 );
// changing /X and /X2 to *MX1 and *MX2, no significantg difference?
//MX=1.0/X;
//MX2=MX*MX;
//FF= (( G*( (4.*X2 -24.)*X*S -(X4 -12.*X2 +24.)*C +24. )*MX2 + B*(2.*X*S -(X2-2.)*C -2.) )*MX + A*(S-X*C)) ;
//HARDSPH= 1./(1. + 24.*volfraction*FF*MX2*MX );
// grouping the terms, was about same as sasmodels for single precision issues
// FF=A*(S/X-C) + B*(2.*S/X - C +2.0*(C-1.0)/X2) + G*( (4./X -24./X3)*S -(1.0 -12./X2 +24./X4)*C +24./X4 );
// HARDSPH= 1./(1. + 24.*volfraction*FF/X2 );
// remove 1/X2 from final line, take more powers of X inside the brackets, stil bad
// FF=A*(S/X3-C/X2) + B*(2.*S/X3 - C/X2 +2.0*(C-1.0)/X4) + G*( (4./X -24./X3)*S -(1.0 -12./X2 +24./X4)*C +24./X4 )/X2;
// HARDSPH= 1./(1. + 24.*volfraction*FF );
//printf("HS4 %g: %g\n",q,HARDSPH);
return(HARDSPH);
"""
source = ["hardsphere.c"]

def random():
"""Return a random parameter set for the model."""
Expand All @@ -186,7 +102,7 @@ def random():
# assuming double precision sasview is correct
tests = [
[{'scale': 1.0, 'background' : 0.0, 'radius_effective' : 50.0,
'volfraction' : 0.2, 'radius_effective_pd' : 0},
'volfraction' : 0.2},
[0.001, 0.1], [0.209128, 0.930587]],
]
# ADDED by: RKH ON: 16Mar2016 using equations from FISH as better than
Expand Down
79 changes: 8 additions & 71 deletions _downloads/57e047d7d856212490d4cb0b056f7a2a/stickyhardsphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@
"stickiness, epsilon"],
]

source = ["stickyhardsphere.c"]

# No volume normalization despite having a volume parameter
# This should perhaps be volume normalized?
form_volume = """
return 1.0;
"""

def random():
"""Return a random parameter set for the model."""
pars = dict(
Expand All @@ -131,78 +139,7 @@ def random():
)
return pars

# No volume normalization despite having a volume parameter
# This should perhaps be volume normalized?
form_volume = """
return 1.0;
"""

Iq = """
double onemineps,eta;
double sig,aa,etam1,etam1sq,qa,qb,qc,radic;
double lam,lam2,test,mu,alpha,beta;
double kk,k2,k3,ds,dc,aq1,aq2,aq3,aq,bq1,bq2,bq3,bq,sq;
onemineps = 1.0-perturb;
eta = volfraction/onemineps/onemineps/onemineps;
sig = 2.0 * radius_effective;
aa = sig/onemineps;
etam1 = 1.0 - eta;
etam1sq=etam1*etam1;
//C
//C SOLVE QUADRATIC FOR LAMBDA
//C
qa = eta/6.0;
qb = stickiness + eta/etam1;
qc = (1.0 + eta/2.0)/etam1sq;
radic = qb*qb - 2.0*qa*qc;
if(radic<0) {
//if(x>0.01 && x<0.015)
// Print "Lambda unphysical - both roots imaginary"
//endif
return(-1.0);
}
//C KEEP THE SMALLER ROOT, THE LARGER ONE IS UNPHYSICAL
radic = sqrt(radic);
lam = (qb-radic)/qa;
lam2 = (qb+radic)/qa;
if(lam2<lam) {
lam = lam2;
}
test = 1.0 + 2.0*eta;
mu = lam*eta*etam1;
if(mu>test) {
//if(x>0.01 && x<0.015)
// Print "Lambda unphysical mu>test"
//endif
return(-1.0);
}
alpha = (1.0 + 2.0*eta - mu)/etam1sq;
beta = (mu - 3.0*eta)/(2.0*etam1sq);
//C
//C CALCULATE THE STRUCTURE FACTOR
//C
kk = q*aa;
k2 = kk*kk;
k3 = kk*k2;
SINCOS(kk,ds,dc);
//ds = sin(kk);
//dc = cos(kk);
aq1 = ((ds - kk*dc)*alpha)/k3;
aq2 = (beta*(1.0-dc))/k2;
aq3 = (lam*ds)/(12.0*kk);
aq = 1.0 + 12.0*eta*(aq1+aq2-aq3);
//
bq1 = alpha*(0.5/kk - ds/k2 + (1.0 - dc)/k3);
bq2 = beta*(1.0/kk - ds/k2);
bq3 = (lam/12.0)*((1.0 - dc)/kk);
bq = 12.0*eta*(bq1+bq2-bq3);
//
sq = 1.0/(aq*aq +bq*bq);
return(sq);
"""

#
tests = [
Expand Down
20 changes: 2 additions & 18 deletions _downloads/651a5546e8d4a3cd3674d51ad8b97dd3/lamellar_hg.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
and $\Delta\rho_T$ is tail contrast (*sld* $-$ *sld_solvent*).
The total thickness of the lamellar sheet is
a_H + \delta_T + \delta_T + \delta_H$. Note that in a non aqueous solvent
$a_H + \delta_T + \delta_T + \delta_H$. Note that in a non aqueous solvent
the chemical "head" group may be the "Tail region" and vice-versa.
The 2D scattering intensity is calculated in the same way as 1D, where
Expand Down Expand Up @@ -86,23 +86,7 @@
return 1.0;
"""

Iq = """
const double qsq = q*q;
const double drh = sld_head - sld_solvent;
const double drt = sld - sld_solvent; //correction 13FEB06 by L.Porcar
const double qT = q*length_tail;
double Pq, inten;
Pq = drh*(sin(q*(length_head+length_tail))-sin(qT)) + drt*sin(qT);
Pq *= Pq;
Pq *= 4.0/(qsq);
inten = 2.0e-4*M_PI*Pq/qsq;
// normalize by the bilayer thickness
inten /= 2.0*(length_head+length_tail);
return inten;
"""
source = ["lamellar_hg.c"]

def random():
"""Return a random parameter set for the model."""
Expand Down
Loading

0 comments on commit 5529a3d

Please sign in to comment.