anim_quick
Generates GIF or MP4 animations by plotting a COMSOL expression over transient time steps or parametric solutions, with locked color ranges for consistent frames.
Instructions
One-call animation: plot an expression over time/solutions and write GIF/MP4.
Creates a plot group + plot feature for expression, renders every
transient time step (or every parametric solution), locks the colour range
and composes a GIF (+MP4 if requested) — the fastest path from a solved model
to a real animation file.
Args: expression: COMSOL expression to plot, e.g. "T", "ht.T", "u", "sqrt(u^2+v^2)". plot_type: "surface2d" (default for 2D models) | "surface3d" | "volume" | "slice" | "contour2d" | "isosurface" | "arrow2d" | "arrow3d" | "streamline" | "line" | "global" | "point". dataset: dataset tag, e.g. "dset1" (None = COMSOL default dataset). formats: ["gif"] (default) | ["gif","mp4"] | ["mp4"] (mp4 needs imageio-ffmpeg). fps: frames per second (default 10). width: frame width px (default 640). height: frame height px (default 480). mode: "auto" (default) | "time" | "solutions" | "static". times: explicit transient times, e.g. [0,2,4,6,8,10]. solnums: explicit 1-based solution indices. max_frames: cap number of frames. range_mode: "common" (default) | "auto" | "manual". color_range: [min, max] data range for range_mode="manual". colortable: COMSOL colour table, e.g. "ThermalLight". title: title text burned into each frame. output: explicit output path for a single-format run. output_directory: directory for generated GIF/MP4 files. frames_directory: directory for intermediate PNG frames. model: model name/tag (None = current model).
Returns: JSON with plotgroup, expression, frame count, colour range and the generated gif/mp4 artifact objects (path, size, frames, duration, valid).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"expression": "<expression>"
},
"name": "anim_quick"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fps | No | ||
| mode | No | auto | |
| model | No | ||
| times | No | ||
| title | No | ||
| width | No | ||
| height | No | ||
| output | No | ||
| dataset | No | ||
| formats | No | ||
| solnums | No | ||
| plot_type | No | surface2d | |
| colortable | No | ||
| expression | Yes | ||
| max_frames | No | ||
| range_mode | No | common | |
| color_range | No | ||
| frames_directory | No | ||
| output_directory | No |