You are on page 1of 22

MATLAB eXtended Finite Element Method

(MXFEM)








User's Guide














Matthew Jon Pais
Structural and Multidisciplinary Optimization Group
Mechanical and Aerospace Engineering Department
University of Florida
Gainesville, FL 32611



April 30, 2010
2
Table of Contents
Chapter 1: Introduction ................................................................................... 3
Chapter 2: eXtended Finite Element Method ................................................. 4
Chapter 3: Level Set Method .......................................................................... 6
Chapter 4: Fracture Mechanics ....................................................................... 8
Chapter 5: Reanalysis.................................................................................... 10
Chapter 6: Use of MXFEM........................................................................... 12
Chapter 7: Examples ..................................................................................... 17
1. Center Crack in a Finite Plate Under Uniaxial Tension ....................................... 17
2. Edge Crack in a Finite Plate Under Uniaxial Tension.......................................... 17
3. Circular Inclusion in a Finite Plate ....................................................................... 18
4. Circular Void in a Finite Plate .............................................................................. 18
5. Paris Crack Growth Law....................................................................................... 18
6. Crack Growth in Presence of a Hard/Soft Inclusion............................................. 18
7. Crack Initiation Angle for Crack Initiating from a Hole in a Plate ...................... 19
Appendix: Auxiliary Stress Fields ................................................................ 20
References ..................................................................................................... 21

3
Chapter 1: Introduction
Modeling crack growth in a traditional finite element framework is a challenging engineering task.
Originally the finite element framework was modified to accommodate the discontinuities that are caused
by phenomena such as cracks, inclusions and voids. The finite element framework is not well suited for
modeling crack growth because the domain of interest is defined by the mesh. At each increment of crack
growth, at least the domain surrounding the crack tip must be remeshed such that the updated crack
geometry is accurately represented.

Here, a simple two-dimensional plane stress and plane strain XFEM implementation within
MATLAB is presented. The extended finite element method (XFEM) along with the level set method can
be used to alleviate many of the inconveniences of using the finite element method (FEM) to model the
evolution of a crack. Special enrichment functions are added to the traditional finite element framework
through the partition of unity framework. For modeling the strong discontinuity of a cracked body two
enrichment functions are used. The Heaviside step function represents the discontinuity away from the
crack tip, and the linear elastic asymptotic crack tip displacement fields are used to account for
discontinuity at the crack tip. The crack is represented independent of the mesh by the enrichment functions
which allows for the crack geometry to be updated without a need to create/update a new mesh on the
domain. In addition, enrichment functions for a bimaterial crack are presented. For the case of a material
interface, an enrichment function is used which combines distance from the weak discontinuity and the
absolute value function. Finally, for a void, a step function is used such that the global displacement
approximation equals zero within the void.

Crack growth was modeled by combining the maximum circumferential stress criterion for predicting
the direction of crack growth. Either a constant crack growth increment or the Paris law is used to
incrementally grow a crack. The stress intensity factors needed for these models were calculated using the
domain form of the J-integral interaction integrals.
4
Chapter 2: eXtended Finite Element Method
The extended finite element method
1,2
(XFEM) allows discontinuities to be represented independent
of the finite element mesh by exploiting the partition of unity finite element method
3
(PUFEM). Arbitrarily
oriented discontinuities can be modeled independent of the finite element mesh by enriching all elements
cut by a discontinuity using enrichment functions satisfying the discontinuous behavior and additional
nodal degrees of freedom. In general the approximation of the displacement field in XFEM takes the
following form:

h
( ) N ( ) ( )
d
I I I
I I
x x x

l
l
=
l
l

u u a (2.1)
where is the entire domain and
d
is the domain containing discontinuities. In Eq. (2.1), N ( )
I
x are the
traditional finite element shape function, ( ) x is the discontinuous enrichment function, and
I
u ,
I
a are
the traditional and enriched degrees of freedom (DOF). Note that where
d
= the enrichment
function ( ) x vanishes. As the discontinuities are not defined by the finite element mesh the level set
method is used to track the discontinuities. The approximation in Eq. (2.1) does not satisfy interpolation
property; i.e., ( )
h
I I
x u u due to enriched degrees of freedom. A common practice to satisfy the
interpolation property in implementations of XFEM is to 'shift' the enrichment function
4
such that
( ) ( ) ( )
I I
x x x = . (2.2)
where ( )
I
x is the shifted enrichment function for the i
th
node and ( )
I
x is the value of ( ) x at the i
th

node. Thus, the interpolation property is recovered as the shifted enrichment function ( )
I
x vanishes at
the node. Here lower case variables are used to represent the unshifted enrichment functions.
Crack Enrichment
For the modeling of a crack in a homogeneous material, two different enrichment schemes are
employed. For an element completely cut by a crack the Heaviside
2
enrichment function is used such that

Above Crack
Below Crack
1
h( )
1
x
'
1
1
=
!
1
1
+
. (2.3)
Thus a discontinuity is explicitly added to an element cut by a crack.
For the case of an element containing the crack tip the functions originally introduced by Fleming
5
for
the representing crack tip displacement fields in the element-free Galerkin (EFG) method and repeated by
Belytschko
1
are repeated. The near tip displacement field takes the form of the following four functions

1 4
( ), sin , cos , sin cos , sin cos
2 2 2 2
x r r r r



=
l
=
l
l
(2.4)
where r and are the polar coordinates in the local crack-tip coordinate system. Note that the crack tip
enrichment functions in Eq. (2.4) introduces a discontinuity across the crack in the element containing the
tip, while the Heaviside function in Eq. (2.3) does in the elements cut by the crack. When a node would be
enriched by both Eqs. (2.3) and (2.4), only Eq. (2.4) is used.
Bimaterial Crack Enrichment
For the case of a bimaterial crack, the enrichment functions introduced by Sukumar
6
are used. Due to
the oscillatory nature of the singularity a more complex near tip displacement field is required which takes
the form of
5

( ) ( )

( ) ( )
( ) ( )
( ) ( )
( ) ( )
- -
1 12
-
- -
( ), cos log e sin , cos log e cos ,
2 2
cos log e sin , cos log e cos ,
2 2
cos log e sin sin , cos log e cos sin ,
2 2
sin log e sin , sin log e cos ,
2 2
sin log e sin , sin log e
2
x r r r r
r r r r
r r r r
r r r r
r r r r














=
=
( ) ( )

cos ,
2
sin log e sin sin , cos log e cos sin
2 2
r r r r



(2.5)
where r and are polar coordinates in the local crack tip coordinate system and is a constant which is
a bimaterial constant given by

1 1
log
2 1


1
=


( )
(2.6)
where is the second Dundurs
7
parameter given by

( ) ( )
( ) ( )
1 2 2 1
1 2 2 1
1 2 1 2
1 1
v v
v v



=

(2.7)
where is the shear modulus and v is Poisson's ratio. Please refer to the paper by Sukumar
6
for the
derivatives of these enrichment functions with respect to the global coordinate system.
Inclusion Enrichment
Sukumar
8
was the first to try and represent a material interface using an enrichment in XFEM. This
enrichment took the form

( ) ( )
I I
I
x N x =

(2.8)
where
I
are the nodal level set values for the material interface level set function. This solution however,
lead to issues with blending between the enriched and unenriched elements. To improve the convergence
rate a minimization problem was formulated which improved the convergence.
Mos
9
then addressed the problem using a modified absolute value enrichment where

( ) ( ) ( )
I I I I
I I
x N x N x =

. (2.9)
This enrichment was shown to have optimal convergence. In addition, note that the enrichment function
goes to zero at all nodes such that it does not need to be shifted like many other enrichment functions.
Void Enrichment
Voids
8,10
have been modeled independent of the finite element mesh using a different enrichment
strategy which takes the form of
( ) V( ) N ( )
h
I I
I
x x x

=

u u (2.10)
where V( ) x is the void enrichment taking a value of 0 inside the void and 1 outside the void. In two-
dimensions, integration is performed only in the portion of an element containing material and nodes with
support completely within in void are fixed.
6
Chapter 3: Level Set Method
The level set method is a versatile method for computing and analyzing the evolution of an interface
in two or three dimensions, which was introduced by Osher and Sethian
11
. The interface bounds an open
region . The velocity of the evolving interface can depend on position, time, interface geometry and the
physics of the underlying problem. The level set function will be used for representing the material
interface between the fiber and matrix as well as the geometry of a crack.
The level set function ( ( ), ) x t t is a continuous function, where ( ) x t is a point in the domain . The
level set function has the following properties

( ( ), ) 0 for
( ( ), ) 0 for
( ( ), ) 0 for
x t t x
x t t x
x t t x

<

=
(11)
Therefore, the boundary of interest at any given time t can be located by finding ( ) x t that satisfies the
following equation:
( ( ), ) 0 x t t = (12)
The boundary is commonly referred to as the zero level set of which can be abbreviated as
o
. Equation
(12) is commonly referred to as the level set equation. The typical approach to using the level set equation
to propagate a moving front over time is to differentiate with respect to time which yields

( )
0
( )
x t
t t x t

=

(13)
Equation (13) can be rewritten as

,
0
t
V =

(14)
where V

is the velocity field. This partial differential equation can then be solved numerically by
discretizing and using a finite difference approach to approximate the gradient of . The derivative of
with respect to the time t can be approximated using the forward difference method as

1
0
n n
n n
V
t

(15)
which can be rewritten into a more convenient form for updating in two-dimensions as

( )
1
, ,
n n n n n n
x y
t u v

= (16)
where u and v are the x and y components of the evolving interface velocity. The time step t is
governed by the Courant-Friedrichs-Lewy (CFL) condition
12
. The CFL condition ensures that the
approximation of the solution to the partial differential equation given in Eq. (13) is convergent. The
limiting parameter for the time step in two-dimensions can be written as

( )
( )
max ,
max ,
x y
t
u v

