0% found this document useful (0 votes)
2 views26 pages

Sparse Finite Element Matrices

The document discusses the sparsity of finite element matrices, particularly the global stiffness matrix, which contains many zeros due to limited interactions between finite elements and degrees of freedom. It outlines methods for determining the number of nonzero entries in the matrix, emphasizing the importance of element connectivity and nodal basis functions in optimizing computational efficiency. Additionally, it provides examples and observations related to the sparsity patterns in various mesh configurations.

Uploaded by

Antonio Mateos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views26 pages

Sparse Finite Element Matrices

The document discusses the sparsity of finite element matrices, particularly the global stiffness matrix, which contains many zeros due to limited interactions between finite elements and degrees of freedom. It outlines methods for determining the number of nonzero entries in the matrix, emphasizing the importance of element connectivity and nodal basis functions in optimizing computational efficiency. Additionally, it provides examples and observations related to the sparsity patterns in various mesh configurations.

Uploaded by

Antonio Mateos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Sparse Finite Element Matrices

Sparsity Pattern of Non zeros for the Stiffness Matrix for


Elasticity, with a mesh of Quadrilateral Elements

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 1 of 26


Why is the Finite Element Matrix
Sparse?
The assembled finite element global stiffness ma-
trix (or mass matrix) is often filled with many ze-
ros—hence, it is called a sparse matrix.
The global stiffness matrix [K] is sparse, meaning
most of its entries are zero.
This sparsity arises because each finite element
only interacts with a small subset of the total de-
grees of freedom in the system.
The number of nonzero entries in any row cor-
responds to the nodes that interact with a given
node in the mesh. This interaction is dictated by
the local support of the nodal basis function and
the element connectivity.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 2 of 26


How can we determine the number of
nonzero entries in a row or column of
the assembled finite element matrix be-
fore explicitly assembling the matrix?
This is a question in computational efficiency be-
cause knowing the sparsity counts of nonzero val-
ues and patterns in advance helps optimize stor-
age and solver performance.
In practice, this can make the difference between
waiting 24 hours or 1 hour for a solver job to com-
plete, and whether you can run this job on your
laptop or need a more powerful computer with
more RAM (Random Access Memory) which pro-
vides fast, short-term storage for active processes,
enabling quick access to frequently used matrix
data.
Sparse direct solvers, iterative methods, and pre-
conditioners all benefit from this information.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 3 of 26


Element and node connectivity allow us to work
only with nonzero entries or blocks or bands of
clustered nonzero entries.
With this information, only necessary degrees of
freedom (DOFs) are stored and computed.
Knowing connectivity helps precompute efficient
sparse storage formats (e.g., CSR—Compressed
Sparse Row format) to speed up numerical equa-
tion solvers.
It also aids in mesh partitioning to optimally allo-
cate data for parallel solvers that rely on connec-
tivity graphs.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 4 of 26


Is there a role in the identification num-
ber for nodes and elements in a mesh of
connected elements?
The node and degree-of-freedom number changes
the sparsity pattern where the nonzero stiffness
values in each row and column appear but does
not change the number of nonzeros in the matrix.
The element number not only does not affect the
number of non-zeros, but it also does not affect
the sparsity pattern.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 5 of 26


When describing the finite element method (FEM),
we often emphasize the role of elements and their
connections in a mesh; however, the big-picture
is driven by the nodes and degrees of freedom
connecting these elements.
Each row in the global matrix represents the equi-
librium equation and stiffness relation associated
with that degree-of-freedom (DOF), coupling all
other nodes that are influenced by this node through
the support of the basis (shape) functions associ-
ated with this DOF.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 6 of 26


Construction of Mesh Node Basis Func-
tion from Element Node Shape Functions
The basis (shape) function of a node in the mesh is
constructed from the shape functions associated
with the elements that connect at this node.
The basis (shape) functions used in the finite ele-
ment method (FEM) have compact support, mean-
ing they influence only a local patch of elements
and their connected nodes and DOF.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 7 of 26


Construction of the global basis function
ϕi(x) for a mesh node shared by triangu-
lar T3 finite elements, using linear inter-
polation shape functions
1. Definition of the Global Basis Func-
tion
The global basis function ϕi(x) is a piecewise lin-
ear interpolation function defined over the patch
neighborhood of node i, which is the union of the
triangular elements that share this node.
ϕi(x) = 1 at node i.
ϕi(xj ) = 0 for all other nodes j 6= i.
ϕi(x) is piecewise defined locally using the shape
functions within each triangular element that share
node i.
For linear shape functions, the function ϕi(x) is
piecewise linear across the elements connected
to node i.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 8 of 26


2. Finite Element Local Shape Function
Contributions
Consider a two-dimensional mesh where a group
of triangular finite elements share node i. Each
triangle has three nodes, and in each element,
we define local shape functions N1, N2, N3.
Each triangular element e with nodes xej = (xej, yje),
for the three nodes j = 1, 2, 3 has the local linear
shape functions:

