Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ FMMLIB2D = "1a804d9e-d798-534b-a6a9-4525c36f0718"
Gmsh = "705231aa-382f-11e9-3f0c-b7cb4346fdeb"
HMatrices = "8646bddf-ab1c-4fa7-9c51-ba187d647618"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
Meshes = "eacbb407-ea5a-433e-ab97-5258b1ca43fa"
QPGreen = "8ff76263-3d2e-4b9c-88ff-2ca8b003e2a7"

[extensions]
Expand All @@ -38,7 +37,7 @@ IntiFMM3DExt = "FMM3D"
IntiFMMLIB2DExt = "FMMLIB2D"
IntiGmshExt = "Gmsh"
IntiHMatricesExt = "HMatrices"
IntiMakieExt = ["Meshes", "Makie"]
IntiMakieExt = "Makie"
IntiQPGreenExt = "QPGreen"

[compat]
Expand All @@ -54,8 +53,7 @@ HAdaptiveIntegration = "1"
HMatrices = "0.2"
LinearAlgebra = "1"
LinearMaps = "3"
Makie = "0.21 - 0.24"
Meshes = "0.42 - 0.55"
Makie = "0.24"
NearestNeighbors = "0.4"
OrderedCollections = "1"
Pkg = "1"
Expand Down
1 change: 0 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
LinearMaps = "7a12625a-238d-50fd-b39a-03d52299707e"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
Meshes = "eacbb407-ea5a-433e-ab97-5258b1ca43fa"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Pluto = "c3e4b0f8-55cb-11ea-2926-15256bba5781"
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
Expand Down
4 changes: 1 addition & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ using Runic
# packages needed for extensions
using Gmsh
using HMatrices
using Meshes
using GLMakie
using FMM2D
using FMM3D
Expand Down Expand Up @@ -92,7 +91,6 @@ function generate_md(input; output = replace(input, r"\.jl$" => ".md"))
end

links = InterLinks(
"Meshes" => "https://juliageometry.github.io/MeshesDocs/dev/objects.inv",
"HMatrices" => "https://integralequations.github.io/HMatrices.jl/stable/objects.inv",
)

Expand All @@ -106,7 +104,7 @@ modules = [Inti]
for extension in
[:IntiGmshExt, :IntiHMatricesExt, :IntiMakieExt, :IntiFMM2DExt, :IntiFMM3DExt]
ext = Base.get_extension(Inti, extension)
isnothing(ext) && "error loading $ext"
isnothing(ext) && error("error loading $extension")
push!(modules, ext)
end

Expand Down
5 changes: 2 additions & 3 deletions docs/src/examples/crack_elasticity.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,10 @@ equation: factoring out the asymptotic (non-smooth) behavior of the solution usi
function.

Finally, we can visualize the displacement field on the mesh by interpolating the computed
values on the quadrature points to the mesh nodes. We use `Meshes` to visualize the
values on the quadrature points to the mesh nodes. We use `plot` to visualize the
solution:

```@example crack_elasticity
using Meshes
φ3w_nodes = Inti.quadrature_to_node_vals(Q, getindex.(φw, 3))
msh_nodes = Inti.nodes(Q.mesh)
w_nodes = [weight(x) for x in msh_nodes]
Expand All @@ -256,7 +255,7 @@ colorrange = extrema(φ3_nodes)
fig = Figure(; size = (800, 600))
ax = Axis3(fig[1, 1])
n = length(Q.mesh.nodes)
viz!(Q.mesh; color = φ3_nodes, interpolate = false, showsegments=true)
plot!(Q.mesh; color = φ3_nodes, interpolate = false, strokewidth=1)
cb = Colorbar(fig[1, 2]; label = "φ₃", colorrange)
fig
```
12 changes: 5 additions & 7 deletions docs/src/examples/heat_equation.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,14 @@ Let's visualize the mesh to confirm our domain setup. The red outline shows the
which consists of both the outer boundary and the boundaries of the interior holes:

```@example heat_equation
using Meshes
using GLMakie
fig = viz(
fig = plot(
Ω_msh;
segmentsize = 1,
showsegments = true,
strokewidth = 1,
axis = (aspect = DataAspect(),),
figure = (; size = (500, 400)),
)
viz!(Γ_msh; color = :red, segmentsize = 4)
plot!(Γ_msh; color = :red, linewidth = 4)
fig # hide
```

Expand Down Expand Up @@ -399,8 +397,8 @@ record(fig, joinpath(@__DIR__,"heat.gif")) do io

