Skip to content

Correcting window size for mass averages. #73

Merged
carlrodriguez merged 2 commits into
masterfrom
mass_average_fix
May 25, 2026
Merged

Correcting window size for mass averages. #73
carlrodriguez merged 2 commits into
masterfrom
mass_average_fix

Conversation

@elenagonzalez870

Copy link
Copy Markdown
Contributor
  • Currently, the local squared mass averages are calculated within a window that is either AVEKERNEL or 1.0e-4 * ((double) clus.N_STAR) / 2.0. For clusters with a large number of stars, this means that mass averages are computed over a window containing thousands of neighbors. This is inconsitent with the fact that other averaged local quantities (like calc_n_local) are always calculated in a fixed window, and it is likely just legacy code that was never changed.

…window that is either AVEKERNEL or 1.0e-4 * ((double) clus.N_STAR) / 2.0. For clusters with a large number of stars, this means that mass averages are computed over a window containing thousands of neighbors. This is inconsitent with the fact that other averaged local quantities (like calc_n_local) are always calculated in a fixed window, and it is likely just legacy code that was never changed.
Copilot AI review requested due to automatic review settings May 8, 2026 23:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the neighbor-window selection used when computing the local average of mass², making it consistently use the fixed AVEKERNEL window size instead of scaling with clus.N_STAR.

Changes:

  • Set the averaging half-window p in calc_average_mass_sqr() to always be AVEKERNEL (removing the MAX(1e-4*N_STAR/2, AVEKERNEL) scaling).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/cmc/cmc_dynamics_helper.c
@carlrodriguez

Copy link
Copy Markdown
Member

looks good to me!

@carlrodriguez
carlrodriguez self-requested a review May 25, 2026 17:44

@carlrodriguez carlrodriguez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@carlrodriguez
carlrodriguez merged commit d9bf076 into master May 25, 2026
6 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.

3 participants