curl --request GET \
--url https://api.ionworks.com/simulations/{simulation_id}/spatial-fieldimport requests
url = "https://api.ionworks.com/simulations/{simulation_id}/spatial-field"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.ionworks.com/simulations/{simulation_id}/spatial-field', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ionworks.com/simulations/{simulation_id}/spatial-field",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ionworks.com/simulations/{simulation_id}/spatial-field"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ionworks.com/simulations/{simulation_id}/spatial-field")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ionworks.com/simulations/{simulation_id}/spatial-field")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"variable": "<string>",
"dimension": 2,
"axis_names": [
"<string>"
],
"n_points": 123,
"points": "<string>",
"n_cells": 123,
"nodes_per_cell": 123,
"cell_type": 123,
"connectivity": "<string>",
"association": "cell",
"times": [
123
],
"values": "<string>",
"value_range": [
123
],
"domains": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Get Simulation Spatial Field
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.
curl --request GET \
--url https://api.ionworks.com/simulations/{simulation_id}/spatial-fieldimport requests
url = "https://api.ionworks.com/simulations/{simulation_id}/spatial-field"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.ionworks.com/simulations/{simulation_id}/spatial-field', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ionworks.com/simulations/{simulation_id}/spatial-field",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ionworks.com/simulations/{simulation_id}/spatial-field"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ionworks.com/simulations/{simulation_id}/spatial-field")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ionworks.com/simulations/{simulation_id}/spatial-field")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"variable": "<string>",
"dimension": 2,
"axis_names": [
"<string>"
],
"n_points": 123,
"points": "<string>",
"n_cells": 123,
"nodes_per_cell": 123,
"cell_type": 123,
"connectivity": "<string>",
"association": "cell",
"times": [
123
],
"values": "<string>",
"value_range": [
123
],
"domains": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Path Parameters
Query Parameters
1 <= x <= 500Response
Successful Response
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.
Evaluated PyBaMM variable name.
Number of meshed spatial axes (2 = x-z plane, 3 = x-y-z).
2, 3 Physical axis of each point coordinate, e.g. ['x', 'y', 'z'].
Number of mesh vertices.
Base64 float32 xyz triples in metres, n_points * 3 values. A 2D mesh has z = 0.
Number of mesh cells.
Vertices per cell.
VTK cell-type code: 5 triangle, 9 quad, 10 tetrahedron, 12 hexahedron.
Base64 int32 vertex indices, n_cells * nodes_per_cell values in VTK node order.
Whether values are per cell or per vertex.
cell, point Sampled simulation times in seconds.
Base64 float32 field values, time-major: len(times) blocks of n_cells (or n_points) values.
[min, max] of the finite values over every sampled time.
PyBaMM domains the field spans.
Was this page helpful?