Skip to content

Commit 553118d

Browse files
authored
Rebuild current and gather buffer masks during regrid (#6412)
This might fix #6390.
1 parent 463a1f3 commit 553118d

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Source/Parallelization/WarpXRegrid.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,6 @@ WarpX::RemakeLevel (int lev, Real /*time*/, const BoxArray& ba, const Distributi
293293
#endif
294294
}
295295

296-
if (lev > 0 && (n_field_gather_buffer > 0 || n_current_deposition_buffer > 0)) {
297-
if (current_buffer_masks[lev] || gather_buffer_masks[lev]) {
298-
BuildBufferMasks();
299-
}
300-
}
301-
302296
// Re-initialize the lattice element finder with the new ba and dm.
303297
m_accelerator_lattice[lev]->InitElementFinder(lev, gamma_boost, gett_new(), ba, dm);
304298

@@ -315,6 +309,18 @@ WarpX::RemakeLevel (int lev, Real /*time*/, const BoxArray& ba, const Distributi
315309

316310
SetDistributionMap(lev, dm);
317311

312+
if (lev > 0 && (n_field_gather_buffer > 0 || n_current_deposition_buffer > 0)) {
313+
if (current_buffer_masks[lev] || gather_buffer_masks[lev]) {
314+
if (current_buffer_masks[lev]) {
315+
RemakeMultiFab( current_buffer_masks[lev] );
316+
}
317+
if (gather_buffer_masks[lev]) {
318+
RemakeMultiFab( gather_buffer_masks[lev] );
319+
}
320+
BuildBufferMasks();
321+
}
322+
}
323+
318324
} else
319325
{
320326
WARPX_ABORT_WITH_MESSAGE("RemakeLevel: to be implemented");

0 commit comments

Comments
 (0)