Skip to content

sam-maloney/FEM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Samuel Maloney - University of Warwick

The Problem

My program solves a simple 2D Poisson problem, specifically the homogeneous equation,

with Dirichlet boundary conditions given as,

which has analytic solutions given by,

The Program

The numerical solution is computed using linear finite elements (FEM) on a regular triangular mesh. The script defines a simple mesh class which is used to generate and store such a mesh for a given number of grid divisions. The program then loops over the elements to compute and assemble the FEM stiffness matrix and uses some sparse linear algebra routines from scipy to compute the numerical solution for the given mesh.

A loop over the number of grid divisions is performed, doubling each time, such that the convergence of the numerical solution towards the expected analytic result can be observed. A figure is produced showing the final numeric solution side by side with the analytic solution for visual comparison, as well as plots of the error norms and observed order of convergence to validate the expected 2nd order spatial accuracy of the method.

About

FEM code from MPAGS course

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published