cpraveen / fem50

Simple matlab FEM code for 2-d poisson equation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

2-D FEM code in Matlab

This is a matlab code for solving poisson equation by FEM on 2-d domains. It is taken from

Alberty, Carstensen, Funken: Remarks around 50 lines of Matlab: short finite element implementation

Examples

  • sample : This contains the example grid from the paper
  • Gamma : Generate grid by running Gamma.m in matlab
  • sinusoid :
  • square : Generate grid by running square.m in matlab

How to run code in "square"

bash> cd square

Start matlab

bash> matlab

In matlab, generate mesh

>> square(30)
>> close all
>> clear all

Add path to fem code and run it

>> addpath(path,'../src')
>> fem_50()

Running on matlab drive

Download code

unzip('https://github.com/cpraveen/fem50/archive/master.zip')
movefile('fem50-master', 'fem50'), addpath(fullfile(cd,'fem50/src')), savepath

Run it

square(30)
fem_50()

About

Simple matlab FEM code for 2-d poisson equation


Languages

Language:MATLAB 100.0%