Sie sind auf Seite 1von 102

1

CHAP 1
Preliminary Concepts and
Linear Finite Elements

Instructor: Nam-Ho Kim (nkim@ufl.edu)


Web: http://www2.mae.ufl.edu/nkim/INFEM/
2
Table of Contents

1.1. INTRODUCTION

1.2. VECTOR AND TENSOR CALCULUS

1.3. STRESS AND STRAIN

1.4. MECHANICS OF CONTINUOUS BODIES

1.5. FINITE ELEMENT METHOD

3
1.1

INTRODUCTION

4
Background
• Finite Element Method (FEM):
– a powerful tool for solving partial differential equations and
integro-differential equations
• Linear FEM:
– methods of modeling and solution procedure are well established
• Nonlinear FEM:
– different modeling and solution procedures based on the
characteristics of the problems  complicated
– many textbooks in the nonlinear FEMs emphasize complicated
theoretical parts or advanced topics
• This book:
– to simply introduce the nonlinear finite element analysis procedure
and to clearly explain the solution procedure
– detailed theories, solution procedures, and implementation using
MATLAB for only representative problems

5
Chapter Outline
2. Vector and Tensor Calculus
– Preliminary to understand mathematical derivations in other
chapters
3. Stress and Strain
– Review of mechanics of materials and elasticity
4. Mechanics of Continuous Bodies
– Energy principles for structural equilibrium (principle of minimum
potential energy)
– Principle of virtual work for more general non-potential problems
5. Finite Element Method
– Discretization of continuum equations and approximation of
solution using piecewise polynomials
– Introduction to MATLAB program ELAST3D

6
1.2

VECTOR AND TENSOR


CALCULUS

7
Vector and Tensor
• Vector: Collection of scalars
• Cartesian vector: Euclidean vector defined using Cartesian
coordinates y
– 2D, 3D Cartesian vectors u2

 u1 
 u1   
u    , or u   u2  e2
x
 u2 
e1
u 
 3 e3 u1
u3
z

– Using basis vectors: e1 = {1, 0, 0}T, e2 = {0, 1, 0}T, e3 = {0, 0, 1}T

u  u1 e1  u2 e2  u3e3

8
Index Notation and Summation Rule
• Index notation: Any vector or matrix can be expressed in
terms of its indices
 v1   A11 A12 A13 
v  [vi ]   v2  A  [Aij ]   A21 A22 A23 
 v3   A31 A32 A33 
• Einstein summation convention
3
 akbk  akbk Repeated indices mean summation!!
k 1

– In this case, k is a dummy variable (can be j or i) akbk  ajbj


– The same index cannot appear more than twice
• Basis representation of a vector
– Let ek be the basis of vector space V N
– Then, any vector in V can be represented by w   wk ek  wk ek
k 1 9
Index Notation and Summation Rule cont.
• Examples
– Matrix multiplication: C  A  B Cij  AikBkj
– Trace operator: tr(A)  A11  A22  A33  Akk
– Dot product: u  v  u1v1  u2v2  u3v3  uk vk
– Cross product: u  v  ujvk ( ej  ek )  eijkujvk ei

0 unless i, j,k are distinct


Permutation 
symbol
eijk   1 if (i, j,k) is an even permutation
 1 if (i, j,k) is an odd permutation

– Contraction: double dot product
3 3
J  A:B   AijBij  AijBij
i1 j1

10
Cartesian Vector
X3
• Cartesian Vectors u
u  u1 e1  u2 e2  u3e3  uiei v e3

v  vjej e1 e2
X2

X1
• Dot product
u  v  (uiei )  (vjej )  uivj ( ei  ej )  uivjij  uivi
– Kronecker delta function
 1 if i  j
ij    jj  11  22  33  3
 0 if i  j
– Equivalent to change index j to i, or vice versa
• How to obtain Cartesian components of a vector
ei  v  ei  (vjej )  vjij  vi Projection

• Magnitude of a vector (norm): v  vv


11
Notation Used Here

Direct tensor notation Tensor component notation Matrix notation

  ab   ab
i i   aT b
A  ab Aij  ab
i j A  abT
b  Aa bi  Aijaj b  Aa
b  aA bj  aA
i ij bT  aT A

12
Tensor and Rank
• Tensor
– A tensor is an extension of scalar, vector, and matrix
(multidimensional array in a given basis)
– A tensor is independent of any chosen frame of reference
– Tensor field: a tensor-valued function associated with each point
in geometric space
• Rank of Tensor
– No. of indices required to write down the components of tensor
– Scalar (rank 0), vector (rank 1), matrix (rank 2), etc
– Every tensor can be expressed as a linear combination of rank 1
tensors
– Rank 1 tensor v: vi  11 12 13 
[ij ]   21 23 
Rank-2
– Rank 2 tensor A: Aij 22 stress
tensor
– Rank 4 tensor C: Cijkl  31 32 33  13
Tensor Operations
• Basic rules for tensors
Different notations
( TS)R  T(SR) TS  T  S
T(S  R)  TS  TR
Identity tensor
( TS)  (T )S  T(S) 1  [ij ]
1T  T1  T
• Tensor (dyadic) product: increase rank
A  u  v  uivjei  ej Aij  uivj AT  Ajiei  ej
( u  v )  w  u( v  w)
w  ( u  v )  v ( w  u)
( u  v )( w  x)  ( v  w)u  x uv  vu

• Rank-4 tensor: D  Dijklei  ej  ek  el


14
Tensor Operations cont.
• Symmetric and skew tensors
– Symmetric S  ST
– Skew W   WT
– Every tensor can be uniquely decomposed by symmetric and
skew tensors
T SW
S  21 ( T  T T )
W  21 ( T  T T )
– Note: W has zero diagonal components and Wij = - Wji

• Properties – Let A be a symmetric tensor


A:W 0
A:T A:S
15
Example
• Displacement gradient can be considered a tensor (rank 2)
 u1 u1 u1 
 X1 X2 X3 
 u   u2 u2 u2 
u      X X X 
 X  1 2 3
 u3 u3 u3 
 X1 X2 X3 
 u1 1 ( u1  u2 ) 1 ( u1  u3 ) 
 X1 2 X2 X1 2 X3 X1 

sym(u)   21 ( X1  X2 ) 1 ( u2  u3 ) 


u u u2 Strain tensor
2 1 X2 2 X3 X2 
 1 u1 u3 1 u2 u3 u3 
 2 ( X3  X1 ) 2 ( X3  X2 ) X3 
 0 1 ( u1  u2 ) 1 ( u1  u3 ) 
 2 X2 X1 2 X3 X1 

skew(u)    21 ( X1  X2 ) 1 ( u2  u3 ) 


u u
0 2 X  X  Spin
2 1 3 2
tensor
 1 u1 u3 1 u u 
  2 ( X3  X1 )  2 ( X3  X2 ) 0
2 3