Nje(x) = aej + bejx + cejy, j = 1, 2, 3.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 9 of 26


The element nodal shape functions satisfy the in-
terpolation property summarized by the Kronecker
delta function δij defined as:

1, if i = j,





δij = 
0,
 if i 6= j.

This function plays a fundamental role in interpo-


lation, particularly in the finite element method,
where shape functions Ni(x) satisfy the property:

Ni(xj ) = δij .

This ensures that at node j, the shape function


associated with node i evaluates to 1 if i = j and
0 otherwise, providing the essential partition of
unity property in finite element interpolation.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 10 of 26


The coefficients aej, bej, cej are computed using the
standard area coordinate interpolation formulas:
xek y`e − xe`yke yke − y`e xe` − xek
aej = e
, bej = e
, cej = e
,
2A 2A 2A
where:
(xek , yke ) and (xe`, y`e) are the coordinates of the other
two nodes in element e, excluding node j,
Ae is the area of element e, given by:
1 e e
Ae = |x1(y2 − y3e) + xe2(y3e − y1e) + xe3(y1e − y2e)| .
2
Since node i is a shared node, in each element
e, the corresponding local shape function Nie(x)
will contribute to the global basis function ϕi(x).

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 11 of 26


Construction of the Global Basis Func-
tion
The global basis function ϕi(x) at node i in the
mesh is constructed from each element e contain-
ing node i, the local shape function Nie(x) associ-
ated with node i contributes to ϕi(x). The global
basis function is a patchwork of these element-
wise shape functions.
The global basis function ϕi(x) is defined locally
within the patch neighborhood and zero elsewhere
in the mesh. For node i, its global basis function
is: 
e
N (x), x ∈ Ωe, e ∈ Ei,



i

ϕi(x) = 
0,
 x∈/ Ωi.
where:
Nie(x) is the local shape function associated with
node i in element e,
Ei is the set of all elements that share node i,
Ωi = Se∈Ei Ωe is the neighborhood of node i.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 12 of 26


In explicit form, using the shape function defini-
tion:

aei + beix + ceiy, x ∈ Ωe, e ∈ Ei,







ϕi(x) = 
0,
 otherwise.

where the coefficients aei, bei, cei depend on the ge-


ometry of element e as given above.

Compact Support and Continuity


ϕi(x) is zero outside the patch neighborhood, en-
suring compact support.
It is piecewise linear and continuous across shared
edges of adjacent elements.
However, ∇ϕi(x) (the gradient) is discontinuous
at element boundaries.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 13 of 26


Determining the Number of Nonzeros
in a Row of the Global Stiffness Matrix
in FEM
The number of nonzero entries in any row corre-
sponds to the nodes that interact with a given node
in the mesh. This interaction is dictated by the lo-
cal support of the nodal basis function and the el-
ement connectivity.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 14 of 26


1. Role of the Nodal Basis Function in
Sparsity
Each nodal basis function ϕi(x) in FEM has local
compact support, meaning ϕi(x) is nonzero only
in the elements that contain node i.

The assembled global stiffness matrix row corre-


sponding to node i will have non-zeros only for
degrees of freedom (DOFs) associated with nodes
that share at least one element with node i.
For a given node i in a finite element mesh, the
number of nonzero entries in row i of [K] is de-
termined by, the number of elements connected
to node i, and the number of nodes in each of
these elements.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 15 of 26


2. Here is how to determine the number
of Non-zeros in a Row of [K]
Each row in [K] corresponds to a global degree of
freedom (DOF), which is tied to a specific node in
the mesh. The nonzero pattern of this row can be
determined as follows:

Step 1: Identify Elements Connected to Node i


Let Ei be the set of elements that contain node i.
These elements define the support of the nodal ba-
sis function ϕi(x).

Step 2: Identify Nodes Sharing These Elements


Each element in Ei has a set of nodes that form its
connectivity. The union of these nodes forms the
interaction neighborhood of node i.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 16 of 26


Step 3: Count Unique Nodes in This Neighbor-
hood
The row i of the global stiffness matrix [K] will
have nonzero entries at positions corresponding
to all nodes and DOF/node connected to node
i through at least one shared element. If an ele-
ment has p nodes, then node i will interact with
at most p − 1 other nodes per element.
The total number of nonzero entries in row j cor-
responding to a DOF at node i (including the di-
agonal) and assuming each node has the same
number of DOF is:
 

NNZj =  pe − (duplicate nodes removed)


X

e∈Ei
× (No. of DOF/Node)

where pe is the number of nodes per element.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 17 of 26


Example: 2D Linear Quadrilateral Ele-
ment Type (Q4) Mesh for 2D Elasticity
Each element has 4 nodes. Each node has 2 DOF
(ux, uy ). A node in an interior region typically be-
longs to 4 elements.
The total number of nonzeros in a row correspond-
ing to a nodal DOF is:

