MPMSolver#
The MPMSolver implements the Material Point Method (MPM) for simulating elastic solids, granular materials, fluids, and phase transitions. It combines Lagrangian particles that track material points with a background Eulerian grid that solves the momentum equations, transferring between them with the moving least squares material point method (MLS-MPM) scheme, which fuses stress and the affine velocity field into one transfer. The materials it supports are listed in MPM. For usage, see Beyond rigid bodies.
Options#
- class genesis.options.solvers.MPMOptions(*, use_sparse_grid: bool = False, leaf_block_size: int = 8, dt: float | None = None, gravity: tuple[float, float, float] | None = None, particle_size: float | None = None, grid_density: float = 64, enable_CPIC: bool = False, lower_bound: tuple[float, float, float] = (-1.0, -1.0, 0.0), upper_bound: tuple[float, float, float] = (1.0, 1.0, 1.0)) None[source]#
Options configuring the MPMSolver.
Note
MPM is a hybrid lagrangian-eulerian method for simulating soft materials. In the eulerian phase, it uses a grid representation. The
upper_boundandlower_boundspecify the simulation domain, but a safety padding will be added to the actual grid boundary. Therefore, the actual boundary could be slightly tighter than the specified one. Note that the size of the domain affects the performance of the simulation, hence you should set it as tight as possible.- Parameters:
particle_size (float, optional) – Particle diameter in meters. If not given, we will compute
particle_sizebased ongrid_density, whereparticle_sizewill be linearly proportional to the grid cell size. A reference value isparticle_size = 0.01forgrid_density = 64. Defaults to None.grid_density (float, optional) – Number of grid cells per meter. Defaults to 64.
enable_CPIC (bool, optional) – Whether to enable CPIC (Compatible Particle-in-Cell) to support coupling with thin objects. Defaults to False.
lower_bound (tuple, shape (3,), optional) – Lower bound of the simulation domain. Defaults to (-1.0, -1.0, 0.0).
upper_bound (tuple, shape (3,), optional) – Upper bound of the simulation domain. Defaults to (1.0, 1.0, 1.0).
use_sparse_grid (bool, optional) – This option is deprecated.
leaf_block_size (int, optional) – This option is deprecated.
MPMSolver#
- class genesis.engine.solvers.mpm_solver.MPMSolver(scene: Scene, sim: Simulator, options: MPMOptions)[source]#
Bases:
GravityMixin,TimeBasedMixin,Solver- material_cls#
alias of
Base
- property is_active#
- add_entity(idx, material, morph, surface, visualize_contact=False, name: str | None = None, desc=None) MPMEntity[source]#
- compute_F_tmp(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>)[source]#
- compute_F_tmp_and_svd(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>)[source]#
- compute_F_tmp_only(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>)[source]#
- p2g(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 0x797f41beddf0>)[source]#
- g2p(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>, geoms_info: ~genesis.utils.array_class.GeomsInfo, links_state: ~genesis.utils.array_class.LinksState, rigid_info: ~genesis.utils.array_class.RigidInfo)[source]#
- copy_frame(source: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>, target: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>)[source]#
- copy_grad(source: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>, target: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>)[source]#
- reset_grid_and_grad(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>)[source]#
- reset_dirty_cells(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>)[source]#
- reset_grad_till_frame(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>)[source]#
- add_grad_from_pos(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>, pos_grad: NdarrayType(dtype=None, ndim=None, layout=Layout.AOS, needs_grad=None))[source]#
- add_grad_from_vel(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>, vel_grad: NdarrayType(dtype=None, ndim=None, layout=Layout.AOS, needs_grad=None))[source]#
- add_grad_from_C(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>, C_grad: NdarrayType(dtype=None, ndim=None, layout=Layout.AOS, needs_grad=None))[source]#
- add_grad_from_F(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>, F_grad: NdarrayType(dtype=None, ndim=None, layout=Layout.AOS, needs_grad=None))[source]#
- add_grad_from_Jp(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>, Jp_grad: NdarrayType(dtype=None, ndim=None, layout=Layout.AOS, needs_grad=None))[source]#
- apply_particle_constraints(f: <quadrants._lib.core.quadrants_python.DataTypeCxx object at 0x798033d1b9b0>, links_state: ~genesis.utils.array_class.LinksState)[source]#
- property n_particles#
- property n_vverts#
- property n_vfaces#
- property grid_density#
- property particle_size#
- property particle_radius#
- property upper_bound#
- property lower_bound#
- property leaf_block_size#
- property use_sparse_grid#
- property dx#
- property inv_dx#
- property particle_volume_real#
- property particle_volume#
- property particle_volume_scale#
- property is_built#
- property lower_bound_cell#
- property upper_bound_cell#
- property grid_res#
- property grid_offset#
- property enable_CPIC#
- property enable_particle_constraints#