Sunteți pe pagina 1din 64

NBCR Summer Institute 2006:

Multi-Scale Cardiac Modeling with


Continuity 6.3

Wednesday:
Finite Element Discretization and
Anatomic Mesh Fitting

Andrew McCulloch and Fred Lionetti


The Finite Element Method
• Evolved first from the matrix methods of structural
analysis in the early 1960’s
• Uses the algorithms of linear algebra
• Later found to have a more fundamental foundation
• The essential features are in the formulation
• There are two alternative formulations that are broadly
equivalent in most circumstances
– Variational formulations, e.g. the Rayleigh-Ritz method
– Weak or weighted residual formulations, e.g.the
Galerkin method
• Both approaches lead to integral equations instead of
differential equations (the strong form)
The Finite Element Method
• Solution is discretized using a finite number of functions
– Piecewise polynomials (elements)
– Continuity across element boundaries ensured by
defining element parameters at nodes with associated
basis functions, 
23 24
14 15
21 22
12 13

• FE equations are derived from the weak form of the


governing equations
Finite differences: R = 0
Finite elements: R = 0
The Finite Element
• Method
Integrate governing equations in each element
• Assemble global system of equations by adding
contributions from each element
23 24 7 8
14 15
3 4
21 22
12 13 L OL O LO
5 6 M
M P
PM
M P
P M
MP
P
M
M P
PM
M P
P M
MP
P
M
M
M
Global equations P
P
P
M
M
M
P
P
P
M
M
M
P
P
P
M
M P
PM
M P
P M
MP
P
1 2 M
M P
PM
M P
P M
MP
P
M
M P
PM
M P
P M
MP
P
M
M P
PM
M P
P M
MP
P
M
M P
PM
M P MP
        P M
P
M
M P
PM
M P
P
M
MP
P
Element equations
       
M PMP M
P
M PM

P MP
       
M         PMP M
P

L
M
k k12 k13 k14 k15 k16 k17 k18 O
L
P
M
u OL
P
fO
M
M
M P
PM
M P
P M
MP
P
f P
M PM P MP


11 1 1
M PM P MP
M
M
k k22 k23 k24 k25 k26 k27 k28 P
M
P
M
u P M P M
M P
PM
M P
P M
MP
P
u P Mf P
21 2 2
M
M P
PM
M P
P M
MP
P
k k32 k33 k34 k35 k36 k37 k38
M
M
31

k k42 k43 k44 k45 k46 k47 k48


P
M
P
M PM
3

u P M
P
f P
3 M
M
M
M
   
   
   
   
P
P
P
P
M
M
M
M
P
P
P
P
M
P
M
MP
P
M
P

M P
Mu P Mf P
M PM P MP
41 4 4        
 M         PMP M
P

M
M
k
51

k
k52
k62
k53
k63
k54
k64
k55
k65
k56
k66
k57
k67
k58
k68
P
M
P
M P5

u P M
M P
f P
5 M
M
M
M
P
P
P
P
M
M
M
M
P
P
P
P
M
M
M
M
P
P
P
P
M
M
61

k k72 k73 k74 k75 k76 k77 k78 P


M
P
Mu P M
P
6

f P
M P
6 M
M
M
M
P
P
P
P
M
M
M
M
P
P
P
M
M
M
P
P
P
MP M
MP
71 7 7

M
Nk
81 k82 k83 k84 k85 k86 k87 k88 P
M
Q
Nu P
QM
8 f P
N Q 8
M
N PN
Q P
Q NP
Q
Integral Formulations
Consider the strong form of a linear partial differential
equation, e.g. 3-D Poisson’s equation with zero boundary
conditions:  2u  2u  2u
    f ( x, y , z )
x 2
y 2
z 2 On region R

u 0 on boundary S

Strong Form Lu = f
Variational Principle, e.g. minimum potential energy
u  min  (Lv  2f )  v d V
v R

Weighted Residual (weak) form, e.g. virtual work


 (Lu  f )  w d V  0
R
Weak Form for 2-D Poisson’s Equation
 2u  2u
   f ( x, y )
