aboutsummaryrefslogtreecommitdiff
path: root/Source/Utils/WarpX_Complex.H
blob: 048ee29940ff34686115a883d08b3c32873c3729 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* Copyright 2019-2020 Andrew Myers, David Grote, Maxence Thevenet
 * Remi Lehe
 *
 * This file is part of WarpX.
 *
 * License: BSD-3-Clause-LBNL
 */
#ifndef WARPX_COMPLEX_H_
#define WARPX_COMPLEX_H_

#ifdef WARPX_USE_PSATD
#  include "FieldSolver/SpectralSolver/AnyFFT.H"
#endif

#include <AMReX_Gpu.H>
#include <AMReX_GpuComplex.H>
#include <AMReX_REAL.H>

#include <complex>

// Defines a complex type on GPU & CPU
using Complex = amrex::GpuComplex<amrex::Real>;

#ifdef WARPX_USE_PSATD
static_assert(sizeof(Complex) == sizeof(AnyFFT::Complex),
    "The complex type in WarpX and the FFT library do not match.");
#endif

static_assert(sizeof(Complex) == sizeof(amrex::Real[2]),
              "Unexpected complex type.");

#endif //WARPX_COMPLEX_H_