Skip to content

Commit 7b1f22c

Browse files
committed
Removed topographical expression as well
1 parent e05640f commit 7b1f22c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pySDC/tutorial/step_7/F_pySDC_with_Gusto.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,12 @@ def williamson_5(
154154
x, y, z = SpatialCoordinate(mesh)
155155
lamda, phi, _ = lonlatr_from_xyz(x, y, z)
156156

157-
# Equation: coriolis
158-
parameters = ShallowWaterParameters(mesh, H=mean_depth, g=g)
159-
Omega = parameters.Omega
160-
161157
# Equation: topography
162158
rsq = min_value(R0**2, (lamda - lamda_c) ** 2 + (phi - phi_c) ** 2)
163159
r = sqrt(rsq)
164160
tpexpr = mountain_height * (1 - r / R0)
165-
eqns = ShallowWaterEquations(domain, parameters, topog_expr=tpexpr)
161+
parameters = ShallowWaterParameters(mesh, H=mean_depth, g=g, topog_expr=tpexpr)
162+
eqns = ShallowWaterEquations(domain, parameters)
166163

167164
eqns.label_terms(lambda t: not t.has_label(time_derivative), implicit)
168165

@@ -327,7 +324,7 @@ def williamson_5(
327324
u0 = stepper.fields('u')
328325
D0 = stepper.fields('D')
329326
uexpr = as_vector([-u_max * y / radius, u_max * x / radius, 0.0])
330-
Dexpr = mean_depth - tpexpr - (radius * Omega * u_max + 0.5 * u_max**2) * (z / radius) ** 2 / g
327+
Dexpr = mean_depth - tpexpr - (radius * parameters.Omega * u_max + 0.5 * u_max**2) * (z / radius) ** 2 / g
331328

332329
u0.project(uexpr)
333330
D0.interpolate(Dexpr)

0 commit comments

Comments
 (0)