x 2
y 2 On region S

u0 on boundary C

Weak form
  2u  2u 
   2  2   w d xdy   f  w d xdy
S  x y  S

Integrate by parts
0 0
 u w u w  u u
S  x x y y 
 d xd y  C y w d x  C x w d y  S f  w d xdy

Where, u and w vanish at the boundary


Galerkin’s Method for 2-D Poisson’s Equation
• Choose a finite set of approximating (trial) functions,
i(x,y), i = 1, 2, …, N
• Allow approximations to u in the form
U(x,y) = U11 + U22 + U33 + … + UNN
(that can also satisfy the essential boundary conditions)
• Solve N discrete equations for U1, U2, U3, …, UN

 1  N   i  1  N   i 
  1 x
U  ...  U N 
x  x 
  U1
y
 ...  U N 
y  y 
dxdy
S
  f i dxdy
s

  K ijU j  Fi 
j
Galerkin’s Method for 2-D Poisson’s
Equation
[K]U = F

[K] is the stiffness matrix and F is the load (RHS) vector

  i  j  i  j 
K ij     dxdy  K ji
S
x x y y 
Fi   f i dxdy
S

[K] is symmetric and positive definite


Comments on Galerkin’s Method
• Galerkin is more general than Rayleigh-Ritz. If we add u/x, symmetry
& the variational principle are lost, but Galerkin still works
• If w is chosen as Dirac delta functions at N points, weighted residuals
reduces to the collocation method
• If w is chosen as the residual functions Lu-f, weighted residuals reduces
to the least squares method
• By choosing w to be the approximating functions, Galerkin’s method
requires the error (residual) in the solution to be orthogonal to the
approximating space.
• The integration by parts (Green-Gauss theorem) automatically
introduces the Neumann (natural) boundary conditions
• The Dirichlet (essential) boundary conditions must be satisifed explicitly
when solving [K]U=F
• Since discretized integrals are sums, contributions from many elements
are assembled into the global stiffness matrix by addition.
• The Ritz-Galerkin FEM finds the approximate solution that minimizes the
error in the energy
Steps in the Finite Element Method
1. Formulate the weighted residual (weak form)
2. Integrate by parts (or Green-Gauss Theorem)
 reduces derivative order of differential operator
 naturally introduces derivative (Neumann) boundary
conditions, e.g. flux or traction. Hence called that
natural boundary condition
3. Discretize the problem
 discretize domain into subdomains (elements)
 discretize dependent variables using finite
expansions of piecewise polynomial interpolating
functions (basis functions) weighted by parameters
defined at nodes
Steps in the Finite Element Method (…cont’d)
4. Derive Galerkin finite element equations
 substitute dependent variable approximation in
weighted residual integral
 Choose weight functions to be interpolating
functions — the Galerkin assumption (Galerkin,
1906)
5. Compute element stiffness matrices and RHS
 integrate Galerkin equations over each element
subdomain
 integrate right-hand side to obtain element load
vectors which also include any prescribed Neumann
boundary conditions
Steps in the Finite Element Method (…cont’d)
6. Assemble global stiffness matrix and load vector
 Add element matrices and RHS vectors into global
system of equations
 Structure of global matrix depends on node ordering
7. Apply essential (i.e. Dirichlet) boundary conditions
 at least one is required (essential) for a solution
 prescribed values of dependent variables at specified
boundary nodes, e.g. prescribed displacements
 eliminate corresponding rows and columns from
global stiffness matrix and transfer column effects of
prescribed values to Right Hand Side
  the constraint reduced system
Steps in the Finite Element Method (…cont’d)

8. Solve global equations


 for unknown nodal dependent variables
 using algorithms for Ax = b or Ax = x
9. Evaluate element solutions
 interpolate dependent variables
 evaluate derivatives, e.g. fluxes
 derived quantities, e.g. stresses or strain energy
 graphical visualization; post-processing
10. Test for convergence
 refine finite element mesh and repeat solution
Galerkin FEM: Simple 1-D Example
d2 u
2
dx 2 solution
u(1)  0 u ( x )  ( x  1)2
u(4)  9
U4=9
8

