shamrock.model_gsph.GSPHModel_f64_3_M6#
- class shamrock.model_gsph.GSPHModel_f64_3_M6#
Bases:
pybind11_objectMethods
Write simulation state to a Shamrock dump file.
Load simulation state from a Shamrock dump file.
Set field value for particles within a box region.
Set field value for particles within a spherical region.
- add_cube_fcc_3d(self: shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6, arg0: float, arg1: f64_3, arg2: f64_3) None#
- add_cube_hcp_3d(self: shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6, arg0: float, arg1: f64_3, arg2: f64_3) None#
- apply_field_from_position_f64(self: shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6, arg0: str, arg1: Callable[[f64_3], float]) None#
- apply_field_from_position_f64_3(self: shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6, arg0: str, arg1: Callable[[f64_3], f64_3]) None#
- dump(self: shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6, filename: str) None#
Write simulation state to a Shamrock dump file.
Uses the shared ShamrockDump mechanism (same as SPH).
Parameters#
- filenamestr
Path to the dump file
Example#
>>> model.dump("checkpoint.shamrock")
- evolve_until(self: shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6, target_time: float, *, niter_max: int = -1) bool#
- gen_default_config(self: shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6) shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6_SolverConfig#
- get_box_dim_fcc_3d(self: shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6, arg0: float, arg1: int, arg2: int, arg3: int) f64_3#
- get_current_config(self: shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6) shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6_SolverConfig#
- get_ideal_fcc_box(self: shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6, arg0: float, arg1: f64_3, arg2: f64_3) tuple[f64_3, f64_3]#
- get_ideal_hcp_box(self: shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6, arg0: float, arg1: f64_3, arg2: f64_3) tuple[f64_3, f64_3]#
- load_from_dump(self: shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6, filename: str) None#
Load simulation state from a Shamrock dump file.
Uses the shared ShamrockDump mechanism (same as SPH).
Parameters#
- filenamestr
Path to the dump file
Example#
>>> model.load_from_dump("checkpoint.shamrock")
- resize_simulation_box(self: shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6, arg0: f64_3, arg1: f64_3) None#
- set_field_in_box(self: shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6, field_name: str, field_type: str, value: object, box_min: f64_3, box_max: f64_3, *, ivar: int = 0) None#
Set field value for particles within a box region.
Useful for setting up discontinuous initial conditions like Sod shock tube.
Parameters#
- field_namestr
Name of the field to set (e.g., “vxyz”, “uint”, “hpart”)
- field_typestr
Type of the field: “f64”, “f64_3”, or “u32”
- valuefloat, tuple, or int
Value to set (type must match field_type)
- box_mintuple
Minimum corner of the box (x, y, z)
- box_maxtuple
Maximum corner of the box (x, y, z)
- ivarint
Variable index for multi-component fields (default: 0)
Examples#
>>> # Sod shock tube: set left state internal energy >>> model.set_field_in_box("uint", "f64", u_left, (-1,-1,-1), (0,1,1)) >>> # Set right state >>> model.set_field_in_box("uint", "f64", u_right, (0,-1,-1), (1,1,1))
- set_field_in_sphere(self: shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6, field_name: str, field_type: str, value: object, center: f64_3, radius: float) None#
Set field value for particles within a spherical region.
Useful for setting up point-source initial conditions like Sedov blast.
Parameters#
- field_namestr
Name of the field to set (e.g., “uint”)
- field_typestr
Type of the field: “f64” or “f64_3”
- valuefloat or tuple
Value to set (type must match field_type)
- centertuple
Center of the sphere (x, y, z)
- radiusfloat
Radius of the sphere
Examples#
>>> # Sedov blast: inject energy in central sphere >>> model.set_field_in_sphere("uint", "f64", u_blast, (0,0,0), r_blast)
- set_solver_config(self: shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6, arg0: shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6_SolverConfig) None#
- timestep(self: shamrock.pyshamrock.model_gsph.GSPHModel_f64_3_M6) shammodels::gsph::TimestepLog#