Dear Yves, Thanks once again for sharing your expertise and your work. I understand now what you had in mind but I really want a "true" interpolation of the gradient and its interpolation matrices for optimization purpose. Actually, I finally managed to obtain such a matrix: after a (naive) coloring of the connectivity graph of the elements, I reduced the evaluation of the coefficients of that matrix to #(nb of colors) x #(nb of degree of freedom in one COV) calls to "getfem.compute_gradient". Of course this is not optimal but it does the job for my objective. Thanks again, best regards, Edouard.
-- Edouard Oudet : http://www-ljk.imag.fr/membres/Edouard.Oudet/ IMAG - Bureau 164 700 avenue Centrale 38400 Saint Martin d'Hères +33 (0)4 57 42 17 71 (office LJK) +33 (0)4 79 68 82 06 (home) De: "Yves Renard" <[email protected]> À: "EDOUARD OUDET" <[email protected]> Cc: "getfem-users" <[email protected]> Envoyé: Lundi 6 Novembre 2017 17:23:26 Objet: Re: [Getfem-users] gradient interpolation matrix Dear Edouard, No, such a matrix in not available for the moment. It is not very difficult to implement, but it has to be done in C++ by extending the function in the file getfem_interpolation.h which do the job for the value, but not for a derivative. May be you can be more accurate on the use of this matrix. May be there is some alternative to avoid it. For instance, what I mentionned in my previous e-mail was to use instead a projection matrix. A projection matrix can be easily assembled with a expression such as for instance "Grad_u(1)Test_v" in term of the generic assembly language where "Grad_u(1)" is the derivative with respect to the first direction and "Test_v" should correspond to a P_0 discontinuous finite element method to obtain a unique value on each element. But of course, in that case, it will be a mean value of the derivative on the element, not the interpolation at the center of the element. Best regards, Yves Le 05/11/2017 à 22:32, Edouard Oudet a écrit : > Dear Yves, > Thanks a lot for your fast answer! > I am not sure I follow your suggestion. My goal is to obtain a > description of the linear operator from my dof to the evaluation of, > let say, the first derivative of my fem at the centers of my elements. > Is this what you call discontinuous fem ? > If my fem is described by an object femk, I understood that a (python) > call to > > M = asm_interpolation_matrix(femk, fem0) > > gives me the interpolaation matrix from femk to fem0 but I do not see > how to use this for my derivative "\partial_1 femk" ? Which matrix > should be inverted ? I apologize for the naivety of my questions, > best, > Edouard. > > Le 05/11/2017 à 16:11, Yves Renard a écrit : >> Dear Edouard, >> >> No, unfortunately, there is no function in Getfem that gives the >> interpolation matrix for a derivative of a field. You can perform the >> interpolation itself with the high level generic assembly, but it >> does not give an interpolation matrix. If you want to interpolate on >> a discontinuous fem, you can instead compute the projection matrix >> which will be easy to invert because it will be local (a small matrix >> on each element). Then if your projection is exact, then the inverse >> will also be an interpolation matrix ... >> >> Best regards, >> >> Yves. >> >> >> >> ----- Original Message ----- >> From: "EDOUARD OUDET" <[email protected]> >> To: [email protected] >> Sent: Friday, November 3, 2017 11:43:34 AM >> Subject: [Getfem-users] gradient interpolation matrix >> >> Dear all, >> Is there a way with the getfem python interface to assembly the >> matrix associated to the interpolation matrix of a first derivative >> evaluation of a fem (or its full gradient). >> I found >> >> Mi = asm_interpolation_matrix(MeshFem mf, vec pts) >> >> for the evaluation of the function u = MeshFem mf itself, but I was >> not able to identify the relevant generalization for derivatives of >> u: \partial u_x, \partial u_y, etc. >> Thanks a lot for this great library, >> best, Edouard. >> > -- Yves Renard ([email protected]) tel : (33) 04.72.43.87.08 Pole de Mathematiques, INSA-Lyon fax : (33) 04.72.43.85.29 20, rue Albert Einstein 69621 Villeurbanne Cedex, FRANCE http://math.univ-lyon1.fr/~renard ---------
