Game Development Reference

In-Depth Information

void
buildKe(CMatrix &Ke,
//Stiffness matrix (out)

CPoint3d
const
&x1,
//Element vertex (in)

CPoint3d
const
&x2,
//Element vertex (in)

CPoint3d
const
&x3,
//Element vertex (in)

CPoint3d
const
&x4,
//Element vertex (in)

float
mu,
//Physical parameter (in)

float
lambda)
//Physical parameter (in)

{
CMatrix Be(6,12),E(6,6),Pe(4,4);

float
vol,mr;
//Element volume

buildBarycentric(Pe, x1, x2, x3, x4);

vol = 1.0/(Pe.det()
∗
6);

buildBe(Be,Pe);

E.loadZero();

mr=2
∗
mu+lambda;

E(0,0) = mr; E(0,1) = lambda; E(0,2) = lambda;

E(1,0) = lambda; E(1,1) = mr; E(1,2) = lambda;

E(2,0) = lambda; E(2,1) = lambda; E(2,2) = mr;

E(3,3) = mu; E(4,4) = mu; E(5,5) = mu;

Ke= vol
∗
Be.transpose()
∗
E
∗
Be;

}

Listing 10.3.
Building matrix

K
e
.

A range of standard methods exist to solve this system: Gauss elimination,

Cholesky factorization, and conjugate gradient, to name just a few. In Section 10.4,

we briefly describe some of them.

An important requirement to solve the static system in Equation (10.13) and

find the displacements is to fix and keep hold of at least three nodes (or nine

degrees of freedom), otherwise the system is singular, meaning that no unique

solution exists. This can be intuitively explained by the fact that without any

boundary conditions or prescribed positions, the body has no unique position in

space, and because there is no unique position, there is no unique deformation.

Boundary conditions are also used as a manner of applying external loads to the

body. Refer to Section 10.3.5 for more details on this subject.

Note that the system does not depend on time, meaning that if we simulate

it, the object
jumps
from one configuration to another without taking into ac-

count any previous configuration. The deformed shape of the body is defined

exclusively by the material properties of the object and the applied forces at that

instant. If the applied forces are removed, the object returns instantaneously to its

rest position; there are no dynamics on the system.