newton.solvers.SolverImplicitMPM#

class newton.solvers.SolverImplicitMPM(model, options)[source]#

Bases: SolverBase

Implicit MPM solver.

This solver implements an implicit MPM algorithm for granular materials, roughly following [1] but with a GPU-friendly rheology solver.

This variant of MPM is mostly interesting for very stiff materials, especially in the fully inelastic limit, but is not as versatile as more traditional explicit approaches.

[1] https://doi.org/10.1145/2897824.2925877

Parameters:
  • model (Model) – The model to solve.

  • options (ImplicitMPMOptions) – The solver options.

Returns:

The solver.

Options#

alias of ImplicitMPMOptions

static enrich_state(state)#

Enrich the state with additional fields for tracking particle strain and deformation.

__init__(model, options)#
collect_collider_impulses(state)#

Returns the list of collider impulses and the positions at which they are applied.

Note: the identifier of the collider is not included in the returned values but can be retrieved from the state as state.collider_ids.

project_outside(state_in, state_out, dt)#

Projects particles outside of the colliders

sample_render_grains(state, particle_radius, grains_per_particle)#

Create point samples for rendering at higher resolution than the simulation particles. Point samples are advected passievely with the continuum velocity field while being constrained to lie within the affinely deformed simulation particles.

setup_collider(model, colliders=None, collider_thicknesses=None, collider_projection_threshold=None, collider_masses=None, collider_friction=None)#

Setups the collision geometry for the implicit MPM solver.

Parameters:
  • model (Model) – The model to read ground collision properties from.

  • colliders (list[Mesh] | None) – A list of warp triangular meshes to use as colliders.

  • collider_thicknesses (list[float] | None) – The thicknesses of the colliders.

  • collider_projection_threshold (list[float] | None) – The projection threshold for the colliders, i.e, the maximum acceptable penetration depth before projecting particles out.

  • collider_masses (list[float] | None) – The masses of the colliders.

  • collider_friction (list[float] | None) – The friction coefficients of the colliders.

step(state_in, state_out, control, contacts, dt)#
update_particle_frames(state_prev, state, dt, min_stretch=0.25, max_stretch=2.0)#

Updates the particle frames to account for the deformation of the particles

update_render_grains(state_prev, state, grains, particle_radius, dt)#

Advect the render grains at the current time step