[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Getfem-users] Calculate the error in the physical domain

From: Yassine ZAIM
Subject: [Getfem-users] Calculate the error in the physical domain
Date: Tue, 18 Dec 2018 18:54:54 +0100

Dear getfem++ users,
I am trying to learn how to implement the fictitious domain method for the simple problem of Poisson. My domain of interest Omega is a circle of center (x0=0,y0=0) and radius r=0.35. I made the resolution in the fictitious domain (the square [-0.5, 0.5]^2) and after that, I used the slice to restrict my solution to the physical domain.
    sl = gf.Slice(('comp',('ball', +1, [x0, y0], r)), m, 5)
    sl.export_to_vtk('App_Solution.vtk', 'ascii', mfu, Uap)
    sl.export_to_vtk('Exc_Solution.vtk', 'ascii', mfu, Uex)
    sl.export_to_vtk('Error-Ex-App.vtk', 'ascii', mfu, Uap-Uex)
When I see the approximate and the exact solution in addition to the error I can say that I get a good approximate solution. But I am trying to get the optimal order of convergence (h and h^2) like in the papers "J. Haslinger and Y. Renard" or "E. Burman and P. Hansbo". So I interpolate the exact and approximate solution in the slice (domain of interest).
    Ue = gf.compute(mfu, Uex, 'interpolate on', sl)
    U = gf.compute(mfu, Uap, 'interpolate on', sl)
And after that I tried to calculate the error for different values of NX=[16,32,..]
    L2error = gf.compute(mfu, U-Ue, 'L2 norm', mim)
    H1error = gf.compute(mfu, U-Ue, 'H1 norm', mim)
such that :
mim = gf.MeshIm('levelset',mls,'inside', gf.Integ('IM_TRIANGLE(6)'))
and  mfu.set_fem(gf.Fem('FEM_PK(2,1)'))
But I get the following error in the "compute" function (of the errors) :
return getfem('compute', mf, U, what, *args)
RuntimeError: (Getfem::InterfaceError) -- The trailing dimension of argument 2 (an array of size 4670) has 4670 elements, 289 were expected.
My question is how to calculate the error just in the interesting domain (physical domain, slice sl in my case). 
Thank you in advance. 

ZAIM Yassine 
PhD in Applied Mathematics

reply via email to

[Prev in Thread] Current Thread [Next in Thread]