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

Add possibility to set up an hierarchical triple system embedded in a circum-triple disc #102

Merged
merged 5 commits into from
Feb 24, 2021

Conversation

si-mon-jinn
Copy link
Contributor

Add subroutine set_multiple in set_binary.f90 in order to substitute a sink with a binary oriented at will.

@danieljprice
Copy link
Owner

I think the mpi build failure here is my fault, apologies

Copy link
Owner

@danieljprice danieljprice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments below, I am happy to merge but would prefer if you could fix the substantial code overlap between set_binary and set_multiple to avoid having to maintain two copies of the same code

! Solve Kepler equation for eccentric anomaly
call get_E(period,eccentricity,tperi,E)
endif

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this repeats a LOT of code that has just been cut-and-pasted from set_binary.f90. Please pull out the common code into a function so that it can be called by both routines, so that set_multiple contains ONLY the code that is needed for setting up the multiple system

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overlap is due to the fact that set_multiple is written as a generalization of set_binary. If set_multiple is called without specifing a sink to substitute, it behaves exactly as set_binary.

We kept set_multiple and set_binary separated in order to test the new function without affecting the behaviour of the setup when two sinks are used. The plan is to substitute set_binary with set_multiple eventually. In this way a single function will handle hierarchical systems and binaries, which are the lowest order of a multiple system.

I can fix the code in this way keeping set_multiple as it is and modifying set_binary as a call to set_multiple.

However, if you think is better to keep two separated function for the building of a binary and the building of an hierarchical system I can surely perform the fix you suggested.

Thank you very much for the help and suggestions.

if (present(verbose)) do_verbose = verbose


!--- Load/Create HIERARCHY file: xyzmh_ptmass index | hierarchical index | star mass | companion star mass | semi-major axis | eccentricity | period | inclination | argument of pericenter | ascending node longitude
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a general comment here is that it would be great to add some documentation about this (just a page in the docs/ directory is all that is required), at least so you at least remember your own workflow here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do it soon, thank you

@danieljprice
Copy link
Owner

please can you add a basic documentation page for this so it can be merged?

@danieljprice danieljprice merged commit 18599d6 into danieljprice:master Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants