Skip to content

Commit

Permalink
Update to Documenter.jl 1.0 (#68)
Browse files Browse the repository at this point in the history
* Update NS example to latest Makie

* Use Documenter 1.0
  • Loading branch information
jipolanco authored Sep 18, 2023
1 parent ab1a2ce commit c98b87b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 3 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
PencilFFTs = "4a48f351-57a6-4416-9ec4-c37015456aae"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Expand All @@ -14,4 +15,5 @@ RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

[compat]
Documenter = "0.27"
Documenter = "1"
Makie = "0.19.9"
14 changes: 9 additions & 5 deletions docs/examples/navier_stokes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@ end

let fig = Figure(resolution = (700, 600))
ax = Axis3(fig[1, 1]; aspect = :data, xlabel = "x", ylabel = "y", zlabel = "z")
vnorm = vecnorm(v⃗₀)
vnorm = parent(vecnorm(v⃗₀)) # use `parent` because Makie doesn't like custom array types...
ct = contour!(
ax, grid.x, grid.y, grid.z, vnorm;
alpha = 0.2, levels = 4,
colormap = :viridis, colorrange = (0.0, 1.0),
colormap = :viridis,
colorrange = (0.0, 1.0),
highclip = (:red, 0.2), lowclip = (:green, 0.2),
)
cb = Colorbar(fig[1, 2], ct; label = "Velocity magnitude")
fig
Expand Down Expand Up @@ -233,11 +235,12 @@ curl_fourier!(ω̂s, v̂s, grid_fourier);

let fig = Figure(resolution = (700, 600))
ax = Axis3(fig[1, 1]; aspect = :data, xlabel = "x", ylabel = "y", zlabel = "z")
ω_norm = vecnorm(ωs)
ω_norm = parent(vecnorm(ωs))
ct = contour!(
ax, grid.x, grid.y, grid.z, ω_norm;
alpha = 0.1, levels = 0.8:0.2:2.0,
colormap = :viridis, colorrange = (0.8, 2.0),
highclip = (:red, 0.2), lowclip = (:green, 0.2),
)
cb = Colorbar(fig[1, 2], ct; label = "Vorticity magnitude")
fig
Expand Down Expand Up @@ -436,7 +439,7 @@ params = (;
)

tspan = (0.0, 10.0)
prob = ODEProblem(ns_rhs!, vs_init_ode, tspan, params)
prob = ODEProblem{true}(ns_rhs!, vs_init_ode, tspan, params)
integrator = init(prob, RK4(); dt = 1e-3, save_everystep = false);

# We finally solve the problem over time and plot the vorticity associated to
Expand Down Expand Up @@ -484,12 +487,13 @@ fig = let
fig[1, 1][1, 1]; title = @lift("t = $(round($t_plot, digits = 3))"),
aspect = :data, xlabel = "x", ylabel = "y", zlabel = "z",
)
ω_mag = @lift vecnorm($ω⃗_plot)
ω_mag = @lift parent(vecnorm($ω⃗_plot))
ω_mag_norm = @lift $ω_mag ./ maximum($ω_mag)
ct = contour!(
ax, grid.x, grid.y, grid.z, ω_mag_norm;
alpha = 0.3, levels = 3,
colormap = :viridis, colorrange = (0.0, 1.0),
highclip = (:red, 0.2), lowclip = (:green, 0.2),
)
cb = Colorbar(fig[1, 1][1, 2], ct; label = "Normalised vorticity magnitude")
ax_sp = Axis(
Expand Down
8 changes: 1 addition & 7 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ examples = MPI.bcast(examples, 0, comm) :: Vector{String}
@time makedocs(
modules = [PencilFFTs],
authors = "Juan Ignacio Polanco <[email protected]> and contributors",
repo = "https://github.com/jipolanco/PencilFFTs.jl/blob/{commit}{path}#L{line}",
repo = Remotes.GitHub("jipolanco", "PencilFFTs.jl"),
sitename = "PencilFFTs.jl",
format = Documenter.HTML(
prettyurls = true, # needed for correct path to movies (Navier-Stokes example)
Expand All @@ -69,12 +69,6 @@ examples = MPI.bcast(examples, 0, comm) :: Vector{String}
"benchmarks.md",
],
doctest = true,
# linkcheck = true,
linkcheck_ignore = [
# This URL is correct, but gets incorrectly flagged by linkcheck.
"https://jipolanco.github.io/PencilArrays.jl/dev/PencilArrays/#PencilArrays.Pencils.range_local-Tuple{Union{PencilArray,%20Union{Tuple{Vararg{A,N}%20where%20N},%20AbstractArray{A,N}%20where%20N}%20where%20A%3C:PencilArray}}",
],
# checkdocs = :all,
)

if rank == 0
Expand Down

0 comments on commit c98b87b

Please sign in to comment.