gs.options.PBDOptions#

class genesis.options.solvers.PBDOptions(*, dt: float | None = None, gravity: tuple | None = None, max_stretch_solver_iterations: int = 4, max_bending_solver_iterations: int = 1, max_volume_solver_iterations: int = 1, max_density_solver_iterations: int = 1, max_viscosity_solver_iterations: int = 1, particle_size: float | None = 0.01, hash_grid_res: tuple | None = None, hash_grid_cell_size: float | None = None, lower_bound: tuple = (-100.0, -100.0, 0.0), upper_bound: tuple = (100.0, 100.0, 100.0))[source]#

Options configuring the PBDSolver.

Note

If spatial hashing parameters are not given, we will compute them automatically this way: For hash_grid_cell_size, we will set it to be 1.25 * particle_size. For hash_grid_res, if a small bound is given, it’s used for the hash grid; otherwise, we use a default value of a 150^3 cube. Any grid bigger than that will results in too many cells hence not ideal.

Parameters:
  • dt (float, optional) – Time duration for each simulation step in seconds. If none, it will inherit from SimOptions. Defaults to None.

  • gravity (tuple, optional) – Gravity force in N/kg. If none, it will inherit from SimOptions. Defaults to None.

  • max_stretch_solver_iterations (int, optional) – Maximum number of iterations for the solving stretch constraints. Defaults to 4.

  • max_bending_solver_iterations (int, optional) – Maximum number of iterations for the solving bending constraints. Defaults to 1.

  • max_volume_solver_iterations (int, optional) – Maximum number of iterations for the solving volume constraints. Defaults to 1.

  • max_density_solver_iterations (int, optional) – Maximum number of iterations for the solving density constraints. Defaults to 1.

  • max_viscosity_solver_iterations (int, optional) – Maximum number of iterations for the solving viscosity constraints. Defaults to 1.

  • particle_size (float, optional) – Particle diameter in meters. Defaults to 1e-2.

  • hash_grid_res (tuple, optional) – Size of the spatially-repetitive spatial hashing grid in meters. If none, it will be computed automatically. Defaults to None.

  • hash_grid_cell_size (float, optional) – Size of the lattic cell of the spatial hashing grid in meters. This should be at least 1.25 * particle_size. If none, it will be computed automatically. Defaults to None.

  • lower_bound (tuple, shape (3,), optional) – Lower bound of the simulation domain. Defaults to (-100.0, -100.0, 0.0).

  • upper_bound (tuple, shape (3,), optional) – Upper bound of the simulation domain. Defaults to (100.0, 100.0, 100.0).