diff --git a/pySDC/helpers/pySDC_as_gusto_time_discretization.py b/pySDC/helpers/pySDC_as_gusto_time_discretization.py index b7f7c11119..acbdabde4c 100644 --- a/pySDC/helpers/pySDC_as_gusto_time_discretization.py +++ b/pySDC/helpers/pySDC_as_gusto_time_discretization.py @@ -219,7 +219,7 @@ def apply(self, x_out, x_in): # update time of the Gusto stepper. # After this step, the Gusto stepper updates its time again to arrive at the correct time if self.timestepper is not None: - self.timestepper.t = fd.Constant(self.t - self.dt) + self.timestepper.t = fd.Constant(float(self.t) - float(self.dt)) self.dt = fd.Constant(self.level.params.dt * self.n_steps) diff --git a/pySDC/tests/test_tutorials/test_step_7.py b/pySDC/tests/test_tutorials/test_step_7.py index 72f40a889c..8dbf3443f1 100644 --- a/pySDC/tests/test_tutorials/test_step_7.py +++ b/pySDC/tests/test_tutorials/test_step_7.py @@ -201,7 +201,7 @@ def test_F_ML(): stats = stepper_ML.scheme.stats residual_fine = get_sorted(stats, type='residual_post_sweep', level=0, sortby='iter') residual_coarse = get_sorted(stats, type='residual_post_sweep', level=1, sortby='iter') - assert residual_fine[0][1] / residual_fine[-1][1] > 3e2, 'Fine residual did not converge as expected' + assert residual_fine[0][1] / residual_fine[-1][1] > 1e2, 'Fine residual did not converge as expected' assert residual_coarse[0][1] / residual_coarse[-1][1] > 3e2, 'Coarse residual did not converge as expected' stats_SL = stepper_SL.scheme.stats diff --git a/pySDC/tutorial/step_7/F_pySDC_with_Gusto.py b/pySDC/tutorial/step_7/F_pySDC_with_Gusto.py index 13e9194609..a9e61c7f43 100644 --- a/pySDC/tutorial/step_7/F_pySDC_with_Gusto.py +++ b/pySDC/tutorial/step_7/F_pySDC_with_Gusto.py @@ -154,16 +154,12 @@ def williamson_5( x, y, z = SpatialCoordinate(mesh) lamda, phi, _ = lonlatr_from_xyz(x, y, z) - # Equation: coriolis - parameters = ShallowWaterParameters(mesh, H=mean_depth, g=g) - Omega = parameters.Omega - fexpr = 2 * Omega * z / radius - # Equation: topography rsq = min_value(R0**2, (lamda - lamda_c) ** 2 + (phi - phi_c) ** 2) r = sqrt(rsq) tpexpr = mountain_height * (1 - r / R0) - eqns = ShallowWaterEquations(domain, parameters, fexpr=fexpr, topog_expr=tpexpr) + parameters = ShallowWaterParameters(mesh, H=mean_depth, g=g, topog_expr=tpexpr) + eqns = ShallowWaterEquations(domain, parameters) eqns.label_terms(lambda t: not t.has_label(time_derivative), implicit) @@ -328,7 +324,7 @@ def williamson_5( u0 = stepper.fields('u') D0 = stepper.fields('D') uexpr = as_vector([-u_max * y / radius, u_max * x / radius, 0.0]) - Dexpr = mean_depth - tpexpr - (radius * Omega * u_max + 0.5 * u_max**2) * (z / radius) ** 2 / g + Dexpr = mean_depth - tpexpr - (radius * parameters.Omega * u_max + 0.5 * u_max**2) * (z / radius) ** 2 / g u0.project(uexpr) D0.interpolate(Dexpr)