diff --git a/gprMax/constants.pxd b/gprMax/constants.pxd index 29b835ff..73984bbb 100644 --- a/gprMax/constants.pxd +++ b/gprMax/constants.pxd @@ -25,5 +25,10 @@ cimport numpy as np # Fractal and dispersive coefficient arrays use complex numbers (complextype) which are represented as two floats # Main field arrays use floats (floattype) and complex numbers (complextype) +# Single precision ctypedef np.float32_t floattype_t ctypedef np.complex64_t complextype_t + +# Double precision +#ctypedef np.float64_t floattype_t +#ctypedef np.complex128_t complextype_t diff --git a/gprMax/constants.py b/gprMax/constants.py index f56a9556..7d9996a5 100644 --- a/gprMax/constants.py +++ b/gprMax/constants.py @@ -30,5 +30,20 @@ z0 = np.sqrt(m0 / e0) # Fractal and dispersive coefficient arrays use complex numbers (complextype) which are represented as two floats # Main field arrays use floats (floattype) and complex numbers (complextype) +# Single precision +# For numpy arrays floattype = np.float32 complextype = np.complex64 + +# For C (CUDA) arrays +cfloattype = 'float' +ccomplextype = 'pycuda::complex' + +# Double precision +# For numpy arrays +#floattype = np.float64 +#complextype = np.complex128 + +# For C (CUDA) arrays +#cfloattype = 'double' +#ccomplextype = 'pycuda::complex'