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

SeBa does not seem to accept particle properties from SeBa.add_particle and add_particles. #1119

Open
spzwart opened this issue Feb 14, 2025 · 1 comment
Labels

Comments

@spzwart
Copy link
Contributor

spzwart commented Feb 14, 2025

If one runs the following small script using sse or seba (python script.py --SeBa), the seba version does not properly set the stellar properties in the code, whereas sse does.

from amuse.datamodel import Particles
from amuse.units import units, constants

def run_bug(use_sse=False):
if use_sse:
from amuse.community.sse.interface import Sse
code = Sse()
else:
from amuse.community.seba.interface import SeBa
code = SeBa()

stars = Particles(1)
stars.mass = 20|units.MSun
stars.radius = 10|units.RSun

code.particles.add_particles(stars)
code.evolve_model(1|units.yr)

channel = stars.new_channel_to(code.particles)
channel.copy()

print("R=", stars.radius)
print("R=", code.particles.radius)

print("M=", stars.mass)
print("M=", code.particles.mass)

def new_option_parser():
from optparse import OptionParser
result = OptionParser()
result.add_option("--SeBa", action="store_false",
dest="use_sse", default=True,
help="stellar code to use [%default]")
return result

if name in ('main'):
o, arguments = new_option_parser().parse_args()
run_bug(use_sse=o.use_sse)

output for the code:
%> python script.py

R= [10.0] RSun
R= [10.0] RSun
M= [20.0] MSun
M= [20.0] MSun

%> python script.py --SeBa

R= [10.0] RSun
R= [0.888249450314] RSun
M= [20.0] MSun
M= [0.0] MSun

Obviously the SeBa results (stellar radius, as well as mass) are incorrect.

Operating system: Linux Eilonwy 6.5.0-1027-oem #28-Ubuntu SMP PREEMPT_DYNAMIC Thu Jul 25 13:32:46 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
compiler: gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0

@LourensVeen
Copy link
Collaborator

The fix hasn't been merged yet, so it's a bit early to close this I'd say. Did you try Claude's code in #1125 and find it to fix the problem? If so, could you leave a review there, or at least a comment saying so?

@LourensVeen LourensVeen reopened this Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants