External Force for Finite Element
#671 FiniteElementExternalForce
The Finite Element External Force applies external 3D forces to individual vertices of finite element meshes through a constraint mechanism, enabling per-vertex force control for effects such as wind, applied loads, or user-driven interactions.
The external force is applied as acceleration per vertex:
where:
- \(\mathbf{F}_{ext,i} \in \mathbb{R}^{3}\) is the external force vector at vertex \(i\)
- \(m_i \in \mathbb{R}\) is the lumped mass at vertex \(i\)
- \(\mathbf{a}_{ext,i} \in \mathbb{R}^{3}\) is the resulting acceleration at vertex \(i\)
The energy function for the Finite Element External Force will be incorporated into the FEM Kinetic Term as:
where \(\tilde{\mathbf{x}}_i\) is the predicted position updated each time step by the velocity, gravity, and external acceleration. The exact formula depends on the time integration scheme used.
Typically, when bdf1 (implicit Euler) is used:
where \(\mathbf{x}_i^t\) is the position of vertex \(i\) at time \(t\), \(\mathbf{v}_i^t\) is the velocity at time \(t\), \(\Delta t\) is the time step size, and \(\mathbf{g}\) is the gravitational acceleration.
When bdf2 is used, the external acceleration \(\mathbf{a}_{ext,i}\) is combined with gravity before being passed to the BDF2 predictor:
Users are allowed to modify the external force \(\mathbf{F}_{ext,i}\) per vertex using the uipc Animator System interface during the simulation.
Attributes
On vertices:
external_force: \(\mathbf{F}_{ext,i} \in \mathbb{R}^3\) per-vertex external force vectoris_constrained: flag indicating whether the vertex is subject to external force (\(1\) = enabled, \(0\) = disabled)