Skip to content

Fix curv operators to function in Octave, and plotting issues with those examples. - #533

Open
jbrzensk wants to merge 2 commits into
mainfrom
bug/531_curv_octave_fix
Open

jbrzensk wants to merge 2 commits into
mainfrom
bug/531_curv_octave_fix

Conversation

@jbrzensk

Copy link
Copy Markdown
Collaborator

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Example
  • Documentation

Description

Octave curvilinear examples fail, with the new curv operators, because Octave cannot broadcast multiply anything to a sparse matrix except other sparse matrices. See issue #531

Related Issues & Documents

Added/updated tests?

_We encourage you to test all code included with MOLE, including examples.

Read Contributing Guide and Code of Conduct

[not-optional] What gif best describes this PR or how it makes you feel?

@jbrzensk jbrzensk self-assigned this Nov 25, 2026
Copilot AI balanced review requested due to automatic review settings November 25, 2026 22:44
@codecov

codecov Bot commented Nov 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are identified for the Octave compatibility updates to curvilinear operators and example output and plotting.

No open issues 🎉

What changed in this PR

This PR addresses the Octave compatibility failures reported in #531 by updating MOLE’s curvilinear operators and related example output and plotting code.

Changes:

  • Replace sparse-matrix broadcasting with sparse diagonal multiplication in the 2D and 3D gradient and divergence operators.
  • Use fprintf to format numerical error output correctly in Octave.
  • Replace incompatible plotting calls with Octave-compatible colorbar labels, axis settings, and multiline titles.
File Description
src/​octave/​grad3DCurv.m Apply 3D gradient metrics through sparse diagonal multiplication.
src/​octave/​grad2DCurv.m Apply 2D gradient metrics through sparse diagonal multiplication.
src/​octave/​div3DCurv.m Apply 3D divergence metrics through sparse diagonal multiplication.
src/​octave/​div2DCurv.m Apply 2D divergence metrics through sparse diagonal multiplication.
examples/​octave/​test_lap3DCurv.m Format the Laplacian error norm with fprintf.
examples/​octave/​test_lap3DCurv_case2.m Format the second Laplacian example’s error norm.
examples/​octave/​test_grad3DCurv.m Format all three gradient error norms.
examples/​octave/​test_grad2DCurv.m Format both gradient error norms.
examples/​octave/​test_div3DCurv.m Format the 3D divergence error norm.
examples/​octave/​test_div2DCurv.m Format the 2D divergence error norm.
examples/​octave/​elliptic2DCurvPeriodic.m Update colorbar labels and numerical error output for Octave.
examples/​octave/​curvConvergenceTest.m Use compatible logarithmic axes, titles, and legend formatting.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

divCurv and gradCurv examples fail in Octave

2 participants