Skip to content

Compactify the Scalar SF - #7469

Open
NamiNishimura73 wants to merge 3 commits into
sxs-collaboration:developfrom
NamiNishimura73:Scalar_SF_compactification
Open

Compactify the Scalar SF#7469
NamiNishimura73 wants to merge 3 commits into
sxs-collaboration:developfrom
NamiNishimura73:Scalar_SF_compactification

Conversation

@NamiNishimura73

@NamiNishimura73 NamiNishimura73 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Proposed changes

  • Compactify the radial domain for Circular Scalar SF
  • Inside the u-region, x coordinate is defined as $\sigma = 2 r_u - \frac{r_u^2}{r}$.
  • Details are in CircularOrbit.hpp

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.
  • If a coding agent was used, have a co-author trailer of the form
    "Co-Authored-By: " as the last line of the
    commit, e.g. "Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com",
    "Co-Authored-by: Codex noreply@openai.com", or
    "Co-Authored-By: GitHub Copilot CLI noreply@microsoft.com".

Further comments

// 2 r_u - r_u^2/r to compactify the wavezone.
// Elliptic PDEs will be re-written as a function of
// inv_r (1/r) instead of r.
inv_r = (2.0 * r_u - r) / (r_u * r_u);

@NamiNishimura73 NamiNishimura73 Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This equation was derived as $\sigma = 2 r_u - \frac{r_u^2}{r}$, $\rightarrow$ $\frac{1}{r}=\frac{2r_{u}-\sigma}{r^{2}_{u}}$.
x-coordinate r in $u$-region represents $\sigma$ (this $\sigma$ is only used in this line, so I did not re-define. Let me know if it is too confusing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, this comment was very helpful :D Please do expand the code comment a bit to make this clearer, and/or define sigma = get<0>(x) (see also comment above).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added more detail in the explanation. Also defined sigma, directly from the x coordinate.

* advantages: first, the horizon is placed at a finite radius rather than
* $r_\star \rightarrow -\infty$; second, the flux component normal to the
* boundary vanishes at the horizon ($r=r_{\plus}$), which reduces to
* boundary vanishes at the horizon ($r=r_+$), which reduces to

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Initially I had r_{\plus}, which appears as "undefined" in the documentation, so this has been changed. (irrelevant to this PR)

Comment on lines +57 to +58
* where $\Delta\phi(r) = \frac{a}{r_+ - r_-}
* \ln(\frac{r-r_+}{r-r_-})$.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Initially I had r_{\plus}, which appears as "undefined" in the documentation, so this has been changed. (irrelevant to this PR)

* \begin{align}
* \Psi_m^P &= \frac{r}{2 \pi \sin(\theta)^{|m|}}
* e^{i m \left( \varphi - \phi\right)} \Phi_m^\mathrm{Wardell} \\
* e^{-i m \left( \varphi - \phi\right)} \Phi_m^\mathrm{Wardell} \\

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Cillian pointed out that I had typo in this equation. This has been fixed (irrelevant to this PR)

MModeNumber: *m_mode_number
HyperboloidalSlicing: True
Order: 2
Upper: None

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Outer BC was changed as we no longer need to impose anything

}
}

SPECTRE_TEST_CASE(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This test checks that, elliptic coefficient (in v or t region) modified by Jacobian returns to the elliptic coefficient in u region. Might be useful if we change elliptic coefficients in the future.
(But I am not sure if this test is necessary)

@NamiNishimura73
NamiNishimura73 marked this pull request as ready for review July 30, 2026 10:49
@NamiNishimura73

Copy link
Copy Markdown
Contributor Author

@nilsvu If you could take a look when you have time, that would be great, thanks!

@NamiNishimura73
NamiNishimura73 force-pushed the Scalar_SF_compactification branch from 24e6d91 to a2938f3 Compare August 9, 2026 03:00
@NamiNishimura73

NamiNishimura73 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

For elliptic coefficients, I re-wrote them as a function of inv_r (=1/r) in the entire region (not just u-region) to simplify the expressions. This is to avoid defining elliptic coefficients differently whether they are in u-region or else where.

// 2 r_u - r_u^2/r to compactify the wavezone.
// Elliptic PDEs will be re-written as a function of
// inv_r (1/r) instead of r.
inv_r = (2.0 * r_u - r) / (r_u * r_u);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, this comment was very helpful :D Please do expand the code comment a bit to make this clearer, and/or define sigma = get<0>(x) (see also comment above).

Comment thread src/Elliptic/Systems/SelfForce/Scalar/AnalyticData/CircularOrbit.hpp Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe this code will be wrong in the u region. Is this a problem? It's probably better not to perform BL-to-tortoise transforms where $r_{BL}$ is actually $\sigma$. Maybe define sigma, inv_r etc. here properly, rather than below.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed r_star completely, as it was never used when penetrating_horizon is true (this is why the problem was never raised, even though the definition was wrong)

get<0>(alpha) = delta / r_sq_plus_a_sq;
get<1>(alpha) = 1.0 / r_sq_plus_a_sq;
get<0>(alpha) = (delta_over_r_sq / one_plus_a_sq_inv_r_sq) * dsigma_dr;
get<1>(alpha) = (square(inv_r) / one_plus_a_sq_inv_r_sq) / dsigma_dr;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it's better to be a bit more careful here with dsigma_dr -> 0. I think it would be reasonable to have in_u_region branches that take care of cancellations (where needed), rather than force everything into the 1/r form.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes I agree. thanks for catching this issue. When outside of u-region, I kept the original expression (without 1/r reformulation) and inside u-region, division by dsigma_dr is now taken care of, by some cancellation so that we no longer have 1/0 in u-region.

Comment thread tests/InputFiles/SelfForce/ScalarCircularOrbit.yaml Outdated
@NamiNishimura73
NamiNishimura73 force-pushed the Scalar_SF_compactification branch from 78db2fa to d680ba8 Compare August 25, 2026 01:53
@@ -104,8 +104,6 @@ CircularOrbit::variables(
// NOLINTNEXTLINE
r.set_data_ref(const_cast<DataVector*>(&r_star_or_r));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This line is incorrect in the u-region where get<0>(x) is actually sigma. This means that many of the computations below are incorrect (like delta etc). I think you're careful about only using correct computations in if (in_u_region) branches, but this is still confusing and easy to introduce bugs. Can you define sigma here properly and make sure all computations below are correct, or (if this makes the code too complicated or leads to unnecessary computations) add comments to clarify exactly which quantities are computed correctly in which region?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You are right. Though they were never used in u-region, it was confusing and misleading. I re-defined r and sigma when penetrating_horizon is true, so that computations below (delta, etc) are always true.

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