aboutsummaryrefslogtreecommitdiff
path: root/src/diffraction.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2009-11-24 12:04:55 +0100
committerThomas White <taw@physics.org>2009-11-24 12:04:55 +0100
commita2ba8dccb91ec900e45280d1f596507198007419 (patch)
treeac727edaa650ce9e38704fbec40ef345bce31e03 /src/diffraction.c
parente2e6f1ae3039184d2012a02901f7d1138c4ac231 (diff)
Preparation for new water simulation
Diffstat (limited to 'src/diffraction.c')
-rw-r--r--src/diffraction.c43
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;
}