zoomy_core.symsolver.numpy_backend.runtime

zoomy_core.symsolver.numpy_backend.runtime#

NumPy runtime of the symbolic solvers: what each name of a printed solver means in plain numpy, block for block the serial path of zoomy_jax.symsolver.runtime. While is a Python loop, Cond an if / else, Root a Newton iteration with a finite-difference Jacobian and LinSolve a restarted GMRES (scipy), optionally AMG-preconditioned (pyamg).

References

  • Saad, Schultz 1986, https://doi.org/10.1137/0907058

  • Knoll, Keyes 2004, https://doi.org/10.1016/j.jcp.2003.08.010

Module Contents#

Classes#

Geometry

The mesh argument of a printed solver: the geometry of geometry_xp.compute_geometry.

Functions#

geometry_of

The solver geometry from the vertex coordinates X (dim, n_vertices); also returns the full compute_geometry dict.

runtime

The name table (dict of callables) a printed solver runs against: the numpy implementation of every zoomy_core.symsolver block on this mesh, serial.

build

Execute printed source against the name table and return the function name; raises if the source uses a block the table lacks.

API#

class zoomy_core.symsolver.numpy_backend.runtime.Geometry#

Bases: typing.NamedTuple

The mesh argument of a printed solver: the geometry of geometry_xp.compute_geometry.

cell_volumes: numpy.ndarray#

None

cell_centers: numpy.ndarray#

None

cell_inradius: numpy.ndarray#

None

face_normals: numpy.ndarray#

None

face_volumes: numpy.ndarray#

None

face_centers: numpy.ndarray#

None

lsq_gradQ: numpy.ndarray#

None

lsq_closure: numpy.ndarray#

None

zoomy_core.symsolver.numpy_backend.runtime.geometry_of(topo, X)#

The solver geometry from the vertex coordinates X (dim, n_vertices); also returns the full compute_geometry dict.

zoomy_core.symsolver.numpy_backend.runtime.runtime(nsm, rt, mesh_np, topo, geom, *, on_write=None, on_save=None, on_load=None, implicit=None, systems=None)#

The name table (dict of callables) a printed solver runs against: the numpy implementation of every zoomy_core.symsolver block on this mesh, serial.

Args

  • rt: the NumpyKernels of nsm

  • topo: static topology (geometry_xp.build_topology) with the boundary-closure classes

  • geom: the compute_geometry dict of the mesh

  • on_write: on_write(time, Q, Qaux) snapshot callback

  • on_save, on_load: the restart pair, on_save(time, Q, Qaux) and on_load(time, Q, Qaux) -> (time, Q, Qaux); None: no restart file / not restarting

  • implicit: Newton and linear-solver settings of root and linsolve

  • systems: further {name: (nsm, NumpyKernels)} a template uses besides nsm

Returns

dict name -> callable

zoomy_core.symsolver.numpy_backend.runtime.build(src, name, module)#

Execute printed source against the name table and return the function name; raises if the source uses a block the table lacks.