< (17)
where x and y represent the grid spacing in the x and y-directions.
For modeling a composite material, a fiber in a matrix will be considered. The level set function
associated with a cylindrical fiber in the composite is denoted ( ) x and calculated as
7
( ) ( ) ( )
2 2
i c i c c
x x y y r = x (18)
where
i
x and
i
y are the coordinates of the
th
i node in the domain,
c
x and
c
y are the coordinates of the
center of the fiber and
c
r is the fiber radius.
The analytical form of the level set function as in Eq. (27) is limited for simple geometries. In addition,
when the interface moves according to Eq. (23), the new interface will not have a simple analytical
expression. Stolarska
13
introduced an extension of the level set method for modeling the evolution of a one-
dimensional curve in a piecewise linear fashion with a particular focus on representing the evolution of a
crack. Instead of having analytical expression of the level set function, a discrete value is assigned at each
node of finite elements, and the location of zero level set is found using interpolation.
Sukumar
8
proposed additional enrichments via the level set method for the modeling of holes and
inclusions. Two level set functions and are needed to track the growth of an open curve in this case a
crack: one for the crack path and the other for the crack tip. In this extension the crack path is represented
as the zero level set of ( ( ), ) x t t . The level set is oriented such that its zero level set passes through the
current crack tip and is oriented in the direction of the crack tip speed function. The zero level set of
( ( ), ) x t t is then given by the line intersecting the current crack tip and orthogonal to the zero level set of
.
For the and level set functions, each grid point is assigned a distance from that point to the
nearest point of that function's zero level set. The sign of the distance for the level set function is
positive on the side counter-clockwise from the direction of the crack tip speed function and negative on
the clockwise side. The sign of the distance function for the function is positive on the side in the
direction of crack growth and negative on the opposite side. The crack is defined to be the locations where
the following conditions are true

( )
( )
( ), 0
( ), 0
x t t
x t t

=
. (19)
8
Chapter 4: Fracture Mechanics
The amount of crack growth depends up on the chosen crack growth law and type of problem being
solved. The maximum circumferential stress criterion
14
is used to evolve the crack in which the crack will
propagate in the direction where

is a maximum. The angle of crack growth is given by


( )
2
1
2arctan 8
4
I I
c II
II II
K K
sign K
K K

1
1
=


( )

( )
(3.1)
where
I
K and
II
K are the mixed-mode stress intensity factors. The magnitude of the incremental crack
growth can be determined either using a constant crack growth increment, typically assumed to be 1/10 of
the initial crack length or using Paris Law. Recall that Paris Law
15
is given by
( )
m
da
C K
dN
= (3.2)
where C and m are Paris Law constants. Tanaka
16
gave a version of K suitable for mixed-mode stress
intensity factors where

4 4 4
8
I II
K K K = . (3.3)
The incremental crack growth length is given by
( )
m
a CN K = . (3.4)
Thus, the direction of crack growth is a function of mixed-mode stress intensity factors. The domain
forms of the interaction integrals
14,17
are used to calculate the mixed-mode stress intensity factors. For a
general mixed-mode situation the relationship between the J-integral and the stress intensity factors as

2 2
I II
eff eff
K K
J
E E
= (3.5)
where
eff
E is defined by a state of plane stress or plane strain as

2
, plane stress
, plane strain
1
eff
E
E
E
v
'
1
1
1
=
!
1
1
1
+
(3.6)
where E is Young's modulus and v is Poisson's ratio. In order to calculate the mixed-mode stress intensity
factors, an auxiliary stress state is superimposed onto the stress and displacement fields from the XFEM
analysis. The auxiliary stress and displacement equations are chosen to be those derived by Westergaard
18

and Williams
19
which are given in the Appendix. For the case of a bimaterial crack, refer to Sukumar
6
for
the auxiliary fields for this crack configuration. The XFEM solutions are denoted with superscript (1) as
( ) 1
ij
,
( ) 1
ij
and
( ) 1
i
u , while that from the auxiliary state as
( ) 2
ij
,
( ) 2
ij
and
( ) 2
i
u .
Recall that the J-integral
20
takes the form of

k
i i jk j
i
u
J Wn n d
x

l
= l
l
l

(3.7)
where W is the strain energy density and i denotes the crack tip opening direction, which is assumed to
correspond to the global x-direction, denoted
1
x . Equation (3.7) can be rewritten as

1 1
1
i
j ij j
u
J W n d
x

l
= l
l
l

. (3.8)
The two stress states can be superimposed into Eq. (3.8) such that
9

( ) ( )
( )
( ) ( )
( )
( ) ( )
( )
( ) ( )
( ) (1 2)
1 2
1 2 1 2 1 2
1 1
1
1
2
i i
j j ij ij ij ij ij ij
u u
J n d
x

l

l
=
l

l
l

. (3.9)
The J-integrals for pure state 1 and auxiliary state 2 can be separated from Eq. (3.9), which leaves an
interaction term such that

( ) ( ) ( ) ( ) 1 2 1 2 1,2
1 1 1
J J J I

= (3.10)
where
( ) 1,2
I is the interaction term and is given by

( ) ( ) ( )
( )
( )
( ) 2 1
1 2 1,2 1,2
1
1 1
i i
j j ij ij
u u
I W n d
x x

l

l
=
l
l

(3.11)
where
( ) 1,2
W is the interaction strain energy density

( ) ( ) ( ) ( ) ( ) 1 2 2 1 1,2
ij ij ij ij
W = = . (3.12)
Since we are superimposing two cracked configurations onto one another we can also write Eq. (3.5)
as

