You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Move force-related methods from State to MechanicalState #6197
The methods addToTotalForces() and removeFromTotalForces() are currently defined in the base State class (lines 116-118 in Sofa/framework/Core/src/sofa/core/State.h). However, these methods are mechanics-specific and should not be in the generic State class.
Rationale
Concept of forces is mechanics-specific: The notion of "force" is inherently tied to mechanical simulations and has no meaning in other physics domains.
Limits State reusability: Having these methods in the base State class prevents State from being reused for other physics simulations such as:
Electrical simulations (where "force" is not applicable)
Thermal simulations (heat flow, not forces)
Other non-mechanical physics
Suggested Solution
Move the following methods from State to MechanicalState:
This would make the base State class truly generic and extensible for any physics domain, while keeping mechanical-specific functionality in MechanicalState.
Impact
This is a refactoring that would improve the architecture's extensibility for non-mechanical physics simulations while maintaining backward compatibility through MechanicalState.
Activity