Suppose you have a function
f[t_, x_, y_] := t (1 - x^2 - y^2)
defined for {x,y}
in Disk[]
and an ElementMesh
of that Region
<< NDSolve`FEM`
mesh = ToElementMesh[Disk[]]
You can evaluate the function for some t
at the vertices and nodes of the mesh:
coords = mesh["Coordinates"];
values = f[0, Sequence@@#]& /@ coords;
and then build an InterpolatingFunction with:
ElementMeshInterpolation[{mesh}, values]
Now suppose you have a list of times:
tl = Range[0, 1, 0.05];
you can evaluate the function for all times and all mesh nodes:
values = Table[f[t, Sequence @@ ##] & /@ coords, {t, tl}];
But it is possible to build a single InterpolatingFunction
from these data, accepting x,y,t
as arguments?
I know I can do somethiong like
Interpolation@Flatten[Table[{t, Sequence @@ xy, f[t, Sequence @@ xy]}, {t,
tl}, {xy, coords}], 1]
ignoring some warning, but I don't think this method can take advantage of a previously built 2nd order ElementMesh
, so I'm searching another way, basically the same way used when NDSolve handle a transient equation.
ElementMeshInterpolation
, and then interpolate between their values int
? $\endgroup$ElementMeshInterpolation
and failed. Could you kindly give a hint, where and how can I get it? $\endgroup$f[t, x, y, z]
? $\endgroup$