( )
( ) ( )
( )
( ) ( )
( )
2 2
1 2 1 2
1 2
1
I I II II
eff eff
K K K K
J
E E


= . (3.13)
Expanding and rearranging terms from Eq. (3.13) yields

( ) ( ) ( )
( ) ( ) ( ) ( )
( )
1 2 1 2
1 2 1 2
1 1 1
2
I I II II
eff
K K K K
J J J
E


= . (3.14)
Setting Eq. (3.10) and Eq. (3.14) equal leads to the relationship

( )
( ) ( ) ( ) ( )
( )
1 2 1 2
1,2
2
I I II II
eff
K K K K
I
E

= . (3.15)
The stress intensity factors for the current state can be found by separating the two modes of fracture. By
selecting
( ) 2
1
I
K = and
( ) 2
0
II
K = , we are able to solve for
( ) 1
I
K such that

( )
( ) 1,Mode I
1
2
eff
I
I E
K = . (3.16)
A similar procedure can also be followed such that
( ) 1
II
K is given by

( )
( ) 1,Mode II
1
2
eff
II
I E
K = . (3.17)
The contour defining
( ) 1,2
I is converted to an area integral by using a smoothing function q . This
function takes a value of 1 on the innermost contour and a value of 0 on the outermost contour. At any
point in A, the linear shape functions are used to interpolate the value of q . The divergence theorem can
be used to give the following equation for the domain form of the interaction integral.

( ) ( ) ( ) ( )
d
2 1
1 2 1,2 1,2
1
1 1
i i
j ij ij
j
A
u u q
I W A
x x x

l

l =
l
l

(3.18)
10
Chapter 5: Reanalysis
Recall that the approximation of the displacement in XFEM takes the form

( ) ( ) ( ) ( )
4
1
h
I I I I I
I
u x N x u H x a x b

=
l
l
=
l
l

(19)
and the corresponding finite element stiffness matrix takes the form

uu ua ub
T
ua aa ab
T T
ub ab bb
K K K
K K K K
K K K
l
l
l
l =
l
l
l
l
. (20)
It can be noticed from Eq. (19) that the stiffness component associated with the traditional finite
element approximation is not a function of the crack location, which implies that the
uu
K component of
the stiffness matrix will be constant at each iteration of crack growth. This implies that the changing
portion of the stiffness matrix is the enriched portion, which will be small compared to the unenriched
portion. Furthermore, it can also be noticed that while the Heaviside enrichment term is a function of the
crack location within an element, that once an element has been enriched with the Heaviside enrichment its
stiffness value will not change in any future iterations, meaning that the stiffness components containing
subscript a will be constant for future iterations of crack growth.

Thus it is only necessary to consider elements which convert from a crack tip enrichment to a Heaviside
enrichment as a result of crack growth and new elements containing crack tips at each iteration after the
initial iteration. If an incremental crack growth increment of a which is proportional to the elemental
length is considered then for any iteration after the initial iteration the stiffness matrix in only about 10
elements per tip must be considered instead of the entire domain. This clearly leads to a drastic decrease in
the computational time required for the simulation of crack growth in the XFEM environment.

Further increases in reducing computational time may be achieved by considering an incremental
Cholesky factorization of the global stiffness matrix. This algorithm is based on the realization that the
crack exists in a relatively small area of the total domain being modeled. Furthermore, of the enriched
domain, a large amount of the domain can be considered to be constant as the result of the Heaviside
enrichment. Recall that the Cholesky factorization of a matrix A takes the form

11 12 11 11 21
21 22
12 22 22
0
0
T T
T
T T
A A L L L
A LL
L L
A A L
l l
l
l l
l
= = =
l l
l
l l
l
l
l l
. (21)
where

( )
( )
11 11
21 11 12
22 22 21 21
T
T
L chol A
L L A
L chol A L L
=
=
=
. (22)
With the above algorithm,
11
A can be considered to be equivalent to
11

11
uu ua
T
ua aa
K K
A
K K
l
l
=
l
l
l
(23)
in the first iteration. Then the components of the global stiffness matrix associated with the crack tip can be
considered as

12 22
,
ub
bb
ab
K
A A K
K
l
l
= =
l
l
l
. (24)
Then
11
A can be kept and reused at future iterations of crack growth. Then the above algorithm can be
used to find the factorization for the new constant stiffness matrix components as a result of new Heaviside
nodes. The new factorization can be appended to the end of the previous iteration's
11
A , then Eqs. (22) and
(24) can be used to factor the new crack tip stiffness matrix. Due to limitations in sparse division present
within MATLAB, the above algorithm has not been implemented in this work. Instead the global stiffness
matrix is modified at each increment and factored from scratch within MATLAB. An iterative procedure
such as the one introduce by Wu
4
could also be used to solve the system of equations.
12

Chapter 6: Use of MXFEM
The MATLAB code has been prepared such that the user modifies the inputQuasiStatic.m file, then
runs xfemQuasiStatic.m from the MATLAB Command Window to solve a quasi-static crack problem. For
an optimization problem the user modifies both inputOptimization.m and xfemOptimization.m and runs
inputOptimization.m to solve the given problem. A detailed description of the input variables follows as
well as a brief summary of the functions which make up the complete code follows.
bimatctipNodes.m
This function calculates the values of the enrichment functions at the nodes enriched with the bimaterial
crack tip enrichment function.
boundaryCond.m
This function applies boundary conditions on the domain. Options included in the current package include
fixing the bottom of the rectangular domain in the y-direction and bottom left hand corner with respect to x
and y, edge crack, half center crack, full center crack, rollers on bottom and left edge, and symmetric about
midpoint. For the case of voids, the additional fixed degrees of freedom are also calculated and added to the
system of equations.
calcDOF.m
This function calculates the total number of degrees of freedom in the system considering traditional,
Heaviside, crack tip, bimaterial crack tip, and inclusion degrees of freedom.
connectivity.m
This function calculates the global XYZ coordinates of all the nodes, defines element connectivity and also
begins to build the NODES matrix which keeps track of the numbering for the enriched degrees of
freedom.
crackCoord2Length.m
This function creates a vector a which consists of the crack length at each iteration from CRACK. This
function is independent of the main code.
ctipNodes.m
This function calculates the values of the enrichment functions at the nodes enriched with the crack tip
enrichment function.
elemStress.m
This function calculates the nodal stress values for the given geometry. If an element by element stress plot
is to be made, then the nodal stress values may or may not be averaged based on the user's specifications.
enrElem.m
This function identifies the enriched elements or the enriched elements which will be modified by the
reanalysis algorithm.
forceVector.m
This function creates the global force vector.
13
gauss.m
This function contains the values of integration points and weights needed for Gauss quadrature in
quadrilaterals and triangles.
growCrack.m
This function determines the angle and magnitude of the next crack growth increment from all crack tips.
The direction of future crack growth is determined based on the maximum circumferential stress criterion.
If the Paris Law constants are assigned in inputQuasiStatic.m then the Paris Law with the Tanaka mixed-
mode correction are used to determine the increment of crack growth. If the effective stress intensity factor
does not exceed the critical stress intensity factor no crack growth occurs and the iterations of growth exit.
heaviNodes.m
This function calculates the values of the enrichment functions at the nodes enriched with the Heaviside
enrichment function.
inputLoadHistory.m
Allows for variable amplitude, uniaxial tension loading in the y-direction. The value of amplitude at each
iteration is input into loadHistory vector within inputLoadHistory.m. For the use of variable amplitude
loading, FORCE in inputQuasiStatic should be empty.
inputOptimization.m
Follows the same layout as inputQuasiStatic.m however, the optimization problem also requires the
modification of the xfemOptimization.m file in order for the crack to be moved at each iteration of the
optimization. See benchmark for example. Note that based on the optimization being performed, the use of
this file may be drastically different.
inputQuasiStatic.m
The following input variables are used to define the problem of interest: DOMAIN, MAT, CRACK, INC,
VOID, GROW, FORCE, BC, PLOT. In order for an analysis to successfully run, the minimum required
variables to be defined are DOMAIN, MAT, GROW, FORCE and BC. A listing of the variables, their size
and their meaning follows.

DOMAIN
This variable defines the rectangular domain and mesh density for the given analysis.
DOMAIN(1) = number of elements in the x-direction
DOMAIN(2) = number of elements in the y-direction
DOMAIN(3) = element length in x-direction
DOMAIN(4) = element length in y-direction (currently DOMAIN(3) must equal DOMAIN(4))

MAT
This variable defines the material properties for the given analysis.
MAT(1) = Young's modulus for domain
MAT(2) = Poisson's ratio for domain
MAT(3) = Young's modulus for inclusion
MAT(4) = Poisson's ratio for inclusion
MAT(5) = plane stress (1) or strain (2)
MAT(6) = plane stress thickness
MAT(7) = critical stress intensity factor for domain

14
CRACK
This variable defines the points which define the linear segments of the crack.
CRACK(i,1) = x-coordinate of the 1st point of the ith segment
CRACK(i,2) = y-coordinate of the 1st point of the ith segment
CRACK(i+1,1) = x-coordinate of the 2nd point of the ith segment, 1st point of the (i+1)th segment
CRACK(i+1,2) = y-coordinate of the 2nd point of the ith segment, 1st point of the (i+1)th segment

INC
This variable defines the location of the inclusion. Two options are provided, either a linear section cutting
the domain into two pieces or circular inclusion(s).
INC(i,1) = x-coordinate of center of inclusion i
INC(i,2) = y-coordinate of center of inclusion i
INC(i,3) = radius of inclusion i

INC(i,1) = x-coordinate of first point defining linear inclusion
INC(i,2) = y-coordinate of first point defining linear inclusion
INC(i,3) = x-coordinate of second point defining linear inclusion
INC(i,4) = y-coordinate of second point defining linear inclusion

VOID
This variable defines the location of the voids. Circular void(s) are available.
VOID(i,1) = x-coordinate of center of void i
VOID(i,2) = y-coordinate of center of void i
VOID(i,3) = radius of void i

GROW
This variable defines how many iterations of crack growth will occur as well as how the growth is modeled.
GROW(1) = Total number of cycles
GROW(2) = Crack growth increment

GROW(1) = Total number of cycles
GROW(2) = Number of cycles per growth increment
GROW(3) = Paris Law constant
GROW(4) = Paris Law exponent

