aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/LaserParticleContainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Particles/LaserParticleContainer.cpp')
-rw-r--r--Source/Particles/LaserParticleContainer.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/Source/Particles/LaserParticleContainer.cpp b/Source/Particles/LaserParticleContainer.cpp
index 8221683c1..73e27b3c5 100644
--- a/Source/Particles/LaserParticleContainer.cpp
+++ b/Source/Particles/LaserParticleContainer.cpp
@@ -86,7 +86,7 @@ LaserParticleContainer::LaserParticleContainer (AmrCore* amr_core, int ispecies,
charge = 1.0;
mass = std::numeric_limits<Real>::max();
- ParmParse pp_laser_name(m_laser_name);
+ const ParmParse pp_laser_name(m_laser_name);
// Parse the type of laser profile and set the corresponding flag `profile`
std::string laser_type_s;
@@ -114,7 +114,7 @@ LaserParticleContainer::LaserParticleContainer (AmrCore* amr_core, int ispecies,
const bool a0_is_specified =
utils::parser::queryWithParser(pp_laser_name, "a0", a0);
if (a0_is_specified){
- Real omega = 2._rt*MathConst::pi*PhysConst::c/m_wavelength;
+ const Real omega = 2._rt*MathConst::pi*PhysConst::c/m_wavelength;
m_e_max = PhysConst::m_e * omega * PhysConst::c * a0 / PhysConst::q_e;
}
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
@@ -138,10 +138,10 @@ LaserParticleContainer::LaserParticleContainer (AmrCore* amr_core, int ispecies,
//Check if someone uses the obsolete syntax
std::vector<std::string> backward_laser_names;
- ParmParse pp_lasers("lasers");
+ const ParmParse pp_lasers("lasers");
pp_lasers.queryarr("names", backward_laser_names);
- for(std::string lasersiter : backward_laser_names){
- ParmParse pp_name(lasersiter);
+ for(const std::string& lasersiter : backward_laser_names){
+ const ParmParse pp_name(lasersiter);
std::string backward_profile;
std::stringstream lasers;
pp_name.query("profile", backward_profile);
@@ -187,7 +187,7 @@ LaserParticleContainer::LaserParticleContainer (AmrCore* amr_core, int ispecies,
// Get the position of the plane, along the boost direction, in the lab frame
// and convert the position of the antenna to the boosted frame
m_Z0_lab = m_nvec[0]*m_position[0] + m_nvec[1]*m_position[1] + m_nvec[2]*m_position[2];
- Real Z0_boost = m_Z0_lab/WarpX::gamma_boost;
+ const Real Z0_boost = m_Z0_lab/WarpX::gamma_boost;
m_position[0] += (Z0_boost-m_Z0_lab)*m_nvec[0];
m_position[1] += (Z0_boost-m_Z0_lab)*m_nvec[1];
m_position[2] += (Z0_boost-m_Z0_lab)*m_nvec[2];
@@ -234,7 +234,7 @@ LaserParticleContainer::LaserParticleContainer (AmrCore* amr_core, int ispecies,
m_updated_position = m_position;
// Sanity checks
- int dir = WarpX::moving_window_dir;
+ const int dir = WarpX::moving_window_dir;
std::vector<Real> windir(3, 0.0);
#if defined(WARPX_DIM_1D_Z)
windir[2] = 1.0;
@@ -328,7 +328,7 @@ LaserParticleContainer::UpdateContinuousInjectionPosition (Real dt)
{
if (!m_enabled) return;
- int dir = WarpX::moving_window_dir;
+ const int dir = WarpX::moving_window_dir;
if (do_continuous_injection and (WarpX::gamma_boost > 1)){
// In boosted-frame simulations, the antenna has moved since the last
// call to this function, and injection position needs to be updated
@@ -482,9 +482,9 @@ LaserParticleContainer::InitData (int lev)
}
}
#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
- BoxArray plane_ba { Box {IntVect(plane_lo[0],0), IntVect(plane_hi[0],0)} };
+ const BoxArray plane_ba { Box {IntVect(plane_lo[0],0), IntVect(plane_hi[0],0)} };
#else
- BoxArray plane_ba { Box {IntVect(0), IntVect(0)} };
+ const BoxArray plane_ba { Box {IntVect(0), IntVect(0)} };
#endif
amrex::Vector<amrex::ParticleReal> particle_x, particle_y, particle_z, particle_w;
@@ -658,7 +658,7 @@ LaserParticleContainer::Evolve (int lev,
if (skip_deposition == false)
{
// Deposit at t_{n+1/2}
- amrex::Real relative_time = -0.5_rt * dt;
+ const amrex::Real relative_time = -0.5_rt * dt;
int* ion_lev = nullptr;
// Deposit inside domains
@@ -792,16 +792,16 @@ LaserParticleContainer::calculate_laser_plane_coordinates (const WarpXParIter& p
const auto GetPosition = GetParticlePosition(pti);
#if (AMREX_SPACEDIM >= 2)
- Real tmp_u_X_0 = m_u_X[0];
- Real tmp_u_X_2 = m_u_X[2];
- Real tmp_position_0 = m_position[0];
- Real tmp_position_2 = m_position[2];
+ const Real tmp_u_X_0 = m_u_X[0];
+ const Real tmp_u_X_2 = m_u_X[2];
+ const Real tmp_position_0 = m_position[0];
+ const Real tmp_position_2 = m_position[2];
#if defined(WARPX_DIM_3D) || defined(WARPX_DIM_RZ)
- Real tmp_u_X_1 = m_u_X[1];
- Real tmp_u_Y_0 = m_u_Y[0];
- Real tmp_u_Y_1 = m_u_Y[1];
- Real tmp_u_Y_2 = m_u_Y[2];
- Real tmp_position_1 = m_position[1];
+ const Real tmp_u_X_1 = m_u_X[1];
+ const Real tmp_u_Y_0 = m_u_Y[0];
+ const Real tmp_u_Y_1 = m_u_Y[1];
+ const Real tmp_u_Y_2 = m_u_Y[2];
+ const Real tmp_position_1 = m_position[1];
#endif
#endif
@@ -854,17 +854,17 @@ LaserParticleContainer::update_laser_particle (WarpXParIter& pti,
const auto GetPosition = GetParticlePosition(pti);
auto SetPosition = SetParticlePosition(pti);
- Real tmp_p_X_0 = m_p_X[0];
- Real tmp_p_X_1 = m_p_X[1];
- Real tmp_p_X_2 = m_p_X[2];
- Real tmp_nvec_0 = m_nvec[0];
- Real tmp_nvec_1 = m_nvec[1];
- Real tmp_nvec_2 = m_nvec[2];
+ const Real tmp_p_X_0 = m_p_X[0];
+ const Real tmp_p_X_1 = m_p_X[1];
+ const Real tmp_p_X_2 = m_p_X[2];
+ const Real tmp_nvec_0 = m_nvec[0];
+ const Real tmp_nvec_1 = m_nvec[1];
+ const Real tmp_nvec_2 = m_nvec[2];
// Copy member variables to tmp copies for GPU runs.
- Real tmp_mobility = m_mobility;
- Real gamma_boost = WarpX::gamma_boost;
- Real beta_boost = WarpX::beta_boost;
+ const Real tmp_mobility = m_mobility;
+ const Real gamma_boost = WarpX::gamma_boost;
+ const Real beta_boost = WarpX::beta_boost;
amrex::ParallelFor(
np,
[=] AMREX_GPU_DEVICE (int i) {