Skip to content

Commit

Permalink
fix access to varname field instead of unallocated m_varnames, and up…
Browse files Browse the repository at this point in the history
…date hi ki-index after flush
  • Loading branch information
RevathiJambunathan committed Oct 24, 2022
1 parent 37b7f3d commit 1c88a91
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Source/Diagnostics/BTDiagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,16 +526,16 @@ BTDiagnostics::UpdateVarnamesForRZopenPMD ()
if (update_varnames) {
for (int comp=0, n=m_varnames_fields.size(); comp<n; comp++)
{
if (m_varnames[comp] == "Er") AddRZModesToOutputNames(std::string("Er"), ncomp, false);
if (m_varnames[comp] == "Et") AddRZModesToOutputNames(std::string("Et"), ncomp, false);
if (m_varnames[comp] == "Ez") AddRZModesToOutputNames(std::string("Ez"), ncomp, false);
if (m_varnames[comp] == "Br") AddRZModesToOutputNames(std::string("Br"), ncomp, false);
if (m_varnames[comp] == "Bt") AddRZModesToOutputNames(std::string("Bt"), ncomp, false);
if (m_varnames[comp] == "Bz") AddRZModesToOutputNames(std::string("Bz"), ncomp, false);
if (m_varnames[comp] == "jr") AddRZModesToOutputNames(std::string("jr"), ncomp, false);
if (m_varnames[comp] == "jt") AddRZModesToOutputNames(std::string("jt"), ncomp, false);
if (m_varnames[comp] == "jz") AddRZModesToOutputNames(std::string("jz"), ncomp, false);
if (m_varnames[comp] == "rho") AddRZModesToOutputNames(std::string("rho"),ncomp, false);
if (m_varnames_fields[comp] == "Er") AddRZModesToOutputNames(std::string("Er"), ncomp, false);
if (m_varnames_fields[comp] == "Et") AddRZModesToOutputNames(std::string("Et"), ncomp, false);
if (m_varnames_fields[comp] == "Ez") AddRZModesToOutputNames(std::string("Ez"), ncomp, false);
if (m_varnames_fields[comp] == "Br") AddRZModesToOutputNames(std::string("Br"), ncomp, false);
if (m_varnames_fields[comp] == "Bt") AddRZModesToOutputNames(std::string("Bt"), ncomp, false);
if (m_varnames_fields[comp] == "Bz") AddRZModesToOutputNames(std::string("Bz"), ncomp, false);
if (m_varnames_fields[comp] == "jr") AddRZModesToOutputNames(std::string("jr"), ncomp, false);
if (m_varnames_fields[comp] == "jt") AddRZModesToOutputNames(std::string("jt"), ncomp, false);
if (m_varnames_fields[comp] == "jz") AddRZModesToOutputNames(std::string("jz"), ncomp, false);
if (m_varnames_fields[comp] == "rho") AddRZModesToOutputNames(std::string("rho"),ncomp, false);
}
}

Expand Down Expand Up @@ -804,8 +804,6 @@ BTDiagnostics::DefineFieldBufferMultiFab (const int i_buffer, const int lev)
const int hi_k_lab = m_buffer_k_index_hi[i_buffer];
m_buffer_box[i_buffer].setSmall( m_moving_window_dir, hi_k_lab - m_buffer_size + 1);
m_buffer_box[i_buffer].setBig( m_moving_window_dir, hi_k_lab );
// Setting hi k-index for the next buffer
m_buffer_k_index_hi[i_buffer] = m_buffer_box[i_buffer].smallEnd(m_moving_window_dir) - 1;
amrex::BoxArray buffer_ba( m_buffer_box[i_buffer] );
buffer_ba.maxSize(m_max_box_size);
// Generate a new distribution map for the back-transformed buffer multifab
Expand Down Expand Up @@ -990,6 +988,8 @@ BTDiagnostics::Flush (int i_buffer)
ResetTotalParticlesInBuffer(i_buffer);
ClearParticleBuffer(i_buffer);
}
// Setting hi k-index for the next buffer
m_buffer_k_index_hi[i_buffer] = m_buffer_box[i_buffer].smallEnd(m_moving_window_dir) - 1;
}

void BTDiagnostics::RedistributeParticleBuffer (const int i_buffer)
Expand Down

0 comments on commit 1c88a91

Please sign in to comment.