Skip to content

mm318/fem-solver-2d-poisson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Finite Element Method Solver for 2D Poisson Problems

build

This package takes a .poly file that defines the problem boundary (see here to understand the file format) and solves the 2D screened Poisson equation:

$$\Delta u(x,y) - u(x,y) = -{x^2 + y^2 - 4 \over 250000}$$

subject to the Dirichlet boundary condition:

$$u(x,y) = {x^2 + y^2 \over 250000}$$

(The problem can be modified by editing prob_def.c)

This was for a university project in 2011.

Usage

Installation

# in <root>/
git clone https://github.com/mm318/fem-solver-2d-poisson.git

Build

# from <root>/
mkdir build
cd build
cmake ../fem-solver-2d-poisson
make

Run

Usage:

FEM_Solver <.poly file>

Example:

# from <root>/build/
cd bin  # current working directory needs to have the plstnd5.fnt and plxtnd5.fnt files
./FEM_Solver bicycle_seat # exclude the .poly extension

Resulting mesh:
bicycle_seat mesh

Resulting solution:
bicycle_seat solution
bicycle_seat solution plot

Requirements

Tested on Ubuntu 20.04 and Ubuntu 22.04.

Dependencies