NNZj = (4 × 4) × (2 DOF/node) = (16)(2) = 32

but after removing duplicate nodes, we get:

NNZj = (16 − 4 − 3)(2) = (9)(2) = 18

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 18 of 26


Examples

0.5

0
0 0.5 1

Rectangular Grid with 4 × 4 cells.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 19 of 26


Sparsity Pattern of Nonzero values for the Stiffness Ma-
trix for 2D Membrane with 1-DOF/node, uz with a 4 × 4
square mesh of 4-node Quadrilateral Elements.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 20 of 26


Sparsity Pattern of Nonzero values for the Stiffness Ma-
trix for 2D Plane Elasticity with 2-DOF/node, (ux, uy ) with
a 4 × 4 square mesh of 4-node Quadrilateral Elements.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 21 of 26


Sparsity Pattern of Nonzero values for the Stiffness Ma-
trix for 2D Frame Structure, with square mesh of 2-node
frame elements with 3 degrees-of-freedom (DOF) per
node: (ux, uy , θz )
.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 22 of 26


Observations
The more elements connected to a shared node
increases the number of nonzeros in that row and
column.
Boundary nodes have fewer nonzeros than inte-
rior nodes because they are connected to fewer
elements.
The total number of nonzero entries in the global
stiffness matrix is proportional to the number of
elements and the number of DOFs per element.
The sparsity pattern of [K] depends on the ele-
ment type, mesh topology, and boundary condi-
tions.
For higher-order quadratic elements (Q9, T6, etc.),
the connectivity grows, increasing the number of
nonzero entries per row.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 23 of 26


Conclusions
The number of nonzero entries in a row of the
global stiffness matrix can be determined before
assembly by analyzing element connectivity.
A nodal basis function’s compact support ensures
that each node interacts only with nodes of ele-
ments that contain i.
This analysis helps optimize sparse matrix stor-
age and improve computational efficiency in FEA
solvers.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 24 of 26


Who knew the numbers in a ma-
trix can be viewed as artwork!
What are your thoughts on this?
I’d love to hear your insights! Let’s discuss this in
the comments.

LinkedIn � - Dr. Lonny Thompson, Clemson University, Feb. 8, 2025. 25 of 26


Surface Extraction
Simplify CAD Fillet radii
Cutouts
Geometry
Splines
Part Assemblies
Isotropic
Orthotropic
Material Properties Anisotropic
Composite Laminates
Embedded Rebar/Fibers
Concentrated
Distributed
Problem
Loads Contact
Initial Strains
Thermal
Fixed
Displacement
Specified
Boundary Conditions Free
Mixed
Rigid Body

Model Constraints Multi-point


Dr. Lonny Thompson Interfaces
Unstructured
Mapped
Mesh Adaptive Mesh (h, p, or hp)
Node coordinates
Data
Element-node connectivity
Bar, Truss
1D Line Bernoulli-Euler
Requirements Beam
Discretization Timoshenko
Linear Static Objectives
Analysis Type Triangle
Buckling
Quadrilateral
Assumptions
Polygonal
2D Surface
Limitations
Document Plane Stress/Strain
Mitigation strategies
Elements Axisymmetric
Recommendations Applications
Plate
Design of Experiments
Shell
Sensitivity Analysis
Tetrahedron
Geometry Optimization
3D Solid Hexahedron
Topology
Polyhedron
Materials Static Linear FEA for Infinite
Deformed Geometry Elastic Solids and Special
Structures Composite
Stress Contours Visualization
Linear or Quadratic
Strain Energy Contours
Shape functions Lagrange or Hermite
Stress Concentrations
Hierarchical
Part Stiffness Interpret Results
Symmetric
Failure Criteria Element Gauss Quadrature
High (Increase density) FEM Numerical integration
Stress gradients Stiffness Matrix Lobotto Quadrature
Low (decrease density) Mesh Convergence Sparse
Grid independence Remesh Assemble global
Error Estimation Banded
Error Estimates
Discrete Equilibrium Equations
Orders of Magnitude Post-Process
Apply boundary conditions
Simple Models
Enforce constraints
Prototypes
Gaussian Elimination
Experiments Direct solvers
Validation LU decomposition
Energy Bounds
Conjugate Gradient
Reaction Forces
Generalized Minimal Residual
Element distortion limits (GMRES)
Check Iterative Solvers
Coincident nodes Block Jacobi diagonal
Nodal Displacements
Element connectivity gaps Incomplete Cholesky
Pre-conditioners
Experiments Verification LU Factorization
Solving
Algebraic Multigrid
QR
Direct
Lanczos
Eigenvalue Solvers
Power
Iterative
Subspace Iteration
Yield
Recovery (strains, stresses, Strength
Failure Limits
reaction forces)
Energy and Work
Stability Limits
Buckling
Critical Limits

You might also like