Skip to content
Snippets Groups Projects
Commit 6880acd1 authored by Florian Atteneder's avatar Florian Atteneder
Browse files

gif for heateq output

parent e6a7b716
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
using GLMakie
GLMakie.activate!()
using dg1d
let
MT = GLMakie.Makie.MathTeXEngine
mt_fonts_dir = joinpath(dirname(pathof(MT)), "..", "assets", "fonts", "NewComputerModern")
theme = Theme(
fonts = ( regular = joinpath(mt_fonts_dir, "NewCM10-Regular.otf"),
bold = joinpath(mt_fonts_dir, "NewCM10-Bold.otf"),
bold_italic = joinpath(mt_fonts_dir, "NewCM10-BoldItalic.otf"),
italic = joinpath(mt_fonts_dir, "NewCM10-Italic.otf"),
),
fontsize=30
)
dir = joinpath(@__DIR__, "heateq_gaussian")
# read data
output = Output(joinpath(dir, "output1d.h5"))
variables = output.variables
varnames = [ last(split(var, ".")) for var in variables ]
nvars = length(variables)
ts = output.times
Nts = length(ts)
q(t) = read_variable(output, "q", t)
obs_y = Observable(q(0.0))
with_theme(theme) do
fig = Figure()
ax = Axis(fig[1,1], xlabel=L"x", ylabel="q")
lines!(ax, output.x, obs_y)
record(fig, "heateq.gif", ts[2:end]) do t
obs_y[] = q(t)
end
end
end
[Evolution]
cfl = 0.8
tend = 2.4
[HeatEq]
id = "sine"
id_sine_width = 4.0
[Mesh]
range = [-2.0, 2.0]
k = 20
basis = "lgl"
n = 5
[Output]
variables1d = ["u", "q"]
aligned_ts = "$(collect(range(0.02,10.4,step=0.02)))"
every_iteration = 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment