Skip to content

added version of bridge that includes velocities of individual stars …#556

Open
webbjj wants to merge 4 commits into
amusecode:mainfrom
webbjj:master
Open

added version of bridge that includes velocities of individual stars …#556
webbjj wants to merge 4 commits into
amusecode:mainfrom
webbjj:master

Conversation

@webbjj

@webbjj webbjj commented Dec 18, 2019

Copy link
Copy Markdown

Note that the changes to bridge itself are minor. It just needs a use_velocities flag and self.vx,self.vy,self.vz need to be passed in get_gravity_at_point. I don't think they are needed in other functions. So it may not be necessary to have a separate file, and bridgev could be folded into bridge.

@rieder

rieder commented Dec 19, 2019

Copy link
Copy Markdown
Member

I would definitely fold it into bridge.py, and make it optional to pass the velocities. It would also make the changes easier to spot for us :).

I think the use_velocities flag should be passed when adding a "kicker" system, individually for each of these. Not all system may support get_gravity_at_point with velocities.

@ipelupessy

Copy link
Copy Markdown
Member

great! I would also put the changes in new (derived) classes in this case (and a more descriptive name than bridgev) in bridge.py. Can you also add an example of its use and some tests wouldalso be nice?

also next time: i suggest you make a feature branch in your fork and a PR against this (this makes it easier for yourself to work on multiple things at the same time;-)...)

@webbjj

webbjj commented Jan 4, 2020

Copy link
Copy Markdown
Author

I would definitely fold it into bridge.py, and make it optional to pass the velocities. It would also make the changes easier to spot for us :).

I think the use_velocities flag should be passed when adding a "kicker" system, individually for each of these. Not all system may support get_gravity_at_point with velocities.

Where is the check to see if the system is a "kicker" or not? Its not entirely clear to me where this is in bridge.

@webbjj

webbjj commented Jan 4, 2020

Copy link
Copy Markdown
Author

great! I would also put the changes in new (derived) classes in this case (and a more descriptive name than bridgev) in bridge.py. Can you also add an example of its use and some tests wouldalso be nice?

also next time: i suggest you make a feature branch in your fork and a PR against this (this makes it easier for yourself to work on multiple things at the same time;-)...)

Thanks for the suggestion. I am still a bit of a git rookie.

I was also hoping you can elaborate on your initial suggestion to put the changes in new (derived) classes. Are you saying make a class Bridgev (with better name) as opposed to adding the use_velocities option to class Bridge? Similarly, add a class GravityCodeInFieldv instead of adding to GravityCodeInField?

@ipelupessy

Copy link
Copy Markdown
Member

ok, I checked more carefully now: you should indeed make a new:

class BridgeWithVelocityDependendForces(Bridge):
..etc

(or some other descriptive name)..the option use_velocity still has to be present because as it is now you can enable these on a per system basis.

eventually this could be folded back in the Bridge, but I think it is nice to have a new class for now since that makes it clearer what the differences are.

already mentioned this, but tests and a way to validate would also be nice;-)

Make VelocityDependentBridge class to differentiate with regular Bridge
Under-the-hood changes look like they can just be merged.
@rieder

rieder commented Jan 27, 2020

Copy link
Copy Markdown
Member

I made some changes in a PR to this branch, creating a separate VelocityDependentBridge class (which mostly just inherits from Bridge) and merging the other changes into bridge.py.

Merge velocity dependent bridge into bridge.py
@rieder

rieder commented Jan 29, 2020

Copy link
Copy Markdown
Member

I'm not sure if I like the re-defining of "get_gravity_at_point" with velocities.

Perhaps we should have a new function "get_force_at_point" for this purpose - after all, the velocity dependent forces are different from gravity...

@ipelupessy

Copy link
Copy Markdown
Member

one thing I don't fully like: the method to get the acceleration in the velocity kick case is still called get_gravity; maybe it should be renamed to get_acceleration?

@ipelupessy

Copy link
Copy Markdown
Member

ok, I see you had the same concern ;-)

@rieder rieder self-requested a review June 2, 2020 08:26
@rieder rieder self-assigned this Jun 2, 2020
@rieder

rieder commented Apr 12, 2021

Copy link
Copy Markdown
Member

@ipelupessy should we perhaps just move to get_acceleration_at_point altogether, leaving get_gravity_at_point as an alias for this in case it is different?

@rieder

rieder commented Dec 3, 2021

Copy link
Copy Markdown
Member

Reminder to self that this is close to being mergeable. Just needs a name change for some functions.

@stale

stale Bot commented Mar 4, 2022

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the status: wontfix label Mar 4, 2022
@ipelupessy ipelupessy added the status: keep-open This issue should not be auto-closed by the bot label Mar 5, 2022
@ipelupessy

Copy link
Copy Markdown
Member

keep open for now

@stale

stale Bot commented May 4, 2022

Copy link
Copy Markdown

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.

@stale stale Bot added the status: stale Issues that have been around for a while without updates label May 4, 2022
@ipelupessy

Copy link
Copy Markdown
Member

keep

@stale stale Bot removed the status: stale Issues that have been around for a while without updates label May 5, 2022
@webbjj webbjj requested a review from a team as a code owner February 22, 2024 06:56
@rieder rieder added the kind: feature request The issue requests a feature that AMUSE does not currently have label Sep 23, 2025
@rieder

rieder commented Sep 23, 2025

Copy link
Copy Markdown
Member

This is still worth merging. Needs only a little bit of updating.

@HannoSpreeuw HannoSpreeuw moved this from Backlog to Feature Request in Development Board Nov 24, 2025
@HannoSpreeuw HannoSpreeuw moved this from Feature Request to Open PRs in Development Board Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind: feature request The issue requests a feature that AMUSE does not currently have status: keep-open This issue should not be auto-closed by the bot

Projects

Status: Open PRs

Development

Successfully merging this pull request may close these issues.

4 participants