### ForceField based on springs

Description:

SpringForceField components are used to describe a network of springs between particles. If the network of springs references particles belonging to the same mechanical object, the ForceField is said to be internal. Otherwise, if it links several mechanical objects, it is said to be an interaction forcefield. Examples of SpringForceField components in Sofa are JointSpringForceField (for rigid mechanical objects) SpringForceField, and MeshSpringForceField (for deformable mechanical objects).

To describe a SpringForceField, we therefore have to specify the following parameters:

- The two mechanical objects that are in interaction. It can be a unique mechanical object in the case of an internal ForceField.
- A set of pairs of indices which specify the end particles for each spring to be created.
- Finally, the internal parameters of each spring, like the rest length, the stiffness, and damping factor.

Key Points:

- If you have a limited number of particles that you want to connect with springs, you can use JointSpringForceField (for rigid bodies) or SpringForceField (for deformable bodies) and specify manually the indices and spring parameters.
- If you load particles from a mesh using a MeshTopology component, there is a corresponding MeshSpringForceField component which does the job of creating springs for you, leaving you only to specify global parameters for the springs. You can do fine tuning later on if you wish to.

Results:
At each time step, the force computed by the SpringForceField is added to the mechanical objects in interaction. When the spring network becomes large this can result in some instability, particularly if you wish to interact with your object using the mouse. You can tweak spring parameters or the simulation parameters to resolve that issue, (like the vdamping factor if you use an implicit integration scheme) but this can be a fastidious operation.
As a general rule, FEM ForceField methods provide a neater way to handle deformations.
A MeshSpringForceField becoming unstable