aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2020-01-28 21:36:36 -0800
committerGravatar Remi Lehe <remi.lehe@normalesup.org> 2020-01-28 22:02:05 -0800
commitcb3ab1a53576cd26f9403138b96e4d9670a6a866 (patch)
tree9efd27201a7773e8ee817dbcd2ce6f53f0b29250 /Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp
parent9b91acb4d08ee89cc41d2980715f9d61df281af1 (diff)
downloadWarpX-cb3ab1a53576cd26f9403138b96e4d9670a6a866.tar.gz
WarpX-cb3ab1a53576cd26f9403138b96e4d9670a6a866.tar.zst
WarpX-cb3ab1a53576cd26f9403138b96e4d9670a6a866.zip
Add comments
Diffstat (limited to 'Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp')
-rw-r--r--Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp33
1 files changed, 24 insertions, 9 deletions
diff --git a/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp b/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp
index 7a3f5aa9b..a84cb0a53 100644
--- a/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp
+++ b/Source/FieldSolver/FiniteDifferenceSolver/EvolveB.cpp
@@ -11,22 +11,34 @@
using namespace amrex;
-void FiniteDifferenceSolver::EvolveB ( VectorField& Bfield,
- VectorField const& Efield,
- amrex::Real const dt ) {
+/**
+ * \brief Update the B field, over one timestep
+ */
+void FiniteDifferenceSolver::EvolveB (
+ std::array< std::unique_ptr<amrex::MultiFab>, 3 >& Bfield,
+ std::array< std::unique_ptr<amrex::MultiFab>, 3 > 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
if (m_fdtd_algo == MaxwellSolverAlgo::Yee){
+
EvolveBCylindrical <CylindricalYeeAlgorithm> ( Bfield, Efield, dt );
+
#else
if (m_do_nodal) {
+
EvolveBCartesian <NodalAlgorithm> ( Bfield, Efield, dt );
+
} else if (m_fdtd_algo == MaxwellSolverAlgo::Yee) {
+
EvolveBCartesian <YeeAlgorithm> ( Bfield, Efield, dt );
+
} else if (m_fdtd_algo == MaxwellSolverAlgo::CKC) {
+
EvolveBCartesian <CKCAlgorithm> ( Bfield, Efield, dt );
+
#endif
} else {
amrex::Abort("Unknown algorithm");
@@ -34,12 +46,14 @@ void FiniteDifferenceSolver::EvolveB ( VectorField& Bfield,
}
+
#ifndef WARPX_DIM_RZ
template<typename T_Algo>
-void FiniteDifferenceSolver::EvolveBCartesian ( VectorField& Bfield,
- VectorField const& Efield,
- amrex::Real const dt ) {
+void FiniteDifferenceSolver::EvolveBCartesian (
+ std::array< std::unique_ptr<amrex::MultiFab>, 3 >& Bfield,
+ std::array< std::unique_ptr<amrex::MultiFab>, 3 > const& Efield,
+ amrex::Real const dt ) {
// Loop through the grids, and over the tiles within each grid
#ifdef _OPENMP
@@ -95,9 +109,10 @@ void FiniteDifferenceSolver::EvolveBCartesian ( VectorField& Bfield,
#else // corresponds to ifndef WARPX_DIM_RZ
template<typename T_Algo>
-void FiniteDifferenceSolver::EvolveBCylindrical ( VectorField& Bfield,
- VectorField const& Efield,
- amrex::Real const dt ) {
+void FiniteDifferenceSolver::EvolveBCylindrical (
+ std::array< std::unique_ptr<amrex::MultiFab>, 3 >& Bfield,
+ std::array< std::unique_ptr<amrex::MultiFab>, 3 > const& Efield,
+ amrex::Real const dt ) {
// Loop through the grids, and over the tiles within each grid
#ifdef _OPENMP