-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: bumblebee metric in slow rotation regime * chore: bump version * style: formatting * test: bumblebee metric * fix: reach under the hood for missing function * fix: remove show
- Loading branch information
Showing
6 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "Gradus" | ||
uuid = "c5b7b928-ea15-451c-ad6f-a331a0f3e4b7" | ||
authors = ["fjebaker <[email protected]>"] | ||
version = "0.2.10" | ||
version = "0.2.11" | ||
|
||
[deps] | ||
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
module __BumblebeeAD | ||
using ..StaticArrays | ||
using ..MuladdMacro | ||
|
||
@muladd @fastmath begin | ||
Δ(r, M, l) = (r^2 - (2M * r)) / (l + 1) | ||
|
||
function metric_components(M, a, l, rθ) | ||
(r, θ) = rθ | ||
sinθ2 = sin(θ)^2 | ||
Δ₀ = Δ(r, M, l) | ||
|
||
tt = -(1 - (2M / r)) | ||
rr = r^2 / Δ₀ | ||
θθ = r^2 | ||
ϕϕ = r^2 * sinθ2 | ||
|
||
tϕ = -2M * a * sinθ2 / r | ||
@SVector [tt, rr, θθ, ϕϕ, tϕ] | ||
end | ||
end | ||
|
||
end # module | ||
|
||
struct BumblebeeMetric{T} <: AbstractAutoDiffStaticAxisSymmetricParams{T} | ||
"Black hole mass." | ||
M::T | ||
"Black hole spin." | ||
a::T | ||
"LSB parameter." | ||
l::T | ||
function BumblebeeMetric(M::T, a, l) where {T} | ||
if l <= -1.0 | ||
error("l must be >-1") | ||
end | ||
if abs(a) > 0.3 | ||
error( | ||
"This metric is for the slow rotation approximation only, and requires |a| < 0.3.", | ||
) | ||
end | ||
new{T}(T(M), T(a), T(l)) | ||
end | ||
end | ||
BumblebeeMetric(; M = 1.0, a = 0.0, l = 0.0) = BumblebeeMetric(M, a, l) | ||
|
||
# implementation | ||
metric_components(m::BumblebeeMetric{T}, rθ) where {T} = | ||
__BumblebeeAD.metric_components(m.M, m.a, m.l, rθ) | ||
inner_radius(m::BumblebeeMetric{T}) where {T} = m.M + √(m.M^2 - m.a^2) | ||
|
||
|
||
export BumblebeeMetric |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters