Open JPGlaser opened 4 years ago
@spzwart Steve mentioned you might have some insight into the correct methodology within the framework, if you have some time.
~ Joe G.
dear Joe,
yes, I think that I can help. however, we have the EAS/NAC meeting right now, which takes all my time. I may be able to have a look next week.
can you send me your script?
simon
On Mon, Jun 29, 2020, 21:52 Joseph Glaser notifications@github.com wrote:
@spzwart https://github.com/spzwart Steve mentioned you might have some insight into the correct methodology within the framework, if you have some time.
~ Joe G.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/amusecode/amuse/issues/652#issuecomment-651324617, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCPFTEVPP7WVQAAVKW43BLRZDWF7ANCNFSM4OJSEMHQ .
@spzwart , Sure no worries there! I have code I am running in the mean-time and I have a review panel starting tomorrow through Thursday.
You can find the script located here: https://github.com/JPGlaser/Tycho/blob/master/sim_cluster.py
You can run it using the following command to get 5000 stellar systems, 2500 tracer Jovians in an open cluser with w0 = 3 evolving for 200 Myr. The seed should make everything repeatable between tests.
python ~/GitHub/Tycho/sim_cluster.py -p 2500 -s 5000 -c Canis -w 3 -T 200 -S Canis -b -N [NUMBER_OF_GPUS_HERE]
The interface calls start at line 337.
~ Joe G.
I think the comsystem in ext helps with this (it transfers the system to center of mass coordinates for puprose of the internal dynamics)
Aye that it does in theory, @ipelupessy. I hadn't noticed it but it was one of my thoughts to do as a patch method. I guess the question is how well this plays with Bridge and Multiples. I'll do some testing this evening on that.
ok, let me know; there surely other ways to do it (and maybe this is not the fastest)...
Following up on this as I just had some time to do testing. In theory comsystem should work fine, however having it wrap Multiples/PH4 fails due to the need to set keyword arguments.
multiples_code = multiples.Multiples(gravity_code=gravity_code, resolve_collision_code_creation_function=util.new_smalln, kepler_code=kep, gravity_constant=units.constants.G)
comgrav = comsystem.center_of_mass_system(multiples_code)
where gravity_code/kep is a set-up ph4/kepler instance(s) which results in the following error:
AttributeError Traceback (most recent call last)
<ipython-input-32-813e6c7174dd> in <module>
1 #gravity_code = ph4(number_of_workers = 1, redirection = "none",
2 # convert_nbody = LargeScaleConverter)
----> 3 comgrav = comsystem.center_of_mass_system(multiples_code)
/home/draco/amuse/amuse3/src/amuse/ext/comsystem.py in center_of_mass_system(baseclass)
8 def center_of_mass_system(baseclass):
9
---> 10 class comsystem(baseclass):
11 def __init__(self,*args,**kwargs):
12 self.particles_accessed=True
/home/draco/amuse/amuse3/src/amuse/couple/multiples.py in __init__(self, gravity_code, resolve_collision_code_creation_function, kepler_code, gravity_constant, **options)
151
152 # Local copy of CM (= root) particles in the gravity code.
--> 153 self._inmemory_particles = self.gravity_code.particles.copy()
154
155 # Dictionary connecting center of mass particles with the
AttributeError: 'str' object has no attribute 'particles'
A similar error results when you feed it just PH4. If you give it a bare base class and try to set the parameters afterwards, the result is:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-33-a3384703b3e2> in <module>
----> 1 comgrav.evolve_model(0.1 | units.Myr)
/home/draco/amuse/amuse3/src/amuse/ext/comsystem.py in evolve_model(self, *args, **kwargs)
15
16 def evolve_model(self,*args,**kwargs):
---> 17 if self.particles_accessed:
18 self.com_position=self._particles.center_of_mass()
19 self.com_velocity=self._particles.center_of_mass_velocity()
AttributeError: 'ScalarQuantity' object has no attribute 'particles_accessed'
A thought on this is you could in theory create another wrapper to initialize any base code with the settings needed and then pass that to comsystem, but that seems like unnecessary overhead. Thoughts, @ipelupessy ?
~ Joe G.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 28 days if no further activity occurs. Thank you for your contributions.
Hey Everyone,
I'm running into some headaches with the switch to larger open-clusters running on ph4/multiples (GPU) when using the default MWpotentialBovy2015 in a bridge. Specifically, I'd like to set the stars around the origin in the ph4/multiples copy of the data-set, but allow for the effects of the galactic potential to be felt by the stars as they orbit at a specified radius much larger than the cluster's radius. In the current implementation, when GPUs are utilized, I am loosing precision due to hardware limitations.
There are a few ways I can see going about doing this, all of which seem a bit "hacky." Just curious how some of you go about handling this scale issue in the Bridge integrator.
~ Joe G.