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 PostNewtonian.jl for initial orbital parameters #6224

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

Conversation

nilsvu
Copy link
Member

@nilsvu nilsvu commented Aug 15, 2024

Proposed changes

Replaces the dependence on SpEC to compute low-eccentricity initial orbital parameters with the sxs package. It provides the PN approximations at higher PN order than SpEC, is much faster, and avoids spurious output from old Fortran code (LSODA) that was used in SpEC.
The PN approximations are provided through the PostNewtonian.jl Julia package, so Julia will be downloaded on first use, which may take a few minutes.

See also moble/PostNewtonian.jl#41, which made this possible.

Upgrade instructions

To use low-eccentricity initial orbital parameters for BBH initial data, install the sxs package in your Python environment:

# In the build directory:
./bin/python-spectre -m pip install sxs

Now you can use ./bin/spectre bbh generate-id with the --eccentricity=0 option.

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 force-pushed the pn_initial_orbital_params branch 6 times, most recently from 2f85cfc to 6cafeef Compare August 21, 2024 17:37
@nilsvu nilsvu force-pushed the pn_initial_orbital_params branch 3 times, most recently from a0ab56f to 14a0626 Compare August 29, 2024 08:08
nilsvu added 4 commits August 29, 2024 11:21
Replaces the dependence on SpEC to compute low-eccentricity
initial orbital parameters with the `sxs` package.
It provides the PN approximations at higher PN order than
SpEC, is much faster, and avoids spurious output from old
Fortran code (LSODA) that was used in SpEC.
The PN approximations are provided through the
`PostNewtonian.jl` Julia package, so Julia will be downloaded
on first use, which may take a few minutes.
@nilsvu nilsvu force-pushed the pn_initial_orbital_params branch from f6bb368 to 55e160d Compare August 29, 2024 18:21
@knelli2 knelli2 added this to the Eccentricity Control milestone Sep 7, 2024
@knelli2 knelli2 added ci/cd Continuous integration & deployment cli/pybindings Command line interface & Python bindings labels Sep 30, 2024
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.

Currently only HPC has a sufficient version of sxs. Ocean and mbot will need to be updated

Comment on lines +28 to +30
pn = PostNewtonian.BBH(
np.array(
[1.0 / (1.0 + q), q / (1.0 + q), *chiA, *chiB, 1, 0, 0, 0, 1, 0]
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a note what these magic 1s and 0s are. I believe they are the following, but the docs/code of the julia implementation don't match so I'm unsure...

1 = v (velocity???)
0, 0, 0, 1 = rotor (quaternion??)
0 = phi

Comment on lines +32 to +33
)
pn.state[12] = PostNewtonian.separation_inverse(r, pn)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why replace? Please add some docs

Comment on lines +12 to +14
# Disable this test if using jemalloc as a shared library, because Julia
# doesn't like the 'LD_PRELOAD' trick to load jemalloc for Pybindings.
if (NOT "${JEMALLOC_LIB_TYPE}" STREQUAL SHARED)
Copy link
Contributor

Choose a reason for hiding this comment

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

Will the source code work in the CLI if we are using JEMALLOC?

@knelli2
Copy link
Contributor

knelli2 commented Nov 1, 2024

Also needs a rebase to fix conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/cd Continuous integration & deployment cli/pybindings Command line interface & Python bindings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants