zoomy_amrex.transformation.to_amrex#
Printers of a frozen SystemModel for the AMReX C++ drivers: Model.H (source,
Jacobians, aux update, eigenvalues, BC and Chorin kernels) and Numerics.H (core’s
AmrexNumerics). Opaque calls (eigensystem, eigenvalues, solve, …) are routed to
the hand-written UserFunctions.H, as foam does.
Module Contents#
Classes#
Core’s |
|
Emit |
Functions#
Generate |
|
Generate |
API#
- class zoomy_amrex.transformation.to_amrex.AmrexNumericsPrinter(numerics, *args, **kwargs)#
Bases:
zoomy_core.transformation.to_amrex.AmrexNumericsCore’s
AmrexNumericswith real-valuedconditional/Heavisideand the opaque eigen- and solve calls routed toamrex_user.Initialization
Initialize the instance.
- c_functions#
None
- class zoomy_amrex.transformation.to_amrex.AmrexSystemModelPrinter(sm, *, analytical_eigenvalues=True, wrapper_name='Model', time_position_ops=False)#
Bases:
zoomy_core.transformation.to_amrex.AmrexCore,zoomy_core.transformation.generic_c.GenericCppBaseEmit
Model.H(operators, BC kernels, state-row map, Chorin metadata) from a frozenSystemModel. Called bygenerate_headersandwrite_chorin_headers.Initialization
Bind the SystemModel
smand register the Q, Qaux, n, p, X and time symbol maps;dtis appended topwhen an operator uses it.Args
analytical_eigenvalues: print the model’s eigenvalues; else zeros (the backend then uses a numerical spectral radius).wrapper_name: name of the emitted struct.time_position_ops:source/update_aux_variablestake(time, X)(hyperbolicModel.Honly).
- gpu_enabled#
True
- c_functions#
None
- get_includes()#
AMReX includes of
Model.H.
- create_code()#
Print the whole
Model.Hstruct: every operator kernel (zero stubs for the slots the driver does not read), the BC kernels and, on a Chorin sub-model, the pressure-operator kernels and metadata.
- zoomy_amrex.transformation.to_amrex.generate_headers(sm, out_dir, *, riemann=None, analytical_eigenvalues=True)#
Generate
Model.H,Numerics.Hand the user-function headers intoout_dirfrom a frozen SystemModel. Files are rewritten only when their text changes, somakedoes not recompile.Args
sm: frozen SystemModel.riemann:zoomy_core.fvm.riemann_solvers.Numericssubclass; defaultNonconservativeRusanov.
Returns
out_diras a Path.
- zoomy_amrex.transformation.to_amrex.write_chorin_headers(split, out_dir)#
Generate
ModelPred.H/ModelPress.H/ModelCorr.H,NumericsPred.Hand the user-function headers for the C++ Chorin driver (predictor, pressure solve, corrector). An unresolved boundary trace in the emitted C++ raisesValueError.Args
split: the model’s ownchorin_split(system_model=sm)result (SM_pred,SM_press,SM_corr).
Returns
out_diras a Path.References
Chorin 1968, https://doi.org/10.1090/S0025-5718-1968-0242392-2