Skip to content

Cpp addscalarBC bug fix - #504

Open
bewagner1 wants to merge 3 commits into
csrc-sdsu:mainfrom
bewagner1:cppaddscalar
Open

bewagner1 wants to merge 3 commits into
csrc-sdsu:mainfrom
bewagner1:cppaddscalar

Conversation

@bewagner1

Copy link
Copy Markdown
Collaborator

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

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

Description

addscalarbc.cpp helper function zeroRows() throws an error when there are non-zero elements in the rows that it is zeroing. This is fixed and tests are updated to random matrices rather than mimetic Laplacians.

Related Issues & Documents

Added/updated tests?

  • Yes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

Read Contributing Guide and Code of Conduct

[optional] Are there any post deployment tasks we need to perform?

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

@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!

@bewagner1 bewagner1 changed the title Cppaddscalar Cpp addscalarBC bug fix Oct 27, 2026
@jbrzensk
jbrzensk requested a balanced review from Copilot November 2, 2026 18:03

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 reported for the boundary-condition row-clearing changes.

No open issues 🎉

What changed in this PR

Fixes C++ scalar boundary-condition handling when rows being cleared contain nonzero entries, addressing the C++ case related to #475.

Changes:

  • Replaces iterator-based element deletion with row-level zeroing and sparse-matrix synchronization.
  • Updates boundary-condition tests to use random matrices instead of Laplacians, exercising populated boundary rows.
  • Adjusts the periodic 1D test to use m entries without ghost points.
File Description
tests/​cpp/​test_addscalarbc.cpp Uses random matrices across boundary-condition tests and updates periodic test dimensions.
src/​cpp/​addscalarbc.cpp Clears boundary rows without modifying entries through an active iterator.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

addScalarBC2D fails with implicit terms

2 participants