@@ -18,14 +18,20 @@ def plot_buoyancy(cwd=''):
1818 uref = np .load (cwd + 'uref.npy' )
1919 usplit = np .load (cwd + 'split.npy' )
2020
21- print ("Estimated discretisation error split explicit: %5.3e" %
22- (np .linalg .norm (usplit .flatten () - uref .flatten (), np .inf ) / np .linalg .norm (uref .flatten (), np .inf )))
23- print ("Estimated discretisation error of DIRK: %5.3e" %
24- (np .linalg .norm (udirk .flatten () - uref .flatten (), np .inf ) / np .linalg .norm (uref .flatten (), np .inf )))
25- print ("Estimated discretisation error of RK-IMEX: %5.3e" %
26- (np .linalg .norm (uimex .flatten () - uref .flatten (), np .inf ) / np .linalg .norm (uref .flatten (), np .inf )))
27- print ("Estimated discretisation error of SDC: %5.3e" %
28- (np .linalg .norm (uend .flatten () - uref .flatten (), np .inf ) / np .linalg .norm (uref .flatten (), np .inf )))
21+ err_split = np .linalg .norm (usplit .flatten () - uref .flatten (), np .inf ) / np .linalg .norm (uref .flatten (), np .inf )
22+ err_dirk = np .linalg .norm (udirk .flatten () - uref .flatten (), np .inf ) / np .linalg .norm (uref .flatten (), np .inf )
23+ err_imex = np .linalg .norm (uimex .flatten () - uref .flatten (), np .inf ) / np .linalg .norm (uref .flatten (), np .inf )
24+ err_sdc = np .linalg .norm (uend .flatten () - uref .flatten (), np .inf ) / np .linalg .norm (uref .flatten (), np .inf )
25+
26+ assert err_split < 4.821E-02 , 'ERROR: split error is too high, got %s' % err_split
27+ assert err_dirk < 1.495e-01 , 'ERROR: dirk error is too high, got %s' % err_dirk
28+ assert err_imex < 1.305e-01 , 'ERROR: imex error is too high, got %s' % err_imex
29+ assert err_sdc < 9.548e-02 , 'ERROR: sdc error is too high, got %s' % err_sdc
30+
31+ print ("Estimated discretisation error split explicit: %5.3e" % err_split )
32+ print ("Estimated discretisation error of DIRK: %5.3e" % err_dirk )
33+ print ("Estimated discretisation error of RK-IMEX: %5.3e" % err_imex )
34+ print ("Estimated discretisation error of SDC: %5.3e" % err_sdc )
2935
3036 fs = 8
3137 rcParams ['figure.figsize' ] = 5.0 , 2.5
0 commit comments