view example/Biharmonic.m @ 157:08dc5547f4d6

Update the examples to the new naming conventions.
author gedeone-octave <marcovass89@hotmail.it>
date Thu, 12 Sep 2013 14:58:34 +0200
parents 4f688918f76a
children
line wrap: on
line source

pkg load fem-fenics msh

problem = 'Biharmonic';
import_ufl_Problem (problem);

# Create mesh and define function space
x = y = linspace (0, 1, 33);
mesh = Mesh(msh2m_structured_mesh (x, y, 1, 1:4));

V = FunctionSpace(problem, mesh);

bc = DirichletBC (V, @(x,y) 0, 1:4);

f = Expression ('f', @(x,y) 4.0*pi^4.*sin(pi.*x).*sin(pi.*y));
g = Expression ('alpha', @(x,y) 8);

a = BilinearForm (problem, V, g);
L = LinearForm (problem, V, f);

[A, b] = assemble_system (a, L, bc);
u = A \ b;

func = Function ('u', V, u);
plot (func);