MLNodeLaplacian: route mknewu through anisotropic sigma path#5380
Merged
drummerdoc merged 10 commits intoAMReX-Codes:developmentfrom May 1, 2026
Merged
MLNodeLaplacian: route mknewu through anisotropic sigma path#5380drummerdoc merged 10 commits intoAMReX-Codes:developmentfrom
drummerdoc merged 10 commits intoAMReX-Codes:developmentfrom
Conversation
When setMapped(true) is used, MLNodeLaplacian stores sigma with
AMREX_SPACEDIM components so each velocity/flux direction can carry
its own diffusivity. However, MLNodeLaplacian::updateVelocity and
MLNodeLaplacian::getFluxes both read only m_sigma[amrlev][0][0]
(sigma_x) and applied it to every velocity component, leaving the
caller with
u_i = u_entry - sigma_x * (grad phi)_i
instead of the correct per-component
u_i = u_entry - sigma_i * (grad phi)_i
Add mlndlap_mknewu_ha (2D and 3D) as an anisotropic-sigma sibling of
mlndlap_mknewu, and route both updateVelocity and getFluxes through
it when m_use_mapped is true. 2D preserves the RZ axial correction.
EB is intentionally left on the scalar sigma_x path: producing
mlndlap_mknewu_eb_ha is a separate task and no in-tree consumer needs
it today.
Downstream codes can detect the fix via the new feature macro
AMREX_MLNODELAP_HAS_MKNEWU_HA in AMReX_MLNodeLaplacian.H.
…es 0..n-1, which ignores bx.smallEnd(0) andwrites to wrong cells under MFIter tiling. Revert the 1D dispatchto PARALLEL_FOR_3D over bx, matching the 2D/3D scalar-sigma branches.
WeiqunZhang
approved these changes
May 1, 2026
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.
Summary
When setMapped(true) is used, MLNodeLaplacian stores sigma with AMREX_SPACEDIM components so each velocity/flux direction can carry its own diffusivity. However, MLNodeLaplacian::updateVelocity and MLNodeLaplacian::getFluxes both read only m_sigma[amrlev][0][0] (sigma_x) and applied it to every velocity component, leaving the caller with
instead of the correct per-component
Add mlndlap_mknewu_ha (2D and 3D) as an anisotropic-sigma sibling of mlndlap_mknewu, and route both updateVelocity and getFluxes through it when m_use_mapped is true. 2D preserves the RZ axial correction. EB is intentionally left on the scalar sigma_x path: producing mlndlap_mknewu_eb_ha is a separate task and no in-tree consumer needs it today.
Downstream codes can detect the fix via the new feature macro AMREX_MLNODELAP_HAS_MKNEWU_HA in AMReX_MLNodeLaplacian.H.
Additional background
This was recognized and fixed as part of an effort to add mapped grids into PeleLMeX - PR coming soon.
Checklist
The proposed changes: