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

Use SpEC's eccentricity control #6333

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

nilsvu
Copy link
Member

@nilsvu nilsvu commented Oct 15, 2024

Proposed changes

Call into SpEC to get eccentricity reduction updates. Replaces the port of an old SpEC script.

Upgrade instructions

Code review checklist

  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.
  • The PR lists upgrade instructions and is labeled bugfix or
    new feature if appropriate.

Further comments

@nilsvu nilsvu requested review from knelli2 and removed request for knelli2 October 15, 2024 00:57
@nilsvu
Copy link
Member Author

nilsvu commented Oct 17, 2024

@sxs-collaboration/spectre-core-devs could one of you take this one?

@nilsvu nilsvu force-pushed the ecc_control branch 2 times, most recently from 65d44ab to ec26450 Compare October 21, 2024 20:30
@nilsvu nilsvu requested a review from knelli2 October 21, 2024 20:31
Copy link
Contributor

@knelli2 knelli2 left a comment

Choose a reason for hiding this comment

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

[not a full review] Seems like some modules need to be fixed. Am I understanding this correctly that we have to have SpEC installed in order to do eccentricity control currently? Should we add an error/warning if somebody tries to use it but their build wasn't configured with SpEC?

@nilsvu
Copy link
Member Author

nilsvu commented Oct 22, 2024

Yes that's correct. I'll add some more checks for that (edit: done). For independence from SpEC we'll have to port the code over at some point.

@nilsvu nilsvu force-pushed the ecc_control branch 3 times, most recently from e52c26b to 1697c37 Compare October 22, 2024 23:43
Comment on lines +50 to +51
the target eccentricity, using SpEC's OmegaDotEccRemoval.py. Currently
supports only circular target orbits (target eccentricity = 0).
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a check that the eccentricity is in fact 0 until we add support for non-zero ecc

Comment on lines 30 to 17
output=None, # reads from Inspiral.yaml
):
def eccentricity_control(h5_files, id_input_file_path, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

Type the arguments

Comment on lines +24 to +26
"Omega0",
"adot0",
"D0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to take this opportunity and move away from the names in SpEC to better names? Like initial_angular_velocity, initial_radial_velocity, initial_separation

Copy link
Member Author

@nilsvu nilsvu Dec 4, 2024

Choose a reason for hiding this comment

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

These names are actually used a lot, so I tend towards keeping them.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok I'm fine with this, but we should be aware that if we want to change the names it's better to do it earlier rather than later while we're still building everything. We'll be even more resistant to change in the future once this is being used

Comment on lines 166 to 171
# Call into SpEC's OmegaDotEccRemoval.py
t, Omega, dOmegadt, OmegaVec = ComputeOmegaAndDerivsFromFile(traj_A, traj_B)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also add a comment that despite the function name, this expects arrays of data, and not filenames

Comment on lines +38 to +39
subfile_name_aha_quantities: str = "ObservationAhA.dat",
subfile_name_ahb_quantities: str = "ObservationAhB.dat",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not factor these defaults out as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

I only factored out the defaults because the lines were too long

Comment on lines 8 to 9

def write_mock_trajectory_data(
Copy link
Contributor

Choose a reason for hiding this comment

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

We already have a class tests/Unit/Helpers/PointwiseFunctions/PostNewtonian/BinaryTrajectories.hpp that can compute low order PN (and Newtonian) trajectories that we use in control system testing. Maybe we should move it to a common location, extend it a bit, and bind it in python to use here (that way we don't rewrite things)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in #6366

Copy link
Contributor

@knelli2 knelli2 left a comment

Choose a reason for hiding this comment

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

You can squash in this last change

Comment on lines +98 to +99
target_eccentricity == 0.0
), "Only circular orbits are supported for eccentricity control yet."
Copy link
Contributor

Choose a reason for hiding this comment

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

yet -> currently

Comment on lines +24 to +26
"Omega0",
"adot0",
"D0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok I'm fine with this, but we should be aware that if we want to change the names it's better to do it earlier rather than later while we're still building everything. We'll be even more resistant to change in the future once this is being used

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