6
u
4 U3 =?

2
U2=?

U1=0
1 2 3 4
x
1. Formulate the weighted residual (weak) form

 (Lu  f )  w d x  0
R

d u 
2
4

 w  2w  d x  0
 dx 
2
1

2. Integrate by parts (or Green-Gauss Theorem)


4
4
 du dw   du 
  2w  d x   w   0
1
 dx dx   dx  1
3. Discretize the problem

• 4 global nodal parameters U1, U2, U3, U4


• 3 linear elements each with 2 element nodal
parameters u1, u2.
• Adjacent elements share global nodal parameters,
e.g., global parameter U2 is element parameter u2 of
element 1 and u1 of element 2.
• Two (linear) element interpolation functions for each
element, i(x), i = 1, 2
• Allow element approximations to u in the form
u(x) = u1 1 + u2 2 = ui i i=1,2
Element Basis Functions

1
1 2

0.5

0
element basis functions
0 0.5 1
x
4. Derive Galerkin equations for each element

2 3
 du dw   du dw 
   dx dx  2w  d x     dx dx  2w  d x
1 2


4
 
3
du dw
dx dx

 2w  d x 

du
 
4
w 0
dx 1

In each element, let


u(x)  u1 1 + u2 2 = ui i (x)
and
w(x)  i (x)
4. Derive Galerkin equations for each element (… cont’d)

e.g. for Element 1 (no derivative boundary conditions):

2
 d d  d 2

 u u 1
 d x   2 dx
2 i

 dx dx  dx
1 2 i
1 1

  k u   f ij j i
j

[k] = [(kij)] is the element stiffness matrix

f = (fi) is the element load vector


5. Compute element stiffness matrices

[k]u = f
Element stiffness matrix, [k] and load (RHS) vector, f
 
k   dx  k
i j

x x
ij ji

f   2 dx
i i

Element 1 : 2
2 1
 1  x x
1  2  x [k]( ele 1)    dx  
 x 1
1 
 1
2  x  1 1 x
 1 1 
 [k]( ele 1)   
 1  1
5. Compute element RHS matrices
fi   2idx
Element 1 : 2
2 4  2x
  4 x  x
2
1  2  x f( ele 1)     dx   
1
2 x  2  2
2  x  1  x  2x 1
(8  4)  ( 4  1) 1
 f( ele 1)    
( 4  4)  (1  2) 1

In this problem, each element is the same size and thus:


[k](ele 1) = [k](ele 2) = [k](ele 3)
and:
f(ele 1) = f(ele 2) = f(ele 3)
6. Assemble global stiffness matrix and load vector

 1 1   1 1 0 0
 1  1 1 1   1 2 1 
0
[K]     
 1  1  1 1  0 1 2 1
   
 1 1  0 0 1 1

1      1
1 1   2
F    
  1 1 2
       
    1  1
7. Apply essential (i.e. Dirichlet) boundary conditions
[K]U  F
 1 1 0 0  U1   1
 1 2 1
 0 U2  2

0 1 2 1 U3  2
    
0 0 1 1 U 4   1

u (1)  U1  0
u ( 4 )  U4  9
That leaves global equations 2 and 3
0  2U2  U3  2
U2  2U3  9  2
8. Solve global equations (constraint-reduced)

0  2U2  U3  2 U2  1
 Exact!
U2  2U3  9  2 U3  4
Representing a One-Dimensional Field

Use a polynomial expression u( x )  a  bx  cx 2  dx 3  ...


and estimate the monomial coefficients a, b, c and d
• Polynomials are convenient, differentiated and integrated readily
• For low degree polynomials this is satisfactory
• If the polynomial order is increased further to improve the accuracy,
it oscillates unacceptably
• Divide domain into subdomains and use low order piecewise
polynomials over each subdomain – called elements
Making Piecewise Polynomials Continuous

• constrain the parameters to ensure continuity of u


across the element boundaries
• or better, replace the parameters a and b in the first
element with parameters u1 and u2, which are the
values of u at the two ends of that element:

u( )  (1   )u1  u2


where  (0    1) is a normalized measure of
distance along the curve
u u = u(x)
u = a + bx u = c + dx u = e + fx
+
+
+ + + +
+ + +
+ + +
+
x
u
u = (1- ) u1 + u 2
u1
+ nodes u3
0 +
+ + + +
 + + +
+ + +
1 u2
+ u4
element 1 element 2 element 3
x
Linear Lagrange Interpolation

1
u = 1- 
u = (1- ) u1 + u2
u1

0 1

u2

 1
0 1 = 


0 1
Global-Element Mapping
• Associate the nodal quantity un with element node n
• Map the value U defined at global node  onto local node n of
element e by using a connectivity matrix  (n, e),
un  U( n,e )

Thus, in the first element

u( )   1 ( )u1   2 ( )u2


with u1=U1 and u2=U2..
In the second element u is
interpolated by
u( )   1 ( )u1   2 ( )u2
With u1=U2 and u2=U3.
Isoparametric Interpolation
We have u () but to define u (x) we need x ().
Define x as an interpolation of nodal values, e.g.

u( )    n ( )un u1 u
n u2 u1

x ( )    n ( ) xn x
1
u2
n
x2 x1 x2 x

x1
1

Quadratic Lagrange Basis Functions
Use three nodal parameters u1, u2 and u3
u     u11     u22     u33   
where 2
1
1  2    1    0.5  1.0 1.0

2  4  1   

3  2    0.5  0 0.5 1.0

0 0.5 1.0

3
1.0


0 0.5 1.0

are the quadratic Lagrange basis functions.


Cubic Hermite Basis Functions

11     1  3 2  2 3 12         1
2
1

0 
1


0 1

 21      2  3  2 
1  22      2    1

0 
1


0 1
Scaling Factors

=0 =1
=0 =0
s1 s2 s3
arc length
Global to local mapping:
n e   n,e 
U U
n e   n,e  n e
 U   U   s 
i

 i  i   i (no sum on i)
    s    
Scaling Factors  arc lengths
Two-Dimensional
Tensor-Product Elements

Bilinear interpolation can be constructed


u(1,  2 )   1 (1,  2 )u1   2 (1,  2 )u2   3 (1,  2 )u3   4 (1,  2 )u4
where
1(1, 2 )  1(1 )1( 2 )  (1  1 )(1   2 )
 2 (1, 2 )   2 (1 )1( 2 )  1(1   2 )
 3 (1, 2 )  1(1 ) 2 ( 2 )  (1   2 ) 2
 4 (1, 2 )   2 (1 ) 2 ( 2 )  1 2
Bilinear Tensor-Product Basis Functions
2

u = n un

1 u
0 1

y
1
1
x
2
x = n xn
y = n yn
0
1 1
A Six-Noded
Quadratic-Linear Element
F 1 I(1   )  2 (1,  2 )  41 (1  1 )(1   2 )
H 2K
 1 ( 1,  2 )  2( 1  1)  1  2

F 1I
F 1 IF 1 I  ( ,  )  2b  1g  
H 2 KH  2 K(1   )
 ( ,  )  2  
3 1 2 1 1 2
4 1 2
H 2K
1 1 2

 ( ,  )  2 F  I
1
 5 ( 1,  2 )  4 1 (1  1 ) 2 6 1 2
H 2K
1 1 2

2
1.0

0 1
0 0.5 1.0
Three-dimensional Linear Basis Functions
e.g. trilinear element has eight nodes with basis functions:

1     1   ;  2      3
7

8
1  1 ,  2 ,  3   1  1  1   2  1   3  ;
5

6 2
2  1 ,  2 ,  3    2  1  1   2  1   3  ; 3

3  1 ,  2 ,  3   1  1   2   2  1   3  ; 1
4

4  1 ,  2 ,  3    2  1   2   2  1   3  ; 2
1
5  1 ,  2 ,  3   1  1  1   2   3   3  ;

6  1 ,  2 ,  3    2  1  1   2   2   3  ; 8

