---
title: "Get Simulation Spatial Field"
method: GET
path: "/simulations/{simulation_id}/spatial-field"
tags: ["Simulations"]
---

# Get Simulation Spatial Field

`GET /simulations/{simulation_id}/spatial-field`

## Request

- Base URL: `https://api.ionworks.com`
- URL: `https://api.ionworks.com/simulations/{simulation_id}/spatial-field`
- Auth: none declared

Evaluate a 2D/3D field on an unstructured mesh from stored solution chunks.

Returns the mesh as a VTK unstructured grid plus the field's cell values at up
to ``max_time_points`` stored times, for rendering with vtk.js.

## Path parameters

- `simulation_id` string, uuid, required

## Query parameters

- `variable` string, required
- `max_time_points` integer

## Response `200`

Successful Response

- SpatialField: A time-dependent scalar field on an unstructured 2D or 3D PyBaMM mesh. Shaped for a VTK unstructured grid. ``points``, ``connectivity`` and ``values`` are base64-encoded little-endian typed arrays: decode them straight into a ``Float32Array`` / ``Int32Array`` / ``Float32Array``.
  - `variable` string, required: Evaluated PyBaMM variable name.
  - `dimension` 2 | 3, required: Number of meshed spatial axes (2 = x-z plane, 3 = x-y-z).
  - `axis_names` string[], required: Physical axis of each point coordinate, e.g. ['x', 'y', 'z'].
  - `n_points` integer, required: Number of mesh vertices.
  - `points` string, required: Base64 float32 xyz triples in metres, n_points * 3 values. A 2D mesh has z = 0.
  - `n_cells` integer, required: Number of mesh cells.
  - `nodes_per_cell` integer, required: Vertices per cell.
  - `cell_type` integer, required: VTK cell-type code: 5 triangle, 9 quad, 10 tetrahedron, 12 hexahedron.
  - `connectivity` string, required: Base64 int32 vertex indices, n_cells * nodes_per_cell values in VTK node order.
  - `association` 'cell' | 'point', required: Whether values are per cell or per vertex.
  - `times` number[], required: Sampled simulation times in seconds.
  - `values` string, required: Base64 float32 field values, time-major: len(times) blocks of n_cells (or n_points) values.
  - `value_range` number[], required: [min, max] of the finite values over every sampled time.
  - `domains` string[]: PyBaMM domains the field spans.

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-20** `1a41e07d413c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/ionworks/apis/ionworks-api/changes/simulations/:simulation_id/spatial-field/get.md)

---

[API](https://skmtc.dev/ionworks/apis/ionworks-api.md) - [All operations](https://skmtc.dev/ionworks/apis/ionworks-api/llms.txt) - [OpenAPI document](https://skmtc.dev/ionworks/apis/ionworks-api/revisions/abebbbc5f60a?raw)
