shamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig#

class shamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig#

Bases: pybind11_object

Methods

add_ext_force_constant_gravity

add_ext_force_point_mass_gravity

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

Converts a json like dictionary to a config

set_Csafe

set_alpha_values

set_amr_mode_density_based

set_amr_mode_jeans_length_based

Refine the blocks where the Jeans length is resolved by less than N_jeans cells.

set_amr_mode_none

set_amr_mode_old

set_amr_mode_pseudo_gradient_based

set_amr_mode_shear_based

set_boundary_condition

set_cooling_mode

Overloaded function.

set_drag_mode_expo

set_drag_mode_irk1

set_drag_mode_irk2

set_drag_mode_no_drag

set_dust_mode_dhll

set_dust_mode_hb

set_dust_mode_none

set_eos_adiabatic

set_eos_barotropic

set_eos_gamma

set_eos_reset_barotropic

Removed, raises an error.

set_ext_force_coupling

Set the time quadrature coupling the external forces to the solver.

set_face_time_interpolation

set_first_order_interpolation_mode

set_gravity_mode_bicgstab

Enable self-gravity, with the BiCGSTAB Poisson solver.

set_gravity_mode_cg

Enable self-gravity, with the Jacobi preconditioned conjugate gradient Poisson solver.

set_gravity_mode_no_gravity

set_gravity_mode_pcg

set_npscal_gas

set_riemann_solver

Set the gas Riemann solver.

set_riemann_solver_hll

Set the HLL Riemann solver.

set_riemann_solver_hllc

Removed, raises an error.

set_riemann_solver_hllc_davis

Set the HLLC_Davis Riemann solver.

set_riemann_solver_hllc_pvrs

Set the HLLC_PVRS Riemann solver.

set_riemann_solver_rusanov

Set the Rusanov Riemann solver.

set_scale_factor

set_scheduler_config

set_second_order_interpolation_mode

set_self_gravity_Niter_max

Set the maximum number of iterations of the self-gravity Poisson solver.

set_self_gravity_happy_breakdown_tol

Set the tolerance of the BiCGSTAB lucky breakdown test.

set_self_gravity_tol

Set the convergence tolerance of the self-gravity Poisson solver.

set_slope_lim_minmod

set_slope_lim_none

set_slope_lim_vanleer_f

set_slope_lim_vanleer_std

set_slope_lim_vanleer_sym

set_units

Set the unit system of the simulation (SI if not set).

to_json

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

Rayleigh-Taylor instability in RAMSES solver

Rayleigh-Taylor instability in RAMSES solver

Shu-Osher shock tube in RAMSES solver

Shu-Osher shock tube in RAMSES solver

Sod tube test with pseudogradient based refinment

Sod tube test with pseudogradient based refinment

Mirror symmetry of the RAMSES solver AMR

Mirror symmetry of the RAMSES solver AMR
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_jeans cells.

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 InstantBarotropic cooling 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.

  1. 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())
    
  2. 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 below rho0, adiabatic with index gamma0 above).

    >>> 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=...) by cfg.set_eos_adiabatic(gamma) and cfg.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) or ExtForceCoupling.Trapezoidal, as obtained from from 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_Davis or HLLC_RAMSES, see RiemannSolverMode.

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 (see set_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 also cfg.set_riemann_solver(HLLC_Davis) and set_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 (see set_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 (see set_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 (see set_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#
set_units(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig, units: shamrock.pyshamrock.UnitSystem) → None#

Set the unit system of the simulation (SI if not set).

It sets the gravitational constant used by self-gravity.

to_json(self: shamrock.pyshamrock.model_ramses.RamsesModel_f64_3_i64_3_SolverConfig) → object#

Converts the config to a json like dictionary