16
Contraction and Trace
• Contraction of rank-2 tensors
a : b  aijbij  a11b11  a12b12   a32b32  a33b33
– contraction operator reduces four ranks from the sum of ranks of
two tensors
• magnitude (or, norm) of a rank-2 tensor
a  a:a
• Constitutive relation between stress and strain
  D : , ij  Dijklkl
• Trace: part of contraction
tr(A)  Aii  A11  A22  A33
– In tensor notation

tr(A)  A : 1  1 : A
17
Orthogonal Tensor
• In two different coord. e3 e3*
e1*
u  uiei  uj* ej*
e2
• Direction cosines e1
e2*
  [ij ]  [ ei*  ej ] ei*  ijej
We can also show
• Change basis ej  ijei* u*   u
u  ujej  ui* ei* u  T u*  T ( u)  (T )u
 ui*ijej
 1  T
uj  ijui* T   T  1 det()  1
Orthogonal tensor
u  T u* Rank-2 tensor transformation
T *   T T , Tij*  ikTkljl 18
Permutation
• The permutation symbol has three indices, but it is not a
tensor

1 if ijk are an even permutation : 123, 231, 312



eijk   1 if ijk are an odd permutation : 132, 213, 321
0 otherwise

• the permutation is zero when any of two indices have the
same value: e112 = e121 = e111 = 0
• Identity
eijk elmk  il jm  im jl

• vector product
u  v  eieijkujvk
19
Dual Vector
• For any skew tensor W and a vector u
u  Wu  u  WT u  u  Wu  0
– Wu and u are orthogonal
 0 W12 W13   W23 
• Let Wij  eijk wk  
W   W12 0 W23   w   W13 
 W13 W23 0   
 W12 

• Then, Wijuj  eijk wkuj  eikjwkuj

Wu  w  u

Dual vector of skew tensor W


wi   21 eijkWjk

20
Vector and Tensor Calculus
• Gradient
f( X)
 
  ei  
X Xi
– Gradient is considered a vector
vi
– We will often use a simplified notation: vi , j 
X j
• Laplace operator
2        
       ei    ej X  
 Xi   j  Xj Xj
• Gradient of a scalar field f(X): vector
2 2 2
f  
f( X)  ei X12 X22 X32
Xi

21
Vector and Tensor Calculus
• Gradient of a Tensor Field (increase rank by 1)
 fi
f  f    fiei  ej  ei  ej
Xj Xj
• Divergence (decrease rank by 2)
   fi
  f   ei  
  f jej  X
 Xi  i
– Ex)     
jk,j ek
• Curl
  v  eieijk vk,j

22
Integral Theorems
• Divergence Theorem

   A d   n  A d n: unit outward normal vector

• Gradient Theorem

 A d   n  A d c

• Stokes Theorem

 n  (  v) d  c r  v dc r
• Reynolds Transport Theorem
d A

dt 
Ad    t d   (n  v )A d
23
Integration-by-Parts
• u(x) and v(x) are continuously differentiable functions
• 1D
b b b
a u(x)v(x) dx   u(x)v(x)  a  a u(x)v(x) dx
• 2D, 3D
u v
 xi v d   uvni d   u xi d
• For a vector field v(x)

 u  v d   u( v  n) d   u  v d
• Green’s identity

 u  v d   uv  n d   u2v d

24
Example: Divergence Theorem
• S: unit sphere (x2 + y2 + z2 = 1), F = 2xi + y2j + z2k
• Integrate S F  n dS
S F  n dS     F d
 2 (1  y  z) d

 2 d  2 y d  2 z d
  
 2 d

8

3

25
Quiz

• A symmetric rank four tensor is defined by


D  1  1  2I
where 1 = [ij] is a unit tensor of rank-two and
I  21 [ik  jl  il jk ] is a symmetric unit tensor of rank-four.
When E is an arbitrary symmetric rank-two tensor,
calculate S = D:E in terms of E.

26
1.3

STRESS AND STRAIN

27
Surface Traction (Stress)
F
• Surface traction (Stress) f1

– The entire body is in equilibrium with n

external forces (f1 ~ f6) P


A
– The imaginary cut body is in equilibrium due f2
to external forces (f1, f2, f3) and internal f3
forces
– Internal force acting at a point P
on a plane whose unit normal is n: f6

F
f1
f5
(n)
t  lim
A 0 A
– The surface traction depends on the unit f4
f2
normal direction n.
z f3
– Surface traction will change as n changes.
y
– unit = force per unit area (pressure) x

t (n)  t1 e1  t2 e2  t3e3
28
Cartesian Stress Components
• Surface traction changes according to the direction of
the surface.
• Impossible to store stress information for all directions.
• Let’s store surface traction parallel to the three
coordinate directions.
• Surface traction in other directions can be calculated
from them.
• Consider the x-face of an infinitesimal cube
x
t (x)
 t1(x) e1  t2(x) e2 + t3(x) e3
z
t (x)
 11 e1  12 e2 + 13e3 13
z F

Normal Shear
11 12
stress stress y
x y 29
Stress Tensor
– First index is the face and the second index is its direction
– When two indices are the same, normal stress, otherwise shear
stress.
– Continuation for other surfaces.
– Total nine components
– Same stress components are defined for the negative planes.

• Rank-2 Stress Tensor


33
  ijei  ej x

31 32
• Sign convention z
13 23
z
sgn(11 )  sgn(n)  sgn( Fx ) 12 21
11 22
sgn(12 )  sgn(n)  sgn( Fy ) y
x y

30
Symmetry of Stress Tensor
– Stress tensor should be symmetric
9 components 6 components 21
– Equilibrium of the angular moment A B
y
 M  l(12  21 )  0 12 l O x 12
 12  21
– Similarly for all three directions: l
C D
12  21 , 23  32 , 13  31 21

 11 
– Let’s use vector notation:     11 12 13 
 22 
Cartesian components  33  [ij ]   12 22 23 
of stress tensor { }   
 12   13 23 33 
 23 
 
 13  31
Stress in Arbitrary Plane
– If Cartesian stress components are known, it is possible to
determine the surface traction acting on any plane.
– Consider a plane whose normal is n.
– Surface area (ABC = A) y
B
PAB  An3 ; PBC  An1 ; PAC  An2
n
– The surface traction 31 33 t(n)
13
11 32
t (n)
 t1( n) e1  t2( n) e2  t3( n) e3
12 P 23 A x
21
– Force balance 22
z C
 1 1 A  11An1  21An2  31An3  0
F  t (n)

t1( n )  11n1  21n2  31n3


32
Cauchy’s Lemma
• All three-directions
t1( n )  11n1  21n2  31n3
t2( n)  12n1  22n2  32n3
t3( n)  13n1  23n2  33n3
• Tensor notation

t(n)  n    t(n)    n
– stress tensor; completely characterize the state of stress at a
point
• Cauchy’s Lemma
– the surface tractions acting on opposite sides of the same surface
are equal in magnitude and opposite in direction

t ( n )   t ( n)
33
Projected Stresses
• Normal stress (n)  t n  n  n    n  ijnn
i j
n 2
• Shear stress (n)  t  2 (n), (n)  t n  n(n)
• Principal stresses tn n  1 , 2 , 3
• Mean stress (hydrostatic pressure)
1 1
p  m  tr()  (11  22  33 )
3 3
• Stress deviator I  21 (ik  jl  il jk )
ijkl
s    m 1  Idev :  Rank-4 identity tensor
 11  m 12 13 
Idev  I  31 1  1
s   12 11  m 23 
Rank-4 deviatoric identity tensor
 13 23 11  m 
Idev : 1  0, Idev : s  s
34
Principal Stresses
• Normal & shear stress change as n changes
– Is there a plane on which the normal (or shear)stress becomes the
maximum?
• There are at least three mutually perpendicular planes
on which the normal stress attains an extremum
– Shear stresses are zero on these planes  Principal directions
– Traction t(n) is parallel to surface normal n

t (n)  nn   n  nn


Principal Principal
• Eigenvalue problem stress direction
[  n 1]  n  0
 11  n 12 13   n1   0 
     
 12 22  n 23   n2    0 
 13 23 33  n   n3   0  35
Eigenvalue Problem for Principal Stresses
• The eigenvalue problem has non-trivial solution if and only
if the determinant is zero:
11  n 12 13
12 22  n 23 0
13 23 33  n
• The above equation becomes a cubic equation:
n3  I1n2  I2n  I3  0
I1  11  22  33
2 2 2
I2  1122  2233  3311  12  23  13
2 2 2
I3    112233  2122313  1123  2213  3312
• Three roots are principal stresses
1  2  3
36
Principal Directions
• Stress Invariants: I1, I2, I3
– independent of the coordinate system
• Principal directions
– Substitute each principal stress to the eigenvalue problem to get n
– Since the determinant is zero, an infinite number of solutions exist
– Among them, choose the one with a unit magnitude

i 2
n  (n1i )2  (n2i )2  (n3i )2  1, i  1,2,3

• Principal directions are mutually perpendicular


ni  n j  0, i  j

37
Principal Directions
• There are three cases for principal directions:
1. σ1, σ2, and σ3 are distinct  principal directions are three unique
mutually orthogonal unit vectors.
2. σ1 = σ2 and σ3 are distinct  n3 is a unique principal direction, and
any two orthogonal directions on the plane that is perpendicular
to n3 are principal directions.
3. σ1 = σ2 = σ3  any three orthogonal directions are principal
directions. This state of stress corresponds to a hydrostatic
pressure.

n3

38
Strains (Simple Version)
– Strain is defined as the elongation per unit length

u2

x2

P x1 u1 P

– Tensile (normal) strains in x1- and x2-directions


u1 u1
11  lim 
x1  0 x1 x1 Textbook has different, but
more rigorous derivations
u2 u2
22  lim 
x2  0 x2 x2
– Strain is a dimensionless quantity. Positive for elongation and
negative for compression
39
Shear Strain
– Shear strain is the tangent of the change in angle between two
originally perpendicular axes
u1
u2
q1 ~ tan q1 
x1 q2
x2
u1 /2 – g12
q2 ~ tan q2 
x2 P
q1 u2
x1
– Shear strain (change of angle)
u2 u1 u2 u1
g12  q1  q2  lim  lim  
x1  0 x1 x2  0 x2 x1 x2
1 1  u2 u1 
12  g12   
2 2  x1 x2 
– Positive when the angle between two positive (or two negative)
faces is reduced and negative when the angle is increased.
– Valid for small deformation
40
Strains (Rigorous Version)
• Strain: a measure of deformation
– Normal strain: change in length of a line segment
– Shear strain: change in angle between two perpendicular line
segments
• Displacement of P = (u1, u2, u3)
• Displacement of Q & R
Q u1 u1
u1  u1  x1 u1  u1 
R
x2
x1 x2
u2 u
R'
Q
u2  u2  x1 u2R  u2  2 x2
x1 x2 Q'

Q u3 u3 R P'(x1+u1, x2+u2, x3+u3)


u3  u3  x1 u3  u3 
R
x2 x2
x1 x2 x 2 x1
P(x1,x2,x3) Q

x1

x3 41
Displacement Field
• Coordinates of P, Q, and R before and after deformation
P : (x1 , x2, x3 )
Q : (x1  x1 , x2, x3 )
R : (x1 , x1  x2, x3 )
P : (x1  u1P , x2  u2P , x3  u3P )  (x1  u1, x2  u2, x3  u3 )
Q : (x1  x1  u1Q , x2  u2Q , x3  u3Q )
u1 u u
 (x1  x1  u1  x1 , x2  u2  2 x1 , x3  u3  3 x1 )
x1 x1 x1
R : (x1  u1R , x2  x2  u2R , x3  u3R )
u1 u u
 (x1  u1  x2 , x2  x2  u2  2 x2, x3  u3  3 x2 )
x2 x2 x2

• Length of the line segment P'Q'

     
2 2 2
PQ  x1P  x1Q x2P  x2Q x3P  x3Q
42
Deformation Field
• Length of the line segment P'Q'
2 2 2
 u1   u2   u3 
PQ  x1  1     x    x 
 x1   1  1
2 1/2
 2 2
u1  u1   u2   u3  
 x1  1  2       
 x1  x1   x1   x1  

 u1 1  u1 
2
1  u2 
2 2
1  u3    u1 
 x1  1             x  1  
 x1 2  x1  2  x1  2  x1   x
   1 
Linear Nonlinear Ignore H.O.T. when displacement
gradients are small
• Linear normal strain
PQ  PQ u1
11  
PQ x1
u2 u3
22  , 33 
x2 x3 43
Deformation Field
• Shear strain gxy
– change in angle between two lines originally parallel to x– and y–
axes Q Q R R
x2  x2 u2 x1  x1 u1
q1   q2  
x1 x1 x2 x2
u1 u2
g12  q1  q2  
x2 x1
u2 u3 Engineering shear strain
g23  
x3 x2
u3 u1
g13   Different notations
x1 x3
1  u u 
  1  2
1  ui uj 
12 ij    
2  x2 x1  
2  xj xi
u 

1  u
23   2  3
2  x3 x2  ij  21 (ui,j  uj,i )
1  u3 u1 
13  
2  x1 x3 
   sym(u) 44
Strain Tensor
• Strain Tensor
  ijei  ej
 11 12 13 
 
• Cartesian Components [ij ]   12 22 23 
 13 23 33 
• Vector notation
 11   11 
   
 22   22 
 33   33 
{}    
 212   g12 
 223   g23 
   
 213   g13 

45
Volumetric and Deviatoric Strain
• Volumetric strain (from small strain assumption)
V  V0
V   (1  11 )(1  22 )(1  33 )  1  11  22  33
V0
V  11  22  33  kk

• Deviatoric strain x3

e    31 V 1 eij  ij  31 V ij e22


e33
e  Idev :  1
x2 1
1
e11 x1

Exercise: Write Idev in matrix-vector notation


46
Stress-Strain Relationship
• Applied Load shape change (strain) stress
• There must be a relation between stress and strain
• Linear Elasticity: Simplest and most commonly used


Ultimate
Fracture
stress
Yield stress

Proportional
limit Young’s
modulus


Strain Necking
hardening

47
Generalized Hooke’s Law
• Linear elastic material   D : , ij  Dijklkl
– In general, Dijkl has 81 components
– Due to symmetry in ij, Dijkl = Djikl
– Due to symmetry in kl, Dijkl = Dijlk 21 independent coeff
– from definition of strain energy, Dijkl = Dklij
• Isotropic material (no directional dependence)
– Most general 4-th order isotropic tensor

Dijkl  ijkl  ik  jl  il jk


 ijkl  (ik  jl  il jk ) D  1  1  2I

– Have only two independent coefficients


(Lame’s constants:  and )

48
Generalized Hooke’s Law cont.
• Stress-strain relation
ij  Dijklkl  [ijkl  (ik  jl  il jk )]kl  kk ij  2ij

– Volumetric strain: kk  11  22  33   v

– Off-diagonal part: 12  212  g12  is the shear modulus

– Bulk modulus K: relation b/w volumetric stress & strain

I1  3m   jj  kk  jj  2 jj  (3  2)kk

p  m  (  23 )kk  K v
Bulk modulus
– Substitute   K  23  so that we can separate volumetric part

• Total deform. = volumetric + deviatoric deform.


49
Generalized Hooke’s Law cont.
• Stress-strain relation cont.
ij  (K  23 )kk ij  2ij
 Kkk ij  2ij  23 kk ij
 Kijklkl  2[ik  jl  31 ijkl ]kl
  Kijkl  2(Idev )ijkl  kl

 σ   K1  1  2Idev  : ε
Deviatoric part
e  Idev : 
Volumetric part Deviatoric strain
 σ  Kv 1  2e s  Idev : 
σ  m 1  s Deviatoric stress

Important for plasticity; plastic deformation only occurs in deviatoric part


volumetric part is always elastic
50
Generalized Hooke’s Law cont.
• Vector notation
– The tensor notation is not convenient for computer implementation
– Thus, we use Voigt notation 2nd-order tensor vector
4th-order tensor matrix
– Strain (6×1 vector), Stress (6×1 vector), and C (6×6 matrix)

 11   u1,1   11 


   u   
 22   2,2   22 
 33   u3,3   33 
      D
 212   u1,2  u2,1   12 
 223   u  u   23 
   2,3 3,2 
 
 213   u1,3  u3,1  
 13 

12 + 21 = 212 You don’t need 2 here

51
3D Solid Element cont.
• Elasticity matrix 1 
 2 1 1 0 0 0
 31 23 3

1  3 3 3
1 0 0 0
D  K1  1  2Idev    1  1 2 0 0 0
1 
1   Idev  3 3 3 
 0 0 0
0  0 0 1
 2 
• Relation b/w 0   0 0 0 1
0 2 0
Lame’s constants    
0  0 0 21 
 0 0 0
and Young’s modulus
and Poisson’s ratio    2   0 0 0
    2  0 0 0 
 (3  2) 
 , E
2(  )       2 0 0 0
D 
E E  0 0 0  0 0
 , 
(1  )(1  2) 2(1  )  0 0 0 0  0
 
 0 0 0 0 0 

Textbook has a definition of D in terms of E and 

52
Plane Stress
• Thin plate–like components parallel to the xy–plane
• The plate is subjected to forces in its in-plane only
• 13 = 23 = 33 = 0

 11  1  0   11 
  E   
{  }   22   2   1 0   22 
   1   0 0 1 (1  )   g 
 12   2   12 

• 13 = 23 = 0, but 33 ≠ 0


• 33 can be calculated from the condition of 33 = 0:


33  (11  22 )
1
53
Plane Strain
• Strains with a z subscript are all zero: 13 = 23 = 33 = 0
• Deformation in the z–direction is constrained, (i.e., u3 = 0)
• can be used if the structure is infinitely long in the z–
direction

 11  1    0   11 
  E   
{  }   22     1 0   22 
   (1  )(1  2)  0 0 1  g 
 12   2   12 

• 13 = 23 = 0, but 33 ≠ 0


• 33 can be calculated from the condition of 33 = 0:
E
33 
(1  )(1  2)
 11  22 

54
1.4

MECHANICS OF
CONTINUOUS BODIES

55
Governing Equations for Equilibrium
• Governing differential equations for structural equilibrium
– Three laws of mechanics: conservation of mass, conservation of
linear momentum and conservation of angular momentum
• Boundary-valued problem: satisfied at every point in 
– Governing D.E. + Boundary conditions
– Solutions: C2–continuous for truss & solid, C4–continuous for beam
– Unnecessarily requirements for higher-order continuity
• Energy-based method
– For conservative system, structural equilibrium when the potential
energy has its minimum: Principle of minimum potential energy
– If the solution of BVP exists, then that solution is the minimizing
solution of the potential energy
– When no solution exists in BVP, PMPE may have a natural solution
• Principle of virtual work
– Equilibrium of the work done by both internal and external forces
with small arbitrary virtual displacements
56
Balance of Linear Momentum
• Balance of linear momentum

 fb d    t n d    a d fb: body force


 tn: surface traction
0 for static problem
• Stress tensor (rank 2):
 11 12 13 
  ijei  ej  ij    21 22 23 
  
 31 32 33 

• Surface traction

X
tn  n  
• Cauchy’s Lemma X3
t n   t n e3
n
e1 X2
e2
tn  n   t n  n   X1 tn

57
Balance of Linear Momentum cont
• Balance of linear momentum

 ( fb  a) d    n   d       d
 

Divergence Theorem
 [    ( fb  a)] d  0

    ( f b  a )  0
– For a static problem

    fb  0 ij,i  fjb  0

• Balance of angular momentum

 x  fb d    x  t n d   x  a d

  T ij   ji
58
Boundary-Valued Problem
• We want to determine the state of a body in equilibrium
• The equilibrium state (solution) of the body must satisfy
– local momentum balance equation
– boundary conditions

• Strong form of BVP

X
– Given body force fb, and traction t
on the boundary, find u such that fb
X3
    fb  0 (1)
e3
and e1 n
e2 X2
u0 on h essential BC (2) X1 t
t  n on  s natural BC (3)

• Solution space

DA  u  [C2 ()]3 | u  0 on x  h ,   n  t on x   s  59
Boundary-Valued Problem cont.
• How to solve BVP
– To solve the strong form, we want to construct trial solutions that
automatically satisfy a part of BVP and find the solution that
satisfy remaining conditions.
– Statically admissible stress field: satisfy (1) and (3)
– Kinematically admissible displacement field: satisfy (2) and have
piecewise continuous first partial derivative
– Admissible stress field is difficult to construct. Thus, admissible
displacement field is used often

60
Principle of Minimum Potential Energy (PMPE)
• Deformable bodies generate internal forces by
deformation against externally applied forces
• Equilibrium: balance between internal and external forces
• For elastic materials, the concept of force equilibrium can
be extended to energy balance
• Strain energy: stored energy due to deformation
(corresponding to internal force)
1
U( u)  
2 
( u) : ( u) d ( u)  D : ( u)
Linear elastic material

• For elastic material, U(u) is only a function of total


displacement u (independent of path)
61
PMPE cont.
• Work done by applied loads (conservative loads)

W( u)   u  fb d   s u  t d.

• U(u) is a quadratic function of u, while W(u) is a linear


function of u. g
u3
fb
u1 u2
x3 h

• Potential energy fs
x2

( u)  U( u)  W( u) x1

1
  ( u) : ( u) d   u  fb d   s u  t d.
2   

62
PMPE cont.
• PMPE: for all displacements that satisfy the boundary
conditions, known as kinematically admissible
displacements, those which satisfy the boundary-valued
problem make the total potential energy stationary on DA
• But, the potential energy is well defined in the space of
kinematically admissible displacements


Z  u  [H1 ()]3 | u  0 on x  h , 
H1: first-order derivatives are integrable

• No need to satisfy traction BC (it is a part of potential)


• Less requirement on continuity
• The solution is called a generalized (natural) solution
63
Example – Uniaxial Bar
• Strong form
EAu  0 x  [0, L] x F
u0 x0
L
EAu(L)  F xL
• Integrate twice: EAu(x)  c1x  c2
Fx
• Apply two BCs: u(x)  Solution of BVP
EA
• PMPE with assumed solution u(x) = c1x + c2
• To satisfy KAD space, u(0) = 0,  u(x) = c1x
• Potential energy: U  1 L EA(u)2 dx  EALc12
2 0
W  Fu(L)  FLc1
d d F Fx
 (U  W)  EALc1  FL  0 c1   u(x) 
dc1 dc1 EA EA
64
Virtual Displacement
• Virtual displacement is not experienced but only assumed to exist so
that various possible equilibrium positions may be compared to
determine the correct one
• Let mass m and springs are in equilibrium at the current position
• Then, a small arbitrary perturbation, r, can be assumed
– Since r is so small, the member forces are assumed unchanged
• The work done by virtual displacement is

W  F1  r  F2  r  F3  r  F4  r  (F1  F2  F3  F4 )  r
• If the current position is in force equilibrium, W = 0

F2 F3

r

F1 F4
65
Virtual Displacement Field
• Virtual displacement (Space Z)
– Small arbitrary perturbation (variation) of real displacement
1 d
u  lim [( u  )  ( u)]  ( u  )    u.
 0  d  0
– Let ū be the virtual displacement, then u + ū must be kinematically
admissible, too
– Then, ū must satisfy homogeneous displacement BC

u u  u  V  u Z


Z  u u  [H1 ()]3, u h
0 
– Space Z only includes homogeneous
essential BCs In the literature, u is often used instead of ū

• Property of variation
 du  d(u)
  
 dx  dx 66
PMPE As a Variation
• Necessary condition for minimum PE
– Stationary condition <--> first variation = 0
1 d
( u; u )  lim [( u  u )  ( u)]  ( u  u ) 0
 0  d  0
for all u  Z
• Variation of strain energy
 u  d  u  u  u
     
 x  d  x   0 x
( u)  ( u )     D : 

U( u; u )    (u ) : D : (u)  ( u) : D : ( u )  d


1
2

  ( u ) : D : ( u) d

 a( u, u ) Energy bilinear form
67
PMPE As a Variation cont.
• Variation of work done by applied loads

W( u; u )   u  fb d   s
u  t d  ( u ) Load linear form

( u; u )  U( u; u )  W( u; u )  0


• Thus, PMPE becomes
a( u, u )  ( u ), u  Z

– Load form ( u ) is linear with respect to ū


– Energy form a(u, ū) is symmetric, bilinear w.r.t. u and ū
– Different problems have different a(u, ū) and ( u ), but they share
the same property
• How can we satisfy “for all ū ” requirement?
Can we test an infinite number of ū?
68
Example – Uniaxial Bar
• Assumed displacement u(x) = cx  u(x)  cx
– virtual displacement is in the same space with u(x):
• Variation of strain energy
d 1 L 2  1 L
U  
d  2 0
EA  (u  u)  dx    2EA(u  u)u dx
  0 2 0  0
L
 0 EAuu dx  EALcc
• Variation of applied load
d
W   F  u(L)  u(L)    0  Fu(L)  FLc
d
• PMPE
Fx
  U  W  c(EALc  FL)  0 u(x)  cx 
EA
Arbitrary u(x)  arbitrary c  coefficient of c must be zero 69
Principle of Virtual Work
• Instead of solving the strong form directly, we want to
solve the equation with relaxed requirement (weak form)
• Virtual work – Work resulting from real forces acting
through a virtual displacement
• Principle of virtual work – when a system is in equilibrium,
the forces applied to the system will not produce any
virtual work for arbitrary virtual displacements
– Balance of linear momentum is force equilibrium     fb  0
– Thus, the virtual work can be obtained by multiplying the force
equilibrium equation with a virtual displacement

W  (     fb )  u d 

– If the above virtual work becomes zero for arbitrary ū, then it


satisfies the original equilibrium equation in a weak sense
70
Principle of Virtual Work cont
• PVW (ij,i  fjb )uj d  0
 u  Z

  ij,iuj d   fjbuj d


– Integration-by-parts
b
   ij j ,i ij j,i 
 (  u )   u  d    j uj d
f
– Divergence Thm
  niijuj d   ijuj,i d   fjbuj d
 

– The boundary is decomposed by   h   s


uj  0 on h and niij  tj on  s

b
  t u
S j j
d    ij j,i

 u d    j uj d

f
0 u 
71
Principle of Virtual Work cont
• Since ij is symmetric
1  ui uj 
ijuj,i  ijsym(uj,i )  ij ij sym(ui,j )      ij

2  Xj Xi 
• Weak Form of BVP

 ij ij d   fjbuj d   s tjuj d u  Z


Internal virtual work = external virtual work


Starting point of FEM
• Symbolic expression

a( u, u )  ( u ) u  Z [K]{ d}  {F }
FE equation
– Energy form: a( u, u )    :  d
– Load form: (u )   u  fb d   s u  t d
 72
Example – Heat Transfer Problem
• Steady-State Differential Equation
T = T0
  T     k T 
k
x  x x

 y  y
y Q  0 domain A ST

• Boundary conditions qn Sq Q

 T  T0 on ST

 dT dT
 qn  nxkx dx  nyky dy on Sq n = {nx, ny}T

• Space of kinematically admissible temperature

Z  T  H1 () T( x)  0, x  ST 
• Multiply by virtual temperature, integrate by part, and
apply boundary conditions
 T T T T 
  x x x y y y
k  k  d 

 TQ d  S Tqn dSq,
q
T  Z
73
Example – Beam Problem
• Governing DE f(x)

d4 v
EI 4
 f(x), x  [0, L] L
dx x

• Boundary conditions for cantilevered beam


dv d2 v d3 v
v(0)  (0)  (L)  (L)  0
dx dx 2
dx 3

• Space of kinematically admissible displacement


 dv 
Z   v  H2 [0, L] v(0)  (0)  0 
 dx 

• Integrate-by-part twice, and apply BCs


L d2v d2v L
0 EI dx2 dx2 dx  0 fv dx, v  Z
74
Difference b/w Strong and Weak Solutions
• The solution of the strong form needs to be twice
differentiable   k T     k T   Q  0
x  x
x  y  y
y 
• The solution of the weak form requires the first-order
derivatives are integrable bigger solution space than
that of the strong form  k T T  k T T  d
  x
x x y
y y 
• If the strong form has a solution, it is the solution of the
weak form
• If the strong form does not have a solution, the weak
form may have a natural solution

75
1.5

FINITE ELEMENT METHOD

76
Finite Element Approximation
• Difficult to solve a variational equation analytically
• Approximate solution n
– Linear combination of trial functions u(x)   cifi (x)
– Smoothness & accuracy depend on i1
the choice of trial functions
– If the approximate solution is expressed in the entire domain, it is
difficult to satisfy kinematically admissible conditions
• Finite element approximation
– Approximate solution in simple sub-domains (elements)
– Simple trial functions (low-order polynomials) within an element
– Kinematically admissible conditions only for elements on the
boundary u(x)
Nodes Approximate
solution
Piecewise-
x
linear
approximation
Finite elements
Exact solution 77
Finite Elements
• Types of finite elements
1D 2D 3D

Linear

Quadratic

• Variational equation is imposed on each element.


1 0.1 0.2 1
0 dx  0 dx  
0.1
dx  
0.9
dx

One element
78
Trial Solution
– Solution within an element is approximated using simple polynomials.
1 2 n1 n
1 2 3 n1 n n+1

xi xi+1
li
– i-th element is composed of two nodes: xi and xi+1. Since two
unknowns are involved, linear polynomial can be used:

u(x)  a0  a1x, xi  x  xi1


– The unknown coefficients, a0 and a1, will be expressed in terms of
nodal solutions u(xi) and u(xi+1).

79
Trial Solution cont.
– Substitute two nodal values
 u(xi )  ui  a0  a1xi

 u(xi1 )  ui1  a0  a1xi1
– Express a0 and a1 in terms of ui and ui+1. Then, the solution is
approximated by

xi1  x x  xi
u(x)  (e)
ui  (e)
ui1
L L
N1 (x) N2 (x)
– Solution for Element e:

u(x)  N1 (x)ui  N2 (x)ui1 , xi  x  xi1


– N1(x) and N2(x): Shape Function or Interpolation Function

80
Trial Solution cont.
• Observations
– Solution u(x) is interpolated using its nodal values ui and ui+1.
– N1(x) = 1 at node xi, and =0 at node xi+1.
N1(x) N2(x)

xi xi+1

– The solution is approximated by piecewise linear polynomial and its


gradient is constant within an element.
u ui+2 du
ui dx
ui+1

xi xi+1 xi+2 xi xi+1 xi+2

– Stress and strain (derivative) are often averaged at the node.

81
1D Finite Elements
2
• 1D BVP d u  p(x)  0, 0  x  1
2
dx
u(0)  0 

du  Boundary conditions
(1)  0 
dx  Space of kinematically
admissible displacements
1 d2u
• Use PVW 0  2  p  u dx  0 
Z  u  H(1) [0,1] u(0)  0 
 dx 

• Integration-by-parts
1
du du du
1 1
u  dx    pu dx
dx 0
0 dx dx 0

– This variational equation also satisfies at individual element level

xj du du xj
(1)
xi dx dx
dx  xi
pu dx u 
82
1D Interpolation Functions
• Finite element approximation for one element (e) at a time

u(e) (x)  uN
i 1 (x)  u N
i1 2 (x)  N (e)
 d(e)

(e)  ui 
d   N(e)   N1 N2 
 ui1 
u(e) (xi )  ui
• Satisfies interpolation condition
u(e) (xi1 )  ui1
• Interpolation of displacement variation (same with u)
u (e) (x)  uN
i 1 (x)  u N
i1 2 (x)  N (e)
 d (e)

• Derivative of u(x): differentiating interpolation functions

du(e)  dN1 dN2   ui   1 1   ui  (e) (e)


       (e) 
(e)  u   B  d
dx  dx dx   ui1   L L   i1 
83
Element-Level Variational Equation
• Approximate variational equation (1) for element (e)
 du 
 (x
 dx i  )
(e)T  xj B(e)T B(e) dx  d(e)  d (e)T xj N(e)T p(x) dx  d (e)T
 xi xi
d  
 du
 (xi1 ) 
 dx 
– Must satisfied for all u (e) (x)  Z
– If element (e) is not on the boundary, d (e) can be arbitrary

• Element-level variational equation


 du 
 (x
 dx i  )
 xj B(e)T B(e) dx  d(e) xj (e)T
 xi
 N p(x) dx   
 xi du
 (xi1 ) 
 dx 
2x2 matrix 2x1 vector
 du 
 (x
 dx i  )

[k (e) ]{ d(e) }  f(e)  
du

 (xi1 ) 
 dx 
84
Assembly
• Need to derive the element-level equation for all elements
• Consider Elements 1 and 2 (connected at Node 2)
 du 
 k11 k12 
(1) (1)  (x
 dx 1  )
 u1   f1 
      
 k21 k22   u2   f2   du
(x2 ) 
 dx 
 du 
(2) (2)  (x
 dx 2  )
 k11 k12   u2   f2 
      
k k
 21 22   u3   f3   du
(x3 ) 
 dx 
• Assembly
Vanished
 du  unknown term
(1)
 k11 (1)
k12 0   u1   f1(1)    (x )
1 
 (1)  dx
(1) (2) (2)    (1) (2)   
 k21 k22  k11 k12   u2    f2  f2   0 
 (2) (2)   u   (2)   du 
 0 k21 k22   3   f3   (x ) 
 dx 3 
85
Assembly cont.
• Assembly of NE elements (ND = NE + 1)
 (1)   du 
 k11
(1)
k12 0 0 u   f1(1)  
 dx 1  (x )
1
 (1) (1) (2) (2)     (1) (2)
  
k
 21 k22  k11 k12 0 u
 2   f2  f 2   0 
 0      
(2)
k221 (2)
k22 (2)
 k11 0   u3    f3(2)  f3(3)   0 
      
      
  NE  (NE )   u   f(NE )   du 
 0 0 0 k21 k22  N 1
 N  N   (x )
  D   ND 1   dx N 
 ND ND   ND 1 

[K]{ d}  {F }
• Coefficient matrix [K] is singular; it will become non-
singular after applying boundary conditions

86
Example
• Use three equal-length elements
d2u
2
 x  0, 0  x  1 u(0)  0, u(1)  0
dx
• All elements have the same coefficient matrix
(e) 1  1 1   3 3 
k 
 22  L(e)  1 1    3 3  , (e  1,2,3)
   
• RHS (p(x) = x)

(e) xi1  N1 (x)  1 xi1  x(xi1  x) 


{f }   p(x)   dx  (e) x   dx
xi
 N2 (x)  L i  x(x  xi ) 
 xi xi1 
  

(e) 3 6
L   , (e  1,2,3)
 xi  xi1 
 6 3 

87
Example cont.
• RHS cont.  f1(1)  1 1 
(2)
 f2  1 4
(3)
 f3  1 7 
 (1)    ,  (2)    ,  (3)    
 f2  54  2   f3  54  5  f
 4  54 8
• Assembly
ìï 1 du ü
ïï - (0) ïïï
ïï 54 dx ïï Element 1
é 3 - 3 0 ì ü
0 ùï u1 ï ï 2 ïï
ê úïï ïï ïï 4 Element 2
ê- 3 3 + 3 - 3 0 úïï u2 ïï ïï 54 + 54 ïïï Element 3
ê úí ý = í ý
ê0 - 3 3 + 3 - 3 úïï u3 ïï ïï 7 5 ïï
ê úï ï ï + ï
êë 0 0 - 3 ú ï ï ï
3 ûïî u4 ïþ ï 54 54 ïï
ïï 8 du ïï
ïï + (1) ïï
• Apply boundary conditions ïî 54 dx ïþ
– Deleting 1st and 4th rows and columns
4
 6 3   u2  1  1  u2  81
 3 6   u   9  2  5
  3   u3  81

88
EXAMPLE cont.
• Approximate solution
 4 1
 x, 0x
 27 3
0.08
u-approx.
u-exact

4 1  1 1 2
u(x)    x , x
0.06

  
 81 27  3 3 3

u(x)
0.04

5 5  2 2
 x  , x1
0.02

  
 81 27  3 3 0
0 0.2 0.4 0.6 0.8 1
x

• Exact solution
1

u(x)  x 1  x2
6

– Three element solutions are poor
– Need more elements

89
3D Solid Element
• Isoparametric mapping
– Build interpolation functions on the reference element
– Jacobian: mapping relation between physical and reference elem.
• Interpolation and mapping
8 8
Same for mapping
u(x)   NI (x)uI x( x )   NI (x)xI and interpolation
I 1 I 1
1
NI (x)  (1  xxI )(1  I )(1  zz I )
8
z
x8 x7 (–1, –1,1) (–1,1,1)

x5 (1, –1,1)
(1,1,1)
x6 
x4 x3 (–1,1,–1)
x1 (1, –1,–1)
x3
(1,1,–1)
x2 x
x2
x1 (a) Finite Element (b) Reference Element
90
3D Solid Element cont.
• Jacobian matrix
8
x NI (x) J : Jacobian
J33    xI
x I 1 x
 x1 x1 x1 
• Derivatives of shape functions  x  z 
 
 NI NI NI   NI NI NI   x2 x2 x2 
  
 x  z   x1 x2 x3   x  z 
 
 x3 x3 x3 
NI NI  x  z 
 J
x x
NI NI
  J 1
x x
– Jacobian should not be zero anywhere in the element
– Zero or negative Jacobian: mapping is invalid (bad element shape)
91
3D Solid Element cont.
• Displacement-strain relation  NI,1 0 0 
8  
 0 N 0 
 BI uI
I,2
( u)   0 0 NI,3 
I 1 BI   
8  NI,2 NI,1 0 
 
  ( u )   BI uI  0 NI,3 NI,2 
I 1 N 0 NI,1 
 I,3
Ni
NI,i 
xi

92
3D Solid Element cont.
• Transformation of integration domain
1 1 1
 d  1 1 1 J dxddz
• Energy form
8 8
 1 1 1 BT DB J dxddz  u  { d }T [k]{ d}
a( u, u )   uIT
 1 1 1 I J  J
I 1 J 1

• Load form
8
T 1 1 1
(u )     
uI
1 1 1
NI (x)fb J dxddz  { d }T { f }
I 1

• Discrete variational equation

{ d }T [k]{ d}  { d }T { f }, { d }  Z h

93
Numerical Integration
• For bar and beam, analytical integration is possible
• For plate and solid, analytical integration is difficult, if
not impossible
• Gauss quadrature is most popular in FEM due to simplicity
and accuracy
• 1D Gauss quadrature
NG
1
1 f(x) dx  
i1
wif(xi )

– NG: No. of integ. points; xi: integ. point; wi: integ. weight
– xi and wi are chosen so that the integration is exact
for (2*NG – 1)-order polynomial
– Works well for smooth function
– Integration domain is [-1, 1]
94
Numerical Integration cont.
• Multi-dimensions
NG NG
1 1
1 1 f(x, ) dxd  
i1 j1
wiwjf(xi, j )

NG NG NG
1 1 1
1 1 1 f(x, , z) dxddz    wiwjwk f(xi, j, zk )
i1 j1 k 1

Integration
NG Weights (wi)
Points (xi)
1 0.0 2.0
2 .5773502692 1.0 x
.7745966692 .5555555556
3
0.0 .8888888889  (a) 11 
.8611363116 .3478546451
4
.3399810436 .6521451549
.9061798459 .2369268851 x x
5 .5384693101 .4786286705
0.0 .5688888889 (b) 22 (c) 33
95
ELAST3D.m
• A module to solve linear elastic problem using NLFEA.m

• Input variables for ELAST3D.m


Variable Array size Meaning
ETAN (6,6) Elastic stiffness matrix Eq. (1.81)
UPDATE Logical variable If true, save stress values
LTAN Logical variable If true, calculate the global stiffness matrix
NE Integer Total number of elements
NDOF Integer Dimension of problem (3)
XYZ (3,NNODE) Coordinates of all nodes
LE (8,NE) Element connectivity

96
How to Solve Linear Problem in Nonlinear Code
• Linear matrix solver
[K]{ d}  {F } {fint} = {fext} {f} = {fext} − {fint} = {0}
– Construct stiffness matrix and force vector
– Use LU decomposition to solve for unknown displacement {d}
• Nonlinear solver (iterative solver)
– Assume the solution at iteration n is known, and n+1 is unknown

{ dn 1 }  { dn }  { d} For linear problem, {dn} = {0}

n 1 n  f 
{f }  { f }    { d}  { 0 }
 d 
{F }  [K]{ dn }  [K]{ d}  0

[K]{ d}  {F } Only one iteration!!


