Full API documentation

Gradus.StatusCodesModule
StatusCodes.T

Status codes that represent the fate of different geodesics.

  • OutOfDomain: left the integration chart by travelling to effective infinity (see chart_for_metric).
  • WithinInnerBoundary: left the integration chart by falling into the inner horizon inner_radius.
  • IntersectedWithGeometry: geodesics intersected with AbstractAccretionGeometry 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.
source
Gradus.tracegeodesicsFunction
tracegeodesics(
    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 and v are arrays of SVector, then many geodesics are traced in parallel.
  • If x is an SVector and the third argument is of type AbstractImagePlane, then every geodesic

of the image plane is traced in parallel.

  • If x is an SVector and v is a function, then trajectories must be specified as a kwarg, 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.

source
Gradus.inverse_metric_componentsFunction
inverse_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)
source
Gradus.metric_jacobianFunction
metric_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.

source
Gradus.intersects_geometryFunction
intersects_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.

source
Missing docstring.

Missing docstring for Gradus.build_collision_callback. Check Documenter's build log for details.

Gradus.jsf_algorithmFunction
jsf_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.

source