aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver
diff options
context:
space:
mode:
authorGravatar Axel Huebl <axel.huebl@plasma.ninja> 2020-02-25 21:09:07 -0800
committerGravatar GitHub <noreply@github.com> 2020-02-25 21:09:07 -0800
commit73cbbfe18c7f1b2d08824ff39fed59410c51f574 (patch)
treeb072c07744f5a7bcd464d14c6a9317d96a3da31a /Source/FieldSolver/SpectralSolver
parent2a56e2b7eae582abc1b7e2eecd83af7a72610f9b (diff)
downloadWarpX-73cbbfe18c7f1b2d08824ff39fed59410c51f574.tar.gz
WarpX-73cbbfe18c7f1b2d08824ff39fed59410c51f574.tar.zst
WarpX-73cbbfe18c7f1b2d08824ff39fed59410c51f574.zip
Includes: Clean Up (#743)
- Use `""` for WarpX-local includes - Order: WarpX `""`, AMReX `<>`, other third party includes `<>` - Add dir prefixes for WarpX Add order to includes by including from `Source/` onward and keeping directory prefixes of non-local includes for clarity.
Diffstat (limited to 'Source/FieldSolver/SpectralSolver')
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/GalileanAlgorithm.H5
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/GalileanAlgorithm.cpp9
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PMLPsatdAlgorithm.H5
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PMLPsatdAlgorithm.cpp9
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.H6
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.cpp8
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H8
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralFieldData.H8
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp6
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralKSpace.H4
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp6
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralSolver.H8
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralSolver.cpp16
-rw-r--r--Source/FieldSolver/SpectralSolver/WarpX_ComplexForFFT.H8
14 files changed, 76 insertions, 30 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/GalileanAlgorithm.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/GalileanAlgorithm.H
index e59b1902c..192c453ad 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/GalileanAlgorithm.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/GalileanAlgorithm.H
@@ -1,8 +1,9 @@
#ifndef WARPX_GALILEAN_ALGORITHM_H_
#define WARPX_GALILEAN_ALGORITHM_H_
-#include <SpectralBaseAlgorithm.H>
+#include "SpectralBaseAlgorithm.H"
+#if WARPX_USE_PSATD
/* \brief Class that updates the field in spectral space
* and stores the coefficients of the corresponding update equation.
*/
@@ -29,5 +30,5 @@ class GalileanAlgorithm : public SpectralBaseAlgorithm
SpectralRealCoefficients C_coef, S_ck_coef;
SpectralComplexCoefficients Theta2_coef, X1_coef, X2_coef, X3_coef, X4_coef;
};
-
+#endif // WARPX_USE_PSATD
#endif // WARPX_GALILEAN_ALGORITHM_H_
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/GalileanAlgorithm.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/GalileanAlgorithm.cpp
index f869da90c..ea0f14db9 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/GalileanAlgorithm.cpp
+++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/GalileanAlgorithm.cpp
@@ -1,7 +1,11 @@
-#include <GalileanAlgorithm.H>
-#include <WarpXConst.H>
+#include "GalileanAlgorithm.H"
+#include "Utils/WarpXConst.H"
+
#include <cmath>
+
+#if WARPX_USE_PSATD
+
using namespace amrex;
/* \brief Initialize coefficients for the update equation */
@@ -237,3 +241,4 @@ void GalileanAlgorithm::InitializeSpectralCoefficients(const SpectralKSpace& spe
});
}
}
+#endif // WARPX_USE_PSATD
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PMLPsatdAlgorithm.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PMLPsatdAlgorithm.H
index a2b85262d..ef12ff12e 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PMLPsatdAlgorithm.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PMLPsatdAlgorithm.H
@@ -7,7 +7,9 @@
#ifndef WARPX_PML_PSATD_ALGORITHM_H_
#define WARPX_PML_PSATD_ALGORITHM_H_
-#include <SpectralBaseAlgorithm.H>
+#include "SpectralBaseAlgorithm.H"
+
+#if WARPX_USE_PSATD
/* \brief Class that updates the field in spectral space
* and stores the coefficients of the corresponding update equation.
@@ -37,4 +39,5 @@ class PMLPsatdAlgorithm : public SpectralBaseAlgorithm
};
+#endif // WARPX_USE_PSATD
#endif // WARPX_PML_PSATD_ALGORITHM_H_
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PMLPsatdAlgorithm.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PMLPsatdAlgorithm.cpp
index 0c4c4d41a..b3f2aa93d 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PMLPsatdAlgorithm.cpp
+++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PMLPsatdAlgorithm.cpp
@@ -4,10 +4,14 @@
*
* License: BSD-3-Clause-LBNL
*/
-#include <PMLPsatdAlgorithm.H>
-#include <WarpXConst.H>
+#include "PMLPsatdAlgorithm.H"
+#include "Utils/WarpXConst.H"
+
#include <cmath>
+
+#if WARPX_USE_PSATD
+
using namespace amrex;
/* \brief Initialize coefficients for the update equation */
@@ -150,3 +154,4 @@ void PMLPsatdAlgorithm::InitializeSpectralCoefficients (
});
}
};
+#endif // WARPX_USE_PSATD
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.H
index 5e9b3e7bf..d71c0ab18 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.H
@@ -8,7 +8,10 @@
#ifndef WARPX_PSATD_ALGORITHM_H_
#define WARPX_PSATD_ALGORITHM_H_
-#include <SpectralBaseAlgorithm.H>
+#include "SpectralBaseAlgorithm.H"
+
+
+#if WARPX_USE_PSATD
/**
* \brief Class that updates the field in spectral space
@@ -37,4 +40,5 @@ class PsatdAlgorithm : public SpectralBaseAlgorithm
SpectralRealCoefficients C_coef, S_ck_coef, X1_coef, X2_coef, X3_coef;
};
+#endif // WARPX_USE_PSATD
#endif // WARPX_PSATD_ALGORITHM_H_
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.cpp
index b2675ff91..8fee0967d 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.cpp
+++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.cpp
@@ -4,10 +4,13 @@
*
* License: BSD-3-Clause-LBNL
*/
-#include <PsatdAlgorithm.H>
-#include <WarpXConst.H>
+#include "PsatdAlgorithm.H"
+#include "Utils/WarpXConst.H"
+
#include <cmath>
+
+#if WARPX_USE_PSATD
using namespace amrex;
/* \brief Initialize coefficients for the update equation */
@@ -176,3 +179,4 @@ void PsatdAlgorithm::InitializeSpectralCoefficients(const SpectralKSpace& spectr
});
}
}
+#endif // WARPX_USE_PSATD
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H
index ed5b98183..2487eae78 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/SpectralBaseAlgorithm.H
@@ -7,8 +7,11 @@
#ifndef WARPX_SPECTRAL_BASE_ALGORITHM_H_
#define WARPX_SPECTRAL_BASE_ALGORITHM_H_
-#include <SpectralKSpace.H>
-#include <SpectralFieldData.H>
+#include "FieldSolver/SpectralSolver/SpectralKSpace.H"
+#include "FieldSolver/SpectralSolver/SpectralFieldData.H"
+
+
+#if WARPX_USE_PSATD
/* \brief Class that updates the field in spectral space
* and stores the coefficients of the corresponding update equation.
@@ -57,4 +60,5 @@ class SpectralBaseAlgorithm
#endif
};
+#endif // WARPX_USE_PSATD
#endif // WARPX_SPECTRAL_BASE_ALGORITHM_H_
diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldData.H b/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
index 3088c9867..2c5a45faa 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralFieldData.H
@@ -8,12 +8,15 @@
#ifndef WARPX_SPECTRAL_FIELD_DATA_H_
#define WARPX_SPECTRAL_FIELD_DATA_H_
-#include <WarpX_ComplexForFFT.H>
-#include <SpectralKSpace.H>
+#include "WarpX_ComplexForFFT.H"
+#include "SpectralKSpace.H"
#include <AMReX_MultiFab.H>
#include <string>
+#ifdef WARPX_USE_PSATD
+# include <fftw3.h>
+
// Declare type for spectral fields
using SpectralField = amrex::FabArray< amrex::BaseFab <Complex> >;
@@ -85,4 +88,5 @@ class SpectralFieldData
#endif
};
+#endif // WARPX_USE_PSATD
#endif // WARPX_SPECTRAL_FIELD_DATA_H_
diff --git a/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp b/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
index 5604285ea..3c8ded86e 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
+++ b/Source/FieldSolver/SpectralSolver/SpectralFieldData.cpp
@@ -5,10 +5,13 @@
*
* License: BSD-3-Clause-LBNL
*/
-#include <SpectralFieldData.H>
+#include "SpectralFieldData.H"
#include <map>
+
+#if WARPX_USE_PSATD
+
using namespace amrex;
/* \brief Initialize fields in spectral space, and FFT plans */
@@ -351,3 +354,4 @@ SpectralFieldData::cufftErrorToString (const cufftResult& err)
}
}
#endif
+#endif // WARPX_USE_PSATD
diff --git a/Source/FieldSolver/SpectralSolver/SpectralKSpace.H b/Source/FieldSolver/SpectralSolver/SpectralKSpace.H
index c8b4f49eb..a736f4163 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralKSpace.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralKSpace.H
@@ -8,10 +8,12 @@
#ifndef WARPX_SPECTRAL_K_SPACE_H_
#define WARPX_SPECTRAL_K_SPACE_H_
-#include <WarpX_ComplexForFFT.H>
+#include "WarpX_ComplexForFFT.H"
+
#include <AMReX_BoxArray.H>
#include <AMReX_LayoutData.H>
+
// `KVectorComponent` and `SpectralShiftFactor` hold one 1D array
// ("ManagedVector") for each box ("LayoutData"). The arrays are
// only allocated if the corresponding box is owned by the local MPI rank.
diff --git a/Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp b/Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp
index d0355fc1e..9f4e9b7c8 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp
+++ b/Source/FieldSolver/SpectralSolver/SpectralKSpace.cpp
@@ -5,10 +5,12 @@
*
* License: BSD-3-Clause-LBNL
*/
-#include <WarpXConst.H>
-#include <SpectralKSpace.H>
+#include "Utils/WarpXConst.H"
+#include "SpectralKSpace.H"
+
#include <cmath>
+
using namespace amrex;
using namespace Gpu;
diff --git a/Source/FieldSolver/SpectralSolver/SpectralSolver.H b/Source/FieldSolver/SpectralSolver/SpectralSolver.H
index 2f6428fc6..6685e489c 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralSolver.H
+++ b/Source/FieldSolver/SpectralSolver/SpectralSolver.H
@@ -7,9 +7,11 @@
#ifndef WARPX_SPECTRAL_SOLVER_H_
#define WARPX_SPECTRAL_SOLVER_H_
-#include <SpectralBaseAlgorithm.H>
-#include <SpectralFieldData.H>
+#include "SpectralAlgorithms/SpectralBaseAlgorithm.H"
+#include "SpectralFieldData.H"
+
+#ifdef WARPX_USE_PSATD
/**
* \brief Top-level class for the electromagnetic spectral solver
*
@@ -64,5 +66,5 @@ class SpectralSolver
// SpectralBaseAlgorithm is a base class ; this pointer is meant
// to point an instance of a *sub-class* defining a specific algorithm
};
-
+#endif // WARPX_USE_PSATD
#endif // WARPX_SPECTRAL_SOLVER_H_
diff --git a/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp b/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
index 9df981528..9b79bc525 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
+++ b/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
@@ -4,13 +4,16 @@
*
* License: BSD-3-Clause-LBNL
*/
-#include <SpectralKSpace.H>
-#include <SpectralSolver.H>
-#include <PsatdAlgorithm.H>
-#include <GalileanAlgorithm.H>
-#include <PMLPsatdAlgorithm.H>
+#include "SpectralKSpace.H"
+#include "SpectralSolver.H"
+#include "SpectralAlgorithms/PsatdAlgorithm.H"
+#include "SpectralAlgorithms/GalileanAlgorithm.H"
+#include "SpectralAlgorithms/PMLPsatdAlgorithm.H"
#include "WarpX.H"
-#include "WarpXProfilerWrapper.H"
+#include "Utils/WarpXProfilerWrapper.H"
+
+
+#if WARPX_USE_PSATD
/* \brief Initialize the spectral Maxwell solver
*
@@ -91,3 +94,4 @@ SpectralSolver::pushSpectralFields(){
// initialized in the constructor of `SpectralSolver`
algorithm->pushSpectralFields( field_data );
}
+#endif // WARPX_USE_PSATD
diff --git a/Source/FieldSolver/SpectralSolver/WarpX_ComplexForFFT.H b/Source/FieldSolver/SpectralSolver/WarpX_ComplexForFFT.H
index f75c9b19a..0b48268fe 100644
--- a/Source/FieldSolver/SpectralSolver/WarpX_ComplexForFFT.H
+++ b/Source/FieldSolver/SpectralSolver/WarpX_ComplexForFFT.H
@@ -7,7 +7,8 @@
#ifndef WARPX_COMPLEXFORFFT_H_
#define WARPX_COMPLEXFORFFT_H_
-#include <WarpX_Complex.H>
+#include "Utils/WarpX_Complex.H"
+
// Check the complex type on GPU/CPU
#ifdef AMREX_USE_GPU
@@ -17,10 +18,11 @@ static_assert( sizeof(Complex) == sizeof(cuDoubleComplex),
"The complex types in WarpX and cuFFT do not match.");
#else
-
-#include <fftw3.h>
+# ifdef WARPX_USE_PSATD
+# include <fftw3.h>
static_assert( sizeof(Complex) == sizeof(fftw_complex),
"The complex types in WarpX and FFTW do not match.");
+# endif // WARPX_USE_PSATD
#endif