Skip to content

Commit 554a2ff

Browse files
authored
WarpX class: AllocInitMultiFab and imultifab_map no longer static (#5614)
This PR contributes to reducing the usage of static member functions and static variables in the WarpX class. **Note:** I have observed a [failure](https://dev.azure.com/ECP-WarpX/WarpX/_build/results?buildId=20508&view=logs&jobId=5dcb75fd-7a98-5ebf-88d6-c1115a1d979a&j=5dcb75fd-7a98-5ebf-88d6-c1115a1d979a&t=f00e0ae1-a8d3-5558-a3f3-078bee0de0f0) of the test `test_2d_embedded_circle` . This failure does not seem to be related to the PR. I have observed that sometimes `embedded_circle` tests fail for apparently random reasons. We should look into that, since it might be a race condition or an undefined behavior issue.
1 parent fc37679 commit 554a2ff

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Source/WarpX.H

+2-2
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ public:
404404
* \param[in] name The name of the iMultiFab to use in the map
405405
* \param[in] initial_value The optional initial value
406406
*/
407-
static void AllocInitMultiFab (
407+
void AllocInitMultiFab (
408408
std::unique_ptr<amrex::iMultiFab>& mf,
409409
const amrex::BoxArray& ba,
410410
const amrex::DistributionMapping& dm,
@@ -417,7 +417,7 @@ public:
417417
// Maps of all of the iMultiFabs used (this can include MFs from other classes)
418418
// This is a convenience for the Python interface, allowing all iMultiFabs
419419
// to be easily referenced from Python.
420-
static std::map<std::string, amrex::iMultiFab *> imultifab_map;
420+
std::map<std::string, amrex::iMultiFab *> imultifab_map;
421421

422422
/**
423423
* \brief

Source/WarpX.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,6 @@ bool WarpX::do_dynamic_scheduling = true;
176176
bool WarpX::do_multi_J = false;
177177
int WarpX::do_multi_J_n_depositions;
178178

179-
std::map<std::string, amrex::iMultiFab *> WarpX::imultifab_map;
180-
181179
IntVect WarpX::filter_npass_each_dir(1);
182180

183181
int WarpX::n_field_gather_buffer = -1;

0 commit comments

Comments
 (0)