Hi,

I am now working on a 2D problem, in which I need to couple a discretized
region with a continuum region. The solution of the discretized region are
values at individual points (Irregularly distributed). Now we need to
define a fipy variable 'val'(continuous function), which matches the
discretized solution. For this, I use the interpolation
function scipy.interpolate.interp2d to generate a function 'f', which is
based on the linear interpolation of those points. But when I try to use
'val.setValue' to set values for val, I got an error of "Invalid input
data". The following is this piece of code:
for i in range(Npoints):
        xold[i] = Cl.item((i,0))
        yold[i] = Cl.item((i,1))
        zold[i] = np.log10(abs(CV.item(i)))                 ##Cl are the
coordinates, CV are the values, they are initially defined as matrices
f = scipy.interpolate.interp2d(xold, yold, zold, kind='linear')
##If I print f(1.5,2,3)[0], it gives me a double data due to interpolation
val.setValue(function(X,Y)[0])               ##This one does not work. val
is the variable defined on certain mesh, X,Y =mesh.cellCenters

I wonder that is there anyone meet the same type of problems, and know how
to solve it?

best,
Zebo
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to