diff options
Diffstat (limited to 'Source/FieldSolver/FiniteDifferenceSolver')
9 files changed, 34 insertions, 12 deletions
diff --git a/Source/FieldSolver/FiniteDifferenceSolver/ComputeDivE.cpp b/Source/FieldSolver/FiniteDifferenceSolver/ComputeDivE.cpp index 5eb5da617..a6376e03c 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/ComputeDivE.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/ComputeDivE.cpp @@ -137,7 +137,7 @@ void FiniteDifferenceSolver::ComputeDivECylindrical ( // Loop over the cells and update the fields amrex::ParallelFor(tdive, - [=] AMREX_GPU_DEVICE (int i, int j, int k){ + [=] AMREX_GPU_DEVICE (int i, int j, int /*k*/){ Real const r = rmin + i*dr; // r on a nodal grid (F is nodal in r) if (r != 0) { // Off-axis, regular equations divE(i, j, 0, 0) = diff --git a/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp b/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp index 138e7eb9a..9afec55e0 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp @@ -154,7 +154,7 @@ void FiniteDifferenceSolver::EvolveBCylindrical ( // Loop over the cells and update the fields amrex::ParallelFor(tbr, tbt, tbz, - [=] AMREX_GPU_DEVICE (int i, int j, int k){ + [=] AMREX_GPU_DEVICE (int i, int j, int /*k*/){ Real const r = rmin + i*dr; // r on nodal point (Br is nodal in r) if (r != 0) { // Off-axis, regular Maxwell equations Br(i, j, 0, 0) += dt * T_Algo::UpwardDz(Et, coefs_z, n_coefs_z, i, j, 0, 0); // Mode m=0 @@ -187,7 +187,7 @@ void FiniteDifferenceSolver::EvolveBCylindrical ( } }, - [=] AMREX_GPU_DEVICE (int i, int j, int k){ + [=] AMREX_GPU_DEVICE (int i, int j, int /*k*/){ Bt(i, j, 0, 0) += dt*( T_Algo::UpwardDr(Ez, coefs_r, n_coefs_r, i, j, 0, 0) - T_Algo::UpwardDz(Er, coefs_z, n_coefs_z, i, j, 0, 0)); // Mode m=0 @@ -201,7 +201,7 @@ void FiniteDifferenceSolver::EvolveBCylindrical ( } }, - [=] AMREX_GPU_DEVICE (int i, int j, int k){ + [=] AMREX_GPU_DEVICE (int i, int j, int /*k*/){ Real const r = rmin + (i + 0.5)*dr; // r on a cell-centered grid (Bz is cell-centered in r) Bz(i, j, 0, 0) += dt*( - T_Algo::UpwardDrr_over_r(Et, r, dr, coefs_r, n_coefs_r, i, j, 0, 0)); for (int m=1 ; m<nmodes ; m++) { // Higher-order modes diff --git a/Source/FieldSolver/FiniteDifferenceSolver/EvolveBPML.cpp b/Source/FieldSolver/FiniteDifferenceSolver/EvolveBPML.cpp index 6282892ab..d449333c1 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/EvolveBPML.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/EvolveBPML.cpp @@ -16,6 +16,7 @@ #endif #include "BoundaryConditions/PMLComponent.H" #include <AMReX_Gpu.H> +#include <AMReX.H> using namespace amrex; @@ -30,6 +31,7 @@ void FiniteDifferenceSolver::EvolveBPML ( // Select algorithm (The choice of algorithm is a runtime option, // but we compile code for each algorithm, using templates) #ifdef WARPX_DIM_RZ + amrex::ignore_unused(Bfield, Efield, dt); amrex::Abort("PML are not implemented in cylindrical geometry."); #else if (m_do_nodal) { diff --git a/Source/FieldSolver/FiniteDifferenceSolver/EvolveE.cpp b/Source/FieldSolver/FiniteDifferenceSolver/EvolveE.cpp index 09aa9df48..fc43fe209 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/EvolveE.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/EvolveE.cpp @@ -202,7 +202,7 @@ void FiniteDifferenceSolver::EvolveECylindrical ( // Loop over the cells and update the fields amrex::ParallelFor(ter, tet, tez, - [=] AMREX_GPU_DEVICE (int i, int j, int k){ + [=] AMREX_GPU_DEVICE (int i, int j, int /*k*/){ Real const r = rmin + (i + 0.5)*dr; // r on cell-centered point (Er is cell-centered in r) Er(i, j, 0, 0) += c2 * dt*( - T_Algo::DownwardDz(Bt, coefs_z, n_coefs_z, i, j, 0, 0) @@ -219,7 +219,7 @@ void FiniteDifferenceSolver::EvolveECylindrical ( } }, - [=] AMREX_GPU_DEVICE (int i, int j, int k){ + [=] AMREX_GPU_DEVICE (int i, int j, int /*k*/){ Real const r = rmin + i*dr; // r on a nodal grid (Et is nodal in r) if (r != 0) { // Off-axis, regular Maxwell equations Et(i, j, 0, 0) += c2 * dt*( @@ -260,7 +260,7 @@ void FiniteDifferenceSolver::EvolveECylindrical ( } }, - [=] AMREX_GPU_DEVICE (int i, int j, int k){ + [=] AMREX_GPU_DEVICE (int i, int j, int /*k*/){ Real const r = rmin + i*dr; // r on a nodal grid (Ez is nodal in r) if (r != 0) { // Off-axis, regular Maxwell equations Ez(i, j, 0, 0) += c2 * dt*( @@ -302,14 +302,14 @@ void FiniteDifferenceSolver::EvolveECylindrical ( // Loop over the cells and update the fields amrex::ParallelFor(ter, tet, tez, - [=] AMREX_GPU_DEVICE (int i, int j, int k){ + [=] AMREX_GPU_DEVICE (int i, int j, int /*k*/){ Er(i, j, 0, 0) += c2 * dt * T_Algo::UpwardDr(F, coefs_r, n_coefs_r, i, j, 0, 0); for (int m=1; m<nmodes; m++) { // Higher-order modes Er(i, j, 0, 2*m-1) += c2 * dt * T_Algo::UpwardDr(F, coefs_r, n_coefs_r, i, j, 0, 2*m-1); // Real part Er(i, j, 0, 2*m ) += c2 * dt * T_Algo::UpwardDr(F, coefs_r, n_coefs_r, i, j, 0, 2*m ); // Imaginary part } }, - [=] AMREX_GPU_DEVICE (int i, int j, int k){ + [=] AMREX_GPU_DEVICE (int i, int j, int /*k*/){ // Mode m=0: no update Real const r = rmin + i*dr; // r on a nodal grid (Et is nodal in r) if (r != 0){ // Off-axis, regular Maxwell equations @@ -327,7 +327,7 @@ void FiniteDifferenceSolver::EvolveECylindrical ( } } }, - [=] AMREX_GPU_DEVICE (int i, int j, int k){ + [=] AMREX_GPU_DEVICE (int i, int j, int /*k*/){ Ez(i, j, 0, 0) += c2 * dt * T_Algo::UpwardDz(F, coefs_z, n_coefs_z, i, j, 0, 0); for (int m=1; m<nmodes; m++) { // Higher-order modes Ez(i, j, 0, 2*m-1) += c2 * dt * T_Algo::UpwardDz(F, coefs_z, n_coefs_z, i, j, 0, 2*m-1); // Real part diff --git a/Source/FieldSolver/FiniteDifferenceSolver/EvolveEPML.cpp b/Source/FieldSolver/FiniteDifferenceSolver/EvolveEPML.cpp index 34144ff0d..a06d98f9b 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/EvolveEPML.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/EvolveEPML.cpp @@ -19,6 +19,7 @@ #include "BoundaryConditions/PMLComponent.H" #include "Utils/WarpXConst.H" #include <AMReX_Gpu.H> +#include <AMReX.H> using namespace amrex; @@ -36,6 +37,7 @@ void FiniteDifferenceSolver::EvolveEPML ( // Select algorithm (The choice of algorithm is a runtime option, // but we compile code for each algorithm, using templates) #ifdef WARPX_DIM_RZ + amrex::ignore_unused(Efield, Bfield, Jfield, Ffield, sigba, dt, pml_has_particles); amrex::Abort("PML are not implemented in cylindrical geometry."); #else if (m_do_nodal) { diff --git a/Source/FieldSolver/FiniteDifferenceSolver/EvolveF.cpp b/Source/FieldSolver/FiniteDifferenceSolver/EvolveF.cpp index 20560f038..6627d2ef6 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/EvolveF.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/EvolveF.cpp @@ -162,7 +162,7 @@ void FiniteDifferenceSolver::EvolveFCylindrical ( // Loop over the cells and update the fields amrex::ParallelFor(tf, - [=] AMREX_GPU_DEVICE (int i, int j, int k){ + [=] AMREX_GPU_DEVICE (int i, int j, int /*k*/){ Real const r = rmin + i*dr; // r on a nodal grid (F is nodal in r) if (r != 0) { // Off-axis, regular equations F(i, j, 0, 0) += dt * ( diff --git a/Source/FieldSolver/FiniteDifferenceSolver/EvolveFPML.cpp b/Source/FieldSolver/FiniteDifferenceSolver/EvolveFPML.cpp index b36c50c35..ba7a90483 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/EvolveFPML.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/EvolveFPML.cpp @@ -16,6 +16,7 @@ #endif #include "BoundaryConditions/PMLComponent.H" #include <AMReX_Gpu.H> +#include <AMReX.H> using namespace amrex; @@ -30,6 +31,7 @@ void FiniteDifferenceSolver::EvolveFPML ( // Select algorithm (The choice of algorithm is a runtime option, // but we compile code for each algorithm, using templates) #ifdef WARPX_DIM_RZ + amrex::ignore_unused(Ffield, Efield, dt); amrex::Abort("PML are not implemented in cylindrical geometry."); #else if (m_do_nodal) { diff --git a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CylindricalYeeAlgorithm.H b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CylindricalYeeAlgorithm.H index 13807b131..6196598b3 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CylindricalYeeAlgorithm.H +++ b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceAlgorithms/CylindricalYeeAlgorithm.H @@ -13,6 +13,7 @@ #include <AMReX_REAL.H> #include <AMReX_Array4.H> #include <AMReX_Gpu.H> +#include <AMReX.H> #include <array> #include <cmath> @@ -76,6 +77,8 @@ struct CylindricalYeeAlgorithm { int const i, int const j, int const k, int const comp ) { using namespace amrex; + ignore_unused(n_coefs_r); + Real const inv_dr = coefs_r[0]; return 1._rt/r * inv_dr*( (r+0.5_rt*dr)*F(i+1,j,k,comp) - (r-0.5_rt*dr)*F(i,j,k,comp) ); }; @@ -92,6 +95,8 @@ struct CylindricalYeeAlgorithm { int const i, int const j, int const k, int const comp ) { using namespace amrex; + ignore_unused(n_coefs_r); + Real const inv_dr = coefs_r[0]; return 1._rt/r * inv_dr*( (r+0.5_rt*dr)*F(i,j,k,comp) - (r-0.5_rt*dr)*F(i-1,j,k,comp) ); }; @@ -105,6 +110,8 @@ struct CylindricalYeeAlgorithm { int const i, int const j, int const k, int const comp ) { using namespace amrex; + ignore_unused(n_coefs_r); + Real const inv_dr = coefs_r[0]; return inv_dr*( F(i+1,j,k,comp) - F(i,j,k,comp) ); }; @@ -118,6 +125,8 @@ struct CylindricalYeeAlgorithm { int const i, int const j, int const k, int const comp ) { using namespace amrex; + ignore_unused(n_coefs_r); + Real const inv_dr = coefs_r[0]; return inv_dr*( F(i,j,k,comp) - F(i-1,j,k,comp) ); }; @@ -130,6 +139,8 @@ struct CylindricalYeeAlgorithm { amrex::Real const * const coefs_z, int const n_coefs_z, int const i, int const j, int const k, int const comp ) { + amrex::ignore_unused(n_coefs_z); + amrex::Real const inv_dz = coefs_z[0]; return inv_dz*( F(i,j+1,k,comp) - F(i,j,k,comp) ); }; @@ -142,6 +153,8 @@ struct CylindricalYeeAlgorithm { amrex::Real const * const coefs_z, int const n_coefs_z, int const i, int const j, int const k, int const comp ) { + amrex::ignore_unused(n_coefs_z); + amrex::Real const inv_dz = coefs_z[0]; return inv_dz*( F(i,j,k,comp) - F(i,j-1,k,comp) ); }; diff --git a/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp b/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp index dd0a48c0b..8ed0f5927 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp @@ -9,8 +9,10 @@ #endif #include "Utils/WarpXConst.H" #include "Utils/CoarsenIO.H" -#include <AMReX_Gpu.H> #include <WarpX.H> +#include <AMReX.H> +#include <AMReX_Gpu.H> + using namespace amrex; @@ -23,6 +25,7 @@ void FiniteDifferenceSolver::MacroscopicEvolveE ( // Select algorithm (The choice of algorithm is a runtime option, // but we compile code for each algorithm, using templates) #ifdef WARPX_DIM_RZ + amrex::ignore_unused(Efield, Bfield, Jfield, dt, macroscopic_properties); amrex::Abort("currently macro E-push does not work for RZ"); #else if (m_do_nodal) { |