LCOV - code coverage report
Current view: top level - src - flows.jl (source / functions) Hit Total Coverage
Test: on branch nothing Lines: 18 18 100.0 %
Date: 2025-02-26 15:13:49 Functions: 0 0 -

          Line data    Source code
       1     3547746 : function doublegyre(t::T, u, p) where {T<:Real}
       2     3547757 :     ((0 <= u[1] <= 2) && (0 <= u[2] <= 1)) || return OutOfDomain
       3             : 
       4     3547735 :     A, ω, ϵ = T.(p)
       5             : 
       6     3547735 :     sinωt = sin(ω * t)
       7             : 
       8     3547735 :     at = ϵ * sinωt
       9     3547735 :     bt = 1 - 2ϵ * sinωt
      10             : 
      11     3547735 :     x, y = u
      12             : 
      13     3547735 :     fxt = at * x^2 + bt * x
      14             : 
      15     3547735 :     sf, cf = sincospi(fxt)
      16     3547735 :     sy, cy = sincospi(y)
      17     3547735 :     dx = -π * A * sf * cy
      18     3547735 :     dy = +π * A * cf * sy * (2x * at + bt)
      19             : 
      20     3547735 :     SVector{2, T}(dx, dy)
      21             : end
      22             : 
      23     3547746 : doublegyre(t, y) = doublegyre(t, y, (0.1, 2π/10, 0.25))
      24             : 
      25             : """
      26             :     dy = doublegyre(t, y[, (A, ω, ϵ) = (0.1, 2π/10, 0.25)])
      27             : 
      28             : The time-dependent *double gyre* data from
      29             : [Shadden](https://shaddenlab.berkeley.edu/uploads/LCS-tutorial/examples.html) in the
      30             : **domain** `[0, 2] × [0, 1]`.
      31             : """ doublegyre
      32             : 
      33     1266144 : function abcflow(t::T, y, p) where {T<:Real}
      34     1266144 :     A, B, C = T.(p)
      35             : 
      36     1266144 :     SVector(A * sin(y[3]) + C * cos(y[2]),
      37             :             B * sin(y[1]) + A * cos(y[3]),
      38             :             C * sin(y[2]) + B * cos(y[1]))
      39             : end
      40             : 
      41             : const ABC_PARAM = (sqrt(3), sqrt(2), 1)
      42             : 
      43     1266144 : abcflow(t::T, y) where {T<:Real} = abcflow(t, y, ABC_PARAM)
      44             : 
      45             : """
      46             :     dy = abcflow(t, y[, (A, B, C) = (√3, √2, 1)])
      47             : 
      48             : [Arnoldi-Beltrami-Childress flow](https://en.wikipedia.org/wiki/Arnold%E2%80%93Beltrami%E2%80%93Childress_flow)
      49             : in the **domain** `[0, 2π]^3`.
      50             : """ abcflow
      51             : 
      52             : # TODO: flow [spiral] (intersect w/ domain boundary)

Generated by: LCOV version 1.16