Skip to content

X3 prolongation limiter uses spacing as gradient output #174

Description

@BenWibking

X3 prolongation limiter uses spacing as gradient output

Summary

ProlongateCellMinModMultiD::Do passes dx3p as the final GradMinMod argument for
the x3 slope calculation.

Why this is a bug

The x1 and x2 branches pass gx1m, gx1p and gx2m, gx2p. The x3 branch should pass
gx3m, gx3p, but it passes gx3m, dx3p. This corrupts the plus-side x3 limited
gradient in 3D AMR prolongation and can produce incorrect fine-cell values.

Patch

diff --git a/src/hydro/prolongation/custom_ops.hpp b/src/hydro/prolongation/custom_ops.hpp
--- a/src/hydro/prolongation/custom_ops.hpp
+++ b/src/hydro/prolongation/custom_ops.hpp
@@
       gx3c =
           GradMinMod(fc, coarse(element_idx, l, m, n, k - 1, j, i),
-                     coarse(element_idx, l, m, n, k + 1, j, i), dx3m, dx3p, gx3m, dx3p);
+                     coarse(element_idx, l, m, n, k + 1, j, i), dx3m, dx3p, gx3m, gx3p);

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-code-auditIssues identified by AI-assisted code audit

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions