[WIP] Fix FDTD: Bump GetMaxGuardCell to 2#6762
Open
ax3l wants to merge 2 commits intoBLAST-WarpX:developmentfrom
Open
[WIP] Fix FDTD: Bump GetMaxGuardCell to 2#6762ax3l wants to merge 2 commits intoBLAST-WarpX:developmentfrom
GetMaxGuardCell to 2#6762ax3l wants to merge 2 commits intoBLAST-WarpX:developmentfrom
Conversation
This is the only call paht in `OneStep_nosub` not using `WarpX::sync_nodal_points`.
ax3l
commented
Apr 10, 2026
| // outdated. | ||
| if (m_safe_guard_cells) { | ||
| FillBoundaryB(guard_cells.ng_alloc_EB); | ||
| FillBoundaryB(guard_cells.ng_alloc_EB, WarpX::sync_nodal_points); |
Member
Author
Member
|
I think this results in the "worst-case scenario" I observed in #6666 (comment), with or without It would be consistent with the fact that we have some tests failing at the analysis stage (not only checksums): If all of this is confirmed, I think the bug fix might require more tweaking. |
Member
|
Here's how I test
If you have this patch applied locally, diff --git a/Examples/Tests/langmuir/analysis_2d.py b/Examples/Tests/langmuir/analysis_2d.py
index 42f8dacdf..b5a35aa2b 100755
--- a/Examples/Tests/langmuir/analysis_2d.py
+++ b/Examples/Tests/langmuir/analysis_2d.py
@@ -103,27 +103,20 @@ for field in ["Ex", "Ez"]:
print("%s: Max error: %.2e" % (field, max_error))
error_rel = max(error_rel, max_error)
-# Plot the last field from the loop (Ez at iteration 40)
-fig, (ax1, ax2) = plt.subplots(1, 2, dpi=100)
-# First plot
-vmin = E_sim.min()
-vmax = E_sim.max()
-cax1 = make_axes_locatable(ax1).append_axes("right", size="5%", pad="5%")
-im1 = ax1.imshow(E_sim, origin="lower", extent=edge, vmin=vmin, vmax=vmax)
-cb1 = fig.colorbar(im1, cax=cax1)
-ax1.set_xlabel(r"$z$")
-ax1.set_ylabel(r"$x$")
-ax1.set_title(r"$E_z$ (sim)")
-# Second plot
-vmin = E_th.min()
-vmax = E_th.max()
-cax2 = make_axes_locatable(ax2).append_axes("right", size="5%", pad="5%")
-im2 = ax2.imshow(E_th, origin="lower", extent=edge, vmin=vmin, vmax=vmax)
-cb2 = fig.colorbar(im2, cax=cax2)
-ax2.set_xlabel(r"$z$")
-ax2.set_ylabel(r"$x$")
-ax2.set_title(r"$E_z$ (theory)")
-# Save figure
+# Plot By from the last iteration
+By_sim = data[("mesh", "By")].to_ndarray()[:, :, 0]
+fig, ax = plt.subplots(1, 1, dpi=100)
+vmax = np.abs(By_sim).max()
+if vmax == 0.0:
+ vmax = 1.0
+cax = make_axes_locatable(ax).append_axes("right", size="5%", pad="5%")
+im = ax.imshow(
+ By_sim, origin="lower", extent=edge, vmin=-vmax, vmax=vmax, cmap="RdBu_r"
+)
+cb = fig.colorbar(im, cax=cax)
+ax.set_xlabel(r"$z$")
+ax.set_ylabel(r"$x$")
+ax.set_title(r"$B_y$ (sim)")
fig.tight_layout()
fig.savefig("Langmuir_multi_2d_analysis.png", dpi=200)you can visualize the y-component of the B field as in the following example: The figure is saved automatically in build/bin/test_2d_langmuir_multi_mr_momentum_conserving/. |
GetMaxGuardCell to 2GetMaxGuardCell to 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fix #6760