Skip to content

Fix review comments: add MultiGrid module with correctness and hygiene fixes - #105

Merged
jdoelz merged 5 commits into
masterfrom
copilot/fix-code-for-review-comments
Jul 22, 2026
Merged

Fix review comments: add MultiGrid module with correctness and hygiene fixes#105
jdoelz merged 5 commits into
masterfrom
copilot/fix-code-for-review-comments

Conversation

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Introduces the MultiGrid module (from PR #97) with all review-requested fixes applied before merging.

Fixes applied

  • ProlongationBsplines.hpp

    • Added missing #include <tuple> (was relying on transitive includes)
    • Guarded the knot search loop in nonZerosInfoRow() against out-of-bounds access and unsafe decrement when the refined knot value is at/past the last knot
    • Hoisted nonZerosInfoRow() call out of the inner j loop — it only depends on i, not j
    • Replaced non_zero_alpha(j) linear indexing with explicit non_zero_alpha(0, j)
  • MultiGridSolver.hpp

    • Replaced macro constants (#define MULTIGRID_*) with a scoped unnamed enum to avoid macro pollution in including translation units:
      // before
      #define MULTIGRID_minLvl 1
      #define MULTIGRID_cycleType 2
      
      // after
      enum : unsigned int { MULTIGRID_minLvl = 1, MULTIGRID_cycleType = 2, ... };
  • Prolongation.hpp

    • Cached fine_glue.get_glue_matrix() and coarse_glue.get_glue_matrix() into local const variables to avoid repeated by-value returns and redundant sparse transposes
  • Bembel/MultiGrid (module header)

    • Added trailing // BEMBEL_MULTIGRID_MODULE_ comment on #endif to match the convention used by all other module headers
  • examples/LaplaceBeltramiMultiGrid.cpp

    • Added max_iters parameter (default 1000) to mmg() and guarded the do/while loop with iter < max_iters to prevent indefinite hangs on non-convergent setups
  • examples/CMakeLists.txt

    • Added LaplaceBeltramiMultiGrid to CIFILES so it is built and run in CI

Copilot AI changed the title [WIP] Fix code according to review comments Fix review comments: add MultiGrid module with correctness and hygiene fixes Jul 21, 2026
Copilot AI requested a review from jdoelz July 21, 2026 18:47
Copilot stopped work on behalf of jdoelz due to an error July 22, 2026 10:03
@jdoelz
jdoelz marked this pull request as ready for review July 22, 2026 10:35

@jdoelz jdoelz left a comment

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.

Ok

@jdoelz
jdoelz requested a review from mx-nlte July 22, 2026 14:38
@jdoelz
jdoelz merged commit 65df839 into master Jul 22, 2026
5 checks passed
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