Bill and J.M. has already answered OP's question, but after some communication with OP in the comment under this post, I think it's worth explaining the usage of InterpolatingFunctionValuesOnGrid[sol] / sol["ValuesOnGrid"] and InterpolatingFunctionCoordinates[sol] / sol["Coordinates"] a bit further.
As the function names suggest, sol["ValuesOnGrid"] is a list of the function value on the grid. (For OP's case, it's a list of value of $T$.) sol["Coordinates"] is a list of the coordinate of grid. (For OP's case, it's a list of value of $x$,$y$,$t$.) If you want to build a list of $(x,y,t,T)$ that can be used in e.g. ListDensityPlot3D, you can:
sol = T /. First@
NDSolve[{D[T[x, y, t], {t, 1}] == (D[T[x, y, t], {x, 2}] + D[T[x, y, t], {y, 2}]),
T[x, y, 0] ==
400 - 400 Exp[-100000 x^2 y^2 (x - 1)^2 (y - 1)^2] +
350 Exp[-100000 x^2 (x - 1)^2], T[x, 0, t] == 350 Exp[-100000 x^2 (x - 1)^2],
T[x, 1, t] == 350 Exp[-100000 x^2 (x - 1)^2], T[0, y, t] == 350,
T[1, y, t] == 350}, T, {x, 0, 1}, {y, 0, 1}, {t, 0, 100}, PrecisionGoal -> 2];
lstT = sol["ValuesOnGrid"];
lstxyt = {lstx, lsty, lstt} = sol["Coordinates"];
{lenx, leny, lent} = Dimensions@lstT;
(* solution 1, not that fast but easy to understand *)
lstxytT = Table[{lstx[[i]], lsty[[j]], lstt[[k]], lstT[[i, j, k]]},
{i, lenx}, {j, leny}, {k, lent}];
(* solution 2, a bit harder to understand but fast *)
lstxytT2 = Transpose[{Transpose[ConstantArray[lstx, {leny, lent}], {2, 3, 1}],
Transpose[ConstantArray[lsty, {lenx, lent}], {1, 3, 2}],
ConstantArray[lstt, {lenx, leny}],
lstT},
{4, 1, 2, 3}];
lstxytT == lstxytT2
(* True *)
ListDensityPlot3D@lstxytT
(* I'm still in v9 so let me omit the picture here *)
Finally I'd like to mention that lstT and lstxyt can be directly used for the building of a interpolating function of $T(x,y,t)$:
solsimpler = ListInterpolation[lstT, lstxyt]
Notice solsimpler isn't the same as sol because it's only built with "ValuesOnGrid" and "Coordinates". To learn more about the information contained in InterpolatingFunction, check this and this post.
- As you receive help, try to give it too, by answering questions in your area of expertise.
- Take the tour and check the faqs!
- When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign!
– Mar 26 '16 at 08:37