diff --git a/Project.toml b/Project.toml index 1f990504..2c36732a 100644 --- a/Project.toml +++ b/Project.toml @@ -20,7 +20,7 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [compat] -CUDA = "1, 2.4.2, 3.0.0 - 3.6.4, 3.7.1, 4, 5" +CUDA = "1, 2.4.2, 3.0.0 - 3.6.4, 3.7.1, 4, 5.4" DocStringExtensions = "0.8, 0.9" FFTW = "1" Interpolations = "0.12, 0.13, 0.14, 0.15" diff --git a/docs/make.jl b/docs/make.jl index 15a30164..74738297 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -10,7 +10,7 @@ using ##### bib_filepath = joinpath(@__DIR__, "src/references.bib") -bib = CitationBibliography(bib_filepath) +bib = CitationBibliography(bib_filepath, style=:authoryear) const EXAMPLES_DIR = joinpath(@__DIR__, "..", "examples") const OUTPUT_DIR = joinpath(@__DIR__, "src/literated") diff --git a/docs/src/aliasing.md b/docs/src/aliasing.md index d245037c..b5965dc9 100644 --- a/docs/src/aliasing.md +++ b/docs/src/aliasing.md @@ -46,9 +46,9 @@ lines!(ax, range(-Lx/2, Lx/2, length=200), f2; color = (:salmon, 0.3), label = "cos(6x)") scatter!(ax, x, f1.(x); - markersize = 12, color = (:steelblue, 0.9), label = "cos(4x)") + markersize = 24, marker = :star5, color = (:steelblue, 0.9), label = "cos(4x)") scatter!(ax, x, f2.(x); - markersize = 24, marker = :star5, color = (:salmon, 0.9), label = "cos(6x)") + markersize = 12, color = (:salmon, 0.9), label = "cos(6x)") axislegend(merge = true) @@ -82,15 +82,21 @@ harmonics with wavenumbers beyond those that our grid is able to resolve and, th aliasing errors. The above-mentioned 1/2-rule for dealiasing for quadratic nonlinearities is, however, not the -most efficient. [Orszag-1971](@cite) pointed out that for quadratic nonlirearities, simply only +most efficient. [Orszag-1971](@citet) pointed out that for quadratic nonlirearities, simply only discarding the highest-1/3 of wavenumber components is enough to save us from aliasing errors. To be fair, with Orszag's so-called 2/3-rule for dealiasing, still some aliasing errors occur, but those errors only occur to the higher-1/3 wavenumber components that will be zero-ed out at the next time step, when we next dealias our solution anyway. When constructing a `grid` we can specify the `aliased_fraction` parameter. By default, this is -set to ``1/3``, appropriate for quadratic nonlinearities. Then `dealias!(fh, grid)` will zero-out -the highest-`aliased_fraction` wavenumber components of `fh`. +set to ``1/3``, appropriate for quadratic nonlinearities. + +```@example 1 +grid = OneDGrid(; nx, Lx) +``` + +Then we can use `dealias!(fh, grid)` to zero-out the highest-`aliased_fraction` wavenumber +components of `fh`. ```@docs FourierFlows.dealias! diff --git a/docs/src/timestepping.md b/docs/src/timestepping.md index 8569cf93..6d8561d3 100644 --- a/docs/src/timestepping.md +++ b/docs/src/timestepping.md @@ -5,7 +5,7 @@ FourierFlows.jl includes several time-stepping algorithms. Most of the time-stepping algorithms are fully explicit schemes: [`ForwardEulerTimeStepper`](@ref), [`AB3TimeStepper`](@ref), [`RK4TimeStepper`](@ref), and [`LSRK54TimeStepper`](@ref). Also we have implemented an [`ETDRK4TimeStepper`](@ref) scheme with the improvements described -by [Kassam-Trefethen-2005](@cite). +by [Kassam-Trefethen-2005](@citet). The [`Problem`](@ref FourierFlows.Problem) constructor expects the chosen time stepper as as string that includes the corresponding name of the time stepper _without_ the ending `TimeStepper`. @@ -41,9 +41,9 @@ close to machine precision. That is: \alpha = \frac{- \log\delta}{(k_{\textrm{max}} - k_{\textrm{cutoff}})^p} \ . ``` -The above-mentioned filter form originates from the book by [Canuto-etal-1987](@cite). -In geophysical turbulence applications it was used by [LaCasce-1996](@cite) and later -by [Arbic-Flierl-2004](@cite). +The above-mentioned filter form originates from the book by [Canuto-etal-1987](@citet). +In geophysical turbulence applications it was used by [LaCasce-1996](@citet) and later +by [Arbic-Flierl-2004](@citet). !!! warning "Not too steep, not too shallow" Care should be taken if one decides to fiddle with the filter parameters. Changing @@ -70,7 +70,7 @@ using FourierFlows: makefilter K = 0:0.001:1 # non-dimensional wavenumber k * dx / π fig = Figure() -ax = Axis(fig[1, 1], xlabel = "|𝐤| dx / π", ylabel = "filter", aspect=2.5, xticks=0:0.2:1) +ax = Axis(fig[1, 1], xlabel = "|𝐤| dx / π", ylabel = "filter", xticks=0:0.2:1) vlines!(ax, 2/3, color = (:gray, 0.4), linewidth = 6, label = "cutoff wavenumber |𝐤| dx / π = 2/3 (default)") @@ -78,7 +78,7 @@ lines!(ax, K, makefilter(K), linewidth = 4, label = "order 4 (default)") lines!(ax, K, makefilter(K, order = 1), linestyle = :dash, label = "order 1") lines!(ax, K, makefilter(K, order = 10), linestyle = :dot, label = "order 10") -axislegend(position = :lb) +fig[0, 1] = Legend(fig, ax) current_figure() # hide ``` diff --git a/src/timesteppers.jl b/src/timesteppers.jl index 9ae03e3f..baafd4ca 100644 --- a/src/timesteppers.jl +++ b/src/timesteppers.jl @@ -306,7 +306,7 @@ uⁿ⁺¹ = uⁿ ``` where `Aᵢ`, `Bᵢ`, and `Cᵢ` are the ``A``, ``B``, and ``C`` coefficients from -the LSRK table at the ``i``-th stage. For details, refer to [Carpenter-Kennedy-1994](@cite). +the LSRK table at the ``i``-th stage. For details, refer to [Carpenter-Kennedy-1994](@citet). !!! info "Usage" The `LSRK54TimeStepper` is *slower* than the [`RK4TimeStepper`](@ref) but @@ -429,7 +429,7 @@ That is, uⁿ⁺¹ = exp(L * dt) * uⁿ + RK4(N(uⁿ)) ``` -For more info refer to [Kassam-Trefethen-2005](@cite). +For more info refer to [Kassam-Trefethen-2005](@citet). """ struct ETDRK4TimeStepper{T,TL} <: AbstractTimeStepper{T} # ETDRK4 coefficents @@ -684,7 +684,7 @@ Calculate the coefficients associated with the (diagonal) linear coefficient `L` for an ETDRK4 timestepper with timestep `dt`. The calculation is done by integrating over a unit circle in the complex space. -For more info refer to [Kassam-Trefethen-2005](@cite). +For more info refer to [Kassam-Trefethen-2005](@citet). """ function getetdcoeffs(dt, L; ncirc=32, rcirc=1) shape = Tuple(cat(ncirc, ones(Int, ndims(L)), dims=1))