# Setup visualization for current frame
ax.title = "Temperature at t = $(round(t, digits = 2))"
viz!(Ω_quad.mesh; showsegments = true, color = u_nodes, colorrange)
viz!(Γ_msh; color = :black, segmentsize = 4)
plot!(Ω_quad.mesh; strokewidth = 1, color = u_nodes, colorrange)
plot!(Γ_msh; color = :black, linewidth = 4)
Colorbar(fig[1, 2]; colorrange = colorrange, label = "Temperature")

# Record current frame
Expand Down
13 changes: 6 additions & 7 deletions docs/src/examples/helmholtz_scattering.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ docsdir = joinpath(@__DIR__, "../..") #src
Pkg.activate(docsdir) #src

#nb ## Environment setup
#nb const DEPENDENCIES = ["GLMakie", "Gmsh", "HMatrices", "IterativeSolvers","LinearAlgebra", "LinearMaps", "SpecialFunctions", "GSL", "Meshes"];
#nb const DEPENDENCIES = ["GLMakie", "Gmsh", "HMatrices", "IterativeSolvers","LinearAlgebra", "LinearMaps", "SpecialFunctions", "GSL"];
#nb ## __NOTEBOOK_SETUP__

# # [Helmholtz scattering](@id helmholtz_scattering)
Expand Down Expand Up @@ -104,7 +104,6 @@ using Inti
using LinearAlgebra
using StaticArrays
using Gmsh
using Meshes
using GLMakie
using SpecialFunctions
using GSL
Expand Down Expand Up @@ -314,7 +313,7 @@ fig, ax, hm = heatmap(
interpolate = true,
axis = (aspect = DataAspect(), xgridvisible = false, ygridvisible = false),
)
viz!(Γ_msh; color = :white, segmentsize = 5)
plot!(Γ_msh; color = :white, linewidth = 5)
Colorbar(fig[1, 2], hm)
fig

Expand Down Expand Up @@ -361,7 +360,7 @@ fig, ax, hm = heatmap(
interpolate = true,
axis = (aspect = DataAspect(), xgridvisible = false, ygridvisible = false),
)
viz!(Γ_msh; color = :black, segmentsize = 4)
plot!(Γ_msh; color = :black, linewidth = 4)
Colorbar(fig[1, 2], hm)
fig

Expand Down Expand Up @@ -563,14 +562,14 @@ us_eval_msh = D * σ - im * k * S * σ
u_eval_msh = ui_eval_msh + us_eval_msh
nothing #hide

# Finalize, we use [`Meshes.viz`](@extref) to visualize the scattered field:
# Finalize, we use `plot` to visualize the scattered field:

nv = length(Inti.nodes(Γ_msh))
colorrange = extrema(real(u_eval_msh))
colormap = :inferno
fig = Figure(; size = (800, 500))
ax = Axis3(fig[1, 1]; aspect = :data)
viz!(Γ_msh; colorrange, colormap, color = zeros(nv), interpolate = true)
viz!(Σ_msh; colorrange, colormap, color = real(u_eval_msh))
plot!(Γ_msh; colorrange, colormap, color = zeros(nv), interpolate = true)
plot!(Σ_msh; colorrange, colormap, color = real(u_eval_msh))
cb = Colorbar(fig[1, 2]; label = "real(u)", colormap, colorrange)
fig # hide
3 changes: 1 addition & 2 deletions docs/src/examples/pep.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ multipole method to compute the action of the operator on the eigenfunction.
The visualization will be done on a 3D volume slices using `Makie`.

```@example NPEP
using Meshes # to visualize the mesh using `viz!`
vₙ = vᵢ[8]
pts_per_dim = 100
xx = yy = zz = range(-2,2,pts_per_dim)
Expand All @@ -449,7 +448,7 @@ plt = volumeslices!(ax, xx, yy, zz, reshape(uₙ,pts_per_dim,pts_per_dim,pts_per
plt[:update_yz][](pts_per_dim ÷ 2)
plt[:update_xz][](pts_per_dim ÷ 2)
plt[:update_xy][](length(zz) ÷ 2)
viz!(Inti.mesh(Q); showsegments = true, color = :lightgray, alpha = 0.5)
plot!(Inti.mesh(Q); strokewidth = 1, color = :lightgray, alpha = 0.5)
current_figure() # hide
```

Expand Down
8 changes: 4 additions & 4 deletions docs/src/examples/poisson.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Pkg.activate(docsdir) #src
tinit = time() # hide

#nb ## Environment setup
#nb const DEPENDENCIES = ["CairoMakie", "Gmsh", "HMatrices", "IterativeSolvers","LinearAlgebra", "LinearMaps", "SpecialFunctions", "GSL", "FMM3D", "FMM2D", "Meshes"];
#nb const DEPENDENCIES = ["CairoMakie", "Gmsh", "HMatrices", "IterativeSolvers","LinearAlgebra", "LinearMaps", "SpecialFunctions", "GSL", "FMM3D", "FMM2D"];
#nb ## __NOTEBOOK_SETUP__

# # [Poisson solver](@id poisson)
Expand Down Expand Up @@ -180,15 +180,15 @@ er = abs.(uₕ_quad - uₑ_quad)
er_nodes = Inti.quadrature_to_node_vals(Ωₕ_quad, er)
uₕ_nodes = Inti.quadrature_to_node_vals(Ωₕ_quad, uₕ_quad)

using GLMakie, Meshes
using GLMakie
fig = Figure(; size = (1200, 400))
ax1 = Axis(fig[1, 1]; aspect = DataAspect(), title = "solution")
colorrange = extrema(uₕ_nodes)
viz!(Ωₕ; showsegments = true, color = uₕ_nodes, colorrange)
plot!(Ωₕ; strokewidth = 1, color = uₕ_nodes, colorrange)
Colorbar(fig[1, 2]; colorrange = colorrange)
ax2 = Axis(fig[1, 3]; aspect = DataAspect(), title = "error")
colorrange = extrema(er_nodes)
viz!(Ωₕ; showsegments = false, color = er_nodes, colorrange)
plot!(Ωₕ; color = er_nodes, colorrange)
Colorbar(fig[1, 4]; colorrange = colorrange)
fig

Expand Down
10 changes: 5 additions & 5 deletions docs/src/examples/poisson.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ nothing #hide
and visualize them:

```@example poisson
using Meshes, GLMakie
viz(Ω_msh; showsegments=true)
viz!(Γ_msh; color=:red)
using GLMakie
plot(Ω_msh; strokewidth=1)
plot!(Γ_msh; color=:red)
Makie.current_figure() #hide
```

Expand Down Expand Up @@ -262,14 +262,14 @@ er = u_nodes - map(uₑ, nodes)
colorrange = extrema(u_nodes)
fig = Figure(; size = (800, 300))
ax = Axis(fig[1, 1]; aspect = DataAspect())
viz!(Ω_msh; colorrange, color = u_nodes, interpolate = true)
plot!(Ω_msh; colorrange, color = u_nodes, interpolate = true)
cb = Colorbar(fig[1, 2]; label = "u", colorrange)
# plot error
log_er = log10.(abs.(er))
colorrange = extrema(log_er)
colormap = :inferno
ax = Axis(fig[1, 3]; aspect = DataAspect())
viz!(Ω_msh; colorrange, colormap, color = log_er, interpolate = true)
plot!(Ω_msh; colorrange, colormap, color = log_er, interpolate = true)
cb = Colorbar(fig[1, 4]; label = "log₁₀|u - uₑ|", colormap, colorrange)
fig # hide
```
3 changes: 1 addition & 2 deletions docs/src/examples/stokes_drag.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ will simply sample points on a grid in the `xz` plane, and plot the velocity vec
points:

```@example stokes_drag
using Meshes
using GLMakie
L = 5
targets = [SVector(x, 0, z) for x in -L:meshsize:L, z in -L:meshsize:L] |> vec
Expand All @@ -213,7 +212,7 @@ directions = u.(targets)
strength = norm.(directions)
fig = Figure(size = (1000, 800))
ax = Axis3(fig[1, 1]; title = "Velocity field", aspect = :data, limits = ([-L, L], [-R, R], [-L, L]))
viz!(msh[Γ], showsegments=true)
plot!(msh[Γ], strokewidth=1)
arrows!(ax, Point3.(targets), Point3.(directions), arrowsize = 0.15, lengthscale = 0.4, arrowcolor = strength, linecolor = strength)
current_figure()
fig
Expand Down
6 changes: 3 additions & 3 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,18 +163,18 @@ println("Approx. value at $pt: ", uₕ(pt))
If we care about the solution on the entire domain, we can visualize it using:

