getfem-users
[Top][All Lists]
Advanced

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

[Getfem-users] Interpolation problem in Matlab interface


From: Walker, Ryan T. (GSFC-615.0)[UNIV OF MARYLAND]
Subject: [Getfem-users] Interpolation problem in Matlab interface
Date: Wed, 8 Feb 2017 19:51:01 +0000

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





reply via email to

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