01.05.2013 Views

C++ et éléments finis Note de cours de DEA (version provisoire)

C++ et éléments finis Note de cours de DEA (version provisoire)

C++ et éléments finis Note de cours de DEA (version provisoire)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

28 CHAPITRE 4. MÉTHODES D’ÉLÉMENTS FINIS P1<br />

4.2.6 Le programme principale<br />

Listing 14 (sfemGC.cpp)<br />

#inclu<strong>de</strong> <br />

#inclu<strong>de</strong> <br />

#inclu<strong>de</strong> <br />

#inclu<strong>de</strong> <br />

#inclu<strong>de</strong> <br />

#inclu<strong>de</strong> "sfem.hpp"<br />

#inclu<strong>de</strong> "RNM.hpp"<br />

#inclu<strong>de</strong> "GC.hpp"<br />

R f(const R2 & ){r<strong>et</strong>urn 1 ;} // right hand si<strong>de</strong><br />

R g(const R2 & ){r<strong>et</strong>urn 0 ;} // boundary condition<br />

R u0(const R2 & ){r<strong>et</strong>urn 0 ;} // initialization<br />

class Laplacien2d: VirtualMatrice { public:<br />

const Mesh & Th ;<br />

type<strong>de</strong>f VirtualMatrice::plusAx plusAx ;<br />

Laplacien2d(const Mesh & T) : Th(T) {} ;<br />

void addMatMul(const KN_ & x, KN_ & Ax) const {<br />

Axi+= <br />

<br />

(∇w<br />

K∈Th K<br />

i |K, ∇w j |K) xj si i n’est pas sur le bord<br />

for (int k=0 ;k

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!