7  1 ,  2 ,  3   1  1   2   2   2   3  ; u   i  1 ,  2 ,  3  ui
i 1
8  1 ,  2 ,  3    2  1   2   2   2   3 .
Tri-Cubic Basis Functions

In each node we define:


3
7

u u  2u u
u, , , , , 5
1  2 1 2  3 2
6
3
 2u  2u  3u
, ,
1 3  2  3 1 2  2 1

2
1
Tri-Cubic Basis Functions (Cont’d)
8
 1 ui ui
u  1 ,  2 ,  3    i  1 ,  2 ,  3  ui  i  1 ,  2 ,  3 
2
 i  1 ,  2 ,  3 
3

i 1  1  2

 2 ui ui  2 ui
   1 ,  2 ,  3 
i
4
 i  1 ,  2 ,  3 
5
 i  1 ,  2 ,  3 
6

1 2  3 1 3

 2
u  3
ui 
 i  1 ,  2 ,  3 
7 i
 i  1 ,  2 ,  3 
8

 2  3 1 2  3 

i j  1 ,  2 ,  3    kl  1   mn   2   qr   3  ;

k , l , m, n, q, r  1,2; i, j  1,2,...8
Scaling Factors

=0 =1
=0 =0
s1 s2 s3
arc length
Global to local mapping:
n e   n,e 
U U
n e   n,e  n e
 U   U   s  i
Scaling Factors  arc lengths
 i  i   i (no sum on i)
    s    
n e   n,e  n e n e
 U  2
 U   s  i
 s 
j

 i j  i j   i  j (no sum on i,j)


     s s       
n e   n,e  n e n e n e
  3U   U   s i   s j   s k 
 i j k  i j k   i  j  k (no sum on i,j,k)
      s s s          
Coordinate Systems
• Rectangular Cartesian global reference
coordinate system {Y1 ,Y2 ,Y3 }
• Orthogonal curvilinear coordinate
system to describe geometry and
deformation {1 ,  2 , 3 }
• Curvilinear local finite element
coordinates {1 ,  2 , 3 }
• Locally orthonormal body coordinates
define material symmetry and
structure, {X 1 , X 2 , X 3 } related to the
finite element coordinates by a rotation
about the (1 ,2 )-normal axis through
the "fiber angle" , 1

From Costa et al, J Biomech Eng 1996;118:452-463


A}=(X,Y,Z)
A) Rectangular Cartesian Coordinates:

Y3=Z
{
Curvilinear
World
Y2=Y

Y1=X

A}=(R,
B) Cylindrical Polar Coordinates: { ,Z)
Coordinates
Y3=Z

Y1 = R cos D) Prolate Spheroidal Coordinates ()


Y2 Y2 = R sin
Y3 = Z

R Y2

Y1 Y1 = d coshcos

Y2 = d sinhsincos
A}=(R,
C) Spherical Polar Coordinates: { ,) Y3 = d sinhsinsin
Y3
Y3

Y1 = R cos cos d=focus +



Y2 = R cos sin 
Y3 = R sin
R Y1

Y2

Y1
Fiber/Sheet Coordinates
S ta te o f C o v a ria n t C o v a ria n t
B ody In d ic e s C o o rd in a te s B a se V e c to rs M e tric T e n s o r s

A ) re c ta n g u la r C a rte s ia n r e fe r e n c e c o o r d in a te s Coordinate
Y e 
System
B R ,S R R R ,S

B r ,s y R e r
 r ,s

B ) c u r v ilin e a r w o rld c o o rd in a te s

 G  

Y R
e G  

Y RY R
Notations
B A ,B A A R A B
 A
 A B

  yr    y r y r
B  ,   g   e r g   
 
C ) n o r m a liz e d fin ite e le m e n t c o o rd in a te s ( L a g ra n g ia n )

        A B
 
B K ,L  K G K  G A G K L  G A B
 K
K L


        
 
B * g K  g  * g K L  g  
 K
K L

D ) lo c a lly o r th o n o r m a l b o d y /fib e r c o o r d in a te s

x  K L
 
x   K
  G IJ  G K L   IJ
B I ,J X I G I  G K  X I X J

X I

x  K   x  K L
 