FORCE
This variable determines the applied loading to the rectangular domain.
FORCE(1) = uniaxial tension in global x (1) or y (2) direction
FORCE(2) = magnitude of force in the x-direction along applied direction
FORCE(3) = magnitude of force in the y-direction along applied direction

BC
This variable determines which boundary conditions should be applied to the rectangular domain.
BC(1) = 1, bottom edge roller, bottom left corner fixed
BC(1) = 2, edge crack
BC(1) = 3, half center crack
BC(1) = 4, full center crack
BC(1) = 5, rollers bottom and left edges
BC(1) = 6, symmetric about midpoint

PLOT
This variable controls which plots are output by the MATLAB code. For all cases 1 = Yes, 0 = No.
PLOT(1,1) = plot level set functions
PLOT(1,2) = plot phi level set functions
PLOT(1,3) = plot psi level set function
PLOT(1,4) = plot zeta level set function (inclusions)
15
PLOT(1,5) = plot chi level set function (voids)
PLOT(1,6) = plot the discontinuity on the level set plot
PLOT(1,7) = define the narrow band level set radius for crack as integer for number of elements
PLOT(2,1) = plot mesh
PLOT(2,2) = plot node numbers
PLOT(2,3) = plot element numbers
PLOT(2,4) = plot enriched nodes (blue circle - Heaviside, blue square - crack tip, black circle - inclusion)
PLOT(2,5) = plot discontinuities (crack, inclusion, voids)
PLOT(2,6) = plot J-domain search radius
PLOT(3,1) = plot the deformed mesh
PLOT(3,2) = plot node numbers
PLOT(3,3) = plot element numbers
PLOT(3,4) = enriched nodes (blue circle - Heaviside, blue square - crack tip, black circle - inclusion)
PLOT(3,5) = plot deformed crack (inner element only)
PLOT(3,6) = deformation scaling factor (if zero, calculated by code)
PLOT(4,1) = plot the stress on an element-by-element basis
PLOT(4,2) = average nodal stress values
PLOT(5,1) = plot the stress contours, default is contour lines
PLOT(5,2) = plot the filled stress contours
PLOT(5,3) = plot the Von Mises stress contour only

Examples of PLOT for Various Outputs
Plot the phi and psi level sets with default narrow band radius:
PLOT(1,:) = [1 1 0 0 0 0 0];

Plot the phi, psi, zeta and chi level sets with default narrow band radius:
PLOT(1,:) = [1 1 1 1 1 0 0];

Plot the phi, psi, zeta and chi level sets with 10 element narrow band radius:
PLOT(1,:) = [1 1 1 1 1 0 10];

Plot the mesh with node numbers:
PLOT(2,:) = [1 1 0 0 0 0 0];

Plot the mesh with enriched nodes and discontinuities:
PLOT(2,:) = [1 0 0 1 1 0 0];

Plot the
xx
,
yy
, and
xy
stress contours:
PLOT(5,:) = [1 1 0 0 0 0 0];

Plot only the Von Mises stress contours:
PLOT(5,:) = [1 1 1 0 0 0 0];
JIntegral.m
This function calculates the mixed-mode stress intensity factors for the traditional or bimaterial crack tip
enrichment functions. The default J-domain search radius is 4 elements around the crack tip. The stress
intensity factors are retuned such that the last tip in CRACK is first and the first tip in CRACK is second.
levelSet.m
This function creates the , , and level set functions used to track the crack tips, crack body, voids
and inclusions. In addition this file defines the locations of the enriched degrees of freedom and assign
these enriched nodes tracking values in the NODES matrix.
16
plotContour.m
This function plots the stress contours and discontinuities. The option for a filled contour is provided.
plotDeformation.m
This function plots the deformed mesh. Options are available for plotting node and element numbers, the
enriched nodes are available.
plotLevelSet.m
This function plots the , , and level set functions. The discontinuities may be plotted.
plotMain.m
This function controls which plots are created based on inputQuasiStatic.m
plotMesh.m
This function plots the finite element mesh. Options are available for plotting node and element numbers,
the enriched nodes, the discontinuities and the J-domain radius.
plotStress.m
This function plots the stress distribution within each element and discontinuities. The option to average
nodal stress values is available.
stiffnessMatrix.m
This function calculates the global stiffness matrix for the system of equations.
subDomain.m
This function subdivides elements containing discontinuities into triangles so that accurate integration can
be performed in these elements.
updateStiffness.m
This function performs the reanalysis algorithm on the stiffness matrix.
xfemOptimization.m
This function is optimized by the desired function in order to optimized the user defined function.
xfemQuasiStatic.m
This function controls the calling of the various functions such that the desired analysis functions well. This
is the function which is run in the command window such that the analysis runs.
17
Chapter 7: Examples
The following examples are given to show that the provided code provides accurate results for a
variety of problems which have well known theoretical values. Please refer to the Examples folder in the
provided download file which contains the input files for these Example problems.
1. Center Crack in a Finite Plate Under Uniaxial Tension
The theoretical Mode I stress intensity factor
I
K for this configuration is given as
( )
I
K F a = (5.1)
where is the applied nominal stress, 2a is the crack length and ( ) F is a factor associated with the
finite effect of the plate
21
given by
( )
( )
( )
2 4
sec 1 0.025 0.06
2
F

= (5.2)
and is the ratio between the crack length and the width of the plate given as

a
W
= (5.3)
where 2W is the width of the plate.

Here the following values are used, a = 1, W = 3, = 1. This corresponds to a theoretical Mode I stress
intensity factor of 1.90. Two models are used and for each case the elemental length is 1/20 which
corresponds to a mesh of size 60 x 200. When half of the center crack is modeled the calculated stress
intensity factors are K
I
= 1.86 and K
II
= 0.003, which are in good agreement with theoretical values. When
the full center crack is modeled the calculated stress intensity factors are K
I
= 1.88 and K
II
= -2.02E-4 at the
right tip and K
I
= 1.88 and K
II
= -0.61E-4 at the left tip, which are also in good agreement with theoretical
values.
2. Edge Crack in a Finite Plate Under Uniaxial Tension
The theoretical Mode I stress intensity factor
I
K for this configuration is given as
( )
I
K F a = (5.4)
where is the applied nominal stress, a is the crack length and ( ) F is a factor associated with the
finite effect of the plate
22
given by
( )
2 3 4
1.12 0.231 10.55 21.72 30.39 F = (5.5)
and is the ratio between the crack length and the width of the plate given as

a
W
= (5.6)
where W is the width of the plate.

Here the following values are used, a = 1, W = 3, = 1. This corresponds to a theoretical Mode I stress
intensity factor of 3.17. For an elemental length of 1/20 which corresponds to a mesh of size 60 x 120, the
calculated stress intensity factors are K
I
= 3.17 and K
II
= 0.0011, which are in good agreement with
theoretical values.
18
3. Circular Inclusion in a Finite Plate
Here an inclusion with E = 70 GPa and v = 0.3 and radius 0.5 is placed in the center of a plate of size 6 x 10
with E = 50 GPa and v = 0.3 which is subjected to a unit tension in the y-direction. The stress values were
calculated using ANSYS and the resulting stress plots were compared to the MATLAB XFEM
implementation.
4. Circular Void in a Finite Plate
Here a void of radius 0.3 is placed in the center of a plate of size 3 x 3 which is subjected to a unit stress in
the y-direction. The stress plot for
yy
is in excellent agreement with the expected 3 stress concentration
at the edges of the hole.
5. Paris Crack Growth Law
Here the XFEM code is used to grow a crack until the Mode I stress intensity factor reaches the critical
value. The example used for comparison is one in which a center crack of length 0.02 is on the wall of a
pressure vessel with applied pressure 0.06 MPa, radius of 3.25 m and thickness of 0.00248 m. The material
properties are those of an aluminum alloy with E = 70 GPa and v = 0.33. The XFEM simulates growth in
increments of 100 cycles up to 4500 for crack growth in an infinite plate. At each increment, the XFEM
values are compared to those of the theoretical current crack size from Paris Law
15
, which are given as

1
1
1
2
2
1
2 2
m
m
m
N o
m pr
a NC a
t

