apply2D01

u=@(x,y) 3/2*cos(x/2-y/3).*sin(x/3+y/2);
divu=@(x,y) 3/2*(5/6*cos(1/2*x - 1/3*y).*cos(1/3*x + 1/2*y) - 1/6*sin(1/2*x - 1/3*y).*sin(1/3*x + 1/2*y));

meshfile=fc_oogmsh.gmsh.buildmesh2d('condenser',30); % generate mesh
Th=fc_simesh.siMesh(meshfile); % read mesh
Lop=fc_vfemp1.Loperator(2,2,[],[],{1,1},[]);
W=Lop.apply(Th,u);

% Graphic parts
figure(1)
Th.plot(Th.eval(u))
shading interp
axis image;colorbar
title(sprintf('u,  nq=%d, nme=%d',Th.nq,Th.get_nme()))

figure(2)
Th.plot(W)
shading interp
axis off,axis image;colorbar
title('W ~ div(u)')

figure(3)
Th.plot(abs(W-Th.eval(divu)))
colormap('jet')
shading interp
axis off,axis image;colorbar
title('error')
[fc-oogmsh] Input file : <fc-oogmsh>/geodir/2d/condenser.geo
[fc-oogmsh] Mesh file <fc-oogmsh>/meshes/condenser-30.msh [version 4.1] already exists.
  -> Use "force" flag to rebuild if needed.
apply2D01-1.pngapply2D01-2.pngapply2D01-3.png