Full API documentation
Gradus.StatusCodes
— ModuleStatusCodes.T
Status codes that represent the fate of different geodesics.
OutOfDomain
: left the integration chart by travelling to effective infinity (seechart_for_metric
).WithinInnerBoundary
: left the integration chart by falling into the inner horizoninner_radius
.IntersectedWithGeometry
: geodesics intersected withAbstractAccretionGeometry
and terminated there. Note
that this status code only applies to optically thick geometry (see optical_property
for more).
NoStatus
: the default status code, which is used to imply no calculation has yet been performed.
Gradus.tracegeodesics
— Functiontracegeodesics(
m::AbstractMetric,
x, v, [disc], λ_domain;
kwargs...
)
tracegeodesics(
m::AbstractMetric,
x, p::AbstractImagePlane, [disc], λ_domain;
kwargs...
)
tracegeodesics(
m::AbstractMetric,
model::AbstractCoronaModel, [disc], λ_domain;
kwargs...
)
Trace a geodesic in the spacetime given by m
with initial four-position x
and four-velocity v
.
- If both
x
andv
are arrays ofSVector
, then many geodesics are traced in parallel. - If
x
is anSVector
and the third argument is of typeAbstractImagePlane
, then every geodesic
of the image plane is traced in parallel.
- If
x
is an SVector andv
is a function, thentrajectories
must be specified as akwarg
, and tracing is performed
in parallel.
The functional form for the velocity must map an index to a velocity
function velocity_function(i)
return SVector(...)
end
The possible keyword arguments are
chart = chart_for_metric(m),
callback = nothing,
solver = Tsit5(),
ensemble = EnsembleThreads(),
trajectories = nothing,
abstol = 1e-9,
reltol = 1e-9,
solver_opts...,
with solver_opts
being forwarded to the SciML solve
function.
Gradus.inverse_metric_components
— Functioninverse_metric_components(g_comp)
Calculates $g^{tt}$, $g^{rr}$, $g^{\theta\theta}$, $g^{\phi\phi}$, $g^{t\phi}$ of a static, axis-symmetric metric from $g_{tt}$, $g_{rr}$, $g_{\theta\theta}$, $g_{\phi\phi}$, $g_{t\phi}$ using a symbolically computed inverse matrix method.
Notes
To recreate:
using Symbolics
@variables g[1:5] # non zero metric components
metric = [
g[1] 0 0 g[5]
0 g[2] 0 0
0 0 g[3] 0
g[5] 0 0 g[4]
]
inv(metric)
Gradus.metric_jacobian
— Functionmetric_jacobian(m::AbstractStaticAxisSymmetric{T}, rθ)
Calculate the value and Jacobian elements of the metric with respect to $r$ and $\theta$.
Limitations:
- currenly pre-supposes static, axis-symmetric metric.
Notes
Function body is equivalent to
f = x -> metric_components(m, x)
J = ForwardDiff.vector_mode_jacobian(f, rθ)
f(rθ), J
but non-allocating.
Gradus.intersects_geometry
— Functionintersects_geometry(m::AbstractAccretionGeometry{T}, line_element)
Utility function. Returns a boolean dependent on whether line_element
intersects with the geometry (true
) or not (false
). Uses in_nearby_region
to optimze and calls has_intersect
to determine intersection.
Missing docstring for Gradus.build_collision_callback
. Check Documenter's build log for details.
Gradus.jsf_algorithm
— Functionjsf_algorithm(V₁::T, V₂::T, V₃::T, Q₁::V, Q₂::V; ϵ = 1e-8)
Implemented from Jiménez, Segura, Feito. Computation Geometry 43 (2010) 474-492.
See this blog post for a discussion.