Skip to content

Fix scalar indexing issue in the callbacks#161

Merged
huiyuxie merged 9 commits intomainfrom
fix
Jun 6, 2025
Merged

Fix scalar indexing issue in the callbacks#161
huiyuxie merged 9 commits intomainfrom
fix

Conversation

@huiyuxie
Copy link
Copy Markdown
Member

@huiyuxie huiyuxie commented Jun 2, 2025

Includes fix for #156.

@huiyuxie huiyuxie requested a review from Copilot June 3, 2025 20:11
@huiyuxie huiyuxie self-assigned this Jun 3, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Fixes scalar indexing in the callback stage by introducing a temporary CPU‐side Jacobian helper and updating the 1D integration API.

  • Add volume_jacobian_temp as a stopgap before a GPU kernel implementation
  • Swap usage of volume_jacobian for 1D callbacks and provide a new integrate wrapper
  • Refactor comments in stable.jl and introduce get_node_vars_view for GPU array slicing

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/solvers/dg.jl Added volume_jacobian_temp; corrected GPU-dimension comment
src/callbacks_step/analysis_dg_1d.jl Replaced volume_jacobian usage; added integrate for 1D
src/auxiliary/stable.jl Reformatted comments; cleaned helpers; added get_node_vars_view
Comments suppressed due to low confidence (3)

src/callbacks_step/analysis_dg_1d.jl:74

  • The positional arguments to integrate_via_indices are misaligned: the first parameter should be the function func, followed by u. Use integrate_via_indices(func, u, mesh, ...) to match its signature.
integrate_via_indices(u, mesh, equations, dg, cache;                          normalize = normalize) do u, i, element, equations, dg

src/callbacks_step/analysis_dg_1d.jl:71

  • [nitpick] The name integrate may collide with existing Base or common library functions; consider a more specific name or module namespace to prevent ambiguity.
function integrate(func::Func, u,

src/auxiliary/stable.jl:28

  • The new helper get_node_vars_view lacks unit tests. Adding coverage will catch slicing errors early.
# Call to get slice of GPU arrays outside of GPU kernels.

Comment thread src/solvers/dg.jl Outdated
Comment thread src/solvers/dg.jl
Comment thread src/solvers/dg.jl
Comment thread src/auxiliary/stable.jl Outdated
@huiyuxie huiyuxie changed the title Fix scalar indexing issue in the callback stage Fix scalar indexing issue in the callbacks Jun 4, 2025
Comment thread src/callbacks_step/stepsize_dg_1d.jl Outdated
@huiyuxie huiyuxie merged commit dbed950 into main Jun 6, 2025
3 of 4 checks passed
@huiyuxie huiyuxie deleted the fix branch June 10, 2025 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants