Skip to content

Skip FTCS solver for zero-diffusion grids#459

Open
stanbot8 wants to merge 1 commit intoBioDynaMo:masterfrom
stanbot8:opt/skip-ftcs-zero-diffusion
Open

Skip FTCS solver for zero-diffusion grids#459
stanbot8 wants to merge 1 commit intoBioDynaMo:masterfrom
stanbot8:opt/skip-ftcs-zero-diffusion

Conversation

@stanbot8
Copy link
Copy Markdown
Contributor

@stanbot8 stanbot8 commented Mar 4, 2026

Summary

  • When the diffusion coefficient is 0 but decay is nonzero, EulerGrid::DiffuseWith* now applies decay as a simple element-wise multiply instead of running the full FTCS stencil. The Laplacian term vanishes with D=0, so the stencil computation is wasted work.
  • Also fixes two pre-existing cpplint warnings (stray semicolons after }) in diffusion_grid.h.

Test plan

  • All existing diffusion tests pass, including EulerDepletionConvergenceExponentialDecay and DepletionMissmatch (both use D=0 depletion grids)

@sportokalidis
Copy link
Copy Markdown
Contributor

Hi @stanbot8,

Thanks for the contribution! I’ll review the changes and get back to you.

In the meantime: the CI issue that previously prevented macos-system-ci and ubuntu-system-ci from running has been fixed on main.

Could you please update your PR branch with the latest main (merge main into your branch, or rebase onto main) and push? That should trigger the missing system CI workflows on this PR.

@stanbot8 stanbot8 force-pushed the opt/skip-ftcs-zero-diffusion branch from da8828e to e34c6fe Compare March 11, 2026 16:34
When the diffusion coefficient is 0 but decay is nonzero, apply
decay as a simple element-wise multiply instead of running the
full FTCS stencil. The Laplacian term vanishes with D=0, so the
stencil computation is wasted work.
@stanbot8 stanbot8 force-pushed the opt/skip-ftcs-zero-diffusion branch from e34c6fe to f7b1bbf Compare March 12, 2026 14:55
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