88from pySDC .helpers .stats_helper import filter_stats , sort_stats
99from pySDC .implementations .collocation_classes .gauss_radau_right import CollGaussRadau_Right
1010from pySDC .implementations .controller_classes .controller_nonMPI import controller_nonMPI
11- from pySDC .implementations .problem_classes .AllenCahn_1D_FD import allencahn_front , allencahn_front_finel
11+ from pySDC .implementations .problem_classes .AllenCahn_1D_FD import allencahn_front_fullyimplicit , allencahn_front_semiimplicit
1212from pySDC .implementations .sweeper_classes .generic_implicit import generic_implicit
13+ from pySDC .implementations .sweeper_classes .imex_1st_order import imex_1st_order
1314from pySDC .playgrounds .Allen_Cahn .AllenCahn_monitor_Bayreuth import monitor
1415
1516
@@ -26,14 +27,14 @@ def setup_parameters():
2627
2728 # initialize level parameters
2829 level_params = dict ()
29- level_params ['restol' ] = 1E-08
30- level_params ['dt' ] = 1 .0 / 4
30+ level_params ['restol' ] = 1E-03
31+ level_params ['dt' ] = 16 .0 / 1
3132 level_params ['nsweeps' ] = 1
3233
3334 # initialize sweeper parameters
3435 sweeper_params = dict ()
3536 sweeper_params ['collocation_class' ] = CollGaussRadau_Right
36- sweeper_params ['num_nodes' ] = [5 ]
37+ sweeper_params ['num_nodes' ] = [3 ]
3738 sweeper_params ['Q1' ] = ['LU' ]
3839 sweeper_params ['Q2' ] = ['LU' ]
3940 sweeper_params ['QI' ] = ['LU' ]
@@ -42,23 +43,23 @@ def setup_parameters():
4243
4344 # This comes as read-in for the problem class
4445 problem_params = dict ()
45- problem_params ['nvars' ] = 2047
46+ problem_params ['nvars' ] = 127
4647 problem_params ['dw' ] = - 0.04
4748 problem_params ['eps' ] = 0.04
4849 problem_params ['newton_maxiter' ] = 100
49- problem_params ['newton_tol' ] = 1E-08
50+ problem_params ['newton_tol' ] = 1E-04
5051 problem_params ['lin_tol' ] = 1E-08
5152 problem_params ['lin_maxiter' ] = 100
5253 problem_params ['radius' ] = 0.25
5354 problem_params ['interval' ] = (- 0.5 , 0.5 )
5455
5556 # initialize step parameters
5657 step_params = dict ()
57- step_params ['maxiter' ] = 20
58+ step_params ['maxiter' ] = 50
5859
5960 # initialize controller parameters
6061 controller_params = dict ()
61- controller_params ['logger_level' ] = 30
62+ controller_params ['logger_level' ] = 20
6263 controller_params ['hook_class' ] = monitor
6364
6465 # fill description dictionary for easy step instantiation
@@ -70,6 +71,7 @@ def setup_parameters():
7071 description ['level_params' ] = level_params # pass level parameters
7172 description ['step_params' ] = step_params # pass step parameters
7273
74+
7375 return description , controller_params
7476
7577
@@ -90,21 +92,16 @@ def run_SDC_variant(variant=None, inexact=False):
9092
9193 # add stuff based on variant
9294 if variant == 'fully-implicit' :
93- # description['problem_class'] = allencahn_front
94- description ['problem_class' ] = allencahn_front_finel
95+ description ['problem_class' ] = allencahn_front_fullyimplicit
96+ # description['problem_class'] = allencahn_front_finel
9597 description ['sweeper_class' ] = generic_implicit
9698 if inexact :
97- description ['problem_params' ]['newton_maxiter' ] = 1
98- # elif variant == 'semi-implicit':
99- # description['problem_class'] = allencahn_semiimplicit
100- # description['sweeper_class'] = imex_1st_order
101- # if inexact:
102- # description['problem_params']['lin_maxiter'] = 10
103- # elif variant == 'semi-implicit_v2':
104- # description['problem_class'] = allencahn_semiimplicit_v2
105- # description['sweeper_class'] = imex_1st_order
106- # if inexact:
107- # description['problem_params']['newton_maxiter'] = 1
99+ description ['problem_params' ]['newton_maxiter' ] = 200
100+ elif variant == 'semi-implicit' :
101+ description ['problem_class' ] = allencahn_front_semiimplicit
102+ description ['sweeper_class' ] = imex_1st_order
103+ if inexact :
104+ description ['problem_params' ]['lin_maxiter' ] = 10
108105 # elif variant == 'multi-implicit':
109106 # description['problem_class'] = allencahn_multiimplicit
110107 # description['sweeper_class'] = multi_implicit
@@ -127,7 +124,7 @@ def run_SDC_variant(variant=None, inexact=False):
127124
128125 # setup parameters "in time"
129126 t0 = 0
130- Tend = 1 .0
127+ Tend = 32 .0
131128
132129 # instantiate controller
133130 controller = controller_nonMPI (num_procs = 1 , controller_params = controller_params , description = description )
@@ -147,8 +144,8 @@ def run_SDC_variant(variant=None, inexact=False):
147144 # call main function to get things done...
148145 uend , stats = controller .run (u0 = uinit , t0 = t0 , Tend = Tend )
149146
150- plt_helper .plt .plot (uend .values )
151- plt_helper .savefig ('uend' , save_pdf = False , save_pgf = False , save_png = True )
147+ # plt_helper.plt.plot(uend.values)
148+ # plt_helper.savefig('uend', save_pdf=False, save_pgf=False, save_png=True)
152149 # exit()
153150
154151 # filter statistics by variant (number of iterations)
@@ -320,9 +317,10 @@ def main(cwd=''):
320317 results = {}
321318 # for variant in ['multi-implicit', 'semi-implicit', 'fully-implicit', 'semi-implicit_v2', 'multi-implicit_v2']:
322319 for variant in ['fully-implicit' ]:
320+ # for variant in ['semi-implicit']:
323321
324- results [(variant , 'exact' )] = run_SDC_variant (variant = variant , inexact = False )
325- # results[(variant, 'inexact')] = run_SDC_variant(variant=variant, inexact=True)
322+ # results[(variant, 'exact')] = run_SDC_variant(variant=variant, inexact=False)
323+ results [(variant , 'inexact' )] = run_SDC_variant (variant = variant , inexact = True )
326324
327325 # dump result
328326 # fname = 'data/results_SDC_variants_AllenCahn_1E-03'
0 commit comments