Plotting and Accessing Simulation Results

Visualizing simulation results

LevelSetSublimation.summaryplotFunction
summaryplot(sim; layout=(3,2), heatvar=:T)

Return a 2x3 plot of simulation results from start to finish.

sim should have a field "sol" , which is passed to get_ϕ(sol, t, dom::Domain) . heatvar determines what is plotted as a heatmap in the results (:T or , currently.)

source
LevelSetSublimation.resultsanimFunction
resultsanim(sim, casename; seconds_length=5, heatvar=:T)

Generate a .gif of the given sim, with filename casename_heatvar_evol.gif.

Pass either :p or :T as heatvar. Passing ϕ will probably cause filename problems

source
LevelSetSublimation.plotframeFunction
plotframe(t::Float64, sim; maxT=nothing, heatvar=:T)

Unpack simulation results and plot the state at time t.

heatvar = :T or =:ϕ or =:p decides whether temperature, level set function, or pressure is plotted as colors. If given, maxT sets an upper limit for the associated colorbar.

source

Accessing simulation results

The return from sim_from_dict is a dictionary, with a field "dom" containing a Domain and "sol" containing an ODESolution.

The ODESolution type comes from DifferentialEquations, and comes with lots of convenience functions documented here.

At a particular timestep, u is used to describe the system's state. With the current implementation, u is a vector, with nr*nz values of the level set function throughout the domain, followed by 1 value for frozen temperature Tf and one value for glass temperature Tvw. ϕ_T_from_u will return a tuple (ϕ, Tf, Tvw) ; this is just so you don't have to hard-code which indices are which variables.

Fine-grained plotting functions, used internally

LevelSetSublimation.plot_cylheatFunction
plot_cylheat(T, dom::Domain)

In a mutating fashion, add a "cylindrical" heatmap of T to the current plot. ("Cylindrical" meaning reflected across x=0 axis.)

source
LevelSetSublimation.heatFunction
heat(field, dom::Domain)

Return a heatmap of field, scaled to fit on dom.

This function generates a new plot.

source
LevelSetSublimation.LevelSetType
LevelSet(phi, dom::Domain)

A small struct, used in dispatch for plotting.

The plot recipe can be variously called as:

plot(LevelSet(phi, dom), reflect=true)
plot(LevelSet(phi, dom), reflect=false)
plot!(LevelSet(phi, dom), reflect=true)
plot!(LevelSet(phi, dom), reflect=false)
source
LevelSetSublimation.markfrontFunction
markfront(phi, dom::Domain; lab="", c=:white)

Add a star marker to Γ (front) cells based on ϕ for current plot, in mutating fashion.

Internally calls Γ_cells.

source

plot(::LevelSet, reflect=true) plots the zero-level set for a level set function LevelSet(phi, dom::Domain). reflect reflects across the y-axis to make cylindrical plots.