diff options
-rw-r--r-- | Source/FieldSolver/WarpX_QED_K.H | 30 | ||||
-rw-r--r-- | Source/WarpX.H | 6 |
2 files changed, 18 insertions, 18 deletions
diff --git a/Source/FieldSolver/WarpX_QED_K.H b/Source/FieldSolver/WarpX_QED_K.H index f971779f7..44492bfbb 100644 --- a/Source/FieldSolver/WarpX_QED_K.H +++ b/Source/FieldSolver/WarpX_QED_K.H @@ -85,9 +85,9 @@ const amrex::Real dyi = 1./dy; amrex::Real Mny [3] = {0.,0.,0.}; amrex::Real Mpz [3] = {0.,0.,0.}; amrex::Real Mnz [3] = {0.,0.,0.}; - + // Calcualting the M-field at the chosen stencil points - + calc_M(Mpx, tmpEx(j+1,k,l), tmpEy(j+1,k,l), tmpEz(j+1,k,l), Bx(j+1,k,l), By(j+1,k,l), Bz(j+1,k,l), xi, c2); calc_M(Mnx, tmpEx(j-1,k,l), tmpEy(j-1,k,l), tmpEz(j-1,k,l), @@ -102,7 +102,7 @@ const amrex::Real dyi = 1./dy; Bx(j,k,l-1), By(j,k,l-1), Bz(j,k,l-1), xi, c2); // Calculating necessary curls - + const amrex::Real VxM[3] = { 0.5*( (Mpy[2]-Mny[2])*dyi - (Mpz[1]-Mnz[1])*dzi ), 0.5*( (Mpz[0]-Mnz[0])*dzi - (Mpx[2]-Mnx[2])*dxi ), @@ -152,7 +152,7 @@ const amrex::Real dyi = 1./dy; }; // Calcualting matrix values for the QED correction algorithm - + const amrex::Real a00 = beta + xi*( 8*ex*ex + 14*c2*bx*bx ); const amrex::Real a11 = beta + xi*( 8*ey*ey + 14*c2*by*by ); @@ -168,7 +168,7 @@ const amrex::Real dyi = 1./dy; const amrex::Real detA = a00*( a11*a22 - a12*a12 ) - a01*( a01*a22 - a02*a12 )+a02*( a01*a12 - a02*a11 ); // Calcualting the rows of the inverse matrix using the general 3x3 inverse form - + const amrex::Real invAx[3] = {a22*a11 - a12*a12, a12*a02 - a22*a01, a12*a01 - a11*a02}; const amrex::Real invAy[3] = {a02*a12 - a22*a01, a00*a22 - a02*a02, a01*a02 - a12*a00}; @@ -176,7 +176,7 @@ const amrex::Real dyi = 1./dy; const amrex::Real invAz[3] = {a12*a01 - a02*a11, a02*a01 - a12*a00, a11*a00 - a01*a01}; // Calcualting the final QED corrections by mutliplying the Omega vector with the inverse matrix - + const amrex::Real dEx = (-1/detA)*(invAx[0]*Omega[0] + invAx[1]*Omega[1] + invAx[2]*Omega[2]); @@ -190,7 +190,7 @@ const amrex::Real dyi = 1./dy; invAz[2]*Omega[2]); // Adding the QED corrections to the origional fields - + Ex(j,k,l) = Ex(j,k,l) + 0.5*dt*dEx; Ey(j,k,l) = Ey(j,k,l) + 0.5*dt*dEy; @@ -202,14 +202,14 @@ const amrex::Real dyi = 1./dy; #else // Picking out points for stencil to be used in curl function of M - + amrex::Real Mpx [3] = {0.,0.,0.}; amrex::Real Mnx [3] = {0.,0.,0.}; amrex::Real Mpz [3] = {0.,0.,0.}; amrex::Real Mnz [3] = {0.,0.,0.}; // Calcualting the M-field at the chosen stencil points - + calc_M(Mpx, tmpEx(j+1,k,0), tmpEy(j+1,k,0), tmpEz(j+1,k,0), Bx(j+1,k,0), By(j+1,k,0), Bz(j+1,k,0), xi, c2); calc_M(Mnx, tmpEx(j-1,k,0), tmpEy(j-1,k,0), tmpEz(j-1,k,0), @@ -220,7 +220,7 @@ const amrex::Real dyi = 1./dy; Bx(j,k-1,0), By(j,k-1,0), Bz(j,k-1,0), xi, c2); // Calculating necessary curls - + const amrex::Real VxM[3] = { -0.5*(Mpz[1]-Mnz[1])*dzi, 0.5*( (Mpz[0]-Mnz[0])*dzi - (Mpx[2]-Mnx[2])*dxi ), @@ -240,7 +240,7 @@ const amrex::Real dyi = 1./dy; }; // Defining comapct values for QED corrections - + const amrex::Real ex = tmpEx(j,k,0); const amrex::Real ey = tmpEy(j,k,0); const amrex::Real ez = tmpEz(j,k,0); @@ -268,7 +268,7 @@ const amrex::Real dyi = 1./dy; Alpha[1] + 2*xi*c2*( 4*ey*EVxB + 2*VxB[1]*( ee - c2*bb ) + 7*c2*by*BVxB ), Alpha[2] + 2*xi*c2*( 4*ez*EVxB + 2*VxB[2]*( ee - c2*bb ) + 7*c2*bz*BVxB ) }; - + // Calcualting matrix values for the QED correction algorithm const amrex::Real a00 = beta + xi*( 8*ex*ex + 14*c2*bx*bx ); @@ -286,7 +286,7 @@ const amrex::Real dyi = 1./dy; const amrex::Real detA = a00*( a11*a22 - a12*a12 ) - a01*( a01*a22 - a02*a12 ) + a02*( a01*a12 - a02*a11 ); // Calcualting matrix values for the QED correction algorithm - + const amrex::Real invAx[3] = {a22*a11 - a12*a12, a12*a02 - a22*a01, a12*a01 - a11*a02}; const amrex::Real invAy[3] = {a02*a12 - a22*a01, a00*a22 - a02*a02, a01*a02 - a12*a00}; @@ -294,7 +294,7 @@ const amrex::Real dyi = 1./dy; const amrex::Real invAz[3] = {a12*a01 - a02*a11, a02*a01 - a12*a00, a11*a00 - a01*a01}; // Calcualting the final QED corrections by mutliplying the Omega vector with the inverse matrix - + const amrex::Real dEx = (-1/detA)*(invAx[0]*Omega[0] + invAx[1]*Omega[1] + invAx[2]*Omega[2]); @@ -308,7 +308,7 @@ const amrex::Real dyi = 1./dy; invAz[2]*Omega[2]); // Adding the QED corrections to the origional fields - + Ex(j,k,0) = Ex(j,k,0) + 0.5*dt*dEx; Ey(j,k,0) = Ey(j,k,0) + 0.5*dt*dEy; diff --git a/Source/WarpX.H b/Source/WarpX.H index bb6da244f..81893175f 100644 --- a/Source/WarpX.H +++ b/Source/WarpX.H @@ -240,20 +240,20 @@ public: * \param dt vector of time steps (for all levels) */ void Hybrid_QED_Push ( amrex::Vector<amrex::Real> dt); - + /** \brief apply QED correction on electric field for level lev * \param lev mesh refinement level * \param dt time step */ void Hybrid_QED_Push (int lev, amrex::Real dt); - + /** \brief apply QED correction on electric field for level lev and patch type patch_type * \param lev mesh refinement level * \param dt patch_type which MR patch: PatchType::fine or PatchType::coarse * \param dt time step */ void Hybrid_QED_Push (int lev, PatchType patch_type, amrex::Real dt); - + static amrex::Real quantum_xi; #ifdef WARPX_DIM_RZ |