Skip to content

Commit

Permalink
Clang-tidy CI tests: use clang-tidy-15 instead of clang-tidy-14 (ECP-…
Browse files Browse the repository at this point in the history
…WarpX#4689)

* use clang-tidy-15 instead of clang-tidy-14 for CI tests

* fix bug

* address issues found with clang-tidy-15

* address more issues found with clang-tidy

* address more issues found with clang-tidy

* address additional issues found with clang-tidy

* fix more issues found with clang-tidy

* fixed bugs

* fixed bugs

* fixed bugs

* fixed issue on Windows

* fixed bug

* address issues found with clang-tidy

* make std::string filepath const both for Windows and other OS

* make edge_lengths a const both with and without EB

* address more issues found with clang-tidy

* address issues found with clang-tidy

* address the residual issues found with clang-tidy

* addressed const-correctness issues

* fixed bug

* fixed bug

* address issue found with clang-tidy

* address issue found with clang-tidy
  • Loading branch information
lucafedeli88 authored Mar 4, 2024
1 parent df312be commit c4b1266
Show file tree
Hide file tree
Showing 52 changed files with 502 additions and 489 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/clang_tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v4
- name: install dependencies
run: |
.github/workflows/dependencies/clang14.sh
.github/workflows/dependencies/clang15.sh
- name: set up cache
uses: actions/cache@v4
with:
Expand All @@ -32,8 +32,8 @@ jobs:
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt
ccache -z
export CXX=$(which clang++)
export CC=$(which clang)
export CXX=$(which clang++-15)
export CC=$(which clang-15)
cmake -S . -B build_clang_tidy \
-DCMAKE_VERBOSE_MAKEFILE=ON \
Expand All @@ -51,7 +51,7 @@ jobs:
${{github.workspace}}/.github/workflows/source/makeMakefileForClangTidy.py --input ${{github.workspace}}/ccache.log.txt
make -j4 --keep-going -f clang-tidy-ccache-misses.mak \
CLANG_TIDY=clang-tidy \
CLANG_TIDY=clang-tidy-15 \
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*"
ccache -s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries
sudo apt-get -qqq update
sudo apt-get install -y \
cmake \
clang-14 \
clang-tidy-14 \
clang-15 \
clang-tidy-15 \
libblas-dev \
libc++-14-dev \
libc++-15-dev \
libboost-math-dev \
libfftw3-dev \
libfftw3-mpi-dev \
libhdf5-openmpi-dev \
liblapack-dev \
libopenmpi-dev \
libomp-dev \
libomp-15-dev \
ninja-build

# ccache
Expand Down
2 changes: 1 addition & 1 deletion Source/AcceleratorLattice/AcceleratorLattice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ AcceleratorLattice::UpdateElementFinder (int const lev) // NOLINT(readability-ma
LatticeElementFinderDevice
AcceleratorLattice::GetFinderDeviceInstance (WarpXParIter const& a_pti, int const a_offset) const
{
LatticeElementFinder & finder = (*m_element_finder)[a_pti];
const LatticeElementFinder & finder = (*m_element_finder)[a_pti];
return finder.GetFinderDeviceInstance(a_pti, a_offset, *this);
}
4 changes: 2 additions & 2 deletions Source/BoundaryConditions/WarpX_PEC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ PEC::ApplyPECtoElectronPressure (amrex::MultiFab* Pefield, const int lev,

amrex::Box domain_box = warpx.Geom(lev).Domain();
if (patch_type == PatchType::coarse) {
amrex::IntVect ref_ratio = ( (lev > 0) ? WarpX::RefRatio(lev-1) : amrex::IntVect(1) );
const amrex::IntVect ref_ratio = ( (lev > 0) ? WarpX::RefRatio(lev-1) : amrex::IntVect(1) );
domain_box.coarsen(ref_ratio);
}
domain_box.convert(Pefield->ixType());
Expand Down Expand Up @@ -552,7 +552,7 @@ PEC::ApplyPECtoElectronPressure (amrex::MultiFab* Pefield, const int lev,
amrex::ignore_unused(j,k);
#endif
// Store the array index
amrex::IntVect iv(AMREX_D_DECL(i,j,k));
const amrex::IntVect iv(AMREX_D_DECL(i,j,k));

PEC::SetNeumannOnPEC(n, iv, Pe_array, mirrorfac, is_pec, fabbox);
});
Expand Down
6 changes: 3 additions & 3 deletions Source/Diagnostics/BTDiagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ 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 );
amrex::BoxArray buffer_ba( m_buffer_box[i_buffer] );
const amrex::BoxArray buffer_ba( m_buffer_box[i_buffer] );
// Generate a new distribution map for the back-transformed buffer multifab
const amrex::DistributionMapping buffer_dmap(buffer_ba);
// Number of guard cells for the output buffer is zero.
Expand Down Expand Up @@ -1040,7 +1040,7 @@ BTDiagnostics::Flush (int i_buffer, bool force_flush)
m_buffer_box[i_buffer].setSmall(m_moving_window_dir, (m_buffer_box[i_buffer].smallEnd(m_moving_window_dir) - 1) );
m_buffer_box[i_buffer].setBig(m_moving_window_dir, (m_buffer_box[i_buffer].bigEnd(m_moving_window_dir) + 1) );
const amrex::Box particle_buffer_box = m_buffer_box[i_buffer];
amrex::BoxArray buffer_ba( particle_buffer_box );
const amrex::BoxArray buffer_ba( particle_buffer_box );
m_particles_buffer[i_buffer][0]->SetParticleBoxArray(0, buffer_ba);
for (int isp = 0; isp < m_particles_buffer.at(i_buffer).size(); ++isp) {
// BTD output is single level. Setting particle geometry, dmap, boxarray to level0
Expand Down Expand Up @@ -1467,7 +1467,7 @@ BTDiagnostics::PrepareParticleDataForOutput()
DefineFieldBufferMultiFab(i_buffer, lev);
}
const amrex::Box particle_buffer_box = m_buffer_box[i_buffer];
amrex::BoxArray buffer_ba( particle_buffer_box );
const amrex::BoxArray buffer_ba( particle_buffer_box );
const amrex::DistributionMapping buffer_dmap(buffer_ba);
m_particles_buffer[i_buffer][i]->SetParticleBoxArray(lev, buffer_ba);
m_particles_buffer[i_buffer][i]->SetParticleDistributionMap(lev, buffer_dmap);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ BackTransformFunctor::operator ()(amrex::MultiFab& mf_dst, int /*dcomp*/, const
slice_box.setBig(moving_window_dir, i_boost);

// Make it a BoxArray
amrex::BoxArray slice_ba(slice_box);
const amrex::BoxArray slice_ba(slice_box);
// Define MultiFab with the distribution map of the destination multifab and
// containing all ten components that were in the slice generated from m_mf_src.
std::unique_ptr< amrex::MultiFab > tmp_slice_ptr = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ FlushFormatPlotfile::WriteWarpXHeader(

warpx.GetPartContainer().WriteHeader(HeaderFile);

MultiParticleContainer& mypc = warpx.GetPartContainer();
const MultiParticleContainer& mypc = warpx.GetPartContainer();
const int n_species = mypc.nSpecies();
for (int i=0; i<n_species; i++)
{
Expand Down
4 changes: 2 additions & 2 deletions Source/Diagnostics/FullDiagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ using namespace amrex::literals;
FullDiagnostics::FullDiagnostics (int i, std::string name):
Diagnostics{i, name},
m_solver_deposits_current{
!(WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::None &&
WarpX::electrostatic_solver_id != ElectrostaticSolverAlgo::LabFrameElectroMagnetostatic)}
(WarpX::electromagnetic_solver_id != ElectromagneticSolverAlgo::None) ||
(WarpX::electrostatic_solver_id == ElectrostaticSolverAlgo::LabFrameElectroMagnetostatic)}
{
ReadParameters();
BackwardCompatibility();
Expand Down
6 changes: 3 additions & 3 deletions Source/Diagnostics/ReducedDiags/ColliderRelevant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ColliderRelevant::ColliderRelevant (std::string rd_name)
: ReducedDiags{std::move(rd_name)}
{
// read colliding species names - must be 2
amrex::ParmParse pp_rd_name(m_rd_name);
const amrex::ParmParse pp_rd_name(m_rd_name);
pp_rd_name.getarr("species", m_beam_name);

WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
Expand Down Expand Up @@ -203,7 +203,7 @@ void ColliderRelevant::ComputeDiags (int step)

// get cell volume
amrex::Geometry const & geom = warpx.Geom(0);
amrex::Real dV = AMREX_D_TERM(geom.CellSize(0), *geom.CellSize(1), *geom.CellSize(2));
const amrex::Real dV = AMREX_D_TERM(geom.CellSize(0), *geom.CellSize(1), *geom.CellSize(2));

const auto get_idx = [&](const std::string& name){
return m_headers_indices.at(name).idx;
Expand Down Expand Up @@ -544,7 +544,7 @@ void ColliderRelevant::ComputeDiags (int step)

// make density MultiFabs from nodal to cell centered
amrex::BoxArray ba = warpx.boxArray(0);
amrex::DistributionMapping dmap = warpx.DistributionMap(0);
const amrex::DistributionMapping dmap = warpx.DistributionMap(0);
constexpr int ncomp = 1;
constexpr int ngrow = 0;
amrex::MultiFab mf_dst1(ba.convert(amrex::IntVect::TheCellVector()), dmap, ncomp, ngrow);
Expand Down
2 changes: 1 addition & 1 deletion Source/Diagnostics/ReducedDiags/FieldReduction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ FieldReduction::FieldReduction (std::string rd_name)

void FieldReduction::BackwardCompatibility ()
{
amrex::ParmParse pp_rd_name(m_rd_name);
const amrex::ParmParse pp_rd_name(m_rd_name);
std::vector<std::string> backward_strings;
WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
!pp_rd_name.queryarr("reduced_function(x,y,z,Ex,Ey,Ez,Bx,By,Bz)", backward_strings),
Expand Down
6 changes: 4 additions & 2 deletions Source/Diagnostics/ReducedDiags/ParticleHistogram2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,12 @@ void ParticleHistogram2D::WriteToFile (int step) const
const std::string fileSuffix = std::string("_%0") + std::to_string(m_file_min_digits) + std::string("T");
filename = filename.append(fileSuffix).append(".").append(m_openpmd_backend);

std::string filepath = m_path + m_rd_name + "/" + filename;
// transform paths for Windows
#ifdef _WIN32
filepath = openPMD::auxiliary::replace_all(filepath, "/", "\\");
const std::string filepath = openPMD::auxiliary::replace_all(
m_path + m_rd_name + "/" + filename, "/", "\\");
#else
const std::string filepath = m_path + m_rd_name + "/" + filename;
#endif

// Create the OpenPMD series
Expand Down
4 changes: 2 additions & 2 deletions Source/Diagnostics/ReducedDiags/ReducedDiags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ReducedDiags::ReducedDiags (std::string rd_name)
std::string restart_chkfile;
const ParmParse pp_amr("amr");
pp_amr.query("restart", restart_chkfile);
bool IsNotRestart = restart_chkfile.empty();
const bool IsNotRestart = restart_chkfile.empty();

if (ParallelDescriptor::IOProcessor())
{
Expand All @@ -50,7 +50,7 @@ ReducedDiags::ReducedDiags (std::string rd_name)
{ amrex::CreateDirectoryFailed(m_path); }

// replace / create output file
std::string rd_full_file_name = m_path + m_rd_name + "." + m_extension;
const std::string rd_full_file_name = m_path + m_rd_name + "." + m_extension;
m_write_header = IsNotRestart || !amrex::FileExists(rd_full_file_name); // not a restart or file doesn't exist
if (m_write_header)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Diagnostics/WarpXOpenPMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ WarpXOpenPMDPlot::DumpToFile (ParticleContainer* pc,
openPMD::ParticleSpecies currSpecies = currIteration.particles[name];

// only BTD writes multiple times into the same step, zero for other methods
unsigned long ParticleFlushOffset = isBTD ? num_already_flushed(currSpecies) : 0;
const unsigned long ParticleFlushOffset = isBTD ? num_already_flushed(currSpecies) : 0;

// prepare data structures the first time BTD has non-zero particles
// we set some of them to zero extent, so we need to time that well
Expand Down
2 changes: 1 addition & 1 deletion Source/EmbeddedBoundary/WarpXFaceExtensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ ComputeNBorrowOneFaceExtension(const amrex::Dim3 cell, const amrex::Real S_ext,
for (int i_n = -1; i_n < 2; i_n++) {
for (int j_n = -1; j_n < 2; j_n++) {
//This if makes sure that we don't visit the "diagonal neighbours"
if (!(i_n == j_n || i_n == -j_n)) {
if ((i_n != j_n) && (i_n != -j_n)) {
// Here a face is available if it doesn't need to be extended itself and if its
// area exceeds Sz_ext. Here we need to take into account if the intruded face
// has given away already some area, so we use Sz_red rather than Sz.
Expand Down
34 changes: 17 additions & 17 deletions Source/Evolve/WarpXOneStepImplicitPicard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ WarpX::OneStep_ImplicitPicard(amrex::Real cur_time)
// particle velocities by dt, then take average of old and new v,
// deposit currents, giving J at n+1/2
// This uses Efield_fp and Bfield_fp, the field at n+1/2 from the previous iteration.
bool skip_current = false;
PushType push_type = PushType::Implicit;
const bool skip_current = false;
const PushType push_type = PushType::Implicit;
PushParticlesandDeposit(cur_time, skip_current, push_type);

SyncCurrentAndRho();
Expand Down Expand Up @@ -209,23 +209,23 @@ WarpX::OneStep_ImplicitPicard(amrex::Real cur_time)
Efield_save[0][0]->minus(*Efield_fp[0][0], 0, ncomps, 0);
Efield_save[0][1]->minus(*Efield_fp[0][1], 0, ncomps, 0);
Efield_save[0][2]->minus(*Efield_fp[0][2], 0, ncomps, 0);
amrex::Real maxE0 = std::max(1._rt, Efield_fp[0][0]->norm0(0, 0));
amrex::Real maxE1 = std::max(1._rt, Efield_fp[0][1]->norm0(0, 0));
amrex::Real maxE2 = std::max(1._rt, Efield_fp[0][2]->norm0(0, 0));
amrex::Real deltaE0 = Efield_save[0][0]->norm0(0, 0)/maxE0;
amrex::Real deltaE1 = Efield_save[0][1]->norm0(0, 0)/maxE1;
amrex::Real deltaE2 = Efield_save[0][2]->norm0(0, 0)/maxE2;
const amrex::Real maxE0 = std::max(1._rt, Efield_fp[0][0]->norm0(0, 0));
const amrex::Real maxE1 = std::max(1._rt, Efield_fp[0][1]->norm0(0, 0));
const amrex::Real maxE2 = std::max(1._rt, Efield_fp[0][2]->norm0(0, 0));
const amrex::Real deltaE0 = Efield_save[0][0]->norm0(0, 0)/maxE0;
const amrex::Real deltaE1 = Efield_save[0][1]->norm0(0, 0)/maxE1;
const amrex::Real deltaE2 = Efield_save[0][2]->norm0(0, 0)/maxE2;
deltaE = std::max(std::max(deltaE0, deltaE1), deltaE2);
if (evolve_scheme == EvolveScheme::ImplicitPicard) {
Bfield_save[0][0]->minus(*Bfield_fp[0][0], 0, ncomps, 0);
Bfield_save[0][1]->minus(*Bfield_fp[0][1], 0, ncomps, 0);
Bfield_save[0][2]->minus(*Bfield_fp[0][2], 0, ncomps, 0);
amrex::Real maxB0 = std::max(1._rt, Bfield_fp[0][0]->norm0(0, 0));
amrex::Real maxB1 = std::max(1._rt, Bfield_fp[0][1]->norm0(0, 0));
amrex::Real maxB2 = std::max(1._rt, Bfield_fp[0][2]->norm0(0, 0));
amrex::Real deltaB0 = Bfield_save[0][0]->norm0(0, 0)/maxB0;
amrex::Real deltaB1 = Bfield_save[0][1]->norm0(0, 0)/maxB1;
amrex::Real deltaB2 = Bfield_save[0][2]->norm0(0, 0)/maxB2;
const amrex::Real maxB0 = std::max(1._rt, Bfield_fp[0][0]->norm0(0, 0));
const amrex::Real maxB1 = std::max(1._rt, Bfield_fp[0][1]->norm0(0, 0));
const amrex::Real maxB2 = std::max(1._rt, Bfield_fp[0][2]->norm0(0, 0));
const amrex::Real deltaB0 = Bfield_save[0][0]->norm0(0, 0)/maxB0;
const amrex::Real deltaB1 = Bfield_save[0][1]->norm0(0, 0)/maxB1;
const amrex::Real deltaB2 = Bfield_save[0][2]->norm0(0, 0)/maxB2;
deltaB = std::max(std::max(deltaB0, deltaB1), deltaB2);
} else {
deltaB = 0.;
Expand Down Expand Up @@ -401,9 +401,9 @@ WarpX::FinishImplicitFieldUpdate(amrex::Vector<std::array< std::unique_ptr<amrex
amrex::Array4<amrex::Real> const& Fy_n = Field_n[lev][1]->array(mfi);
amrex::Array4<amrex::Real> const& Fz_n = Field_n[lev][2]->array(mfi);

amrex::Box tbx = mfi.tilebox(Field_fp[lev][0]->ixType().toIntVect());
amrex::Box tby = mfi.tilebox(Field_fp[lev][1]->ixType().toIntVect());
amrex::Box tbz = mfi.tilebox(Field_fp[lev][2]->ixType().toIntVect());
amrex::Box const tbx = mfi.tilebox(Field_fp[lev][0]->ixType().toIntVect());
amrex::Box const tby = mfi.tilebox(Field_fp[lev][1]->ixType().toIntVect());
amrex::Box const tbz = mfi.tilebox(Field_fp[lev][2]->ixType().toIntVect());

amrex::ParallelFor(
tbx, ncomps, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
Expand Down
2 changes: 1 addition & 1 deletion Source/FieldSolver/FiniteDifferenceSolver/ComputeDivE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void FiniteDifferenceSolver::ComputeDivECylindrical (
for ( MFIter mfi(divEfield, TilingIfNotGPU()); mfi.isValid(); ++mfi ) {

// Extract field data for this grid/tile
Array4<Real> divE = divEfield.array(mfi);
const Array4<Real> divE = divEfield.array(mfi);
Array4<Real> const& Er = Efield[0]->array(mfi);
Array4<Real> const& Et = Efield[1]->array(mfi);
Array4<Real> const& Ez = Efield[2]->array(mfi);
Expand Down
2 changes: 1 addition & 1 deletion Source/FieldSolver/FiniteDifferenceSolver/EvolveE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ void FiniteDifferenceSolver::EvolveECylindrical (
if (Ffield) {

// Extract field data for this grid/tile
Array4<Real> F = Ffield->array(mfi);
const Array4<Real> F = Ffield->array(mfi);

// Loop over the cells and update the fields
amrex::ParallelFor(ter, tet, tez,
Expand Down
2 changes: 1 addition & 1 deletion Source/FieldSolver/FiniteDifferenceSolver/EvolveF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ void FiniteDifferenceSolver::EvolveFCylindrical (
for ( MFIter mfi(*Ffield, TilingIfNotGPU()); mfi.isValid(); ++mfi ) {

// Extract field data for this grid/tile
Array4<Real> F = Ffield->array(mfi);
const Array4<Real> F = Ffield->array(mfi);
Array4<Real> const& Er = Efield[0]->array(mfi);
Array4<Real> const& Et = Efield[1]->array(mfi);
Array4<Real> const& Ez = Efield[2]->array(mfi);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ HybridPICModel::HybridPICModel ( int nlevs_max )

void HybridPICModel::ReadParameters ()
{
ParmParse pp_hybrid("hybrid_pic_model");
const ParmParse pp_hybrid("hybrid_pic_model");

// The B-field update is subcycled to improve stability - the number
// of sub steps can be specified by the user (defaults to 50).
Expand All @@ -32,7 +32,7 @@ void HybridPICModel::ReadParameters ()
if (!utils::parser::queryWithParser(pp_hybrid, "elec_temp", m_elec_temp)) {
Abort("hybrid_pic_model.elec_temp must be specified when using the hybrid solver");
}
bool n0_ref_given = utils::parser::queryWithParser(pp_hybrid, "n0_ref", m_n0_ref);
const bool n0_ref_given = utils::parser::queryWithParser(pp_hybrid, "n0_ref", m_n0_ref);
if (m_gamma != 1.0 && !n0_ref_given) {
Abort("hybrid_pic_model.n0_ref should be specified if hybrid_pic_model.gamma != 1");
}
Expand Down Expand Up @@ -219,23 +219,23 @@ void HybridPICModel::InitData ()
// Initialize external current - note that this approach skips the check
// if the current is time dependent which is what needs to be done to
// write time independent fields on the first step.
std::array< std::unique_ptr<amrex::MultiFab>, 3 > edge_lengths;

for (int lev = 0; lev <= warpx.finestLevel(); ++lev)
{
#ifdef AMREX_USE_EB
auto& edge_lengths_x = warpx.getedgelengths(lev, 0);
edge_lengths[0] = std::make_unique<amrex::MultiFab>(
edge_lengths_x, amrex::make_alias, 0, edge_lengths_x.nComp()
);
auto& edge_lengths_y = warpx.getedgelengths(lev, 1);
edge_lengths[1] = std::make_unique<amrex::MultiFab>(
edge_lengths_y, amrex::make_alias, 0, edge_lengths_y.nComp()
);
auto& edge_lengths_z = warpx.getedgelengths(lev, 2);
edge_lengths[2] = std::make_unique<amrex::MultiFab>(
edge_lengths_z, amrex::make_alias, 0, edge_lengths_z.nComp()
);

const auto edge_lengths = std::array< std::unique_ptr<amrex::MultiFab>, 3 >{
std::make_unique<amrex::MultiFab>(
edge_lengths_x, amrex::make_alias, 0, edge_lengths_x.nComp()),
std::make_unique<amrex::MultiFab>(
edge_lengths_y, amrex::make_alias, 0, edge_lengths_y.nComp()),
std::make_unique<amrex::MultiFab>(
edge_lengths_z, amrex::make_alias, 0, edge_lengths_z.nComp())
};
#else
const auto edge_lengths = std::array< std::unique_ptr<amrex::MultiFab>, 3 >();
#endif
GetCurrentExternal(edge_lengths, lev);
}
Expand Down
Loading

0 comments on commit c4b1266

Please sign in to comment.