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#
The |
Functions#
The solver geometry from the vertex coordinates |
|
The name table (dict of callables) a printed solver runs against: the numpy
implementation of every |
|
Execute printed source against the name table and return the function |
API#
- class zoomy_core.symsolver.numpy_backend.runtime.Geometry#
Bases:
typing.NamedTupleThe
meshargument of a printed solver: the geometry ofgeometry_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 fullcompute_geometrydict.
- 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.symsolverblock on this mesh, serial.Args
rt: theNumpyKernelsofnsmtopo: static topology (geometry_xp.build_topology) with the boundary-closure classesgeom: thecompute_geometrydict of the meshon_write:on_write(time, Q, Qaux)snapshot callbackon_save,on_load: the restart pair,on_save(time, Q, Qaux)andon_load(time, Q, Qaux) -> (time, Q, Qaux); None: no restart file / not restartingimplicit: Newton and linear-solver settings ofrootandlinsolvesystems: further{name: (nsm, NumpyKernels)}a template uses besidesnsm
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.