comparison +noname/calculateSolution.m @ 32:ddfb98209aa2

Fixed a bunch of problems regarding convergence and saving solutions
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 29 Sep 2015 09:22:22 +0200
parents 791decafe6e4
children c6eb3af205c0
comparison
equal deleted inserted replaced
31:d1f9dd55a2b0 32:ddfb98209aa2
3 % method -- time stepping method 3 % method -- time stepping method
4 % m -- grid parameter 4 % m -- grid parameter
5 % order -- order of accuracy of the approximtion 5 % order -- order of accuracy of the approximtion
6 % T -- time to calculate solution for 6 % T -- time to calculate solution for
7 % input paramters m, t, order may all be vectors. 7 % input paramters m, t, order may all be vectors.
8 function [] = calculateSolution(filename, discrHand, method, m, T, order) 8 function [] = calculateSolution(filename, discrHand, method, m, T, order, force_flag)
9 default_arg('force_flag',false);
9 10
10 if exist(filename,'file') 11 if exist(filename,'file') && ~force_flag
11 fprintf('File ''%s'' already exist.',filename); 12 fprintf('File ''%s'' already exist.',filename);
12 do_append = yesnoQuestion('Do you want to append to it?'); 13 do_append = yesnoQuestion('Do you want to append to it?');
13 if ~do_append 14 if ~do_append
14 fprintf('Exiting...\n'); 15 fprintf('Exiting...\n');
15 return 16 return
79 saveToFile(sf, method, order(i), m(j),T(l), snapshot, runtime, k, discr); 80 saveToFile(sf, method, order(i), m(j),T(l), snapshot, runtime, k, discr);
80 fprintf('Done! (%.3fs)\n',runtime); 81 fprintf('Done! (%.3fs)\n',runtime);
81 end 82 end
82 83
83 end 84 end
84 85 sf.stupidSave();
85 end 86 end
86 end 87 end
87 end 88 end
88 89
89 90