diff options
author | 2023-03-08 14:05:13 -0800 | |
---|---|---|
committer | 2023-03-08 14:05:13 -0800 | |
commit | 5ab5dc70cca6491fd61831d848bb8ee230f5ee2c (patch) | |
tree | ba7c31aa2fb88e4268742b8fa60ce057fde84b93 /Source/WarpX.cpp | |
parent | 712714d19147786f4d716ccdc5aa21b73912e05d (diff) | |
download | WarpX-5ab5dc70cca6491fd61831d848bb8ee230f5ee2c.tar.gz WarpX-5ab5dc70cca6491fd61831d848bb8ee230f5ee2c.tar.zst WarpX-5ab5dc70cca6491fd61831d848bb8ee230f5ee2c.zip |
Fix handling of name passed into SetTag (#3735)
* Fix handling of name passed into SetTag
* Make name a reference in AddToMultiFabMap
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r-- | Source/WarpX.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 465b993a8..0f57cbee1 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -2958,10 +2958,10 @@ WarpX::AllocInitMultiFab ( const amrex::DistributionMapping& dm, const int ncomp, const amrex::IntVect& ngrow, - const std::string name, + const std::string& name, std::optional<const amrex::Real> initial_value) { - const auto tag = amrex::MFInfo().SetTag(std::move(name)); + const auto tag = amrex::MFInfo().SetTag(name); mf = std::make_unique<amrex::MultiFab>(ba, dm, ncomp, ngrow, tag); if (initial_value) { mf->setVal(*initial_value); @@ -2976,10 +2976,10 @@ WarpX::AllocInitMultiFab ( const amrex::DistributionMapping& dm, const int ncomp, const amrex::IntVect& ngrow, - const std::string name, + const std::string& name, std::optional<const int> initial_value) { - const auto tag = amrex::MFInfo().SetTag(std::move(name)); + const auto tag = amrex::MFInfo().SetTag(name); mf = std::make_unique<amrex::iMultiFab>(ba, dm, ncomp, ngrow, tag); if (initial_value) { mf->setVal(*initial_value); @@ -2993,7 +2993,7 @@ WarpX::AliasInitMultiFab ( const amrex::MultiFab& mf_to_alias, const int scomp, const int ncomp, - const std::string name, + const std::string& name, std::optional<const amrex::Real> initial_value) { mf = std::make_unique<amrex::MultiFab>(mf_to_alias, amrex::make_alias, scomp, ncomp); |