aboutsummaryrefslogtreecommitdiff
path: root/Source/LaserParticleContainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/LaserParticleContainer.cpp')
-rw-r--r--Source/LaserParticleContainer.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/Source/LaserParticleContainer.cpp b/Source/LaserParticleContainer.cpp
index 92b64b28c..23ba2457c 100644
--- a/Source/LaserParticleContainer.cpp
+++ b/Source/LaserParticleContainer.cpp
@@ -232,7 +232,7 @@ LaserParticleContainer::InitData (int lev)
BoxArray plane_ba { Box {IntVect(plane_lo[0],0), IntVect(plane_hi[0],0)} };
#endif
- Vector<Real> particle_x, particle_y, particle_z, particle_w;
+ RealVector particle_x, particle_y, particle_z, particle_w;
const DistributionMapping plane_dm {plane_ba, nprocs};
const Vector<int>& procmap = plane_dm.ProcessorMap();
@@ -263,9 +263,9 @@ LaserParticleContainer::InitData (int lev)
}
}
const int np = particle_z.size();
- Vector<Real> particle_ux(np, 0.0);
- Vector<Real> particle_uy(np, 0.0);
- Vector<Real> particle_uz(np, 0.0);
+ RealVector particle_ux(np, 0.0);
+ RealVector particle_uy(np, 0.0);
+ RealVector particle_uz(np, 0.0);
if (Verbose()) amrex::Print() << "Adding laser particles\n";
AddNParticles(lev,
@@ -289,6 +289,7 @@ LaserParticleContainer::Evolve (int lev,
BL_PROFILE_VAR_NS("Laser::Evolve::Copy", blp_copy);
BL_PROFILE_VAR_NS("PICSAR::LaserParticlePush", blp_pxr_pp);
BL_PROFILE_VAR_NS("PICSAR::LaserCurrentDepo", blp_pxr_cd);
+ BL_PROFILE_VAR_NS("Laser::Evolve::Accumulate", blp_accumulate);
const std::array<Real,3>& dx = WarpX::CellSize(lev);
@@ -311,7 +312,7 @@ LaserParticleContainer::Evolve (int lev,
#pragma omp parallel
#endif
{
- Vector<Real> xp, yp, zp, giv, plane_Xp, plane_Yp, amplitude_E;
+ RealVector xp, yp, zp, giv, plane_Xp, plane_Yp, amplitude_E;
FArrayBox local_rho, local_jx, local_jy, local_jz;
for (WarpXParIter pti(*this, lev); pti.isValid(); ++pti)
@@ -403,8 +404,7 @@ LaserParticleContainer::Evolve (int lev,
&lvect, &WarpX::charge_deposition_algo);
const int ncomp = 1;
- amrex_atomic_accumulate_fab(BL_TO_FORTRAN_3D(local_rho),
- BL_TO_FORTRAN_N_3D(rhofab,icomp), ncomp);
+ rhofab.atomicAdd(local_rho, 0, icomp, ncomp);
};
if (rho) depositCharge(rho,0);
@@ -512,15 +512,15 @@ LaserParticleContainer::Evolve (int lev,
&WarpX::nox,&WarpX::noy,&WarpX::noz,
&lvect,&WarpX::current_deposition_algo);
- const int ncomp = 1;
- amrex_atomic_accumulate_fab(BL_TO_FORTRAN_3D(local_jx),
- BL_TO_FORTRAN_3D(jxfab), ncomp);
- amrex_atomic_accumulate_fab(BL_TO_FORTRAN_3D(local_jy),
- BL_TO_FORTRAN_3D(jyfab), ncomp);
- amrex_atomic_accumulate_fab(BL_TO_FORTRAN_3D(local_jz),
- BL_TO_FORTRAN_3D(jzfab), ncomp);
-
BL_PROFILE_VAR_STOP(blp_pxr_cd);
+
+ BL_PROFILE_VAR_START(blp_accumulate);
+
+ jxfab.atomicAdd(local_jx);
+ jyfab.atomicAdd(local_jy);
+ jzfab.atomicAdd(local_jz);
+
+ BL_PROFILE_VAR_STOP(blp_accumulate);
if (rho) depositCharge(rho,1);