API Reference

IMASutils

IMASutils.contour_cacheFunction
contour_cache(values::Matrix{T}; aggression_level::Int = 2) where {T<:Real}

For a given matrix values, create cache for xcontour and ycontour aggression_level determines how large to make the cache:

  1. assume contour no bigger than an inscribed ellipse

  2. assume contour no bigger than the other boundary

  3. assume contour could go through every single cell once

source
IMASutils.contour_from_midplaneFunction
contour_from_midplane(values::Matrix{T},
                      x_coords::AbstractVector{T},
                      y_coords::AbstractVector{T},
                      level::T, xaxis::T, yaxis::T, vaxis::T) where {T<:Real}

Find a contour of (xcoords, ycoords, values) at value=level that crosses y=yaxis at the smallest x > xaxis

This will correspond to a closed surface around the axis if it exists, otherwise it will give upto one of possibly multiple open surfaces

Returns vectors for xcontour and ycontour

source
IMASutils.contour_from_midplane!Function
contour_from_midplane!(x_cache::Vector{T}, y_cache::Vector{T},
                      values::Matrix{T},
                      x_coords::AbstractVector{T},
                      y_coords::AbstractVector{T},
                      level::T, xaxis::T, yaxis::T, vaxis::T) where {T<:Real}

Find a contour of (xcoords, ycoords, values) at value=level that crosses y=yaxis at the smallest x > xaxis

This will correspond to a closed surface around the axis if it exists, otherwise it will give upto one of possibly multiple open surfaces

The contour is computed in-place using xcache and ycache, and returned as views of those caches to avoid allocations

source
IMASutils.cumtrapzFunction
cumtrapz(x::AbstractVector{S}, y::AbstractVector{T}) where {S<:Real, T<:Real}

Computes the cumulative integral of the values in y with respect to x using the trapezoidal rule.

source
cumtrapz(x::AbstractVector{S}, f::T) where {S<:Real, T<:Function}

Computes the cumulative integral of f(k::Int, xx::S) for xx = x[k] with respect to x using the trapezoidal rule.

source
IMASutils.mirror_boundFunction
mirror_bound(x::T, l::T, u::T) where {T<:Real}

Return tuple with value of x bounded between l and u The bounding is done by mirroring the value at the bound limits.

source
IMASutils.trapzFunction
trapz(x::AbstractVector{S}, y::AbstractVector{T}) where {S<:Real, T<:Real}

Numerically integrates the values in y with respect to x using the trapezoidal rule.

source
trapz(x::AbstractVector{S}, f::T) where {S<:Real, T<:Function}

Numerically integrates f(k::Int, xx::S) for xx = x[k] with respect to x using the trapezoidal rule.

source