Skip to content

Commit 277491b

Browse files
author
Daniel Ruprecht
committed
now reports on total number of gmres iterations of sdc and comparison run with dirk-4; plots horizontal cut through end solution for validation
1 parent c212658 commit 277491b

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

examples/boussinesq_2d_imex/HookClass.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ def __init__(self):
2020

2121
# add figure object for further use
2222
# self.fig = plt.figure(figsize=(18,6))
23-
self.fig = plt.figure(figsize=(15,5))
24-
self.counter = 0
23+
#self.fig = plt.figure(figsize=(15,5))
24+
#self.counter = 0
25+
26+
def dump_sweep(self,status):
27+
pass
2528

2629
def dump_step(self,status):
2730
"""

examples/boussinesq_2d_imex/ProblemClass.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def solve_system(self,rhs,factor,u0,t):
106106
sol, info = LA.gmres( self.Id - factor*self.M, b, x0=u0.values.flatten(), tol=self.gmres_tol, restart=self.gmres_restart, maxiter=self.gmres_maxiter, callback=cb)
107107
# If this is a dummy call with factor==0.0, do not log because it should not be counted as a solver call
108108
if factor!=0.0:
109-
print "Number of GMRES iterations: %3i --- Final residual: %6.3e" % ( cb.getcounter(), cb.getresidual() )
109+
print "SDC: Number of GMRES iterations: %3i --- Final residual: %6.3e" % ( cb.getcounter(), cb.getresidual() )
110110
self.logger.add(cb.getcounter())
111111
me = mesh(self.nvars)
112112
me.values = unflatten(sol, 4, self.N[0], self.N[1])
@@ -197,8 +197,3 @@ def u_exact(self,t):
197197
me.values[2,:,:] = dtheta*np.sin( np.pi*self.zz/H )/( 1.0 + np.square(self.xx - x_c)/(a*a))
198198
me.values[3,:,:] = 0.0*self.xx
199199
return me
200-
201-
def report_log(self):
202-
print "Number of calls to implicit solver: %5i" % self.logger.solver_calls
203-
print "Total number of iterations: %5i" % self.logger.iterations
204-
print "Average number of iterations per call: %6.3f" % (float(self.logger.iterations)/float(self.logger.solver_calls))

0 commit comments

Comments
 (0)