shamrock.model_sph.SPHModel_f64_3_M4_SPHSetup#

class shamrock.model_sph.SPHModel_f64_3_M4_SPHSetup#

Bases: pybind11_object

Methods

apply_setup

make_combiner_add

make_generator_disc_mc

Create a Monte Carlo disc particle generator.

make_generator_from_context

make_generator_lattice_cubic

make_generator_lattice_fcc

Generate particles on a true FCC lattice (ABC stacking of close-packed layers along z) of parameter dr (neighbours are 2 dr apart)

make_generator_lattice_hcp

Generate particles on a HCP lattice of parameter dr (neighbours are 2 dr apart)

make_modifier_custom_warp

make_modifier_filter

make_modifier_offset

make_modifier_split_part

make_modifier_warp_disc

Sphere advection with multiple patch

Sphere advection with multiple patch

Init a simulation from another simulation

Init a simulation from another simulation

Killing sphere for SPH simulation

Killing sphere for SPH simulation

Basic disc simulation

Basic disc simulation

Custom warp disc simulation

Custom warp disc simulation

Using Shamrock SPH rendering module

Using Shamrock SPH rendering module

SPH Setup logs

SPH Setup logs

Tracking particles by id in SPH

Tracking particles by id in SPH

Uniform box in SPH

Uniform box in SPH

Init a simulation from an upscaled simulation

Init a simulation from an upscaled simulation

Isolated star GW emmission

Isolated star GW emmission

Testing the MHD rotor problem (3D) with SPMHD

Testing the MHD rotor problem (3D) with SPMHD
apply_setup(self: shamrock.pyshamrock.model_sph.SPHModel_f64_3_M4_SPHSetup, setup: shammodels::sph::modules::ISPHSetupNode, *, part_reordering: bool = True, gen_step: Optional[int] = None, insert_step: Optional[int] = None, msg_count_limit: Optional[int] = None, rank_comm_size_limit: Optional[int] = None, max_msg_size: Optional[int] = None, do_setup_log: bool = False, use_new_setup: bool = True, speculative_balancing: bool = False) → None#
make_combiner_add(self: shamrock.pyshamrock.model_sph.SPHModel_f64_3_M4_SPHSetup, arg0: shammodels::sph::modules::ISPHSetupNode, arg1: shammodels::sph::modules::ISPHSetupNode) → shammodels::sph::modules::ISPHSetupNode#
make_generator_disc_mc(self: shamrock.pyshamrock.model_sph.SPHModel_f64_3_M4_SPHSetup, *, part_mass: float, disc_mass: float, r_in: float, r_out: float, sigma_profile: Callable[[float], float], H_profile: Callable[[float], float], rot_profile: Callable[[float], float] = None, cs_profile: Callable[[float], float] = None, velocity_field: Callable[[f64_3], f64_3] = None, cs_field: Callable[[f64_3], float] = None, random_seed: int, init_h_factor: float = 0.8) → shammodels::sph::modules::ISPHSetupNode#

Create a Monte Carlo disc particle generator.

Particles are sampled in cylindrical coordinates: the radius is drawn with rejection sampling from sigma_profile, the azimuth is uniform, and the vertical coordinate follows a Gaussian with scale H_profile(r). The initial density is extrapolated from the surface density profile, and smoothing lengths are set from that density.

Args:

part_mass: Mass of each SPH particle. disc_mass: Total disc mass. The particle count is disc_mass / part_mass. r_in: Inner disc radius. r_out: Outer disc radius. sigma_profile: Surface density profile sigma(r). H_profile: Disc scale height profile H(r). rot_profile: Azimuthal speed profile v_theta(r). The velocity is

projected along the cylindrical azimuthal direction at each particle position. Mutually exclusive with velocity_field.

cs_profile: Sound speed profile c_s(r). Evaluated at the cylindrical

radius of each particle. Required when the solver uses a locally isothermal EOS. Mutually exclusive with cs_field.

velocity_field: Velocity profile v(x, y, z). Mutually exclusive

with rot_profile.

