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; the default
backend (no JAX, no compiler). Mirrors zoomy_jax.symsolver.solver without AD, GPU and the
hyperbolic preCICE coupling (the Chorin march couples by overlapping Schwarz); comm= (mpi4py)
runs it distributed (numpy_backend.parallel, the JAX backend’s partition).
Module Contents#
Classes#
Finite-volume solver in NumPy: prints |
|
The Chorin projection solver in NumPy ( |
API#
- class zoomy_core.symsolver.numpy_backend.solver.SymbolicHyperbolicSolverNumpy(**kwargs)#
Bases:
zoomy_core.symsolver.settings.HyperbolicSettingsFinite-volume solver in NumPy: prints
HyperbolicTemplatefor a NumericalSystemModel and runs it serially. Usesetup(mesh, model), thenrun(Q, Qaux).Initialization
- on_write#
‘Callable(…)’
- output#
‘String(…)’
- comm#
‘Parameter(…)’
- mpi_linear_solver#
‘OptionParam(…)’
- setup(mesh, model)#
Lift
modelto an NSM if needed, then build the solver onmesh.Args
mesh: a mesh, or the path of a mesh filemodel: 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.
- integral(X)#
sum_cells X volper row ofX(rows, cells)over the whole mesh (e.g. the mass). Distributed: a collective, call it on every rank (each gets the total).
- property parameters#
The parameter vector, read by symbol:
solver.parameters[sm.parameters.n](Parameters).
- run(Q, Qaux, parameters=None, time0=None)#
March from
time0(defaulttime_start; a restart: the saved state) totime_end; returns(time, Q, Qaux)(aRunResult:.Q).parametersis a mapping {symbol: value} (the rest from the model),solver.parametersor a vector.
- class zoomy_core.symsolver.numpy_backend.solver.SymbolicChorinSolverNumpy(**kwargs)#
Bases:
zoomy_core.symsolver.numpy_backend.solver.SymbolicHyperbolicSolverNumpy,zoomy_core.symsolver.settings.ChorinSettingsThe 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(…)’
- couple#
‘Dict(…)’
- 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).