Skip to content

Commit

Permalink
replace free function in warpx class with one-liner where it was used
Browse files Browse the repository at this point in the history
  • Loading branch information
lucafedeli88 committed Jan 21, 2025
1 parent 3f76233 commit c2daac4
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions Source/WarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3314,14 +3314,6 @@ WarpX::isAnyParticleBoundaryThermal ()
return false;
}

std::string
TagWithLevelSuffix (std::string name, int const level)
{
// Add the suffix "[level=level]"
name.append("[level=").append(std::to_string(level)).append("]");
return name;
}

void
WarpX::AllocInitMultiFab (
std::unique_ptr<amrex::iMultiFab>& mf,
Expand All @@ -3333,7 +3325,8 @@ WarpX::AllocInitMultiFab (
const std::string& name,
std::optional<const int> initial_value)
{
const auto name_with_suffix = TagWithLevelSuffix(name, level);
// Add the suffix "[level=level]"
const auto name_with_suffix = name + "[level=" + std::to_string(level) + "]";
const auto tag = amrex::MFInfo().SetTag(name_with_suffix);
mf = std::make_unique<amrex::iMultiFab>(ba, dm, ncomp, ngrow, tag);
if (initial_value) {
Expand Down

0 comments on commit c2daac4

Please sign in to comment.