2828
2929 # This comes as read-in for the level class
3030 lparams = {}
31- lparams ['restol' ] = 1E-12
31+ lparams ['restol' ] = 1E-14
3232
3333 swparams = {}
3434 swparams ['collocation_class' ] = collclass .CollGaussLobatto
3535 swparams ['num_nodes' ] = 3
3636 swparams ['do_LU' ] = True
3737
3838 sparams = {}
39- sparams ['maxiter' ] = 15
39+ sparams ['maxiter' ] = 4
4040
4141 # setup parameters "in time"
4242 t0 = 0
43- Tend = 3
44- Nsteps = 1
43+ Tend = 3000
44+ Nsteps = 500
45+ Tend = 30
46+ Nsteps = 5
4547 dt = Tend / float (Nsteps )
4648
4749 # This comes as read-in for the problem class
4850 pparams = {}
49- pparams ['nvars' ] = [(4 ,300 , 10 )]
51+ pparams ['nvars' ] = [(4 ,450 , 30 )]
5052 pparams ['u_adv' ] = 0.02
5153 pparams ['c_s' ] = 0.3
5254 pparams ['Nfreq' ] = 0.01
5355 pparams ['x_bounds' ] = [(- 150.0 , 150.0 )]
5456 pparams ['z_bounds' ] = [( 0.0 , 10.0 )]
55- pparams ['order' ] = [0 , 0 ] # [fine_level, coarse_level]
56- pparams ['gmres_maxiter' ] = [50 , 5 ]
57+ pparams ['order' ] = [0 ] # [fine_level, coarse_level]
58+ pparams ['gmres_maxiter' ] = [50 ]
5759 pparams ['gmres_restart' ] = 20
58- pparams ['gmres_tol' ] = 1e-14
60+ pparams ['gmres_tol' ] = 1e-6
5961
6062 # This comes as read-in for the transfer operations
6163 tparams = {}
7173 description ['sweeper_class' ] = imex_1st_order
7274 description ['level_params' ] = lparams
7375 description ['hook_class' ] = plot_solution
74- description ['transfer_class' ] = mesh_to_mesh_2d
75- description ['transfer_params' ] = tparams
76+ # description['transfer_class'] = mesh_to_mesh_2d
77+ # description['transfer_params'] = tparams
7678
7779 # quickly generate block of steps
7880 MS = mp .generate_steps (num_procs ,sparams ,description )
7981
8082 # get initial values on finest level
8183 P = MS [0 ].levels [0 ].prob
8284 uinit = P .u_exact (t0 )
85+
86+ cfl_advection = pparams ['u_adv' ]* dt / P .h [0 ]
87+ cfl_acoustic_hor = pparams ['c_s' ]* dt / P .h [0 ]
88+ cfl_acoustic_ver = pparams ['c_s' ]* dt / P .h [1 ]
89+ print ("CFL number of advection: %4.2f" % cfl_advection )
90+ print ("CFL number of acoustics (horizontal): %4.2f" % cfl_acoustic_hor )
91+ print ("CFL number of acoustics (vertical): %4.2f" % cfl_acoustic_ver )
8392
8493 # call main function to get things done...
8594 uend ,stats = mp .run_pfasst (MS ,u0 = uinit ,t0 = t0 ,dt = dt ,Tend = Tend )
92101
93102 P .report_log ()
94103
95- plt .show ()
104+ # plt.show()
96105
97- # extract_stats = grep_stats(stats,iter=-1,type='residual')
98- # sortedlist_stats = sort_stats(extract_stats,sortby='step')
99- # print(extract_stats,sortedlist_stats)
106+ #extract_stats = grep_stats(stats,iter=-1,type='residual')
107+ #sortedlist_stats = sort_stats(extract_stats,sortby='step')
108+ #print(extract_stats,sortedlist_stats)
0 commit comments