diff options
Diffstat (limited to 'src/diffraction.c')
-rw-r--r-- | src/diffraction.c | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/src/diffraction.c b/src/diffraction.c index 3d4fa6ea..4ed13709 100644 --- a/src/diffraction.c +++ b/src/diffraction.c @@ -33,10 +33,6 @@ /* Avogadro's number */ #define AVOGADRO (6.022e23) -/* Number of slices to divide water column into, where the - * slices are coplanar with the beam and the cylinder axis */ -#define N_WATER_SLICES 100 - static double lattice_factor(struct threevec q, double ax, double ay, double az, double bx, double by, double bz, @@ -124,44 +120,7 @@ static double complex molecule_factor(struct molecule *mol, struct threevec q, static double complex water_factor(struct threevec q, double en) { - double x; - double complex res = 0.0; - int n = 0; - double s; - double molecules_per_m3; - double molecules_per_m; - const double rc = 0.5e-6; /* Radius of cylinder (m) */ - const double rb = 1.5e-6; /* Radius of beam (m) */ - - /* Density of water molecules */ - molecules_per_m3 = WATER_DENSITY * (AVOGADRO / WATER_MOLAR_MASS); - - /* Number of water molecules per slice per metre of thickness */ - molecules_per_m = (2*rb*2*rc) * molecules_per_m3 / N_WATER_SLICES; - - /* s = sin(theta)/lambda = 1/2d = (1/d)/2.0 */ - s = modulus(q.u, q.v, q.w) / 2.0; - - for ( x=-rc; x<=rc; x+=rc/(N_WATER_SLICES/2) ) { - - double ph; - double thickness; - - /* The thickness of a cylinder in a direction parallel - * to the beam. The cylinder axis is perpendicular to - * the beam */ - thickness = 2.0 * sqrt((rc*rc)-(x*x)); - - ph = q.u*x; - res += thickness * (cos(2.0*M_PI*ph) + I*sin(2.0*M_PI*ph)); - n++; - - } - res *= (get_sfac("O", s, en) + 2.0*get_sfac("H", s, en)) - * molecules_per_m; - - /* Correct for sampling of integration */ - return (res/(double)n) * (2.0*rc); + return 0.0; } |