Skip to content

fix for pow(0,0) in mom counter - #499

Open
pdziekan wants to merge 2 commits into
igfuw:masterfrom
pdziekan:master
Open

fix for pow(0,0) in mom counter#499
pdziekan wants to merge 2 commits into
igfuw:masterfrom
pdziekan:master

Conversation

@pdziekan

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI lite review requested due to automatic review settings August 24, 2026 13:27

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.

Pull request overview

Fixes zeroth-moment handling for zero-valued attributes and improves unknown-attribute diagnostics.

Changes:

  • Avoids evaluating pow(x, 0).
  • Includes invalid attribute names in error messages.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Summary
src/impl/diagnose_SD_attributes/particles_impl_moms.ipp Handles zero-order moments directly.
src/impl/diagnose_SD_attributes/particles_impl_fill_outbuf.ipp Improves unknown-attribute error details.
Suppressed comments (1)

src/impl/diagnose_SD_attributes/particles_impl_moms.ipp:254

  • Please add a regression test that initializes a diagnosed attribute to zero and calls a zeroth moment (for example, diag_up_mom(0)). The existing tests exercise zeroth moments only with positive radii or other nonzero values, so they would not catch the pow(0,0) failure this branch is intended to prevent; covering the CUDA backend would be valuable as well.
          if(xp == 0)
            return n;

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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