Postprocessing and Visualization
A variety of postprocessing and visualization tools are available, both within this package and through related packages in the ecosystem. These tools enable you to analyze, visualize, and export finite element solutions and derived quantities.
Related Packages
- ExtendableGrids.jl:
- Interface to WriteVTK.jl for exporting results to VTK format (for use with ParaView, VisIt, etc.).
CellFinder
utility for locating the cell containing a given point.
- ExtendableFEMBase.jl:
- Node value interpolations.
PointEvaluator
for evaluating solutions at arbitrary points in the domain.SegmentIntegrator
for integrating along 1D line intersections with the mesh.- Basic unicode plotting for quick inspection of results.
- GridVisualize.jl:
- Grid and scalar function plotting for simplicial grids in 1D, 2D, and 3D.
- Supports multiple backends, e.g., PyPlot, GLMakie, PlutoVista.
Plots and Tables
This package provides some convenient plotting and table-generation functions for visualizing and summarizing results:
ExtendableFEM.broken_scalarplot!
— Functionbroken_scalarplot!(vis, feVectorBlock::FEVectorBlock, operator = Identity; kwargs...)
A "broken" scalarplot of a broken finite element vector. Instead of averaging the discontinuous values on the grid nodes, each grid cell is plotted independently. Thus, a discontinuous plot is generated.
All kwargs of the calling method are transferred to the scalarplot in this method.
ExtendableFEM.plot!
— Methodfunction plot!(p::GridVisualizer, ops, sol; kwargs...)
Plots the operator evaluations ops of blocks in sol into the GridVisualizer.
ExtendableFEM.plot
— Methodfunction plot!(p::GridVisualizer, ops, sol; Plotter = nothing, kwargs...)
Plots the operator evaluations ops of blocks in sol with the specified Plotter module that is supported by GridVisualize (e.g. GLMakie, PyPlot, Plots)
ExtendableFEM.plot_convergencehistory!
— Methodfunction plot_convergencehistory!(
p::GridVisualizer,
X,
Y;
add_h_powers = [],
X_to_h = X -> X,
colors = [:blue, :green, :red, :magenta, :lightblue],
title = "convergence history",
legend = :best,
ylabel = "",
ylabels = [],
xlabel = "ndofs",
markershape = :circle,
markevery = 1,
clear = true,
args...,
Plots a convergence history based on arrays X vs. Y into the GridVisualizer.
ExtendableFEM.plot_convergencehistory
— Methodfunction plot_convergencehistory(X, Y; Plotter = nothing, kwargs...)
Plots a convergence history based on arrays X vs. Y into the GridVisualizer with the specified Plotter module (that needs to be supported by GridVisualize).
ExtendableFEM.plot_unicode
— Methodfunction plot_unicode(sol; kwargs...)
Plots all blocks of sol into stdout (via plot_scalarplot from the UnicodePlots extension of ExtendableFEMBase)
ExtendableFEM.print_convergencehistory
— Methodprint_convergencehistory(
X,
Y;
X_to_h,
ylabels,
xlabel,
latex_mode,
separator,
order_seperator,
title,
digits
)
Prints a formatted convergence history table for a sequence of data points, optionally in LaTeX format.
Arguments
X
: Array of x-values (e.g., number of degrees of freedom, mesh sizes).Y
: 2D array (or vector) of y-values (e.g., errors, residuals), with one row per entry inX
.X_to_h
: Function mappingX
to a mesh size or similar for order calculation (default: identity).ylabels
: Array of labels for each column ofY
(default: auto-generated).xlabel
: Label for the x-axis column (default:"ndofs"
).latex_mode
: Iftrue
, output is formatted as a LaTeX tabular environment (default:false
).separator
: Column separator for plain text or LaTeX (default:"|"
or"&"
).order_seperator
: Separator between value and order columns (default: matchesseparator
).title
: (optional) Title for the table (default: none).digits
: (optional) Number of significant digits for value formatting (default:3
).
ExtendableFEM.print_table
— MethodPrints a table with data X vs. Y
Arguments
X
: Array of x-values (e.g., number of degrees of freedom, mesh sizes).Y
: 2D array (or vector) of y-values (e.g., errors, residuals), with one row per entry inX
.ylabels
: Array of labels for each column ofY
(default: auto-generated).xlabel
: Label for the x-axis column (default:"ndofs"
).