zoomy_core.symsolver.backend_cxx

zoomy_core.symsolver.backend_cxx#

The C++ backend of the symbolic solvers, shared by foam and AMReX: it prints a solver template as the host program Solver.H. Both runtimes include RUNTIME_HEADER (rt_common.H), and a driver combines with a strategy by inheritance, driver first.

Module Contents#

Classes#

CxxBackend

The settings of a hyperbolic solver on a C++ runtime and the printing of its host program (_print); the driver subclasses implement build and run.

CxxChorinBackend

The Chorin projection template (ChorinTemplate) on a C++ runtime; run takes (pred, press, corr), the predictor and the pressure and corrector systems of the model’s split.

Functions#

initial_state

The initial state Q0 (n_state, n_inner_cells) of model on mesh for a C++ backend’s run: the model’s initial conditions at the cell centres (zero without).

write_snapshots

Write the snapshots [(time, Q)] of a C++ backend run (solver.snapshots) as a zoomy HDF5 store at path (mesh, state names, one iteration_k per snapshot); returns path.

Data#

API#

zoomy_core.symsolver.backend_cxx.RUNTIME_HEADER#

‘with_name(…)’

class zoomy_core.symsolver.backend_cxx.CxxBackend(**kwargs)#

Bases: zoomy_core.symsolver.settings.HyperbolicSettings

The settings of a hyperbolic solver on a C++ runtime and the printing of its host program (_print); the driver subclasses implement build and run.

Initialization

couple#

‘Dict(…)’

subcycling#

‘Boolean(…)’

gmres_restart#

‘Integer(…)’

abstract build(nsm, dimension)#

Print the host program (self.source), write the build tree and compile (cached); returns the binary.

abstract run(mesh, model, Q0, workdir)#

March Q0 to time_end (write the case into workdir, launch, read back); returns (time, Q) and keeps the snapshots in self.snapshots.

Args

  • Q0: initial state in the mesh’s order.

  • model: the SystemModel or NSM (see _prepare).

class zoomy_core.symsolver.backend_cxx.CxxChorinBackend(**kwargs)#

Bases: zoomy_core.symsolver.backend_cxx.CxxBackend, zoomy_core.symsolver.settings.ChorinSettings

The Chorin projection template (ChorinTemplate) on a C++ runtime; run takes (pred, press, corr), the predictor and the pressure and corrector systems of the model’s split.

References

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

Initialization

zoomy_core.symsolver.backend_cxx.initial_state(mesh, model)#

The initial state Q0 (n_state, n_inner_cells) of model on mesh for a C++ backend’s run: the model’s initial conditions at the cell centres (zero without).

Args

  • model: a SystemModel or NSM, or the Chorin triple (pred, press, corr).

zoomy_core.symsolver.backend_cxx.write_snapshots(path, mesh, model, snapshots)#

Write the snapshots [(time, Q)] of a C++ backend run (solver.snapshots) as a zoomy HDF5 store at path (mesh, state names, one iteration_k per snapshot); returns path.