solve_laplace_3d
Solve the 3D Laplace equation on a unit cube with Dirichlet boundaries using Jacobi iteration, returning the potential field grid.
Instructions
Solve u_xx + u_yy + u_zz = 0 on the unit cube with Dirichlet faces.
``x0``/``x1`` are the values on the faces x=0 and x=1 (likewise for y and
z). A vectorised Jacobi iteration is run until max|u_new-u_old| < tol; if
``max_iter`` is reached first the call still succeeds with
``converged = False`` and the achieved ``iterations``. Grids above 500,000
cells are rejected. The full (z, y, x) grid is saved to .npz and returned
downsampled to at most 20 points per axis.
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": {
"nx": "<nx>",
"ny": "<ny>",
"nz": "<nz>"
},
"name": "solve_laplace_3d"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nx | Yes | ||
| ny | Yes | ||
| nz | Yes | ||
| x0 | No | ||
| x1 | No | ||
| y0 | No | ||
| y1 | No | ||
| z0 | No | ||
| z1 | No | ||
| tol | No | ||
| max_iter | No |