Skip to content
Projects

Quickstart

Install simgeometry, then use its geometry modules from Python:

from simgeometry.grid import Grid
from simgeometry.objects import Circle
grid = Grid(ndim=2, lower_bound=(0, 0), upper_bound=(1, 1), num_gridpoints=(32, 32))
circle = Circle(midpoint=(0.5, 0.5), radius=0.25)
mask = circle.node_mask(grid)

mask marks the grid nodes inside the circle.

Continue with grids and coordinates to understand node spacing and periodic axes, or shapes and node masks for point queries and index lists. For MPI layouts, see parallel grids.

With simgeometry[plot], inspect objects and sections directly:

from simgeometry import Sphere
shell = Sphere((0, 0, 0), 1) - Sphere((0, 0, 0), 0.4)
shell.show_3d(opacity=0.6)
shell.slice(z=0.2).show()

See Geometry inspection and queries for coordinate conventions, accuracy, return values, and optional dependencies.