newton.solvers.SolverBase#
- class newton.solvers.SolverBase(model)[source]#
Bases:
objectGeneric base class for solvers.
The implementation provides helper kernels to integrate rigid bodies and particles. Concrete solver back-ends should derive from this class and override
step()as well asnotify_model_changed()where necessary.- classmethod register_custom_attributes(builder)#
Register custom attributes for the solver.
- Parameters:
builder (ModelBuilder) – The model builder to register the custom attributes to.
- __init__(model)#
- integrate_bodies(model, state_in, state_out, dt, angular_damping=0.0)#
Integrate the rigid bodies of the model.
- integrate_particles(model, state_in, state_out, dt)#
Integrate the particles of the model.
- notify_model_changed(flags)#
Notify the solver that parts of the
Modelwere modified.The flags argument is a bit-mask composed of the
SolverNotifyFlagsenums defined innewton.solvers. Each flag represents a category of model data that may have been updated after the solver was created. Passing the appropriate combination of flags enables a solver implementation to refresh its internal buffers without having to recreate the whole solver object. Valid flags are:Constant
Description
SolverNotifyFlags.JOINT_PROPERTIESJoint transforms or coordinates have changed.
SolverNotifyFlags.JOINT_DOF_PROPERTIESJoint axis limits, targets, modes, DOF state, or force buffers have changed.
SolverNotifyFlags.BODY_PROPERTIESRigid-body pose or velocity buffers have changed.
SolverNotifyFlags.BODY_INERTIAL_PROPERTIESRigid-body mass or inertia tensors have changed.
SolverNotifyFlags.SHAPE_PROPERTIESShape transforms or geometry have changed.
SolverNotifyFlags.MODEL_PROPERTIESModel global properties (e.g., gravity) have changed.
- Parameters:
flags (int) – Bit-mask of model-update flags indicating which model properties changed.
- step(state_in, state_out, control, contacts, dt)#
Simulate the model for a given time step using the given control input.