### Creation of a Scene (4/9)

Description

Now that we have a topology, a mechanical object well initialized, it is time to simulate the deformation of the object. To do so, we add a ForceField to the scene.

You have to choose a ForceField that is compatible with your MechanicalObject. In order to be compatible, the two must use the same template.

Find the MechanicalObject component using the Filter.

Notice that beside MechanicalObject is a dropdown menu with Vec3d selected.

Click the dropdown menu to see the other possible selections.

You will see choices such as Rigid and Vec2f. These are possible templates. Since we didn't concern ourselves with the template when we added the MechanicalObject to our scene, our MechanicalObject uses the default template, Vec3d. This means we won't be able to add ForceFields using Rigid types, for example. Some ForceFields rely on a given topology. Most of the time, their name informs you about the topology the are relying on.

We can see that the SparceGridTopology makes a grid of particles. If these particles were joined by lines going down the rows and columns of these particles, they would become cubes. Cubes have six faces, and are therefore hexahedral. This means that we can use all Hexadedron based ForceFields with the SpaceGridTopology.

Key points

We chose to model our deformation using Finite Elements: HexahedronFEMForceField.

Find and add the HexahedronFEMForceField to the Object node. Go to the Properties 2/2 tab, and change the Young's Modulus from 5000 to "200".
Results

Run in SOFA. To get a better view of the animation, change the DT from 0.02 to "0.001", and animate.

Now you should see the hexahedra corresponding to the Finite Elements. When you animate, you will be able to see the deformation of the cells of the grid.

Related

Modify the young modulus of the FEM force field: the higher, the stiffer will be the model.

Modify the poisson ratio (between 0 and 0.5).

### Previous ____________ Next