shamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig#
- class shamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig#
Bases:
pybind11_objectMethods
Add the gravity of a fixed point mass to the external forces: a = -G M (r - pos) / (|r - pos|^2 + epsilon_soft^2)^{3/2}, with G from the unit system. epsilon_soft must be > 0.
Converts a json like dictionary to a config
Refine the blocks where the Jeans length is resolved by less than
N_jeanscells.Overloaded function.
Removed, raises an error.
Set the time quadrature coupling the external forces to the solver.
Enable self-gravity, with the BiCGSTAB Poisson solver.
Enable self-gravity, with the Jacobi preconditioned conjugate gradient Poisson solver.
Set the gas Riemann solver.
Set the HLL Riemann solver.
Removed, raises an error.
Set the HLLC_Davis Riemann solver.
Set the HLLC_PVRS Riemann solver.
Set the Rusanov Riemann solver.
Set the maximum number of iterations of the self-gravity Poisson solver.
Set the tolerance of the BiCGSTAB lucky breakdown test.
Set the convergence tolerance of the self-gravity Poisson solver.
Set the unit system of the simulation (SI if not set).
Converts the config to a json like dictionary
Barotropic collapse of a uniform sphere in RAMSES solver
Barotropic collapse of a uniform sphere in RAMSES solver
Protoplanetary disc around a point mass in RAMSES solver
Protoplanetary disc around a point mass in RAMSES solver- add_ext_force_constant_gravity(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, g: f64_3) None#
- add_ext_force_point_mass_gravity(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, mass: float, pos: f64_3, epsilon_soft: float) None#
Add the gravity of a fixed point mass to the external forces: a = -G M (r - pos) / (|r - pos|^2 + epsilon_soft^2)^{3/2}, with G from the unit system. epsilon_soft must be > 0.
- from_json(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, arg0: object) None#
Converts a json like dictionary to a config
- set_Csafe(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, arg0: float) None#
- set_alpha_values(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, arg0: float) None#
- set_amr_mode_density_based(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, *, crit_mass: float) None#
- set_amr_mode_jeans_length_based(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, *, N_jeans: int) None#
Refine the blocks where the Jeans length is resolved by less than
N_jeanscells.A block is refined if one of its cells has \(N_J \Delta x > \lambda_J = \sqrt{\pi c_s^2 / (G \rho)}\), with the sound speed of the equation of state (of the barotrope with the
InstantBarotropiccooling mode) and the gravitational constant of the unit system (cfg.set_units). It is derefined if the cells twice larger would still resolve the Jeans length by more than \(\sqrt{2} N_J\) cells.Only implemented in the new AMR (
cfg.set_amr_mode_old(False)).
- set_amr_mode_none(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#
- set_amr_mode_old(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, arg0: bool) None#
- set_amr_mode_pseudo_gradient_based(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, *, error_min: float, error_max: float) None#
- set_amr_mode_shear_based(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, *, Threshold: float) None#
- set_boundary_condition(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, axis: str, bc_type: str) None#
- set_cooling_mode(*args, **kwargs)#
Overloaded function.
set_cooling_mode(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, mode: shamrock.pyshamrock.model_ramses.NoCooling) -> None
Disable the cooling (the default).
>>> from shamrock.model_ramses import NoCooling >>> cfg.set_cooling_mode(NoCooling())
set_cooling_mode(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, mode: shamrock.pyshamrock.model_ramses.InstantBarotropic) -> None
Set the instantaneous barotropic cooling (RAMSES-like).
At the end of each timestep, before the CFL condition, the internal energy of every cell is overwritten by \(P_{\rm baro}(\rho) / (\gamma - 1)\), with \(\gamma\) the adiabatic index of the equation of state (
cfg.set_eos_adiabatic) and \(P_{\rm baro}(\rho) = c_{s,0}^2 \rho (1 + (\rho / \rho_0)^{\gamma_0 - 1})\) (isothermal belowrho0, adiabatic with indexgamma0above).>>> from shamrock.model_ramses import InstantBarotropic >>> cfg.set_cooling_mode(InstantBarotropic(rho0=1e-13, gamma0=1.4, cs0=0.2))
- set_drag_mode_expo(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, arg0: bool) None#
- set_drag_mode_irk1(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, arg0: bool) None#
- set_drag_mode_irk2(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, arg0: bool) None#
- set_drag_mode_no_drag(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#
- set_dust_mode_dhll(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, arg0: int) None#
- set_dust_mode_hb(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, arg0: int) None#
- set_dust_mode_none(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#
- set_eos_adiabatic(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, arg0: float) None#
- set_eos_barotropic(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, *, rho_crit: float, cs0: float, gamma: float) None#
- set_eos_gamma(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, arg0: float) None#
- set_eos_reset_barotropic(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, *args, **kwargs) None#
Removed, raises an error.
The reset of the internal energy onto a barotrope is now a cooling mode, replace
cfg.set_eos_reset_barotropic(rho_crit=..., cs0=..., gamma_baro=..., gamma=...)bycfg.set_eos_adiabatic(gamma)andcfg.set_cooling_mode(InstantBarotropic(rho0=rho_crit, gamma0=gamma_baro, cs0=cs0)).
- set_ext_force_coupling(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, mode: shamrock.pyshamrock.model_ramses.ExtForceCoupling) None#
Set the time quadrature coupling the external forces to the solver.
Parameters#
- modeExtForceCoupling
Either
ExtForceCoupling.Midpoint(the default) orExtForceCoupling.Trapezoidal, as obtained fromfrom shamrock.model_ramses import ExtForceCoupling.
- set_face_time_interpolation(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, arg0: bool) None#
- set_first_order_interpolation_mode(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#
- set_gravity_mode_bicgstab(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#
Enable self-gravity, with the BiCGSTAB Poisson solver.
Self-gravity is applied as an external force and requires the trapezoidal coupling (
cfg.set_ext_force_coupling(ExtForceCoupling.Trapezoidal)). The gravitational constant is the one of the unit system (cfg.set_units).
- set_gravity_mode_cg(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#
Enable self-gravity, with the Jacobi preconditioned conjugate gradient Poisson solver.
Self-gravity is applied as an external force and requires the trapezoidal coupling (
cfg.set_ext_force_coupling(ExtForceCoupling.Trapezoidal)). The gravitational constant is the one of the unit system (cfg.set_units).
- set_gravity_mode_no_gravity(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#
- set_gravity_mode_pcg(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#
- set_npscal_gas(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, arg0: int) None#
- set_riemann_solver(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, mode: shamrock.pyshamrock.model_ramses.RiemannSolverMode) None#
Set the gas Riemann solver.
Parameters#
- modeRiemannSolverMode
One of
Rusanov,HLL(the default),HLLC_PVRS,HLLC_DavisorHLLC_RAMSES, seeRiemannSolverMode.
Usage#
>>> from shamrock.model_ramses import HLLC_PVRS >>> cfg.set_riemann_solver(HLLC_PVRS)
or equivalently
>>> from shamrock.model_ramses import RiemannSolverMode >>> cfg.set_riemann_solver(RiemannSolverMode.HLLC_PVRS)
- set_riemann_solver_hll(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#
Set the HLL Riemann solver.
Deprecated since version Use:
cfg.set_riemann_solver(HLL)instead (seeset_riemann_solver()).
- set_riemann_solver_hllc(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#
Removed, raises an error.
It was replaced by
cfg.set_riemann_solver(HLLC_PVRS)(same solver as before) to lift the ambiguity on the HLLC variant; see alsocfg.set_riemann_solver(HLLC_Davis)andset_riemann_solver().
- set_riemann_solver_hllc_davis(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#
Set the HLLC_Davis Riemann solver.
Deprecated since version Use:
cfg.set_riemann_solver(HLLC_Davis)instead (seeset_riemann_solver()).
- set_riemann_solver_hllc_pvrs(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#
Set the HLLC_PVRS Riemann solver.
Deprecated since version Use:
cfg.set_riemann_solver(HLLC_PVRS)instead (seeset_riemann_solver()).
- set_riemann_solver_rusanov(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#
Set the Rusanov Riemann solver.
Deprecated since version Use:
cfg.set_riemann_solver(Rusanov)instead (seeset_riemann_solver()).
- set_scale_factor(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, arg0: float) None#
- set_scheduler_config(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, *, split_load_value: int, merge_load_value: int) None#
- set_second_order_interpolation_mode(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#
- set_self_gravity_Niter_max(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, Niter: int) None#
Set the maximum number of iterations of the self-gravity Poisson solver.
- set_self_gravity_happy_breakdown_tol(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, tol: float) None#
Set the tolerance of the BiCGSTAB lucky breakdown test.
BiCGSTAB restarts (shadow residual and search direction reset to the residual) when |<r_k, r'_0>| < tol |r_k| |r'_0|.
- set_self_gravity_tol(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, tol: float) None#
Set the convergence tolerance of the self-gravity Poisson solver.
The solver stops when the L2 norm of the residual is below tol relative to the one of the right-hand side.
- set_slope_lim_minmod(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#
- set_slope_lim_none(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#
- set_slope_lim_vanleer_f(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#
- set_slope_lim_vanleer_std(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#
- set_slope_lim_vanleer_sym(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) None#