Skip to content

Commit eeda0f2

Browse files
author
Daniel Ruprecht
committed
added a couple of useful notes to hook class
1 parent ff5f4ff commit eeda0f2

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

examples/boussinesq_2d_imex/HookClass.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,8 @@ def dump_step(self,status):
6666
self.counter = self.counter + 1
6767
plt.pause(0.001)
6868

69+
# NOTE: Can use ffmpeg to collate images into movie.
70+
# HELPFUL WEBSITE: http://hamelot.co.uk/visualization/using-ffmpeg-to-convert-a-set-of-images-into-a-video/
71+
# USEFUL COMMAND: ffmpeg -r 25 -i boussinesq-%04d.jpeg -vcodec libx264 -crf 25 test1800.avi
72+
# WEBSITE TO CONVERT TO MP4: http://video.online-convert.com/convert-to-mp4
6973
return None

examples/boussinesq_2d_imex/playground.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
# This comes as read-in for the level class
3030
lparams = {}
31-
lparams['restol'] = 1E-6
31+
lparams['restol'] = 1E-14
3232

3333
swparams = {}
3434
swparams['collocation_class'] = collclass.CollGaussLobatto
@@ -41,7 +41,9 @@
4141
# setup parameters "in time"
4242
t0 = 0
4343
Tend = 3000
44-
Nsteps = 250
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
@@ -71,8 +73,8 @@
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)
@@ -97,10 +99,10 @@
9799
print('error at time %s: %9.5e' %(Tend,np.linalg.norm(uex.values[2,:,:].flatten()-uend.values[2,:,:].flatten(),np.inf)/np.linalg.norm(
98100
uex.values.flatten(),np.inf)))
99101

100-
#P.report_log()
102+
P.report_log()
101103

102104
#plt.show()
103105

104-
# extract_stats = grep_stats(stats,iter=-1,type='residual')
105-
# sortedlist_stats = sort_stats(extract_stats,sortby='step')
106-
# 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

Comments
 (0)