Skip to content

Adjust FMG approximation - Skip costly multigrid cycles on finest level#185

Merged
julianlitz merged 1 commit intomainfrom
litz_fast_fmg
Feb 27, 2026
Merged

Adjust FMG approximation - Skip costly multigrid cycles on finest level#185
julianlitz merged 1 commit intomainfrom
litz_fast_fmg

Conversation

@julianlitz
Copy link
Collaborator

@julianlitz julianlitz commented Feb 27, 2026

During FMG initialization, multigrid cycles were being applied at every level including the finest (depth 0). However, any cycles applied at depth 0 during FMG are redundant and should be counted towards the standard multigrid iterations anyway.

New behavior: The initial FMG approximation now ends with the interpolation to the finest grid. No further MGC is applied.

Why this matters for PCG

This becomes especially important when combining FMG with a Preconditioned Conjugate Gradient (PCG) solver. Any multigrid cycles burned at depth 0 during FMG are slow and expensive (finest grid = largest problem), and they delay the point at which PCG can take over with its faster convergence. By skipping these redundant cycles, PCG starts earlier, reducing the total iteration count and overall solve time.

Merge Request - GuideLine Checklist

Guideline to check code before resolve WIP and approval, respectively.
As many checkboxes as possible should be ticked.

Checks by code author:

Always to be checked:

  • There is at least one issue associated with the pull request.
  • New code adheres with the coding guidelines
  • No large data files have been added to the repository. Maximum size for files should be of the order of KB not MB. In particular avoid adding of pdf, word, or other files that cannot be change-tracked correctly by git.

If functions were changed or functionality was added:

  • Tests for new functionality has been added
  • A local test was succesful

If new functionality was added:

  • There is appropriate documentation of your work. (use doxygen style comments)

If new third party software is used:

  • Did you pay attention to its license? Please remember to add it to the wiki after successful merging.

If new mathematical methods or epidemiological terms are used:

  • Are new methods referenced? Did you provide further documentation?

Checks by code reviewer(s):

  • Is the code clean of development artifacts e.g., unnecessary comments, prints, ...
  • The ticket goals for each associated issue are reached or problems are clearly addressed (i.e., a new issue was introduced).
  • There are appropriate unit tests and they pass.
  • The git history is clean and linearized for the merge request. All reviewers should squash commits and write a simple and meaningful commit message.
  • Coverage report for new code is acceptable.
  • No large data files have been added to the repository. Maximum size for files should be of the order of KB not MB. In particular avoid adding of pdf, word, or other files that cannot be change-tracked correctly by git.

@julianlitz julianlitz changed the title Adjust FMG approximation - Avoid costly MGC on level = 0 Adjust FMG approximation - Skip costly multigrid cycles on finest level Feb 27, 2026
@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 76.66667% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.21%. Comparing base (39ce1dd) to head (d0be022).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/GMGPolar/solver.cpp 74.07% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #185      +/-   ##
==========================================
+ Coverage   95.18%   95.21%   +0.03%     
==========================================
  Files          94       94              
  Lines        9345     9327      -18     
==========================================
- Hits         8895     8881      -14     
+ Misses        450      446       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@julianlitz julianlitz merged commit a5f97e6 into main Feb 27, 2026
7 of 8 checks passed
@julianlitz julianlitz deleted the litz_fast_fmg branch February 27, 2026 13:21
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