From 658c6888a1cf1de2828a187d6d051a6bc5a2f4cb Mon Sep 17 00:00:00 2001 From: Remi Lehe Date: Mon, 27 Jan 2020 13:51:10 -0800 Subject: Fix compilation errors --- .../FieldSolver/FiniteDifferenceSolver/EvolveB.cpp | 45 ++++++++++++++-------- 1 file changed, 28 insertions(+), 17 deletions(-) (limited to 'Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp') diff --git a/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp b/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp index c08dee04f..72d3a1135 100644 --- a/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp +++ b/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp @@ -1,7 +1,7 @@ #include "WarpXAlgorithmSelection.H" #include "FiniteDifferenceSolver.H" #ifdef WARPX_DIM_RZ - #include "FiniteDifferenceAlgorithms/YeeAlgorithm.H" + #include "FiniteDifferenceAlgorithms/CylindricalYeeAlgorithm.H" #else #include "FiniteDifferenceAlgorithms/YeeAlgorithm.H" #include "FiniteDifferenceAlgorithms/CKCAlgorithm.H" @@ -14,19 +14,20 @@ void FiniteDifferenceSolver::EvolveB ( VectorField& Bfield, VectorField const& Efield, amrex::Real const dt ) { + // Select algorithm (The choice of algorithm is a runtime option, + // but we compile code for each algorithm, using templates) #ifdef WARPX_DIM_RZ - EvolveBCylindrical( Bfield, Efield, dt ); + if (m_fdtd_algo == MaxwellSolverAlgo::Yee){ + EvolveBCylindrical ( Bfield, Efield, dt ); #else - // Select algorithm (The choice of algorithm is a runtime option, - // but we compile code for each algorithm, using templates) if (m_fdtd_algo == MaxwellSolverAlgo::Yee){ EvolveBCartesian ( Bfield, Efield, dt ); } else if (m_fdtd_algo == MaxwellSolverAlgo::CKC) { EvolveBCartesian ( Bfield, Efield, dt ); +#endif } else { amrex::Abort("Unknown algorithm"); } -#endif } @@ -110,12 +111,16 @@ void FiniteDifferenceSolver::EvolveBCylindrical ( VectorField& Bfield, auto const& Ez = Efield[2]->array(mfi); // Extract stencil coefficients - Real const dr = m_dr; Real const* AMREX_RESTRICT coefs_r = stencil_coefs_r.dataPtr(); int const n_coefs_r = stencil_coefs_r.size(); Real const* AMREX_RESTRICT coefs_z = stencil_coefs_z.dataPtr(); int const n_coefs_z = stencil_coefs_z.size(); + // Extract cylindrical specific parameters + Real const dr = m_dr; + int const nmodes = m_nmodes; + Real const rmin = m_rmin; + // Extract tileboxes for which to loop const Box& tbr = mfi.tilebox(Bfield[0]->ixType().ixType()); const Box& tbt = mfi.tilebox(Bfield[1]->ixType().ixType()); @@ -128,9 +133,11 @@ void FiniteDifferenceSolver::EvolveBCylindrical ( VectorField& Bfield, Real const r = rmin + i*dr; // r on nodal point (Br is nodal in r) Br(i, j, 0, 0) += dt * T_Algo::UpwardDz(Et, coefs_z, n_coefs_z, i, j, 0, 0); // Mode m=0 for (int m=1; m