Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pySDC/helpers/pySDC_as_gusto_time_discretization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion pySDC/tests/test_tutorials/test_step_7.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 3 additions & 7 deletions pySDC/tutorial/step_7/F_pySDC_with_Gusto.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
Loading