97
function ELAST3D(ETAN, UPDATE, LTAN, NE, NDOF, XYZ, LE)
%***********************************************************************
% MAIN PROGRAM COMPUTING GLOBAL STIFFNESS MATRIX AND RESIDUAL FORCE FOR
% ELASTIC MATERIAL MODELS
%***********************************************************************
%%
global DISPTD FORCE GKF SIGMA
%
% Integration points and weights (2-point integration)
XG=[-0.57735026918963D0, 0.57735026918963D0];
WGT=[1.00000000000000D0, 1.00000000000000D0];
%
% Index for history variables (each integration pt)
INTN=0;
%
%LOOP OVER ELEMENTS, THIS IS MAIN LOOP TO COMPUTE K AND F
for IE=1:NE
% Nodal coordinates and incremental displacements
ELXY=XYZ(LE(IE,:),:);
% Local to global mapping
IDOF=zeros(1,24);
for I=1:8
II=(I-1)*NDOF+1;
IDOF(II:II+2)=(LE(IE,I)-1)*NDOF+1:(LE(IE,I)-1)*NDOF+3;
end
DSP=DISPTD(IDOF);
DSP=reshape(DSP,NDOF,8);
%
%LOOP OVER INTEGRATION POINTS
for LX=1:2, for LY=1:2, for LZ=1:2
E1=XG(LX); E2=XG(LY); E3=XG(LZ);
INTN = INTN + 1;
%
% Determinant and shape function derivatives
[~, SHPD, DET] = SHAPEL([E1 E2 E3], ELXY);
FAC=WGT(LX)*WGT(LY)*WGT(LZ)*DET; 98
% Strain
DEPS=DSP*SHPD';
DDEPS=[DEPS(1,1) DEPS(2,2) DEPS(3,3) ...
DEPS(1,2)+DEPS(2,1) DEPS(2,3)+DEPS(3,2) DEPS(1,3)+DEPS(3,1)]';
%
% Stress
STRESS = ETAN*DDEPS;
%
% Update stress
if UPDATE
SIGMA(:,INTN)=STRESS;
continue;
end
%
% Add residual force and stiffness matrix
BM=zeros(6,24);
for I=1:8
COL=(I-1)*3+1:(I-1)*3+3;
BM(:,COL)=[SHPD(1,I) 0 0;
0 SHPD(2,I) 0;
0 0 SHPD(3,I);
SHPD(2,I) SHPD(1,I) 0;
0 SHPD(3,I) SHPD(2,I);
SHPD(3,I) 0 SHPD(1,I)];
end
%
% Residual forces
FORCE(IDOF) = FORCE(IDOF) - FAC*BM'*STRESS;
%
% Tangent stiffness
if LTAN
EKF = BM'*ETAN*BM;
GKF(IDOF,IDOF)=GKF(IDOF,IDOF)+FAC*EKF;
end
end, end, end, end
end 99
function [SF, GDSF, DET] = SHAPEL(XI, ELXY)
%*************************************************************************
% Compute shape function, derivatives, and determinant of hexahedral
element
%*************************************************************************
%%
XNODE=[-1 1 1 -1 -1 1 1 -1;
-1 -1 1 1 -1 -1 1 1;
-1 -1 -1 -1 1 1 1 1];
QUAR = 0.125; SF(8 1): shape functions,
SF=zeros(8,1);
DSF=zeros(3,8);
for I=1:8
GDSF (3 8): shape functions derivatives
XP = XNODE(1,I);
YP = XNODE(2,I);
ZP = XNODE(3,I);
DET: Jacobian of the mapping
%
XI0 = [1+XI(1)*XP 1+XI(2)*YP 1+XI(3)*ZP];
%
SF(I) = QUAR*XI0(1)*XI0(2)*XI0(3);
DSF(1,I) = QUAR*XP*XI0(2)*XI0(3);
DSF(2,I) = QUAR*YP*XI0(1)*XI0(3);
DSF(3,I) = QUAR*ZP*XI0(1)*XI0(2);
end
GJ = DSF*ELXY;
DET = det(GJ);
GJINV=inv(GJ);
GDSF=GJINV*DSF;
end

100
One Element Tension Example
x3
%
% One element example 10kN 10kN
%
% Nodal coordinates 10kN 5 10kN
XYZ=[0 0 0;1 0 0;1 1 0;0 1 0;0 0 1;1 0 1;1 1 1;0 1 1]; 8
%
% Element connectivity
LE=[1 2 3 4 5 6 7 8];
6 7
%
% External forces [Node, DOF, Value]
EXTFORCE=[5 3 10.0E3; 6 3 10.0E3; 7 3 10.0E3; 8 3 10.0E3];
4 x2
% 1
% Prescribed displacements [Node, DOF, Value]
SDISPT=[1 1 0;1 2 0;1 3 0;2 2 0;2 3 0;3 3 0;4 1 0;4 3 0];
% 2
% Material properties x1
% MID:0(Linear elastic) PROP=[LAMBDA NU]
3
MID=0;
PROP=[110.747E3 80.1938E3];
%
% Load increments [Start End Increment InitialFactor FinalFactor]
TIMS=[0.0 1.0 1.0 0.0 1.0]';
%
% Set program parameters
ITRA=30; ATOL=1.0E5; NTOL=6; TOL=1E-6;
%
% Calling main function
NOUT = fopen('output.txt','w');
NLFEA(ITRA, TOL, ATOL, NTOL, TIMS, NOUT, MID, PROP, EXTFORCE, SDISPT, XYZ, LE);
fclose(NOUT); 101
One Element Output
Command line output
Time Time step Iter Residual
1.00000 1.000e+00 2 5.45697e-12

Contents in output.txt
TIME = 1.000e+00

Nodal Displacements

Node U1 U2 U3
1 0.000e+00 0.000e+00 0.000e+00
2 -5.607e-08 0.000e+00 0.000e+00
3 -5.607e-08 -5.607e-08 0.000e+00
4 0.000e+00 -5.607e-08 0.000e+00
5 -5.494e-23 1.830e-23 1.933e-07
6 -5.607e-08 4.061e-23 1.933e-07
7 -5.607e-08 -5.607e-08 1.933e-07
8 -8.032e-23 -5.607e-08 1.933e-07

Element Stress

S11 S22 S33 S12 S23 S13


Element 1
0.000e+00 1.091e-11 4.000e+04 -2.322e-13 6.633e-13 -3.317e-12
0.000e+00 0.000e+00 4.000e+04 -3.980e-13 1.327e-13 -9.287e-13
-3.638e-12 7.276e-12 4.000e+04 -1.592e-12 -2.123e-12 -3.317e-12
0.000e+00 0.000e+00 4.000e+04 2.653e-13 -2.123e-12 5.307e-13
0.000e+00 0.000e+00 4.000e+04 5.638e-13 3.449e-12 -1.327e-12
0.000e+00 0.000e+00 4.000e+04 -1.194e-12 4.776e-12 1.061e-12
0.000e+00 0.000e+00 4.000e+04 -7.960e-13 2.919e-12 -3.449e-12
3.638e-12 3.638e-12 4.000e+04 -5.307e-13 3.715e-12 1.061e-12
*** Successful end of program *** 102