4.1 Choose a physical view
result.field(ref) accepts the reference belonging to the model instance used in the solve. A SolvedField exposes its native space, values, coefficients and unit. The values of an FV scalar are usually cell-supported and the coefficients of a Nedelec field are edge moments. Use evaluate(points) for physical values at explicit world points. Use at(time) or evaluate(points, time=...) when selecting a retained state. Inspect result.times or the recorded output times before choosing frames. For line profiles, field.sample(along=..., points=..., time=...) and result.sample(field=..., along=..., points=..., time=...) use the sampling carrier rather than a reshaped coefficient vector.
field.integrate(over=..., time=...) is appropriate when the field and its support supply native integration. Use region= or boundary= for a named subset, and specify component= or normal_component=True when the physical integral is a scalar component or outward flux. Verify support, sign, and geometric measure. For example, a temperature integrated over a volume has units K m\(^3\). Dividing by the volume gives an average in K. A boundary flux integral can be a power, provided the flux is defined on that support with the correct outward normal. For discrete FV conservation, use the executed conservative face fluxes as in the thermal study.
4.2 Use a built-in viewer or customize the panel
field.plot(...) offers an application-facing plot entry point. The visualization package also takes the result.result_set and ref.field_id. For example, onesim.visualization.line_plot accepts explicit start= and end= points. slice_plot accepts a plane= and can render the cut using the native carrier, with controls for time, component, and complex representation. result_widget gives a notebook viewer when the relevant optional dependencies are installed. Import the geometry and animation functions from their owning subpackages because the parent attributes with the same names refer to the packages.
For a custom panel, first build arrays with well-defined shape and support. A regular cut can use meshgrid, one batched evaluate call, and a reshape that matches the grid order. For an unstructured surface, use its actual connectivity or native cut topology. Keep discontinuous cell values piecewise constant unless you explicitly describe the reconstruction used for display. Use an aligned coordinate and color scale for comparisons. For phasors choose real part, magnitude or phase and state the convention. For a transient animation, use a fixed color normalization and label the time of every frame.
4.3 Keep verification and presentation together
Save vector SVG or PDF for clean line art and text. Use PNG when the figure is dense or the target viewer requires a raster image. Save raw arrays with coordinates and units in CSV or NPZ, and include the runtime version, mesh and time parameters, metrics and export filenames in a small JSON record. Check those metrics before recording a successful run. HDF5OutputSink supplies a storage option for supported larger outputs. The memory sink holds selected snapshots in process memory. For long runs choose an explicit ExecutionOptions retention policy and verify that the requested fields and times remain available. Use the checkpoint API when continuation requires numerical history, for example after a multistep time method. A CSV of sampled fields represents observables and usually lacks the state and history needed for restart.
# Run after the cantilever example.
import json
from importlib.metadata import version
summary = {
"runtime": version("onesimulation"),
"fine_cells": [20, 4, 3],
"element": "Q2",
"tip_m": float(u[-1, 2]),
"relative_mesh_change": float(abs(coarse_tip / u[-1, 2] - 1)),
"figure": "cantilever.svg",
}
(out / "cantilever-verification.json").write_text(
json.dumps(summary, indent=2) + "\n", encoding="utf-8"
)