aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics/ReducedDiags/ParticleEnergy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Diagnostics/ReducedDiags/ParticleEnergy.cpp')
-rw-r--r--Source/Diagnostics/ReducedDiags/ParticleEnergy.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/Source/Diagnostics/ReducedDiags/ParticleEnergy.cpp b/Source/Diagnostics/ReducedDiags/ParticleEnergy.cpp
index 47b90e099..ebf280e8f 100644
--- a/Source/Diagnostics/ReducedDiags/ParticleEnergy.cpp
+++ b/Source/Diagnostics/ReducedDiags/ParticleEnergy.cpp
@@ -99,9 +99,6 @@ void ParticleEnergy::ComputeDiags (int step)
// Get number of species
const int nSpecies = mypc.nSpecies();
- // Some useful offsets to fill m_data below
- int offset_total_species, offset_mean_species, offset_mean_all;
-
amrex::Real Wtot = 0.0_rt;
// Loop over species
@@ -169,7 +166,7 @@ void ParticleEnergy::ComputeDiags (int step)
// Offset:
// 1 value of total energy for all species +
// 1 value of total energy for each species
- offset_total_species = 1 + i_s;
+ const int offset_total_species = 1 + i_s;
m_data[offset_total_species] = Etot;
// Offset:
@@ -177,7 +174,7 @@ void ParticleEnergy::ComputeDiags (int step)
// 1 value of total energy for each species +
// 1 value of mean energy for all species +
// 1 value of mean energy for each species
- offset_mean_species = 1 + nSpecies + 1 + i_s;
+ const int offset_mean_species = 1 + nSpecies + 1 + i_s;
if (Ws > std::numeric_limits<Real>::min())
{
m_data[offset_mean_species] = Etot / Ws;
@@ -197,14 +194,14 @@ void ParticleEnergy::ComputeDiags (int step)
// Offset:
// 1 value of total energy for all species +
// 1 value of total energy for each species
- offset_total_species = 1 + i_s;
+ const int offset_total_species = 1 + i_s;
m_data[0] += m_data[offset_total_species];
}
// Total mean energy. Offset:
// 1 value of total energy for all species +
// 1 value of total energy for each species
- offset_mean_all = 1 + nSpecies;
+ const int offset_mean_all = 1 + nSpecies;
if (Wtot > std::numeric_limits<Real>::min())
{
m_data[offset_mean_all] = m_data[0] / Wtot;