view example/MixedPoisson.m @ 76:6cb2a3e3be68

New examples which solve vector field problems * NS: solve the incompressible NS equations using the chorin-temam algorithm * MixedPoisson: solve the Poisson equation using amixed formulation using DG and Brezzi-Douglas-marini finite elements
author gedeone-octave <marcovass89@hotmail.it>
date Fri, 02 Aug 2013 23:01:39 +0200
parents
children ff95326e6f13
line wrap: on
line source

pkg load msh

fem_init_env ();

x = y = linspace (0, 1, 32);
msho = msh2m_structured_mesh (x, y, 1, 1:4);
mshd = fem_init_mesh (msho);

V = fem_fs_MixedPoisson (mshd);

bc1 = fem_bc (V, @(x,y) [0; -sin(5.0*x); 0], 1);
bc2 = fem_bc (V, @(x,y) [0;  sin(5.0*x); 0], 3);


f = fem_coeff ('f', @(x,y) 10*exp(-((x - 0.5)^2 + (y - 0.5)^2) / 0.02));

A = fem_rhs_MixedPoisson (V, bc1, bc2);
b = fem_lhs_MixedPoisson (V, f, bc1, bc2);

u = A \ b;


func = fem_func ('u', V, u);

fem_plot (func);