B i,j xi g i  g K g ij  g K L   ij
xi  x i x j

* g x  x K
  x  xKx L
 
B I  g K * g IJ  g K L
X I
 X I X J

* R e p r e s e n ts a L a g ra n g ia n d e s c rip tio n o f th e d e fo r m a tio n fro m B to B .


Fitting with Linear Lagrange 1-D Elements

Result of twice refining the mesh (yielding 8


Two linear Lagrange elements fit the data with
a root-mean-squared-error (RMSE) of 0.614892. elements) and re-fitting: RMSE = 0.0930764
Least Squares Fitting
The least squares fit minimizes the objective function:
F  X     d X  d   Xd 
2

d 1,D

   X  d   Xd    X  d   Xd  
2 2

  1 1
 2
 2
d 

 
  2  X  d   Xd   2  X  d   Xd   2  X  d   Xd  
2 2 2

  3 12
 4
22
 5
1 2
 d

 
where Xd is measured coordinate or field variable;
X   d  is the interpolated value at ξ d
d are weights applied to the data points
i are smoothing weights

X  d   X j  i    X   
d
N
j N id

F
 0  a linear system of equations for nodal parameters X N
j
X jN
Fitting a Coronary Vascular Tree with Quadratic
Lagrange 1-D Elements
Rabbit Ventricular Anatomy
heart cast in rubber
• anesthetized & ventilated
knife
New Zealand White rabbit
• heart arrested in diastole,
excised
• pulmonary vessels removed,
aorta cannulated
• heart suspended in Ringers
lactate, perfused in unloaded
state with buffered formalin
at 80 mm Hg for 4 minutes tube
• heart cast in
polyvinylsiloxane
plunger
Rabbit Ventricular Anatomy
knife

BASE

plunger

APEX
x = d cosh  cos 
y = d sinh  sin  cos 
z = d sinh  sin  sin 
Bicubic Hermite
isoparametric interpolation
4
 
(1, 2 )   {i1i (1, 2 ) 
i1 
i
data point
 2 projects onto
i (1, 2 ) 
1 surface at
i ddd 
 3
i (1, 2 ) 
2 
2 i

i4 (1, 2 )}
12 
endo

epi

RIGHT VENTRICLE

LEFT VENTRICLE
Anatomic Model

• 8,351 geometric
points
• 14,368 fiber angles
• 36 elements
• 552 geometric DOF
RMSE = ±0.55 mm
• 184 Fiber angle DOF
RMSE = ±19°

Vetter & McCulloch Prog Biophys & Mol Biol 69(2/3):157 (1998)
Strain Analysis
X 2, longitudinal
X c , crossfiber
X 1, circumferential
X r , radial
X 3 , radial
X f , fiber

xi xi k


F  Fij ei  e j  ei  e j  ei  e j
X j k X j
E= 1
2  F TF  I 
d s 2  d S 2  21 Eij dX i dX j
A/P View Lateral View

Reconstructed
3D Coordinates

Transform
End-Systolic Circumferential Strain

Baseline 2 minutes ischemia

0.04

0.00

-0.04

-0.07
F  X    d X  xd   Xd
2

0.7 d 1,D

  X x   X  2
  X  x d   Xd 
2

RMS Fitting Error (mm)

 dx 

d d
0.6 

1 2 
 
0.5  2  X  x   X  2
  X  xd   Xd 
2
2
  X  x d   Xd 
2
2

 dx

d d
  2


12  2
2 12 
 
0.4

0.3

0.2

0.1

0
10-7 10-6 10-5 10-4 10-3 10-2 10-1 100
Smoothing Weight 
10-2 0.032
0.03
0.028
0.026
10-3 0.024
0.022
 10-4 0.02

10-5
0.018
10-6
10-6 10-5 10-4 10-3 10-2

Myocardial Blood Flow Fiber Strain Cross-fiber Strain
Control
LAD Occlusion

0.0 1.5 3.0 -0.05 0.00 0.05


mL/min/g
Pre-surgery 3months post-surgery

LATERAL
SEPTAL

S-ar putea să vă placă și