2. In order to figure out more, I tried a simple problem to solve \frac{d^2 u}{dx^2} = 1 on [0,1] with boundary conditions u(0) = u(1) =2. However, the solution I obtain is wrong. The dirichlet conditions are not imposed correctly. The code is as under
clear all; gf_workspace('clear');
M = gf_mesh('cartesian',[0:0.025:1]); MFU = gf_mesh_fem(M,1); gf_mesh_fem_set(MFU,'fem',gf_fem('FEM_PK(1,1)')); MIM = gf_mesh_im(M,gf_integ('IM_NC(1,1)'));
nbd = gf_mesh_fem_get(MFU,'nbdof');
A = gf_mesh_fem_get(MFU, 'eval', {-1}) ; K = gf_asm('laplacian',MIM,MFU,MFU,A) ; F = gf_asm('volumic source', MIM, MFU, MFU, -A) ;