Skip to content

Commit 393a5c9

Browse files
author
Mathieu Lobet
committed
Clean member variable and function names in Radiation.h to respect the Smilei rules
1 parent d82b433 commit 393a5c9

File tree

11 files changed

+58
-58
lines changed

11 files changed

+58
-58
lines changed

src/MultiphotonBreitWheeler/MultiphotonBreitWheeler.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ MultiphotonBreitWheeler::MultiphotonBreitWheeler(Params& params, Species * speci
2525
dt = params.timestep;
2626

2727
// Normalized Schwinger Electric Field
28-
norm_E_Schwinger = params.electron_mass*params.c_vacuum*params.c_vacuum
28+
norm_E_Schwinger_ = params.electron_mass*params.c_vacuum*params.c_vacuum
2929
/ (params.red_planck_cst*params.reference_angular_frequency_SI);
3030

31-
// Inverse of norm_E_Schwinger
32-
inv_norm_E_Schwinger = 1./norm_E_Schwinger;
31+
// Inverse of norm_E_Schwinger_
32+
inv_norm_E_Schwinger_ = 1./norm_E_Schwinger_;
3333

3434
// Number of positrons and electrons generated per event
3535
this->mBW_pair_creation_sampling[0] = species->mBW_pair_creation_sampling[0];

src/MultiphotonBreitWheeler/MultiphotonBreitWheeler.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class MultiphotonBreitWheeler
6464
double & Bx, double & By, double & Bz)
6565
{
6666

67-
return inv_norm_E_Schwinger
67+
return inv_norm_E_Schwinger_
6868
* sqrt( fabs( pow(Ex*kx + Ey*ky + Ez*kz,2)
6969
- pow(gamma*Ex - By*kz + Bz*ky,2)
7070
- pow(gamma*Ey - Bz*kx + Bx*kz,2)
@@ -146,10 +146,10 @@ class MultiphotonBreitWheeler
146146
// Factors
147147

148148
//! Normalized Schwinger Electric field
149-
double norm_E_Schwinger;
149+
double norm_E_Schwinger_;
150150

151151
//! Inverse Normalized Schwinger Electric field
152-
double inv_norm_E_Schwinger;
152+
double inv_norm_E_Schwinger_;
153153

154154
//! Espilon to check when tau is near 0
155155
const double epsilon_tau_ = 1e-100;

src/Radiation/Radiation.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ Radiation::Radiation(Params& params, Species * species)
2020
nDim_ = params.nDim_particle;
2121

2222
// Time step
23-
dt = params.timestep;
23+
dt_ = params.timestep;
2424

2525
// Inverse of the species mass
2626
one_over_mass_ = 1./species->mass;
2727

2828
// Normalized Schwinger Electric Field
29-
norm_E_Schwinger = params.electron_mass*params.c_vacuum*params.c_vacuum
29+
norm_E_Schwinger_ = params.electron_mass*params.c_vacuum*params.c_vacuum
3030
/ (params.red_planck_cst* params.reference_angular_frequency_SI);
3131

32-
// Inverse of norm_E_Schwinger
33-
inv_norm_E_Schwinger = 1./norm_E_Schwinger;
32+
// Inverse of norm_E_Schwinger_
33+
inv_norm_E_Schwinger_ = 1./norm_E_Schwinger_;
3434

3535
// The thread radiated energy is initially null
36-
radiated_energy = 0;
36+
radiated_energy_ = 0;
3737
}
3838

3939
// -----------------------------------------------------------------------------
@@ -52,7 +52,7 @@ Radiation::~Radiation()
5252
//! \param iend Index of the last particle
5353
//! \param ithread Thread index
5454
// -----------------------------------------------------------------------------
55-
void Radiation::compute_thread_chipa(Particles &particles,
55+
void Radiation::computeParticlesChi(Particles &particles,
5656
SmileiMPI* smpi,
5757
int istart,
5858
int iend,
@@ -105,7 +105,7 @@ void Radiation::compute_thread_chipa(Particles &particles,
105105
+ momentum[2][ipart]*momentum[2][ipart]);
106106

107107
// Computation of the Lorentz invariant quantum parameter
108-
chi[ipart] = Radiation::compute_chipa(charge_over_mass2,
108+
chi[ipart] = Radiation::computeParticleChi(charge_over_mass2,
109109
momentum[0][ipart],momentum[1][ipart],momentum[2][ipart],
110110
gamma,
111111
(*(Ex+ipart-ipart_ref)),(*(Ey+ipart-ipart_ref)),(*(Ez+ipart-ipart_ref)),

src/Radiation/Radiation.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ class Radiation
6262
//! \param By y component of the particle magnetic field
6363
//! \param Bz z component of the particle magnetic field
6464
//#pragma omp declare simd
65-
double inline compute_chipa(double & charge_over_mass2,
65+
double inline computeParticleChi(double & charge_over_mass2,
6666
double & px, double & py, double & pz,
6767
double & gamma,
6868
double & Ex, double & Ey, double & Ez,
6969
double & Bx, double & By, double & Bz)
7070
{
7171

72-
return fabs(charge_over_mass2)*inv_norm_E_Schwinger
72+
return fabs(charge_over_mass2)*inv_norm_E_Schwinger_
7373
* sqrt( fabs( pow(Ex*px + Ey*py + Ez*pz,2)
7474
- pow(gamma*Ex - By*pz + Bz*py,2)
7575
- pow(gamma*Ey - Bz*px + Bx*pz,2)
@@ -79,14 +79,14 @@ class Radiation
7979
//! Return the total normalized radiated energy
8080
double inline getRadiatedEnergy()
8181
{
82-
return radiated_energy;
82+
return radiated_energy_;
8383
};
8484

8585
//! Set the total normalized radiated energy of the path
8686
//! \param value value of the radiated energy to be assigned
8787
void setRadiatedEnergy(double value)
8888
{
89-
radiated_energy = value;
89+
radiated_energy_ = value;
9090
};
9191

9292
//! Computation of the quantum parameter for the given
@@ -96,7 +96,7 @@ class Radiation
9696
//! \param istart Index of the first particle
9797
//! \param iend Index of the last particle
9898
//! \param ithread Thread index
99-
void compute_thread_chipa(Particles &particles,
99+
void computeParticlesChi(Particles &particles,
100100
SmileiMPI* smpi,
101101
int istart,
102102
int iend,
@@ -117,19 +117,19 @@ class Radiation
117117
double one_over_mass_;
118118

119119
//! Time step
120-
double dt;
120+
double dt_;
121121

122122
//! Radiated energy of the total thread
123-
double radiated_energy;
123+
double radiated_energy_;
124124

125125
// _________________________________________
126126
// Factors
127127

128128
//! Normalized Schwinger Electric field
129-
double norm_E_Schwinger;
129+
double norm_E_Schwinger_;
130130

131131
//! Inverse Normalized Schwinger Electric field
132-
double inv_norm_E_Schwinger;
132+
double inv_norm_E_Schwinger_;
133133

134134
private:
135135

src/Radiation/RadiationCorrLandauLifshitz.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void RadiationCorrLandauLifshitz::operator() (
102102
std::vector <double> rad_norm_energy (iend-istart,0);
103103

104104
// Reinitialize the cumulative radiated energy for the current thread
105-
this->radiated_energy = 0.;
105+
radiated_energy_ = 0.;
106106

107107
// _______________________________________________________________
108108
// Computation
@@ -117,7 +117,7 @@ void RadiationCorrLandauLifshitz::operator() (
117117
+ momentum[2][ipart]*momentum[2][ipart]);
118118

119119
// Computation of the Lorentz invariant quantum parameter
120-
particle_chi = Radiation::compute_chipa(charge_over_mass2,
120+
particle_chi = Radiation::computeParticleChi(charge_over_mass2,
121121
momentum[0][ipart],momentum[1][ipart],momentum[2][ipart],
122122
gamma,
123123
(*(Ex+ipart-ipart_ref)),(*(Ey+ipart-ipart_ref)),(*(Ez+ipart-ipart_ref)),
@@ -130,7 +130,7 @@ void RadiationCorrLandauLifshitz::operator() (
130130

131131
// Radiated energy during the time step
132132
temp =
133-
RadiationTables.get_corrected_cont_rad_energy_Ridgers(particle_chi,dt);
133+
RadiationTables.get_corrected_cont_rad_energy_Ridgers(particle_chi,dt_);
134134

135135
// Temporary factor
136136
temp *= gamma/(gamma*gamma - 1);
@@ -159,5 +159,5 @@ void RadiationCorrLandauLifshitz::operator() (
159159
{
160160
radiated_energy_loc += weight[ipart]*rad_norm_energy[ipart] ;
161161
}
162-
radiated_energy += radiated_energy_loc;
162+
radiated_energy_ += radiated_energy_loc;
163163
}

src/Radiation/RadiationLandauLifshitz.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void RadiationLandauLifshitz::operator() (
9999
std::vector <double> rad_norm_energy (iend-istart,0);
100100

101101
// Reinitialize the cumulative radiated energy for the current thread
102-
this->radiated_energy = 0.;
102+
radiated_energy_ = 0.;
103103

104104
// _______________________________________________________________
105105
// Computation
@@ -114,7 +114,7 @@ void RadiationLandauLifshitz::operator() (
114114
+ momentum[2][ipart]*momentum[2][ipart]);
115115

116116
// Computation of the Lorentz invariant quantum parameter
117-
particle_chi = Radiation::compute_chipa(charge_over_mass2,
117+
particle_chi = Radiation::computeParticleChi(charge_over_mass2,
118118
momentum[0][ipart],momentum[1][ipart],momentum[2][ipart],
119119
gamma,
120120
(*(Ex+ipart-ipart_ref)),(*(Ey+ipart-ipart_ref)),(*(Ez+ipart-ipart_ref)),
@@ -126,7 +126,7 @@ void RadiationLandauLifshitz::operator() (
126126

127127
// Radiated energy during the time step
128128
temp =
129-
RadiationTables.get_classical_cont_rad_energy(particle_chi,dt);
129+
RadiationTables.get_classical_cont_rad_energy(particle_chi,dt_);
130130

131131
// Effect on the momentum
132132
// Temporary factor
@@ -155,5 +155,5 @@ void RadiationLandauLifshitz::operator() (
155155
{
156156
radiated_energy_loc += weight[ipart]*rad_norm_energy[ipart - istart] ;
157157
}
158-
radiated_energy += radiated_energy_loc;
158+
radiated_energy_ += radiated_energy_loc;
159159
}

src/Radiation/RadiationMonteCarlo.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void RadiationMonteCarlo::operator() (
121121
// double* chi = &( particles.chi(0));
122122

123123
// Reinitialize the cumulative radiated energy for the current thread
124-
this->radiated_energy = 0.;
124+
radiated_energy_ = 0.;
125125

126126
// _______________________________________________________________
127127
// Computation
@@ -135,7 +135,7 @@ void RadiationMonteCarlo::operator() (
135135
mc_it_nb = 0;
136136

137137
// Monte-Carlo Manager inside the time step
138-
while ((local_it_time < dt)
138+
while ((local_it_time < dt_)
139139
&&(mc_it_nb < max_monte_carlo_iterations_))
140140
{
141141

@@ -145,7 +145,7 @@ void RadiationMonteCarlo::operator() (
145145
+ momentum[2][ipart]*momentum[2][ipart]);
146146

147147
// Computation of the Lorentz invariant quantum parameter
148-
particle_chi = Radiation::compute_chipa(charge_over_mass2,
148+
particle_chi = Radiation::computeParticleChi(charge_over_mass2,
149149
momentum[0][ipart],momentum[1][ipart],momentum[2][ipart],
150150
gamma,
151151
(*(Ex+ipart-ipart_ref)),(*(Ey+ipart-ipart_ref)),(*(Ez+ipart-ipart_ref)),
@@ -178,7 +178,7 @@ void RadiationMonteCarlo::operator() (
178178
// Time to discontinuous emission
179179
// If this time is > the remaining iteration time,
180180
// we have a synchronization
181-
emission_time = std::min(tau[ipart]/temp, dt - local_it_time);
181+
emission_time = std::min(tau[ipart]/temp, dt_ - local_it_time);
182182

183183
// Update of the optical depth
184184
tau[ipart] -= temp*emission_time;
@@ -221,7 +221,7 @@ void RadiationMonteCarlo::operator() (
221221
{
222222

223223
// Remaining time of the iteration
224-
emission_time = dt - local_it_time;
224+
emission_time = dt_ - local_it_time;
225225

226226
// Radiated energy during emission_time
227227
cont_rad_energy =
@@ -236,18 +236,18 @@ void RadiationMonteCarlo::operator() (
236236
}
237237

238238
// Incrementation of the radiated energy cumulative parameter
239-
radiated_energy += weight[ipart]*(gamma - sqrt(1.0
239+
radiated_energy_ += weight[ipart]*(gamma - sqrt(1.0
240240
+ momentum[0][ipart]*momentum[0][ipart]
241241
+ momentum[1][ipart]*momentum[1][ipart]
242242
+ momentum[2][ipart]*momentum[2][ipart]));
243243

244244
// End for this particle
245-
local_it_time = dt;
245+
local_it_time = dt_;
246246
}
247247
// No emission since particle_chi is too low
248248
else // if (particle_chi < RadiationTables.get_chipa_radiation_threshold())
249249
{
250-
local_it_time = dt;
250+
local_it_time = dt_;
251251
}
252252

253253
}
@@ -389,6 +389,6 @@ void RadiationMonteCarlo::photon_emission(int ipart,
389389
gammaph = gammapa - sqrt(1.0 + momentum[0][ipart]*momentum[0][ipart]
390390
+ momentum[1][ipart]*momentum[1][ipart]
391391
+ momentum[2][ipart]*momentum[2][ipart]);
392-
radiated_energy += weight[ipart]*gammaph;
392+
radiated_energy_ += weight[ipart]*gammaph;
393393
}
394394
}

src/Radiation/RadiationNiel.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ void RadiationNiel::operator() (
7777
// 1/mass^2
7878
const double one_over_mass_2 = pow(one_over_mass_,2.);
7979

80-
// Sqrt(dt), used intensively in these loops
81-
const double sqrtdt = sqrt(dt);
80+
// Sqrt(dt_), used intensively in these loops
81+
const double sqrtdt = sqrt(dt_);
8282

8383
// Number of particles
8484
const int nbparticles = iend-istart;
@@ -113,7 +113,7 @@ void RadiationNiel::operator() (
113113
double * particle_chi = &( particles.chi(istart));
114114

115115
// Reinitialize the cumulative radiated energy for the current thread
116-
this->radiated_energy = 0.;
116+
radiated_energy_ = 0.;
117117

118118
const double chipa_radiation_threshold = RadiationTables.get_chipa_radiation_threshold();
119119
const double factor_cla_rad_power = RadiationTables.get_factor_cla_rad_power();
@@ -137,7 +137,7 @@ void RadiationNiel::operator() (
137137
+ momentum[2][ipart]*momentum[2][ipart]);
138138

139139
// Computation of the Lorentz invariant quantum parameter
140-
particle_chi[ipart] = Radiation::compute_chipa(charge_over_mass2,
140+
particle_chi[ipart] = Radiation::computeParticleChi(charge_over_mass2,
141141
momentum[0][ipart],momentum[1][ipart],momentum[2][ipart],
142142
gamma[ipart],
143143
(*(Ex+ipart-ipart_ref)),(*(Ey+ipart-ipart_ref)),(*(Ez+ipart-ipart_ref)),
@@ -155,7 +155,7 @@ void RadiationNiel::operator() (
155155
{
156156
157157
// Pick a random number in the normal distribution of standard
158-
// deviation sqrt(dt) (variance dt)
158+
// deviation sqrt(dt_) (variance dt_)
159159
random_numbers[ipart] = Rand::normal(sqrtdt);
160160
}
161161
}*/
@@ -170,7 +170,7 @@ void RadiationNiel::operator() (
170170
{
171171

172172
// Pick a random number in the normal distribution of standard
173-
// deviation sqrt(dt) (variance dt)
173+
// deviation sqrt(dt_) (variance dt_)
174174
//random_numbers[ipart] = 2.*Rand::uniform() -1.;
175175
random_numbers[ipart] = 2.*drand48() -1.;
176176
}
@@ -302,7 +302,7 @@ void RadiationNiel::operator() (
302302

303303
// Radiated energy during the time step
304304
rad_energy =
305-
RadiationTables.get_corrected_cont_rad_energy_Ridgers(particle_chi[ipart],dt);
305+
RadiationTables.get_corrected_cont_rad_energy_Ridgers(particle_chi[ipart],dt_);
306306

307307
// Effect on the momentum
308308
// Temporary factor
@@ -330,7 +330,7 @@ void RadiationNiel::operator() (
330330
+ momentum[1][ipart]*momentum[1][ipart]
331331
+ momentum[2][ipart]*momentum[2][ipart]));
332332
}
333-
radiated_energy += radiated_energy_loc;
333+
radiated_energy_ += radiated_energy_loc;
334334

335335
//double t5 = MPI_Wtime();
336336

0 commit comments

Comments
 (0)