```@example lap2d
using Meshes, GLMakie # trigger the loading of some Inti extensions
using GLMakie # triggers the loading of the Makie extension
xx = yy = range(-2, 2, length = 100)
fig = Figure(; size = (600,300))
inside = x -> Inti.isinside(x, Q)
opts = (xlabel = "x", ylabel = "y", aspect = DataAspect())
ax1 = Axis(fig[1, 1]; title = "Exact solution", opts...)
h1 = heatmap!(ax1, xx,yy,(x, y) -> inside((x,y)) ? uₑ((x,y)) : NaN)
viz!(msh; segmentsize = 3)
plot!(msh; linewidth = 3)
cb = Colorbar(fig[1, 3], h1, size = 20, height = 200)
ax2 = Axis(fig[1, 2]; title = "Approx. solution", opts...)
h2 = heatmap!(ax2, xx,yy, (x, y) -> inside((x,y)) ? uₕ((x,y)) : NaN, colorrange = cb.limits[])
viz!(msh; segmentsize = 3)
plot!(msh; linewidth = 3)
fig # hide
```

Expand Down
13 changes: 6 additions & 7 deletions docs/src/pluto-examples/helmholtz_scattering.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.20.17
# v1.0.1

using Markdown
using InteractiveUtils
Expand All @@ -17,7 +17,6 @@ begin
using LinearAlgebra
using StaticArrays
using Gmsh
using Meshes
using GLMakie
using SpecialFunctions
using GSL
Expand Down Expand Up @@ -370,7 +369,7 @@ begin
interpolate = true,
axis = (aspect = DataAspect(), xgridvisible = false, ygridvisible = false),
)
viz!(Γ_msh; color = :white, segmentsize = 5)
plot!(Γ_msh; color = :white, linewidth = 5)
Colorbar(fig[1, 2], hm)
fig
end
Expand Down Expand Up @@ -422,7 +421,7 @@ let
interpolate = true,
axis = (aspect = DataAspect(), xgridvisible = false, ygridvisible = false),
)
viz!(Γ_msh; color = :black, segmentsize = 4)
plot!(Γ_msh; color = :black, linewidth = 4)
Colorbar(fig[1, 2], hm)
fig
end
Expand Down Expand Up @@ -687,7 +686,7 @@ end

# ╔═╡ 0cec09b1-8806-4aee-970d-cc0b1e4b841c
md"""
Finalize, we use [`Meshes.viz`](@extref) to visualize the scattered field:
Finalize, we use `plot` to visualize the scattered field:
"""

# ╔═╡ dab9a19c-977e-4ab1-a3d9-f9970af69642
Expand All @@ -697,8 +696,8 @@ begin
colormap = :inferno
fig_3d = Figure(; size = (800, 500))
ax_3d = Axis3(fig_3d[1, 1]; aspect = :data)
viz!(Γ_msh_3d; colorrange, colormap, color = zeros(nv), interpolate = true)
viz!(Σ_msh; colorrange, colormap, color = real(u_eval_msh))
plot!(Γ_msh_3d; colorrange, colormap, color = zeros(nv), interpolate = true)
plot!(Σ_msh; colorrange, colormap, color = real(u_eval_msh))
cb = Colorbar(fig_3d[1, 2]; label = "real(u)", colormap, colorrange)
fig_3d #hide
end
Expand Down
12 changes: 6 additions & 6 deletions docs/src/pluto-examples/poisson.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.20.17
# v1.0.1

using Markdown
using InteractiveUtils
Expand Down Expand Up @@ -124,9 +124,9 @@ end

# ╔═╡ 2c4bace3-ef35-4500-829f-2f5ae6725249
begin
using Meshes, GLMakie
viz(Ω_msh; showsegments = true)
viz!(Γ_msh; color = :red)
using GLMakie
plot(Ω_msh; strokewidth = 1)
plot!(Γ_msh; color = :red)
Makie.current_figure() #hide
end

Expand Down Expand Up @@ -333,14 +333,14 @@ begin
colorrange = extrema(u_nodes)
fig = Figure(; size = (800, 300))
ax = Axis(fig[1, 1]; aspect = DataAspect())
viz!(Ω_msh; colorrange, color = u_nodes, interpolate = true)
plot!(Ω_msh; colorrange, color = u_nodes, interpolate = true)
cb = Colorbar(fig[1, 2]; label = "u", colorrange)
# plot error
log_er = log10.(abs.(er))
colorrange = extrema(log_er)
colormap = :inferno
ax = Axis(fig[1, 3]; aspect = DataAspect())
viz!(Ω_msh; colorrange, colormap, color = log_er, interpolate = true)
plot!(Ω_msh; colorrange, colormap, color = log_er, interpolate = true)
cb = Colorbar(fig[1, 4]; label = "log₁₀|u - uₑ|", colormap, colorrange)
fig #hide
end
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pluto-examples/toy_example.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.20.17
# v1.0.1

using Markdown
using InteractiveUtils
Expand Down
Loading
Loading