amuse icon indicating copy to clipboard operation
amuse copied to clipboard

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

Open spzwart opened this issue 11 months ago • 1 comments

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

spzwart avatar Feb 14 '25 11:02 spzwart

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 avatar Feb 26 '25 16:02 LourensVeen

This did get fixed by #1125 according to spz, so I'm closing this.

LourensVeen avatar Sep 02 '25 13:09 LourensVeen