Upcoming Events
Unite 2010
11/10 - 11/12 @ Montréal, Canada

GDC China
12/5 - 12/7 @ Shanghai, China

Asia Game Show 2010
12/24 - 12/27  

GDC 2011
2/28 - 3/4 @ San Francisco, CA

More events...
Quick Stats
66 people currently visiting GDNet.
2406 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!
Link to us Events 4 Gamers
Intel sponsors gamedev.net search:

Contents
 Introduction
 Preliminary discussion
 Finite Element
 Method

 Adaptation of the
 FEM

 Appendix

 Printable version
 Discuss this article
 in the forums


The Series
 Part 1
 Part 2
 Part 3 (coming soon)

Adaptation of the FEM

General procedure

Here are the common steps for a calculation based on the FEM:

Pre-processing     Property of the material,
geometric shape of the body
  Data entry
   
  Computation step
Meshing (the division of the body is done into finite elements)
Computation of each stiffness matrix
Construction of the global matrix
     
Solution     Boundary conditions (degree of freedom, loading)
Application of the boundary conditions
Resolution of the system
   
Post-Processing     Display results

FEM in real-time

In current applications displayed in the previous pictures, the number of nodes and consequently the number of unknowns are very important. To find the displacements of the nodes, we must resolve the linear system . depends only on the geometry, the characteristics of the material, the number and the shape of the finite elements. Consequently, and it is the most important, the matrix doesn't depend on the applied forces.


K doesn't depend of the loading conditions

To resolve the matrix system, finite element applications use Gauss elimination, substitution or Newton-Raphson methods. These methods manipulate the second member of the equation (i.e. force vector ), and of course these methods are the fastest. For example, the computation time to resolve a system within 10 000 degrees of freedom is about one minute. Of course it is not in real time. Let us try another trick to resolve the system. This trick is to resolve the system independently of the force vector.

Resolution in two steps

The solution is to compute the inverse of the matrix. But everyone knows that the inversion of matrix is a slow computation, but does it matter? If the solution doesn't depend on the force vector, the system is resolved before the beginning of the application. In more precise terms, the inverse of the matrix is stored in a file and loaded during the initialization of the application (typically during the loading of a game level).

   
Classic method Construction of the global matrix;
Application of the boundary conditions.
Loading of the global matrix
Application of the boundary conditions;
Resolution with Gauss of the system
Adapted method Construction of the global matrix;
Application of the boundary conditions;
Inversion of the global matrix.
Loading of the inversed global matrix
Matrix multiplication
  Construction of the level Loading of the level Execution of the level - Step in real-time

The drawback of this method is that the boundary conditions are fixed and could not change. In fact, to inverse the matrix, simplification is done according to the boundary conditions. In the next part, called Study of a case, the detailed procedure will be explained.

Two steps and two tools

In a part of the introduction called "Hyperion Project", some units have been presented. The most important is the set of components called Ephydryne Components. These components have been developed with the Hyperion Pattern framework. The Ephydryne package defines a set of interfaces and implementes components to make the appropriate computing steps of the finite element method. Two tools have been set up to use the capabilities of the Ephydryne Components.

HypDev

It is a client application that uses the Ephydryne components. The goal of HypDev is to calculate the linear relations between the forces applied on the rigid bodies and the deformations. According to the method presented in this article, the linear relation is computed during the development of the level. Again the linear relation is consequently loaded during the execution of the level. So an important part of the computation is not done during the game (step which is in real-time).

HypVisual

The step which is in real time is studied with the application called HypVisual. This application loads the file generated by HypDev, displays the body and manages the simulation.

Here are some screenshots from the application:


The two tools used the same set of components

For more information about these two applications, go to the web site of the project at http://sourceforge.net/projects/ephydryne/.

Here below is summarized the general process of the method:

    Property of the material,
geometric shape of the body, boundary conditions, degree of freedoms
  Data entry
   
  Computation step
 
 
Meshing (the division of the body is done into finite elements)  
 
Computation of each stiffness matrix  
 
Construction of the global matrix  
 
Application of the boundary conditions  
 
Inversion of the global matrix  
 
Saving of the matrix
       
    Loading of the matrix  
 
Loading conditions  
 
Resolution of the system
 
 
Display results  




Next : Appendix