Skip to content

Commit

Permalink
Cleaning & Member Variable Convention
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l authored Sep 26, 2024
1 parent bdbeb5f commit 361bbf9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Source/Diagnostics/BTDiagnostics.H
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ private:
* will be used by all snapshots to obtain lab-frame data at the respective
* z slice location.
*/
std::string const cell_centered_data_name;
std::string const m_cell_centered_data_name;
/** Vector of pointers to compute cell-centered data, per level, per component
* using the coarsening-ratio provided by the user.
*/
Expand Down Expand Up @@ -346,7 +346,7 @@ private:
* \param[in] i_buffer snapshot index
*/
void SetSnapshotFullStatus (int i_buffer);
/** Vector of field-data stored in the cell-centered multifab, cell_centered_data.
/** Vector of field-data stored in the cell-centered MultiFab.
* All the fields are stored regardless of the specific fields to plot selected
* by the user.
*/
Expand Down
24 changes: 12 additions & 12 deletions Source/Diagnostics/BTDiagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace

BTDiagnostics::BTDiagnostics (int i, const std::string& name)
: Diagnostics{i, name},
cell_centered_data_name("BTD_cell_centered_data_"+name)
m_cell_centered_data_name("BTD_cell_centered_data_" + name)
{
ReadParameters();
}
Expand Down Expand Up @@ -521,7 +521,7 @@ BTDiagnostics::DefineCellCenteredMultiFab(int lev)
#endif
bool const remake = false;
bool const redistribute_on_remake = false;
warpx.m_fields.alloc_init(cell_centered_data_name, lev, ba, dmap, ncomps, amrex::IntVect(ngrow), 0.0_rt,
warpx.m_fields.alloc_init(m_cell_centered_data_name, lev, ba, dmap, ncomps, amrex::IntVect(ngrow), 0.0_rt,
remake, redistribute_on_remake);

}
Expand All @@ -548,7 +548,7 @@ BTDiagnostics::InitializeFieldFunctors (int lev)
// to the correct field-data pointers
m_all_field_functors[lev].clear();
// For back-transformed data, all the components are cell-centered and stored
// in a single multifab, cell_centered_data.
// in a single multifab.
// Therefore, size of functors at all levels is 1.
const int num_BT_functors = 1;
m_all_field_functors[lev].resize(num_BT_functors);
Expand All @@ -557,11 +557,11 @@ BTDiagnostics::InitializeFieldFunctors (int lev)
// Create an object of class BackTransformFunctor
for (int i = 0; i < num_BT_functors; ++i)
{
// coarsening ratio is not provided since the source MultiFab, cell_centered_data
// coarsening ratio is not provided since the source MultiFab
// is coarsened based on the user-defined m_crse_ratio
const int nvars = static_cast<int>(m_varnames.size());
m_all_field_functors[lev][i] = std::make_unique<BackTransformFunctor>(
warpx.m_fields.get(cell_centered_data_name, lev), lev,
warpx.m_fields.get(m_cell_centered_data_name, lev), lev,
nvars, m_num_buffers, m_varnames, m_varnames_fields);
}

Expand Down Expand Up @@ -673,14 +673,14 @@ BTDiagnostics::InitializeFieldFunctorsRZopenPMD (int lev)
// to the correct field-data pointers
m_all_field_functors[lev].clear();
// For back-transformed data, all the components are cell-centered and stored
// in a single multifab, cell_centered_data.
// in a single MultiFab.
// Therefore, size of functors at all levels is 1
const int num_BT_functors = 1;
m_all_field_functors[lev].resize(num_BT_functors);
for (int i = 0; i < num_BT_functors; ++i) {
const int nvars = static_cast<int>(m_varnames.size());
m_all_field_functors[lev][i] = std::make_unique<BackTransformFunctor>(
warpx.m_fields.get(cell_centered_data_name, lev), lev,
warpx.m_fields.get(m_cell_centered_data_name, lev), lev,
nvars, m_num_buffers, m_varnames,
m_varnames_fields);
}
Expand Down Expand Up @@ -807,23 +807,23 @@ BTDiagnostics::PrepareFieldDataForOutput ()
for (int icomp = 0; icomp<m_cell_center_fuctors_at_lev_size; ++icomp) {
// Call all the cell-center functors in m_cell_center_functors.
// Each of them computes cell-centered data for a field and
// stores it in cell-centered MultiFab, cell_centered_data[lev].
m_cell_center_functors[lev][icomp]->operator()(*warpx.m_fields.get(cell_centered_data_name, lev), icomp_dst);
// stores it in cell-centered MultiFab.
m_cell_center_functors[lev][icomp]->operator()(*warpx.m_fields.get(m_cell_centered_data_name, lev), icomp_dst);
icomp_dst += m_cell_center_functors[lev][icomp]->nComp();
}
// Check that the proper number of user-requested components are cell-centered
AMREX_ALWAYS_ASSERT( icomp_dst == m_cellcenter_varnames.size() );
// fill boundary call is required to average_down (flatten) data to
// the coarsest level.
ablastr::utils::communication::FillBoundary(*warpx.m_fields.get(cell_centered_data_name, lev),
ablastr::utils::communication::FillBoundary(*warpx.m_fields.get(m_cell_centered_data_name, lev),
WarpX::do_single_precision_comms,
warpx.Geom(lev).periodicity());
}
// Flattening out MF over levels

for (int lev = warpx.finestLevel(); lev > 0; --lev) {
ablastr::coarsen::sample::Coarsen(*warpx.m_fields.get(cell_centered_data_name, lev - 1),
*warpx.m_fields.get(cell_centered_data_name, lev), 0, 0,
ablastr::coarsen::sample::Coarsen(*warpx.m_fields.get(m_cell_centered_data_name, lev - 1),
*warpx.m_fields.get(m_cell_centered_data_name, lev), 0, 0,
static_cast<int>(m_cellcenter_varnames.size()), 0, WarpX::RefRatio(lev-1) );
}

Expand Down

0 comments on commit 361bbf9

Please sign in to comment.