Skip to content

cpraveen/fem50

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()

You can avoid matlab

There is no reason to use matlab which is not a free software. You have better options in Python and Julia. For similar codes as this, see

  1. Python: https://github.com/cpraveen/fem/tree/master/python/2d
  2. Julia: https://github.com/cpraveen/juliafem

About

Simple matlab FEM code for 2-d poisson equation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages