Mercurial > repos > public > sbplib
diff +noname/testCfl.m @ 886:8894e9c49e40 feature/timesteppers
Merge with default for latest changes
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Thu, 15 Nov 2018 16:36:21 -0800 |
parents | 7f6f04bfc007 |
children |
line wrap: on
line diff
--- a/+noname/testCfl.m Mon Sep 10 16:19:16 2018 +0200 +++ b/+noname/testCfl.m Thu Nov 15 16:36:21 2018 -0800 @@ -27,29 +27,37 @@ end end + if silentFlag + rsInterval = util.ReplaceableString(''); + end + % Use bisection to find sharp estimate while( (alpha0(2)-alpha0(1))/alpha0(1) > tol) alpha = mean(alpha0); if ~silentFlag fprintf('[%.3e,%.3e]: ', alpha0(1), alpha0(2)); + else + rsInterval.update('[%.3e,%.3e]: ', alpha0(1), alpha0(2)); end [ok, n_step, maxVal] = testAlpha(alpha); if ok alpha0(1) = alpha; + stability = 'STABLE'; else alpha0(2) = alpha; + stability = 'UNSTABLE'; end if ~silentFlag - fprintf('a = %.3e, n_step=%d max = %.2e\n', alpha, n_step, maxVal); + fprintf('a = %.3e, n_step=%d %8s max = %.2e\n', alpha, n_step, stability, maxVal); end end if silentFlag - fprintf('Last calculated: a = %.3e, n_step=%d max = %.2e\n', alpha, n_step, maxVal); + rsInterval = util.ReplaceableString(''); end fprintf('T = %-3d dof = %-4d order = %d: clf = %.4e\n',T, discr.size(), discr.order, alpha0(1));