(
| |
| |
(
= +
|
|
|
( \
\

(5.7)
where N is the number of cycles, C is the Paris Law constant, m is the Paris Law exponent, and
o
a is
the initial crack length. A comparison of the XFEM and Paris Law values are given in Figure 1.

0 500 1000 1500 2000 2500 3000 3500 4000 4500
0.02
0.03
0.04
0.05
0.06
0.07
0.08
Number of Cycles
C
r
a
c
k

L
e
n
g
t
h

(
m
)
Comparison on Analytical Paris Law and XFEM with Paris Law Growth Increments


Paris Law
XFEM

Figure 1. Comparison of XFEM and Paris Law predictions of crack growth.
6. Crack Growth in Presence of a Hard/Soft Inclusion
Here an example problem used by Bordas
23
is repeated. In this problem, a domain of width 4 and height 8
contains a circular inclusion with radius 1 and center at width/2 and height/4. An initial edge crack of 0.5 is
located along the left edge of the domain at height/2. The inclusion is either harder or softer than the main
material with a ratio of 10 or 0.1. The crack is grown until it passes the inclusion. Results correspond very
well to published results. Note that the boundary conditions are not specified in the paper and that the
19
resulting difference between the assumed and published solution are most likely a result of different
boundary conditions.
7. Crack Initiation Angle for Crack Initiating from a Hole in a Plate
Here an example optimization problem is solved of the form

( )
s.t.
min
2 2
G


(5.8)
for a plate with a hole under uniaxial tension. The theoretical solution is 0 degrees, while the optimization
result is an initial angle of -1.7287e-005 degrees.
20
Appendix: Auxiliary Stress FieldsThe auxiliary stresses derived by
Westergaard and Williams are

11
1 3 3
cos 1 sin sin sin 2 cos cos
2 2 2 2 2 2 2
I II
K K
r

l l
=
l l
l l
(A1)

22
1 3 3
cos 1 sin sin sin cos cos
2 2 2 2 2 2 2
I II
K K
r

l
=
l
l
(A2)
( )
33 11 22
v = (A3)

23
1
cos
2 2
III
K
r

= (A4)

31
1
sin
2 2 r

= (A5)

12
1 3 3
sin cos cos cos 1 sin sin
2 2 2 2 2 2 2
I II
K K
r

l
=
l
l
(A6)
and the auxiliary displacements are
( ) ( )
1
1
cos cos sin 2 cos
2 2 2 2
I II
r
u K K



= (A7)
( ) ( )
2
1
sin sin cos 2 cos
2 2 2 2
I II
r
u K K



= (A8)

3
2
sin
2 2
III
r
u K


= (A9)
where is the shear modulus and is the Kosolov constant.

21
References

1
Belytschko, T., Black, T., "Elastic crack growth in finite elements with minimal remeshing." International
Journal for Numerical Methods in Engineering, Vol. 45, 1999, pp. 601-620.

2
Mos, N., Dolbow, J., Belytschko, T., "A finite element method for crack growth without remeshing."
International Journal for Numerical Methods in Engineering, Vol. 46, 1999, pp. 131-150.

3
Babuska, I., Melenk, J., "The Partition of Unity Method." International Journal for Numerical Methods in
Engineering, Vol. 40, 1997, pp. 727-758.

4
Belytschko, T., Mos, N., Usui, S., Parimi, C., "Arbitrary discontinuities in finite elements." International
Journal for Numerical Methods in Engineering, Vol. 50, 2001, pp. 993-1013.

5
Fleming, M., Chu, A., Moran, B., Belytschko, T., "Enriched Element-Free Galerkin Methods for Crack
Tip Fields." International Journal for Numerical Methods in Engineering, Vol. 40, 1997, pp. 1483-1504.

6
Sukumar, N., Huang, Z., Prvost, J., Suo, Z., "Partition of unity enrichment for bimaterial interface
cracks." International Journal for Numerical Methods in Engineering, Vol. 59, 2004, pp. 1075-1102.

7
Dundurs, J., "Edge-bonded dissimilar orthogonal elastic wedges." Journal of Applied Mechanics, Vol. 36,
1969, pp. 650-652.

8
Sukumar, N., Chopp, D., Mos, N., Belytschko, T., "Modeling holes and inclusions by level sets in the
extended finite-element method." Computer Methods in Applied Mechanics and Engineering, Vol. 190,
2001, pp. 6183-6200.

9
Moes, N., Cloirec, M., Cartraud, P., Remacle, J., "A Computational Appraoch to Handle Complex
Microstructure Geometries." Computer Methods in Applied Mechanics and Engineering, Vol. 192, 2003,
pp. 3163-3177.

10
Daux, C., N, M., Dolbow, J., Sukumar, N., Belytschko, T., "Arbitrary branched and intersecting cracks
with the extended finite element method." International Journal for Numerical Methods in Engineering,
Vol. 48, 2000, pp. 1741-1760.

11
Osher, S., Sethian, J., "Fronts propagating with curvature dependent speed: Algorithms based on
Hamilton-Jacobi formulations." Journal of Computational Physics, Vol. 79, 1988, pp. 12-49.

12
Courant, R., Friedrichs, K., Lewy, H., "On the partial difference equations of mathematical physics."
Mathematische Annalen, Vol. 100, 1928, pp. 32-74.

13
Stolarska, M., Chopp, D., Mos, N., Belytschko, T., "Modelling crack growth by level sets in the
extended finite element method." International Journal for Numerical Methods in Engineering, Vol. 51,
2001, pp. 943-960.

14
Shih, C., Asaro, R., "Elastic-plastic analysis of cracks on bimaterial interfaces: part I - small scale
yielding." Journal of Applied Mechanics, Vol. 55, 1988, pp. 299-316.

15
Paris, P., Gomez, M., Anderson, W., "A Rational Analytic Theory of Fatigue." The Trend in Engineering,
Vol. 13, 1961, pp. 9-14.

16
Tanaka, K., "Fatigue Crack Propagation from a Crack Inclined to the Cyclic Tension Axis." Engineering
Fracture Mechanics, Vol. 6, 1974, pp. 493-507.

22
17
Yau, J., Wang, S., Corten, H., "A mixed-mode crack analysis of isotropic solids using conservation laws
of elasticity." Journal of Applied Mechanics, Vol. 47, 1980, pp. 335-341.

18
Westergaard, I., "Bearing pressures and cracks." Journal of Applied Mechanics, Transactions ASME, Vol.
61, 1939, pp. A49-A53.

19
Williams, M., "On the stress distribution at the base of a stationary crack, ." Journal of Applied
Mechanics, Vol. 24, 1957, pp. 109-114.

20
Rice, J., "A path integral and the approximate analysis of strain concentration by notches and cracks."
Journal of Applied Mechanics, Vol. 35, 1968, pp. 379-386.

21
Mukamai, Y. (ed.), Stress Intensity Factors Handbook, Pergamon Press, 1987.

22
Brown, W., Srawley, J., "Plain strain crack toughness testing of high-strength metallic materials." ASME
STP 410, Vol., 1966, pp. 12.

23
Bordas, S., Vinh Nguyen, P., Dunany, C., Nguyen-Dang, H., Guidoum, A., "An extended finite element
library." International Journal for Numerical Methods in Engineering, Vol. 2, 2006, pp. 1-33.

You might also like