amuse icon indicating copy to clipboard operation
amuse copied to clipboard

added version of bridge that includes velocities of individual stars …

Open webbjj opened this issue 6 years ago • 15 comments

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.

webbjj avatar Dec 18 '19 15:12 webbjj

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.

rieder avatar Dec 19 '19 13:12 rieder

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;-)...)

ipelupessy avatar Dec 19 '19 14:12 ipelupessy

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 avatar Jan 04 '20 01:01 webbjj

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?

webbjj avatar Jan 04 '20 01:01 webbjj

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;-)

ipelupessy avatar Jan 06 '20 10:01 ipelupessy

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.

rieder avatar Jan 27 '20 17:01 rieder

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...

rieder avatar Jan 29 '20 10:01 rieder

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 avatar Jan 29 '20 10:01 ipelupessy

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

ipelupessy avatar Jan 29 '20 10:01 ipelupessy

@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 avatar Apr 12 '21 16:04 rieder

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

rieder avatar Dec 03 '21 22:12 rieder

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[bot] avatar Mar 04 '22 15:03 stale[bot]

keep open for now

ipelupessy avatar Mar 05 '22 19:03 ipelupessy

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[bot] avatar May 04 '22 19:05 stale[bot]

keep

ipelupessy avatar May 05 '22 10:05 ipelupessy