Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(set-binary) update npartoftype array when particle types are set according to a specific star in a binary #596

Merged
merged 2 commits into from
Oct 20, 2024

Conversation

themikelau
Copy link
Collaborator

Type of PR:
Bug fix (found by @msha0023)

Description:
When setting up two gas-particle stars in a binary using SETUP=binary with relax_star, the second star is not relaxed because of an error raised by checksetup called in `relax_star:

rstar =    1.0000000000000000       mstar =   0.99935806369259794       tdyn =    1.1110774122591152     
 n(via iphase)=         100           0           0         100           0           0           0           0
 npartoftype  =         200           0           0           0           0           0           0           0
 ERROR: sum of types in iphase is not equal to npartoftype

 ERROR! relax_star: cannot relax star because particle setup contains errors

The cause of this is that the npartoftype array was not updated when particles from star 1 were set to the type itype+ioffset, causing a mismatch with iphase. I have now ensured npartoftype is updated whenever particle types are changed.

@danieljprice danieljprice merged commit e805ed6 into master Oct 20, 2024
180 checks passed
@danieljprice danieljprice deleted the set-binary-fix branch October 20, 2024 21:05
@danieljprice
Copy link
Owner

thanks both

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