Skip to content

Commit 2082843

Browse files
committed
bugfix......
1 parent 2e6c6e8 commit 2082843

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

pySDC/playgrounds/order_test/heat1d.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
def 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)

pySDC/tests/test_2d_fd_accuracy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def run_accuracy_check(nvars_list,problem_params):
5959
# create a mesh instance and fill it with the Laplacian of the sine wave
6060
u_lap = prob.dtype_u(init=prob.init)
6161
u_lap.values = -2*(np.pi * prob.params.freq) ** 2 * prob.params.nu * np.kron(np.sin(np.pi * prob.params.freq * xvalues), np.sin(np.pi * prob.params.freq * xvalues))
62-
62+
u_lap.values = u_lap.values.reshape(nvars)
6363
# compare analytic and computed solution using the eval_f routine of the problem class
6464
err = abs(prob.eval_f(u, 0) - u_lap)
6565

0 commit comments

Comments
 (0)