changeset 19:1644d000c304

Fixed bug in SolutionsFile.m. Updated calculateSolution to also save a function handle to the Discr constructor.
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 22 Sep 2015 17:10:51 +0200
parents 4d8068cb5c65
children c7efff913935
files +noname/calculateSolution.m SolutionFile.m
diffstat 2 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/+noname/calculateSolution.m	Tue Sep 22 14:52:13 2015 +0200
+++ b/+noname/calculateSolution.m	Tue Sep 22 17:10:51 2015 +0200
@@ -45,7 +45,7 @@
             if T(1) == 0
                 v = discr.v0;
                 t = 0;
-                saveToFile(sf, method, order(i), m(j),T(1), v, t, NaN, NaN);
+                saveToFile(sf, method, order(i), m(j),T(1), v, t, NaN, NaN, discrHand);
                 T(1) = [];
             end
 
@@ -63,7 +63,7 @@
                     clock_start = tic();
                     [v,t] = ts.stepN(end_step-ts.n,true);
                     runtime = runtime + toc(clock_start);
-                    saveToFile(sf, method, order(i), m(j),T(l), v, t, runtime, k);
+                    saveToFile(sf, method, order(i), m(j),T(l), v, t, runtime, k, discrHand);
                     fprintf('Done! (%.3fs)\n',runtime);
                 end
             else
@@ -75,7 +75,7 @@
                     clock_start = tic();
                     [v,t] = ts.stepN(N-ts.n,true);
                     runtime = toc(clock_start);
-                    saveToFile(sf, method, order(i), m(j),T(l), v, t, runtime, k);
+                    saveToFile(sf, method, order(i), m(j),T(l), v, t, runtime, k, discrHand);
                     fprintf('Done! (%.3fs)\n',runtime);
                 end
 
@@ -86,7 +86,7 @@
 end
 
 
-function saveToFile(sf, method, order, m, T, v, t, runtime, k)
+function saveToFile(sf, method, order, m, T, v, t, runtime, k, discrHand)
     key.method = method;
     key.order  = order;
     key.m      = m;
@@ -96,6 +96,7 @@
     entry.t = t;
     entry.runtime = runtime;
     entry.k = k;
+    entry.discrHand = discrHand;
 
     sf.store(key,entry);
 end
--- a/SolutionFile.m	Tue Sep 22 14:52:13 2015 +0200
+++ b/SolutionFile.m	Tue Sep 22 17:10:51 2015 +0200
@@ -68,7 +68,7 @@
             end
 
             I = obj.getIndex(key);
-            e = getEntryByIndex(I); % unpack the cell array
+            e = obj.getEntryByIndex(I); % unpack the cell array
         end