gs.options.FEMOptions#
- class genesis.options.solvers.FEMOptions(*, dt: float | None = None, gravity: tuple | None = None, damping: float | None = 0.0, floor_height: float = None, use_implicit_solver: bool = False, n_newton_iterations: int = 1, n_pcg_iterations: int = 500, n_linesearch_iterations: int = 0, newton_dx_threshold: float = 1e-06, pcg_threshold: float = 1e-06, linesearch_c: float = 0.0001, linesearch_tau: float = 0.5, damping_alpha: float = 0.5, damping_beta: float = 0.0005, enable_vertex_constraints: bool = False)[source]#
Options configuring the FEMSolver.
Note
Damping coefficients are used to control the damping effect in the simulation.
They are used in the Rayleigh Damping model, which is a common damping model in FEM simulations. Reference: https://doc.comsol.com/5.5/doc/com.comsol.help.sme/sme_ug_modeling.05.083.html - TODO Move it to material parameters in the future instead of solver options.
- 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.
damping (float, optional) – Damping factor. Defaults to 0.0.
floor_height (float, optional) – Height of the floor in meters. If none, it will inherit from SimOptions. Defaults to None.
use_implicit_solver (bool, optional) – Whether to use the implicit solver. Defaults to False. Implicit solver is a more stable solver for FEM. It can be used with a large time step.
n_newton_iterations (int, optional) – Maximum number of Newton iterations. Defaults to 1. Only used when use_implicit_solver is True.
n_pcg_iterations (int, optional) – Maximum number of PCG iterations. Defaults to 500. Only used when use_implicit_solver is True.
n_linesearch_iterations (int, optional) – Maximum number of line search iterations. Defaults to 0. Only used when use_implicit_solver is True.
newton_dx_threshold (float, optional) – Threshold for the Newton solver. Defaults to 1e-6. Only used when use_implicit_solver is True.
pcg_threshold (float, optional) – Threshold for the PCG solver. Defaults to 1e-6. Only used when use_implicit_solver is True.
linesearch_c (float, optional) – Line search sufficient decrease parameter. Defaults to 1e-4. Only used when use_implicit_solver is True.
linesearch_tau (float, optional) – Line search step size reduction factor. Defaults to 0.5. Only used when use_implicit_solver is True.
damping_alpha (float, optional) – Rayleigh Damping factor for the implicit solver. Defaults to 0.5. Only used when use_implicit_solver is True.
damping_beta (float, optional) – Rayleigh Damping factor for the implicit solver. Defaults to 5e-4. Only used when use_implicit_solver is True.
enable_vertex_constraints (bool, optional) – Whether to enable vertex constraints. Defaults to False.