aboutsummaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2009-11-25 15:18:45 +0100
committerThomas White <taw@physics.org>2009-11-25 15:18:45 +0100
commit664db6be6a05b11e8a5df9f77c41ec54d3dd202a (patch)
tree6b976ac97a762ec2c13bb385bd0c53076b48ffd0 /src/utils.h
parentde1c9acaf81912488ea5e35d46dd229ea933f1a2 (diff)
Reflection range (increase, trap when too high)
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/utils.h b/src/utils.h
index 5221249f..e81ea840 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -35,7 +35,7 @@
#define THOMSON_LENGTH (2.81794e-15)
/* Maxmimum index to go up to */
-#define INDMAX 20
+#define INDMAX 40
#define IDIM (INDMAX*2 +1)
@@ -97,6 +97,13 @@ static inline double complex get_integral(double complex *ref, signed int h,
{
int idx;
+ if ( (abs(h) > INDMAX) || (abs(k) > INDMAX) || (abs(l) > INDMAX) ) {
+ printf("\nReflection %i %i %i is out of range!\n", h, k, l);
+ printf("You need to re-configure INDMAX, delete the reflection"
+ " cache file and re-run.\n");
+ exit(1);
+ }
+
if ( h < 0 ) h += IDIM;
if ( k < 0 ) k += IDIM;
if ( l < 0 ) l += IDIM;