diff options
author | 2023-04-20 18:56:20 +0200 | |
---|---|---|
committer | 2023-04-20 09:56:20 -0700 | |
commit | 7771d25e8cb7ec8115c4e0cec24eee13a5bf9032 (patch) | |
tree | dc0fd88c71dc33645163f07df0138363e88d2ad7 /Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp | |
parent | 18e9ca3fd9e55651a39cc54d9fc31a8300756021 (diff) | |
download | WarpX-7771d25e8cb7ec8115c4e0cec24eee13a5bf9032.tar.gz WarpX-7771d25e8cb7ec8115c4e0cec24eee13a5bf9032.tar.zst WarpX-7771d25e8cb7ec8115c4e0cec24eee13a5bf9032.zip |
Use amrex::Math::powi<N>(x) in WarpX (#3846)
* use_powi
* fix bug
* fix bug
* fix bug
* fix bug
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp')
-rw-r--r-- | Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp index 8f576dad7..aecc754d4 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithmComoving.cpp @@ -13,6 +13,7 @@ #include <AMReX_GpuComplex.H> #include <AMReX_GpuLaunch.H> #include <AMReX_GpuQualifiers.H> +#include <AMReX_Math.H> #include <AMReX_MFIter.H> #include <AMReX_PODVector.H> @@ -198,21 +199,21 @@ void PsatdAlgorithmComoving::InitializeSpectralCoefficients (const SpectralKSpac { // Calculate norm of finite-order k vector const amrex::Real knorm_mod = std::sqrt( - std::pow(kx_mod[i], 2) + + amrex::Math::powi<2>(kx_mod[i]) + #if defined(WARPX_DIM_3D) - std::pow(ky_mod[j], 2) + - std::pow(kz_mod[k], 2)); + amrex::Math::powi<2>(ky_mod[j]) + + amrex::Math::powi<2>(kz_mod[k])); #else - std::pow(kz_mod[j], 2)); + amrex::Math::powi<2>(kz_mod[j])); #endif // Calculate norm of infinite-order k vector const amrex::Real knorm = std::sqrt( - std::pow(kx[i], 2) + + amrex::Math::powi<2>(kx[i]) + #if defined(WARPX_DIM_3D) - std::pow(ky[j], 2) + - std::pow(kz[k], 2)); + amrex::Math::powi<2>(ky[j]) + + amrex::Math::powi<2>(kz[k])); #else - std::pow(kz[j], 2)); + amrex::Math::powi<2>(kz[j])); #endif // Physical constants c, c**2, and epsilon_0, and imaginary unit constexpr amrex::Real c = PhysConst::c; |