Thanks, Yves — What I mean is that it appears that I have set D nonzero everywhere, and using gf_compute appears to confirm this. But I still get an all zero solution. The simplest code I have that does this was included in the original message.
In trying again, I have found that Matlab’s interp2 function sometimes inappropriately returns NaN at points on the boundary for which it has data, which then causes the all zero solution. I don’t know why it does this within GetFEM++, as this error doesn’t happen when I run the interpolation on its own. This appears to be a Matlab issue where it wrongly uses extrapolation on the boundary. At least in the test problem I’ve been running, setting the interpolation method to spline (which allows extrapolation to return a not NaN value) resolves the problem. So I think that this is a Matlab issue rather than a GetFEM++ issue. Best regards, Ryan On Feb 9, 2017, at 10:10 AM, Yves Renard <[email protected]<mailto:[email protected]>> wrote: Dear Walker, I do not understand what you mean by " I get the identically zero solution". Do you mean that D is zero ? But if D is zero, then there is no chance that "gf_compute(mfu,D,’interpolate on’,nodes);" to give other result than zero. May be if you attach the simplest program you can that does not work, it could help. Yves. Le 08/02/2017 à 20:51, Walker, Ryan T. (GSFC-615.0)[UNIV OF MARYLAND] a écrit : Hi all, I’m working on plate bending (i.e., bilaplacian) for a problem where I have observed data for the stiffness D. I’m setting D using gf_mesh_fem_get to evaluate the Matlab interpolation function interp2 on the lagrangian mesh. This produces an identically zero solution, as if D = 0 everywhere. However, when I use gf_compute to evaluate D on the solution nodes, I get the values I was expecting from the interpolation. The simplest thing I can do to get this problem is modifying demo_bilaplacian.m to include this: % create “data” on coarse grid [xx,yy] = meshgrid(0:0.1:0.4,0:0.1:1.2); foo = 1 + xx.^2 + yy.^2; % trying to interpolate onto the lagrangian mesh mfd getD = @(x,y,z) interp2(xx,yy,foo,x,y); D = gf_mesh_fem_get(mfd,'eval',{getD}); gf_model_set(md, 'add initialized fem data', 'D', mfd, [D]); When I do this, I get the identically zero solution. But if I then do nodes = gf_mesh_get(mfu,’pts’); D_pts = gf_compute(mfu,D,’interpolate on’,nodes); I get the values of D I was expecting. If I use the same formula for D directly without interpolating like this: getD = @(x,y,z) 1 + x.^2 + y.^2; D = gf_mesh_fem_get(mfd,'eval',{getD}); gf_model_set(md, 'add initialized fem data', 'D', mfd, [D]); I get the right solution (and the right values of D on the solution nodes). What am I doing wrong here? Thanks, Ryan ********************************************** Dr. Ryan T. Walker Earth System Science Interdisciplinary Center University of Maryland at College Park Cryospheric Sciences Laboratory, Code 615 NASA Goddard Space Flight Center 8800 Greenbelt Road Greenbelt, MD 20771 USA _______________________________________________ Getfem-users mailing list [email protected]<mailto:[email protected]> https://mail.gna.org/listinfo/getfem-users -- Yves Renard ([email protected]<mailto:[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 --------- ********************************************** Dr. Ryan T. Walker Earth System Science Interdisciplinary Center University of Maryland at College Park Cryospheric Sciences Laboratory, Code 615 NASA Goddard Space Flight Center 8800 Greenbelt Road Greenbelt, MD 20771 USA
_______________________________________________ Getfem-users mailing list [email protected] https://mail.gna.org/listinfo/getfem-users
