10
$\begingroup$

Bug introduced in 10.0.0 and fixed in 10.2.0


I was experiencing some kernel crash while using "ValuesOnGrid" method of an InterpolatingFunction returned by NDSolve as a solution of a 3D time-dependent problem.

After some research I discovered this is related with my need of persisting the solution of NDSolve. Because I need to exchange the solution between different platforms, and because the solution is really part of an Association which contains also several aspects and statistics about solution process, the most natural way to serialize this Association was the WDX format.

The minimal code to reproduce the kernel crash (on Windows 8.1 x64 with Mathematica 10.1) is the following:

if = NDSolveValue[{D[u[t, x, y, z], t] == 0, u[0, x, y, z] == 0}, 
  u, {x, y, z} \[Element] Ball[], {t, 0, 1}, 
  Method -> "FiniteElement"] 
if["ValuesOnGrid"] // Dimensions (* OK *)
Export["if.wdx", if];

if = Import["if.wdx"];
if["ValuesOnGrid"] (* Kernel crash *)

What is the proper way to cross-platform serialize an Association containg some InterpolatingFunction returned by NDSolve FiniteElement method for ad 3D time-dependent problem?

$\endgroup$
  • $\begingroup$ What if you Compress[] your InterpolatingFunction[]? $\endgroup$ – J. M. will be back soon Jun 6 '15 at 10:40
  • $\begingroup$ @Guesswhoitis.Unfortunately the problem persists. $\endgroup$ – unlikely Jun 6 '15 at 10:45
  • 1
    $\begingroup$ looks like a bug in the relatively new code for interpolating functions on unstructured grids (you might want to report to WRI). You could see whether saving and storing to .mx format would work, that seems to work for me (and would even be faster). AFAIK .mx is nowadays only different on 32bit and 64bit machines so chances should be large that you can load them on another machine. If that wouldn't work you'd probably have to store the pure data (Grid and ValuesOnGrid and probably some derivative info) and reconstruct the interpolating function... $\endgroup$ – Albert Retey Jun 6 '15 at 12:12
  • $\begingroup$ @AlbertRetey MX is shareable between 64bit Linux and Windows machines? $\endgroup$ – unlikely Jun 6 '15 at 12:21
  • 1
    $\begingroup$ Yes, as of V10 only 32-bit vs 64-bit matters for .mx files, so they would be compatible between 64-bit Linux, Windows and MacOS X. $\endgroup$ – ilian Jun 6 '15 at 15:25
9
$\begingroup$

This crash has been fixed in version 10.2.

In[1]:= if = NDSolveValue[{D[u[t, x, y, z], t] == 0, u[0, x, y, z] == 0},       
           u, {x, y, z} \[Element] Ball[], {t, 0, 1},                           
           Method -> "FiniteElement"];                                          

In[2]:= Export["if.wdx", if];                                                   

In[3]:= if = Import["if.wdx"];                                                  

In[4]:= if["ValuesOnGrid"] // Dimensions                                        

Out[4]= {21, 11054}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.