LegacyCoupler#
The LegacyCoupler is the default: a scene that names no coupler_options gets it. It handles every cross-solver pair (rigid, MPM, SPH, PBD, FEM), which suits general multi-physics scenes. It is slated for deprecation in favor of the SAP and IPC couplers.
Options#
- class genesis.options.solvers.LegacyCouplerOptions(*, rigid_mpm: bool = True, rigid_sph: bool = True, rigid_pbd: bool = True, rigid_fem: bool = True, mpm_sph: bool = True, mpm_pbd: bool = True, fem_mpm: bool = True, fem_sph: bool = True) None[source]#
Options configuring the inter-solver coupling.
- Parameters:
rigid_mpm (bool, optional) – Whether to enable coupling between rigid and MPM solvers. Defaults to True.
rigid_sph (bool, optional) – Whether to enable coupling between rigid and SPH solvers. Defaults to True.
rigid_pbd (bool, optional) – Whether to enable coupling between rigid and PBD solvers. Defaults to True.
rigid_fem (bool, optional) – Whether to enable coupling between rigid and FEM solvers. Defaults to True.
mpm_sph (bool, optional) – Whether to enable coupling between MPM and SPH solvers. Defaults to True.
mpm_pbd (bool, optional) – Whether to enable coupling between MPM and PBD solvers. Defaults to True.
fem_mpm (bool, optional) – Whether to enable coupling between FEM and MPM solvers. Defaults to True.
fem_sph (bool, optional) – Whether to enable coupling between FEM and SPH solvers. Defaults to True.
LegacyCoupler#
- class genesis.engine.couplers.legacy_coupler.LegacyCoupler(simulator: Simulator, options: LegacyCouplerOptions)[source]#
Bases:
RBCThis class handles all the coupling between different solvers. LegacyCoupler will be deprecated in the future.
- mpm_grid_op(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>, t: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1ae70>, geoms_state: ~genesis.utils.array_class.GeomsState, geoms_info: ~genesis.utils.array_class.GeomsInfo, links_state: ~genesis.utils.array_class.LinksState, rigid_info: ~genesis.utils.array_class.RigidInfo, sdf_info: ~genesis.utils.array_class.SDFInfo, collider_static_config: <quadrants.types.annotations.Template object at 0x797f48843e60>)[source]#
- mpm_surface_to_particle(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>, geoms_state: ~genesis.utils.array_class.GeomsState, geoms_info: ~genesis.utils.array_class.GeomsInfo, sdf_info: ~genesis.utils.array_class.SDFInfo, rigid_info: ~genesis.utils.array_class.RigidInfo, collider_static_config: <quadrants.types.annotations.Template object at 0x797f488453d0>)[source]#
- fem_surface_force(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>, geoms_state: ~genesis.utils.array_class.GeomsState, geoms_info: ~genesis.utils.array_class.GeomsInfo, links_state: ~genesis.utils.array_class.LinksState, rigid_info: ~genesis.utils.array_class.RigidInfo, sdf_info: ~genesis.utils.array_class.SDFInfo, collider_static_config: <quadrants.types.annotations.Template object at 0x797f48847fe0>)[source]#
- fem_hydroelastic(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>)[source]#
- sph_rigid(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>, geoms_state: ~genesis.utils.array_class.GeomsState, geoms_info: ~genesis.utils.array_class.GeomsInfo, links_state: ~genesis.utils.array_class.LinksState, links_info: ~genesis.utils.array_class.LinksInfo, rigid_info: ~genesis.utils.array_class.RigidInfo, sdf_info: ~genesis.utils.array_class.SDFInfo, collider_static_config: <quadrants.types.annotations.Template object at 0x797f48844980>)[source]#
- kernel_pbd_rigid_collide(geoms_state: ~genesis.utils.array_class.GeomsState, geoms_info: ~genesis.utils.array_class.GeomsInfo, links_state: ~genesis.utils.array_class.LinksState, sdf_info: ~genesis.utils.array_class.SDFInfo, rigid_info: ~genesis.utils.array_class.RigidInfo, collider_static_config: <quadrants.types.annotations.Template object at 0x797f4874deb0>)[source]#
- kernel_attach_pbd_to_rigid_link(particles_idx: NdarrayType(dtype=None, ndim=None, layout=Layout.AOS, needs_grad=None), envs_idx: NdarrayType(dtype=None, ndim=None, layout=Layout.AOS, needs_grad=None), link_idx: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>, links_state: ~genesis.utils.array_class.LinksState) None[source]#
Sets listed particles in listed environments to be animated by the link.
Current position of the particle, relatively to the link, is stored and preserved.
- kernel_pbd_rigid_clear_animate_particles_by_link(particles_idx: NdarrayType(dtype=None, ndim=None, layout=Layout.AOS, needs_grad=None), envs_idx: NdarrayType(dtype=None, ndim=None, layout=Layout.AOS, needs_grad=None)) None[source]#
Detach listed particles from links, and simulate them freely.
- kernel_pbd_rigid_solve_animate_particles_by_link(clamped_inv_dt: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1ae70>, links_state: ~genesis.utils.array_class.LinksState)[source]#
Itearates all particles and environments, and sets corrective velocity for all animated particle.
Computes target position and velocity from the attachment/reference link and local offset position.
Note, that this step shoudl be done after rigid solver update, and before PDB solver update. Currently, this is done after both rigid and PBD solver updates, hence the corrective velocity is off by a frame.
Note, it’s adviced to clamp inv_dt to avoid large jerks and instability. 1/0.02 might be a good max value.
- property active_solvers#
All the active solvers managed by the scene’s simulator.