zoomy_core.symsolver.numpy_backend.solver

zoomy_core.symsolver.numpy_backend.solver#

Driver of the NumPy backend: prints the solver template (hyperbolic, Chorin) of a NumericalSystemModel with PyPrinter and runs it against numpy_backend.runtime, serially; the default backend (no JAX, no compiler). Mirrors zoomy_jax.symsolver.solver without AD, GPU, MPI and preCICE.

Module Contents#

Classes#

SymbolicHyperbolicSolverNumpy

Finite-volume solver in NumPy: prints HyperbolicTemplate for a NumericalSystemModel and runs it serially. Use setup(mesh, model), then run(Q, Qaux).

SymbolicChorinSolverNumpy

The Chorin projection solver in NumPy (ChorinTemplate): setup(mesh, pred, press, corr) takes the predictor NSM on the full state and the pressure and corrector systems.

API#

class zoomy_core.symsolver.numpy_backend.solver.SymbolicHyperbolicSolverNumpy(**kwargs)#

Bases: zoomy_core.symsolver.settings.HyperbolicSettings

Finite-volume solver in NumPy: prints HyperbolicTemplate for a NumericalSystemModel and runs it serially. Use setup(mesh, model), then run(Q, Qaux).

Initialization

on_write#

‘Callable(…)’

output#

‘String(…)’

comm#

‘Parameter(…)’

setup(mesh, model)#

Lift model to an NSM if needed, then build the solver on mesh.

Args

  • mesh: a mesh, or the path of a mesh file

  • model: SystemModel or NumericalSystemModel

Returns

initial (Q, Qaux)

initial_aux(Q, Qaux, parameters=None)#

The aux of the initial state: the pointwise formula plus the derivative aux with the BC ghosts and the boundary closure.

property parameters#

The kernels’ parameter vector.

run(Q, Qaux, parameters=None, time0=None)#

March from time0 (default time_start; a restart: the saved state) to time_end; returns (time, Q, Qaux).

class zoomy_core.symsolver.numpy_backend.solver.SymbolicChorinSolverNumpy(**kwargs)#

Bases: zoomy_core.symsolver.numpy_backend.solver.SymbolicHyperbolicSolverNumpy, zoomy_core.symsolver.settings.ChorinSettings

The Chorin projection solver in NumPy (ChorinTemplate): setup(mesh, pred, press, corr) takes the predictor NSM on the full state and the pressure and corrector systems.

References

  • Chorin 1968, https://doi.org/10.1090/S0025-5718-1968-0242392-2

Initialization

pressure_linear_solver#

‘OptionParam(…)’

pressure_amg_rebuild#

‘Integer(…)’

pressure_amg_growth#

‘Number(…)’

setup(mesh, pred, press, corr)#

Check the split, build the pressure and corrector kernels and the linear-solver settings, then _setup; returns the initial (Q, Qaux).