Skip to content

Fix C++ Two-Way-Wave-Neumann Tutorial, and move existing doc and octave files to the correct folder locations. - #502

Open
jbrzensk wants to merge 8 commits into
mainfrom
bug/folder_rename
Open

jbrzensk wants to merge 8 commits into
mainfrom
bug/folder_rename

Conversation

@jbrzensk

@jbrzensk jbrzensk commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

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

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

Description

The two-way-wave-equation example was listed in an older matlab_octave folder. Moved to the octave folder.

Related Issues & Documents

Closes #143 and #501

Added/updated tests?

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

  • Yes
  • No, and this is why: not needed on file move.
  • I need help with writing tests

Read Contributing Guide and Code of Conduct

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

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.

Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.

@codecov

codecov Bot commented Oct 20, 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.

🔵 Needs a closer look

The relocated comparison driver retains an obsolete library path that prevents standalone execution in a clean session.

No open issues 🎉

Review effort: Balanced


// Store data for comparison
flops_md(cell_index) = static_cast<Real>((2 * nnz_md + U0_md.n_elem) * t);
flops_md(cell_index) = static_cast<Real>((2 * nnz_md + 3 * U0_md.n_elem) * t);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hey @jbrzensk , thank you for this PR. May I ask why the 3 here? I thought the PR was only renaming the directory path. Thanks

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Renaming and fixing the C++ code. This was skipped.

The 3 is there as an estimate for the number of FLOPs.
The solve should be:

 U2_md = 2.0 * U1_md + (L_interior * U1_md) - U0_md;

Let n be the number of elements in U0_md, and z be the nnz in L_interior.

  • 2*U1_md = n flops
  • L_interior*U1_md = approx 2z flops. Shortcut for sparsevector. I guess technically it is (z + (z-1)).
  • Step 1 + sparse mat mult = n flops
  • Result - U0_md = n flops

As I write this, I see the r2_md multiplying every step. That can be pre-multiplied to save n flops per step.

Arggh, I will fix it and rename the PR to address what it is actually doing.

@jbrzensk jbrzensk changed the title moved files to octave folder Fix C++ Two-Way-Wave-Neumann Tutorial, and move existing doc and octave files to the correct folder locations. Oct 26, 2026

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a Mimetic Operator Vs Finite Difference tutorial with a step-by-step explanations and comparisons

3 participants