1919def main ():
2020 # initialize level parameters
2121 level_params = dict ()
22- level_params ['restol' ] = 1E-12
22+ level_params ['restol' ] = 1E-10
2323 level_params ['dt' ] = None
2424
2525 # This comes as read-in for the step class (this is optional!)
@@ -30,20 +30,20 @@ def main():
3030 problem_params = dict ()
3131 problem_params ['nu' ] = 0.01
3232 problem_params ['freq' ] = 2
33- problem_params ['nvars' ] = [2 ** 7 ] # , 2 ** 6]
33+ problem_params ['nvars' ] = [2 ** 7 , 2 ** 6 ]
3434
3535 # This comes as read-in for the sweeper class
3636 sweeper_params = dict ()
3737 sweeper_params ['collocation_class' ] = CollGaussRadau_Right
38- sweeper_params ['num_nodes' ] = 3
39- sweeper_params ['QI' ] = 'IE'
40- sweeper_params ['spread' ] = True
38+ sweeper_params ['num_nodes' ] = [ 5 ]
39+ sweeper_params ['QI' ] = [ 'IE' , 'PIC' ]
40+ sweeper_params ['spread' ] = False
4141 sweeper_params ['do_coll_update' ] = False
4242
4343 # initialize space transfer parameters
4444 space_transfer_params = dict ()
4545 space_transfer_params ['rorder' ] = 2
46- space_transfer_params ['iorder' ] = 2
46+ space_transfer_params ['iorder' ] = 6
4747 space_transfer_params ['periodic' ] = True
4848
4949 # initialize controller parameters
@@ -69,8 +69,8 @@ def main():
6969 t0 = 0.0
7070 Tend = 1.0
7171
72- dt_list = [Tend / 2 ** i for i in range (3 , 6 )]
73- niter_list = [2 ]#[1, 2, 3, 4]
72+ dt_list = [Tend / 2 ** i for i in range (0 , 6 )]
73+ niter_list = [100 ]#[1, 2, 3, 4]
7474
7575 for niter in niter_list :
7676
@@ -82,7 +82,7 @@ def main():
8282 description ['step_params' ]['maxiter' ] = niter
8383 description ['level_params' ]['dt' ] = dt
8484
85- Tend = t0 + dt
85+ # Tend = t0 + dt
8686
8787 # instantiate the controller
8888 controller = allinclusive_multigrid_nonMPI (num_procs = 1 , controller_params = controller_params ,
@@ -108,15 +108,15 @@ def main():
108108 err = err_new
109109
110110 # # filter statistics by type (number of iterations)
111- # filtered_stats = filter_stats(stats, type='niter')
112- #
113- # # convert filtered statistics to list of iterations count, sorted by process
114- # iter_counts = sort_stats(filtered_stats, sortby='time')
115- #
116- # # compute and print statistics
117- # niters = np.array([item[1] for item in iter_counts])
118- # out = ' Mean number of iterations: %4.2f' % np.mean(niters)
119- # print(out)
111+ filtered_stats = filter_stats (stats , type = 'niter' )
112+
113+ # convert filtered statistics to list of iterations count, sorted by process
114+ iter_counts = sort_stats (filtered_stats , sortby = 'time' )
115+
116+ # compute and print statistics
117+ niters = np .array ([item [1 ] for item in iter_counts ])
118+ out = ' Mean number of iterations: %4.2f' % np .mean (niters )
119+ print (out )
120120 # out = ' Range of values for number of iterations: %2i ' % np.ptp(niters)
121121 # # f.write(out + '\n')
122122 # print(out)
0 commit comments