cs_field: Sound speed profile c_s(x, y, z). Required when the solver

uses a locally isothermal EOS. Mutually exclusive with cs_profile.

random_seed: Seed for the Monte Carlo sampler. init_h_factor: Multiplier applied to the smoothing length inferred from

the generated density. Defaults to 0.8.

Notes:

Exactly one of velocity_field or rot_profile must be provided.

If the solver uses a locally isothermal EOS, exactly one of cs_field or cs_profile must be provided. Otherwise both sound-speed profiles are ignored and a warning is emitted if either is supplied.

Returns:

A setup node to pass to apply_setup().

make_generator_from_context(self: shamrock.pyshamrock.model_sph.SPHModel_f64_3_M4_SPHSetup, arg0: shamrock.pyshamrock.Context) → shammodels::sph::modules::ISPHSetupNode#
make_generator_lattice_cubic(self: shamrock.pyshamrock.model_sph.SPHModel_f64_3_M4_SPHSetup, arg0: float, arg1: f64_3, arg2: f64_3) → shammodels::sph::modules::ISPHSetupNode#
make_generator_lattice_fcc(self: shamrock.pyshamrock.model_sph.SPHModel_f64_3_M4_SPHSetup, dr: float, box_min: f64_3, box_max: f64_3, discontinuous: bool = True, init_h_factor: float = 1.7817974362806785) → shammodels::sph::modules::ISPHSetupNode#

Generate particles on a true FCC lattice (ABC stacking of close-packed layers along z) of parameter dr (neighbours are 2 dr apart)

The number of layers along z must be a multiple of 3, the number of rows along y even

The initial smoothing length is set to init_h_factor * dr. The default 2^(5/6) is the equilibrium smoothing length for hfact = 1 (the smallest hfact of all the SPH kernels), so the initial guess never exceeds the equilibrium value.

make_generator_lattice_hcp(self: shamrock.pyshamrock.model_sph.SPHModel_f64_3_M4_SPHSetup, dr: float, box_min: f64_3, box_max: f64_3, discontinuous: bool = True, init_h_factor: float = 1.7817974362806785) → shammodels::sph::modules::ISPHSetupNode#

Generate particles on a HCP lattice of parameter dr (neighbours are 2 dr apart)

The initial smoothing length is set to init_h_factor * dr. The default 2^(5/6) is the equilibrium smoothing length for hfact = 1 (the smallest hfact of all the SPH kernels), so the initial guess never exceeds the equilibrium value.

make_modifier_custom_warp(self: shamrock.pyshamrock.model_sph.SPHModel_f64_3_M4_SPHSetup, *, parent: shammodels::sph::modules::ISPHSetupNode, inc_profile: Callable[[float], float], psi_profile: Callable[[float], float], k_profile: Callable[[float], f64_3]) → shammodels::sph::modules::ISPHSetupNode#
make_modifier_filter(self: shamrock.pyshamrock.model_sph.SPHModel_f64_3_M4_SPHSetup, *, parent: shammodels::sph::modules::ISPHSetupNode, filter: Callable[[f64_3], bool]) → shammodels::sph::modules::ISPHSetupNode#
make_modifier_offset(self: shamrock.pyshamrock.model_sph.SPHModel_f64_3_M4_SPHSetup, *, parent: shammodels::sph::modules::ISPHSetupNode, offset_position: f64_3, offset_velocity: f64_3) → shammodels::sph::modules::ISPHSetupNode#
make_modifier_split_part(self: shamrock.pyshamrock.model_sph.SPHModel_f64_3_M4_SPHSetup, *, parent: shammodels::sph::modules::ISPHSetupNode, n_split: int, seed: int, h_scaling: float = 0.6) → shammodels::sph::modules::ISPHSetupNode#
make_modifier_warp_disc(self: shamrock.pyshamrock.model_sph.SPHModel_f64_3_M4_SPHSetup, *, parent: shammodels::sph::modules::ISPHSetupNode, Rwarp: float, Hwarp: float, inclination: float, posangle: float = 0.0) → shammodels::sph::modules::ISPHSetupNode#