Mercurial > repos > public > sbplib
comparison +noname/testCfl.m @ 39:7249f105e67b
Added silent option to noname.testCfl.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 09 Oct 2015 10:52:42 +0200 |
parents | bce9e28c1e26 |
children | 9933169d2651 |
comparison
equal
deleted
inserted
replaced
38:4fcc4448682f | 39:7249f105e67b |
---|---|
1 function testCfl(discr, timestepper_method, T, alpha0, tol,threshold) | 1 function testCfl(discr, timestepper_method, T, alpha0, tol,threshold, silentFlag) |
2 default_arg('tol',0.00005); | 2 default_arg('tol',0.00005); |
3 default_arg('threshold',1e2); | 3 default_arg('threshold',1e2); |
4 default_arg('silentFlag', false); | |
4 | 5 |
5 alpha0(2) = alpha0(1)+2*(alpha0(2)-alpha0(1)); | 6 alpha0(2) = alpha0(1)+2*(alpha0(2)-alpha0(1)); |
6 | 7 |
7 while( (alpha0(2)-alpha0(1))/alpha0(1) > tol) | 8 while( (alpha0(2)-alpha0(1))/alpha0(1) > tol) |
8 alpha = mean(alpha0); | 9 alpha = mean(alpha0); |
21 alpha0(2) = alpha; | 22 alpha0(2) = alpha; |
22 else | 23 else |
23 alpha0(1) = alpha; | 24 alpha0(1) = alpha; |
24 end | 25 end |
25 | 26 |
26 fprintf('[%.3e,%.3e]: a = %.3e, max= %.2e\n',alpha0(1),alpha0(2), alpha,max_val); | 27 if ~silentFlag |
27 | 28 fprintf('[%.3e,%.3e]: a = %.3e, max= %.2e\n',alpha0(1),alpha0(2), alpha,max_val); |
29 end | |
28 end | 30 end |
29 | 31 |
30 fprintf('T = %-3d dof = %-4d order = %d: clf = %.4e\n',T, discr.size(), discr.order, alpha0(1)); | 32 fprintf('T = %-3d dof = %-4d order = %d: clf = %.4e\n',T, discr.size(), discr.order, alpha0(1)); |
31 | 33 |
32 end | 34 end |