Skip to content

Commit 9512b24

Browse files
committed
Floating is hard
1 parent 18da9ec commit 9512b24

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

test/mismip_test.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def run_simulation(ny: int):
175175

176176
sparams = {
177177
"solver_parameters": {
178-
#"snes_monitor": None,
178+
"snes_monitor": None,
179179
"snes_type": "newtonls",
180180
"snes_max_it": 200,
181181
"snes_linesearch_type": "nleqerr",
@@ -215,7 +215,7 @@ def run_simulation(ny: int):
215215
)
216216

217217
t = Constant(0.0)
218-
timestep = 2.0
218+
timestep = 1.0
219219
dt = Constant(timestep)
220220
F_dummy = (
221221
inner(u - u_0, v) * dx + inner(M - M_0, N) * dx + inner(τ - τ_0, σ) * dx
@@ -233,10 +233,10 @@ def run_simulation(ny: int):
233233
"snes_converged_reason": None,
234234
#"snes_linesearch_monitor": None,
235235
"snes_type": "vinewtonrsls",
236-
"snes_max_it": 50,
237-
#"snes_atol": 2e-6,
238-
"snes_stol": 1e-15,
239-
#"snes_convergence_test": "skip",
236+
"snes_max_it": 5,
237+
"snes_atol": 2e-6,
238+
"snes_stol": 1e-8,
239+
"snes_convergence_test": "skip",
240240
"snes_linesearch_type": "l2",
241241
"snes_linesearch_max_it": 5,
242242
"ksp_type": "preonly",
@@ -248,12 +248,14 @@ def run_simulation(ny: int):
248248
"bounds": ("stage", lower, upper),
249249
}
250250
method = BackwardEuler()
251-
solver = TimeStepper(F, method, t, dt, z, **params, **pparams, bcs=bcs)
251+
mass_solver = TimeStepper(F_mass + F_dummy, method, t, dt, z, **params, **pparams)
252252

253-
final_time = 1.0
253+
final_time = 50.0
254254
num_steps = int(final_time / timestep)
255255
for step in range(num_steps):
256-
solver.advance()
256+
mass_solver.advance()
257+
momentum_solver.solve()
258+
z_0.assign(z)
257259

258260
u, M, τ, h = z.subfunctions
259261
firedrake.assemble((h - h_0) * dx)

0 commit comments

Comments
 (0)